diff --git a/dll/shellext/fontext/CFontExt.cpp b/dll/shellext/fontext/CFontExt.cpp index 7fffa90736e..30a62919bb4 100644 --- a/dll/shellext/fontext/CFontExt.cpp +++ b/dll/shellext/fontext/CFontExt.cpp @@ -42,11 +42,6 @@ static FolderViewColumns g_ColumnDefs[] = }; - -// Should fix our headers.. -EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(LPCWSTR pszPath, DWORD dwFileAttributes, REFIID riid, void **ppv); - - // Helper functions to translate a guid to a readable name bool GetInterfaceName(const WCHAR* InterfaceString, WCHAR* buf, size_t size) { diff --git a/dll/shellext/zipfldr/CZipFolder.hpp b/dll/shellext/zipfldr/CZipFolder.hpp index e89aeb81d87..29644d95c2b 100644 --- a/dll/shellext/zipfldr/CZipFolder.hpp +++ b/dll/shellext/zipfldr/CZipFolder.hpp @@ -5,10 +5,6 @@ * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org) */ - -EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(LPCWSTR pszPath, DWORD dwFileAttributes, REFIID riid, void **ppv); - - struct FolderViewColumns { int iResource; diff --git a/dll/win32/shell32/CExtractIcon.cpp b/dll/win32/shell32/CExtractIcon.cpp index 26bdb4e9307..e82dfec4999 100644 --- a/dll/win32/shell32/CExtractIcon.cpp +++ b/dll/win32/shell32/CExtractIcon.cpp @@ -345,15 +345,17 @@ HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv) * Currently (march 2018) our shell does not handle IExtractIconW with an invalid path, * so this (wrong) implementation actually works better for us. */ -EXTERN_C HRESULT +EXTERN_C +HRESULT WINAPI -SHCreateFileExtractIconW(LPCWSTR pszPath, - DWORD dwFileAttributes, - REFIID riid, - void **ppv) +SHCreateFileExtractIconW( + _In_ LPCWSTR pszFile, + _In_ DWORD dwFileAttributes, + _In_ REFIID riid, + _Outptr_ void **ppv) { SHFILEINFOW shfi; - ULONG_PTR firet = SHGetFileInfoW(pszPath, dwFileAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICONLOCATION); + ULONG_PTR firet = SHGetFileInfoW(pszFile, dwFileAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICONLOCATION); HRESULT hr = E_FAIL; if (firet) { @@ -373,4 +375,3 @@ SHCreateFileExtractIconW(LPCWSTR pszPath, return hr; } - diff --git a/sdk/include/psdk/shlobj.h b/sdk/include/psdk/shlobj.h index f8be3e7d299..9f7b215bff8 100644 --- a/sdk/include/psdk/shlobj.h +++ b/sdk/include/psdk/shlobj.h @@ -2091,6 +2091,28 @@ SHBindToParent( _Outptr_ LPVOID *ppv, _Outptr_opt_ PCUITEMID_CHILD *ppidlLast); +/**************************************************************************** + * SHCreateFileExtractIcon API + */ +#if (NTDDI_VERSION >= NTDDI_WINXP) + +// NOTE: Even if documented on MSDN, the SHCreateFileExtractIconA() +// ANSI function never existed on Windows! + +HRESULT +WINAPI +SHCreateFileExtractIconW( + _In_ LPCWSTR pszFile, + _In_ DWORD dwFileAttributes, + _In_ REFIID riid, + _Outptr_ void **ppv); + +#ifdef UNICODE +#define SHCreateFileExtractIcon SHCreateFileExtractIconW +#endif + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + /**************************************************************************** * SHDefExtractIcon API */