mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 18:56:48 +00:00
[SHELL32] Partially implement SHCreateFileExtractIconW
CORE-14082
This commit is contained in:
parent
0d07967a27
commit
a69393205a
2 changed files with 36 additions and 14 deletions
|
@ -338,3 +338,39 @@ HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
|
|||
{
|
||||
return ShellObjectCreator<CExtractIcon>(riid, ppv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Partially implemented
|
||||
* See apitests\shell32\SHCreateFileExtractIconW.cpp for details
|
||||
* 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
|
||||
WINAPI
|
||||
SHCreateFileExtractIconW(LPCWSTR pszPath,
|
||||
DWORD dwFileAttributes,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
SHFILEINFOW shfi;
|
||||
ULONG_PTR firet = SHGetFileInfoW(pszPath, dwFileAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICONLOCATION);
|
||||
HRESULT hr = E_FAIL;
|
||||
if (firet)
|
||||
{
|
||||
CComPtr<IDefaultExtractIconInit> iconInit;
|
||||
hr = SHCreateDefaultExtractIcon(IID_PPV_ARG(IDefaultExtractIconInit, &iconInit));
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
||||
hr = iconInit->SetNormalIcon(shfi.szDisplayName, shfi.iIcon);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
||||
return iconInit->QueryInterface(riid, ppv);
|
||||
}
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,20 +69,6 @@ PathIsEqualOrSubFolder(LPWSTR lpFolder, LPWSTR lpSubFolder)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
*/
|
||||
EXTERN_C HRESULT
|
||||
WINAPI
|
||||
SHCreateFileExtractIconW(LPCWSTR pszPath,
|
||||
DWORD dwFileAttributes,
|
||||
REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
FIXME("SHCreateFileExtractIconW() stub\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
EXTERN_C HRESULT
|
||||
WINAPI
|
||||
SHGetUnreadMailCountW(HKEY hKeyUser,
|
||||
|
|
Loading…
Reference in a new issue