Shell32 patch 6

Martin Fuchs martin-fuchs at gmx.net
Sat Jan 17 07:16:26 CST 2004


Changelog:
- include "wine/port.h" in folders.c for MSVC compilation
- use full paths instead of only filenames in icon cache to distinguish between different files with the same name


Index: shell32_main.h
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v
retrieving revision 1.77
diff -u -p -d -r1.77 shell32_main.h
--- shell32_main.h      16 Jan 2004 23:06:25 -0000      1.77
+++ shell32_main.h      17 Jan 2004 13:15:44 -0000
@@ -235,4 +235,7 @@ inline static WCHAR * __SHCloneStrAtoW(W
 typedef UINT (*SHELL_ExecuteW32)(WCHAR *lpCmd, void *env, LPSHELLEXECUTEINFOW sei, BOOL shWait);
 BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);

+extern WCHAR swShell32Name[MAX_PATH];
+extern char sShell32Name[MAX_PATH];
+
 #endif

Index: folders.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/folders.c,v
retrieving revision 1.40
diff -u -p -d -r1.40 folders.c
--- folders.c   22 Sep 2003 19:30:25 -0000      1.40
+++ folders.c   17 Jan 2004 13:15:43 -0000
@@ -17,6 +17,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */

+#include "config.h"
+#include "wine/port.h"
+
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -147,7 +150,8 @@ static ULONG WINAPI IExtractIconW_fnRele
        return This->ref;
 }

-static WCHAR swShell32Name[] = {'s','h','e','l','l','3','2','.','d','l','l',0};
+WCHAR swShell32Name[MAX_PATH];
+char sShell32Name[MAX_PATH];

 /**************************************************************************
 *  IExtractIconW_GetIconLocation

Index: iconcache.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/iconcache.c,v
retrieving revision 1.71
diff -u -p -d -r1.71 iconcache.c
--- iconcache.c 15 Dec 2003 19:48:52 -0000      1.71
+++ iconcache.c 17 Jan 2004 13:15:43 -0000
@@ -97,12 +97,12 @@ static INT CALLBACK SIC_CompareEntries(
 static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon)
 {      LPSIC_ENTRY lpsice;
        INT ret, index, index1;
-       char *path;
+       char path[MAX_PATH];
        TRACE("%s %i %p %p\n", sSourceFile, dwSourceIndex, hSmallIcon ,hBigIcon);

        lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));

-       path = PathFindFileNameA(sSourceFile);
+       GetFullPathNameA(sSourceFile, MAX_PATH, path, NULL);
        lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, strlen(path)+1 );
        strcpy( lpsice->sSourceFile, path );

@@ -167,10 +167,12 @@ static INT SIC_LoadIcon (LPCSTR sSourceF
 INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex )
 {      SIC_ENTRY sice;
        INT ret, index = INVALID_INDEX;
+       char path[MAX_PATH];

        TRACE("%s %i\n", sSourceFile, dwSourceIndex);

-       sice.sSourceFile = PathFindFileNameA(sSourceFile);
+       GetFullPathNameA(sSourceFile, MAX_PATH, path, NULL);
+       sice.sSourceFile = path;
        sice.dwSourceIndex = dwSourceIndex;

        EnterCriticalSection(&SHELL32_SicCS);
@@ -257,7 +259,7 @@ BOOL SIC_Initialize(void)
            hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(0), IMAGE_ICON, 16, 16,LR_SHARED);
            hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(0), IMAGE_ICON, 32, 32,LR_SHARED);
          }
-         SIC_IconAppend ("shell32.dll", index, hSm, hLg);
+         SIC_IconAppend (sShell32Name, index, hSm, hLg);
        }

        TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);

Index: shell32_main.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.c,v
retrieving revision 1.127
diff -u -p -d -r1.127 shell32_main.c
--- shell32_main.c      26 Nov 2003 05:04:15 -0000      1.127
+++ shell32_main.c      17 Jan 2004 13:15:44 -0000
@@ -904,6 +904,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,
        {
          case DLL_PROCESS_ATTACH:
            shell32_hInstance = hinstDLL;
+
+           /* get full path to this DLL for IExtractIconW_fnGetIconLocation() */
+           GetModuleFileNameW(hinstDLL, swShell32Name, MAX_PATH);
+           WideCharToMultiByte(CP_ACP, 0, swShell32Name, -1, sShell32Name, MAX_PATH, NULL, NULL);
+
            hComctl32 = GetModuleHandleA("COMCTL32.DLL");
            DisableThreadLibraryCalls(shell32_hInstance);






More information about the wine-patches mailing list