Skip to content

Commit 909468c

Browse files
authored
[SDK][SHELL32][SHLWAPI][SHLWAPI_APITEST] Split IShellFolder helpers hack (reactos#7685)
Splitting the hack will improve our code quality. JIRA issue: N/A - Add sdk/include/reactos/ishellfolder_helpers.h header file. - Split conflicting code.
1 parent d5ce3d2 commit 909468c

File tree

6 files changed

+54
-46
lines changed

6 files changed

+54
-46
lines changed

dll/win32/shell32/precomp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#include <shlguid_undoc.h>
4343
#include <shlobj_undoc.h>
4444

45-
#define SHLWAPI_ISHELLFOLDER_HELPERS
4645
#include <shlwapi_undoc.h>
46+
#include <ishellfolder_helpers.h>
4747

4848
#include <shellapi.h>
4949
#undef ShellExecute

dll/win32/shlwapi/utils.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@
2121
#include <shlguid_undoc.h>
2222
#include <atlstr.h>
2323

24-
/*
25-
* HACK!
26-
*/
27-
#undef IShellFolder_GetDisplayNameOf
28-
#undef IShellFolder_ParseDisplayName
29-
#undef IShellFolder_CompareIDs
30-
31-
#define SHLWAPI_ISHELLFOLDER_HELPERS /* HACK! */
3224
#include <shlwapi_undoc.h>
25+
#include <ishellfolder_helpers.h>
3326

3427
#include <strsafe.h>
3528

modules/rostests/apitests/shlwapi/IShellFolderHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <shlwapi.h>
1111
#include <versionhelpers.h>
1212

13-
#define SHLWAPI_ISHELLFOLDER_HELPERS
1413
#include <shlwapi_undoc.h>
14+
#include <ishellfolder_helpers.h>
1515

1616
static INT s_nStep = 0;
1717

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* PROJECT: ReactOS header
3+
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4+
* PURPOSE: SHLWAPI IShellFolder helpers
5+
* COPYRIGHT: Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
6+
* Copyright 2025 Katayama Hirofumi MZ <[email protected]>
7+
*/
8+
9+
#pragma once
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/* HACK! These function names are conflicting with <shobjidl.h> functions. */
16+
#undef IShellFolder_GetDisplayNameOf
17+
#undef IShellFolder_ParseDisplayName
18+
#undef IShellFolder_CompareIDs
19+
20+
HRESULT WINAPI
21+
IShellFolder_GetDisplayNameOf(
22+
_In_ IShellFolder *psf,
23+
_In_ LPCITEMIDLIST pidl,
24+
_In_ SHGDNF uFlags,
25+
_Out_ LPSTRRET lpName,
26+
_In_ DWORD dwRetryFlags);
27+
28+
/* Flags for IShellFolder_GetDisplayNameOf */
29+
#define SFGDNO_RETRYWITHFORPARSING 0x00000001
30+
#define SFGDNO_RETRYALWAYS 0x80000000
31+
32+
HRESULT WINAPI
33+
IShellFolder_ParseDisplayName(
34+
_In_ IShellFolder *psf,
35+
_In_ HWND hwndOwner,
36+
_In_ LPBC pbcReserved,
37+
_In_ LPOLESTR lpszDisplayName,
38+
_Out_ ULONG *pchEaten,
39+
_Out_ PIDLIST_RELATIVE *ppidl,
40+
_Out_ ULONG *pdwAttributes);
41+
42+
EXTERN_C HRESULT WINAPI
43+
IShellFolder_CompareIDs(
44+
_In_ IShellFolder *psf,
45+
_In_ LPARAM lParam,
46+
_In_ PCUIDLIST_RELATIVE pidl1,
47+
_In_ PCUIDLIST_RELATIVE pidl2);
48+
49+
#ifdef __cplusplus
50+
} /* extern "C" */
51+
#endif

sdk/include/reactos/shlobj_undoc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#pragma once
1111

12-
#define SHLWAPI_ISHELLFOLDER_HELPERS
1312
#include <shlwapi_undoc.h> // For ASSOCQUERY
1413

1514
#ifdef __cplusplus

sdk/include/reactos/shlwapi_undoc.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -376,41 +376,6 @@ DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid);
376376
#define SHACF_WIN95SHLEXEC 0x00000200 /* Geoff Chappell */
377377
DWORD WINAPI SHGetAppCompatFlags(DWORD dwMask);
378378

379-
/*
380-
* HACK! These functions are conflicting with <shobjidl.h> inline functions...
381-
* We provide a macro option SHLWAPI_ISHELLFOLDER_HELPERS for using these functions.
382-
*/
383-
#ifdef SHLWAPI_ISHELLFOLDER_HELPERS
384-
HRESULT WINAPI
385-
IShellFolder_GetDisplayNameOf(
386-
_In_ IShellFolder *psf,
387-
_In_ LPCITEMIDLIST pidl,
388-
_In_ SHGDNF uFlags,
389-
_Out_ LPSTRRET lpName,
390-
_In_ DWORD dwRetryFlags);
391-
392-
/* Flags for IShellFolder_GetDisplayNameOf */
393-
#define SFGDNO_RETRYWITHFORPARSING 0x00000001
394-
#define SFGDNO_RETRYALWAYS 0x80000000
395-
396-
HRESULT WINAPI
397-
IShellFolder_ParseDisplayName(
398-
_In_ IShellFolder *psf,
399-
_In_ HWND hwndOwner,
400-
_In_ LPBC pbcReserved,
401-
_In_ LPOLESTR lpszDisplayName,
402-
_Out_ ULONG *pchEaten,
403-
_Out_ PIDLIST_RELATIVE *ppidl,
404-
_Out_ ULONG *pdwAttributes);
405-
406-
EXTERN_C HRESULT WINAPI
407-
IShellFolder_CompareIDs(
408-
_In_ IShellFolder *psf,
409-
_In_ LPARAM lParam,
410-
_In_ PCUIDLIST_RELATIVE pidl1,
411-
_In_ PCUIDLIST_RELATIVE pidl2);
412-
#endif /* SHLWAPI_ISHELLFOLDER_HELPERS */
413-
414379
/*****************************************************************************
415380
* IAssociationElementOld interface
416381
*

0 commit comments

Comments
 (0)