From 0c7b07dc89a4425a3d6ba0926abb396733096ed5 Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Thu, 21 Nov 2019 22:35:52 +0100 Subject: [PATCH] [SDK] Move HIDA helper functions to shellutils.h --- dll/shellext/fontext/precomp.h | 10 ---------- modules/rostests/apitests/shell32/CIDLData.cpp | 10 ---------- .../rostests/apitests/shell32/SHCreateDataObject.cpp | 10 ---------- sdk/include/reactos/shellutils.h | 12 ++++++++++++ 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/dll/shellext/fontext/precomp.h b/dll/shellext/fontext/precomp.h index c17b4e53c71..8037e4cd064 100644 --- a/dll/shellext/fontext/precomp.h +++ b/dll/shellext/fontext/precomp.h @@ -38,16 +38,6 @@ HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEM HRESULT _GetCidlFromDataObject(IDataObject *pDataObject, CIDA** ppcida); -inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - inline BOOL IsFontDotExt(LPCWSTR pchDotExt) { static const LPCWSTR array[] = diff --git a/modules/rostests/apitests/shell32/CIDLData.cpp b/modules/rostests/apitests/shell32/CIDLData.cpp index 502a1b321fa..28fa0d2aef8 100644 --- a/modules/rostests/apitests/shell32/CIDLData.cpp +++ b/modules/rostests/apitests/shell32/CIDLData.cpp @@ -60,16 +60,6 @@ static void TestAdviseAndCanonical(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUI } -static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - #define ok_wstri(x, y) \ ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) diff --git a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp index 927afa28d23..00f4ec11077 100644 --- a/modules/rostests/apitests/shell32/SHCreateDataObject.cpp +++ b/modules/rostests/apitests/shell32/SHCreateDataObject.cpp @@ -63,16 +63,6 @@ static void TestAdviseAndCanonical(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUI } -static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) -{ - return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); -} - -static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) -{ - return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); -} - #define ok_wstri(x, y) \ ok(wcsicmp(x, y) == 0, "Wrong string. Expected '%S', got '%S'\n", y, x) diff --git a/sdk/include/reactos/shellutils.h b/sdk/include/reactos/shellutils.h index 467f142c4ae..8cc51f379d4 100644 --- a/sdk/include/reactos/shellutils.h +++ b/sdk/include/reactos/shellutils.h @@ -534,4 +534,16 @@ void DumpIdList(LPCITEMIDLIST pcidl) #define S_GREATERTHAN S_FALSE #define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL)) + +static inline PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const* pida) +{ + return (PCUIDLIST_ABSOLUTE)(((LPBYTE)pida) + (pida)->aoffset[0]); +} + +static inline PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const* pida, SIZE_T i) +{ + return (PCUIDLIST_RELATIVE)(((LPBYTE)pida) + (pida)->aoffset[i + 1]); +} + + #endif /* __ROS_SHELL_UTILS_H */