mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[USER32] Fix the ICO_ExtractIconExW() helper with respect to what is found with the user32_apitest:PrivateExtractIcons test.
CORE-15150
This commit is contained in:
parent
57a9fca04b
commit
40737bdddb
1 changed files with 17 additions and 2 deletions
|
@ -24,6 +24,10 @@
|
||||||
|
|
||||||
#include <user32.h>
|
#include <user32.h>
|
||||||
|
|
||||||
|
#ifndef ARRAY_SIZE
|
||||||
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Start of Hack section */
|
/* Start of Hack section */
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(icon);
|
WINE_DEFAULT_DEBUG_CHANNEL(icon);
|
||||||
|
@ -275,13 +279,24 @@ static UINT ICO_ExtractIconExW(
|
||||||
LPBYTE peimage;
|
LPBYTE peimage;
|
||||||
HANDLE fmapping;
|
HANDLE fmapping;
|
||||||
DWORD fsizeh,fsizel;
|
DWORD fsizeh,fsizel;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
WCHAR szExpandedExePath[MAX_PATH];
|
||||||
|
#endif
|
||||||
WCHAR szExePath[MAX_PATH];
|
WCHAR szExePath[MAX_PATH];
|
||||||
DWORD dwSearchReturn;
|
DWORD dwSearchReturn;
|
||||||
|
|
||||||
TRACE("%s, %d, %d %p 0x%08x\n", debugstr_w(lpszExeFileName), nIconIndex, nIcons, pIconId, flags);
|
TRACE("%s, %d, %d %p 0x%08x\n", debugstr_w(lpszExeFileName), nIconIndex, nIcons, pIconId, flags);
|
||||||
|
|
||||||
dwSearchReturn = SearchPathW(NULL, lpszExeFileName, NULL, sizeof(szExePath) / sizeof(szExePath[0]), szExePath, NULL);
|
#ifdef __REACTOS__
|
||||||
if ((dwSearchReturn == 0) || (dwSearchReturn > sizeof(szExePath) / sizeof(szExePath[0])))
|
if (RetPtr)
|
||||||
|
*RetPtr = NULL;
|
||||||
|
|
||||||
|
if (ExpandEnvironmentStringsW(lpszExeFileName, szExpandedExePath, ARRAY_SIZE(szExpandedExePath)))
|
||||||
|
lpszExeFileName = szExpandedExePath;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
dwSearchReturn = SearchPathW(NULL, lpszExeFileName, NULL, ARRAY_SIZE(szExePath), szExePath, NULL);
|
||||||
|
if ((dwSearchReturn == 0) || (dwSearchReturn > ARRAY_SIZE(szExePath)))
|
||||||
{
|
{
|
||||||
WARN("File %s not found or path too long\n", debugstr_w(lpszExeFileName));
|
WARN("File %s not found or path too long\n", debugstr_w(lpszExeFileName));
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue