Re: shell32: fix folder icon index when read from registry
Any thing wrong with this patch? On 31.12.2005 21:31:25 Martin Fuchs wrote:
Changelog: fix folder icon index when read from registry
Index: folders.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/folders.c,v retrieving revision 1.66 diff -u -p -d -r1.66 folders.c --- folders.c 26 Aug 2005 10:05:35 -0000 1.66 +++ folders.c 31 Dec 2005 20:29:30 -0000 @@ -166,7 +166,7 @@ static HRESULT getIconLocationForFolder( LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) { IExtractIconWImpl *This = (IExtractIconWImpl *)iface; - DWORD dwNr; + DWORD dwNr; /*TODO: change to int type */ WCHAR wszPath[MAX_PATH]; WCHAR wszCLSIDValue[CHARS_IN_GUID]; static const WCHAR shellClassInfo[] = { '.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0 }; @@ -202,9 +202,13 @@ static HRESULT getIconLocationForFolder( if (!HCR_GetDefaultIconW(folder, szIconFile, cchMax, &dwNr)) { lstrcpynW(szIconFile, swShell32Name, cchMax); - dwNr = IDI_SHELL_FOLDER; + dwNr = (DWORD)-IDI_SHELL_FOLDER; } - *piIndex = -((uFlags & GIL_OPENICON) ? dwNr + 1 : dwNr); + + if (uFlags & GIL_OPENICON) + *piIndex = (int)dwNr<0? (int)dwNr-1: dwNr+1; + else + *piIndex = dwNr; } return S_OK; }
"Martin Fuchs" <martin-fuchs(a)gmx.net> writes:
Any thing wrong with this patch?
Well, yes, you noted it yourself:
+ DWORD dwNr; /*TODO: change to int type */
-- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Martin Fuchs