[SHLWAPI][SDK] Add IShellFolder_... helper functions (#6893)

Implementing missing features...
JIRA issue: CORE-19278
- Implement IShellFolder_GetDisplayNameOf,
  IShellFolder_ParseDisplayName, and
  IShellFolder_CompareIDs functions.
- Add them to <shlwapi_undoc.h>.
- Modify shlwapi.spec.
- Add some SHCIDS_... macros into shobjidl.idl.
- Provide a macro option
  SHLWAPI_ISHELLFOLDER_HELPERS to
  avoid conflict with <shobjidl.h>
  IShellFolder_... inline functions. Ugly hack
  but effective!
This commit is contained in:
Katayama Hirofumi MZ 2024-05-18 21:33:33 +09:00 committed by GitHub
parent ae02934445
commit 6c2d1c31dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 161 additions and 7 deletions

View file

@ -218,6 +218,12 @@ interface IShellFolder : IUnknown
cpp_quote("#define SFGAO_STORAGEANCESTOR 0x00800000L")
cpp_quote("#define SFGAO_STORAGECAPMASK 0x70C50008L")
cpp_quote("#define SFGAO_PKEYSFGAOMASK 0x81044000L")
typedef ULONG SFGAOF;
cpp_quote("#define SHCIDS_COLUMNMASK 0x0000FFFFL")
cpp_quote("#define SHCIDS_BITMASK 0xFFFF0000L")
cpp_quote("#define SHCIDS_CANONICALONLY 0x10000000L")
cpp_quote("#define SHCIDS_ALLFIELDS 0x80000000L")
cpp_quote("#define STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS L\"Parse Shell Protocol To File Objects\"")
cpp_quote("#define STR_FILE_SYS_BIND_DATA L\"File System Bind Data\"")
@ -225,8 +231,6 @@ interface IShellFolder : IUnknown
cpp_quote("#define STR_PARSE_TRANSLATE_ALIASES L\"Parse Translate Aliases\"")
cpp_quote("#define STR_DONT_PARSE_RELATIVE L\"Don't Parse Relative\"")
typedef ULONG SFGAOF;
HRESULT ParseDisplayName(
[in] HWND hwndOwner,
[in] LPBC pbcReserved,

View file

@ -332,6 +332,40 @@ IContextMenu_Invoke(
DWORD WINAPI SHGetObjectCompatFlags(IUnknown *pUnk, const CLSID *clsid);
/*
* HACK! These functions are conflicting with <shobjidl.h> inline functions...
* We provide a macro option SHLWAPI_ISHELLFOLDER_HELPERS for using these functions.
*/
#ifdef SHLWAPI_ISHELLFOLDER_HELPERS
HRESULT WINAPI
IShellFolder_GetDisplayNameOf(
_In_ IShellFolder *psf,
_In_ LPCITEMIDLIST pidl,
_In_ DWORD uFlags,
_Out_ LPSTRRET lpName,
_In_ DWORD dwRetryFlags);
/* Flags for IShellFolder_GetDisplayNameOf */
#define SFGDNO_RETRYWITHFORPARSING 1
HRESULT WINAPI
IShellFolder_ParseDisplayName(
_In_ IShellFolder *psf,
_In_ HWND hwndOwner,
_In_ LPBC pbcReserved,
_In_ LPOLESTR lpszDisplayName,
_Out_ ULONG *pchEaten,
_Out_ PIDLIST_RELATIVE *ppidl,
_Out_ ULONG *pdwAttributes);
EXTERN_C HRESULT WINAPI
IShellFolder_CompareIDs(
_In_ IShellFolder *psf,
_In_ LPARAM lParam,
_In_ PCUIDLIST_RELATIVE pidl1,
_In_ PCUIDLIST_RELATIVE pidl2);
#endif /* SHLWAPI_ISHELLFOLDER_HELPERS */
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */