shell32 patch 24

Martin Fuchs martin-fuchs at gmx.net
Wed Mar 24 14:38:16 CST 2004


Changelog:
implementation of IPersistFile::IsDirty()


<comment>
"/*, LPITEMIDLIST pidl, LPCWSTR args*/" is commented out because patch 23e is not yet commited.
</comment>


Index: shell32_main.h
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v
retrieving revision 1.83
diff -u -p -d -r1.83 shell32_main.h
--- shell32_main.h	22 Mar 2004 20:43:07 -0000	1.83
+++ shell32_main.h	24 Mar 2004 20:35:06 -0000
@@ -233,6 +233,9 @@ typedef UINT (*SHELL_ExecuteW32)(const W
 
 BOOL WINAPI ShellExecuteExW32(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
 
+UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
+                          LPWSTR lpResult, /*int resultLen, */LPWSTR key, void **env/*, LPITEMIDLIST pidl, LPCWSTR args*/);
+
 extern WCHAR swShell32Name[MAX_PATH];
 
 #endif

Index: shlexec.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shlexec.c,v
retrieving revision 1.35
diff -u -p -d -r1.35 shlexec.c
--- shlexec.c	19 Mar 2004 01:52:30 -0000	1.35
+++ shlexec.c	24 Mar 2004 20:35:07 -0000
@@ -343,8 +343,8 @@ static UINT SHELL_FindExecutableByOperat
  *              command (it'll be used afterwards for more information
  *              on the operation)
  */
-static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
-                                 LPWSTR lpResult, LPWSTR key, void **env)
+UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
+                                 LPWSTR lpResult, /*int resultLen, */LPWSTR key, void **env)
 {
     static const WCHAR wWindows[] = {'w','i','n','d','o','w','s',0};
     static const WCHAR wPrograms[] = {'p','r','o','g','r','a','m','s',0};

Index: shelllink.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shelllink.c,v
retrieving revision 1.62
diff -u -p -d -r1.62 shelllink.c
--- shelllink.c	22 Mar 2004 22:58:37 -0000	1.62
+++ shelllink.c	24 Mar 2004 20:35:06 -0000
@@ -143,6 +143,8 @@ typedef struct
 	LPWSTR        sWorkDir;
 	LPWSTR        sDescription;
 	LPWSTR        sPathRel;
+
+	BOOL		bDirty;
 } IShellLinkImpl;
 
 #define _IShellLinkW_Offset ((int)(&(((IShellLinkImpl*)0)->lpvtblw)))
@@ -216,7 +218,12 @@ static HRESULT WINAPI IPersistFile_fnGet
 static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface)
 {
 	_ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface);
-	FIXME("(%p)\n",This);
+
+	TRACE("(%p)\n",This);
+
+	if (This->bDirty)
+	    return S_OK;
+
 	return NOERROR;
 }
 static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode)
@@ -234,6 +241,7 @@ static HRESULT WINAPI IPersistFile_fnLoa
             r = IPersistStream_Load(StreamThis, stm);
             ShellLink_UpdatePath(This->sPathRel, pszFileName, This->sWorkDir, &This->sPath);
             IStream_Release( stm );
+            This->bDirty = TRUE;
         }
 
         return r;
@@ -290,8 +298,12 @@ static HRESULT WINAPI IPersistFile_fnSav
         IStream_Release( stm );
 
         if( SUCCEEDED( r ) )
+	{
             StartLinkProcessor( pszFileName );
-        else
+
+            This->bDirty = TRUE;
+        }
+	else
         {
             DeleteFileW( pszFileName );
             WARN("Failed to create shortcut %s\n", debugstr_w(pszFileName) );
@@ -787,6 +799,7 @@ HRESULT WINAPI IShellLink_Constructor (
 	sl->lpvtblPersistFile = &pfvt;
 	sl->lpvtblPersistStream = &psvt;
 	sl->iShowCmd = SW_SHOWNORMAL;
+	sl->bDirty = FALSE;
 
 	TRACE("(%p)->()\n",sl);
 
@@ -1025,13 +1038,14 @@ static HRESULT WINAPI IShellLinkA_fnGetI
 
 static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl)
 {
-	ICOM_THIS(IShellLinkImpl, iface);
+    ICOM_THIS(IShellLinkImpl, iface);
 
-	TRACE("(%p)->(pidl=%p)\n",This, pidl);
+    TRACE("(%p)->(pidl=%p)\n",This, pidl);
 
-	if (This->pPidl)
-            ILFree(This->pPidl);
-	This->pPidl = ILClone (pidl);
+    if (This->pPidl)
+	ILFree(This->pPidl);
+    This->pPidl = ILClone (pidl);
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1062,6 +1076,8 @@ static HRESULT WINAPI IShellLinkA_fnSetD
     if ( !This->sDescription )
         return E_OUTOFMEMORY;
 
+    This->bDirty = TRUE;
+
     return S_OK;
 }
 
@@ -1092,6 +1108,8 @@ static HRESULT WINAPI IShellLinkA_fnSetW
     if ( !This->sWorkDir )
         return E_OUTOFMEMORY;
 
+    This->bDirty = TRUE;
+
     return S_OK;
 }
 
@@ -1122,6 +1140,8 @@ static HRESULT WINAPI IShellLinkA_fnSetA
     if( !This->sArgs )
         return E_OUTOFMEMORY;
 
+    This->bDirty = TRUE;
+
     return S_OK;
 }
 
@@ -1143,6 +1163,7 @@ static HRESULT WINAPI IShellLinkA_fnSetH
 	TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
 
 	This->wHotKey = wHotkey;
+	This->bDirty = TRUE;
 
 	return S_OK;
 }
@@ -1163,6 +1184,7 @@ static HRESULT WINAPI IShellLinkA_fnSetS
     TRACE("(%p) %d\n",This, iShowCmd);
 
     This->iShowCmd = iShowCmd;
+    This->bDirty = TRUE;
 
     return NOERROR;
 }
@@ -1194,7 +1216,9 @@ static HRESULT WINAPI IShellLinkA_fnSetI
     This->sIcoPath = HEAP_strdupAtoW(GetProcessHeap(), 0, pszIconPath);
     if ( !This->sIcoPath )
         return E_OUTOFMEMORY;
+
     This->iIcoNdx = iIcon;
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1208,6 +1232,7 @@ static HRESULT WINAPI IShellLinkA_fnSetR
     if (This->sPathRel)
         HeapFree(GetProcessHeap(), 0, This->sPathRel);
     This->sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel);
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1232,6 +1257,8 @@ static HRESULT WINAPI IShellLinkA_fnSetP
     if( !This->sPath )
         return E_OUTOFMEMORY;
 
+    This->bDirty = TRUE;
+
     return S_OK;
 }
 
@@ -1340,6 +1367,8 @@ static HRESULT WINAPI IShellLinkW_fnSetI
     if( !This->pPidl )
         return E_FAIL;
 
+    This->bDirty = TRUE;
+
     return S_OK;
 }
 
@@ -1369,7 +1398,9 @@ static HRESULT WINAPI IShellLinkW_fnSetD
                                     (lstrlenW( pszName )+1)*sizeof(WCHAR) );
     if ( !This->sDescription )
         return E_OUTOFMEMORY;
+
     lstrcpyW( This->sDescription, pszName );
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1401,6 +1432,7 @@ static HRESULT WINAPI IShellLinkW_fnSetW
     if ( !This->sWorkDir )
         return E_OUTOFMEMORY;
     lstrcpyW( This->sWorkDir, pszDir );
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1432,6 +1464,7 @@ static HRESULT WINAPI IShellLinkW_fnSetA
     if ( !This->sArgs )
         return E_OUTOFMEMORY;
     lstrcpyW( This->sArgs, pszArgs );
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1454,6 +1487,7 @@ static HRESULT WINAPI IShellLinkW_fnSetH
     TRACE("(%p)->(hotkey=%x)\n",This, wHotkey);
 
     This->wHotKey = wHotkey;
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1474,6 +1508,7 @@ static HRESULT WINAPI IShellLinkW_fnSetS
     _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
 
     This->iShowCmd = iShowCmd;
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1508,6 +1543,7 @@ static HRESULT WINAPI IShellLinkW_fnSetI
     lstrcpyW( This->sIcoPath, pszIconPath );
 
     This->iIcoNdx = iIcon;
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1525,6 +1561,7 @@ static HRESULT WINAPI IShellLinkW_fnSetR
     if ( !This->sPathRel )
         return E_OUTOFMEMORY;
     lstrcpyW( This->sPathRel, pszPathRel );
+    This->bDirty = TRUE;
 
     return S_OK;
 }
@@ -1550,7 +1587,9 @@ static HRESULT WINAPI IShellLinkW_fnSetP
                              (lstrlenW( pszFile )+1) * sizeof (WCHAR) );
     if ( !This->sPath )
         return E_OUTOFMEMORY;
+
     lstrcpyW( This->sPath, pszFile );
+    This->bDirty = TRUE;
 
     return S_OK;
 }





More information about the wine-patches mailing list