shell32 - file not found

Martin Fuchs martin-fuchs at gmx.net
Tue Apr 13 16:03:01 CDT 2004


Changelog:
return "file not found" error values instead of E_INVALIDARG if _ILCreateFromPathA() failed to find files


Index: shfldr_desktop.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/shell32/shfldr_desktop.c,v
retrieving revision 1.8
diff -u -p -d -r1.8 shfldr_desktop.c
--- shfldr_desktop.c	11 Apr 2004 13:24:29 -0000	1.8
+++ shfldr_desktop.c	13 Apr 2004 20:51:06 -0000
@@ -235,6 +235,9 @@ static HRESULT WINAPI ISF_Desktop_fnPars
 	    len = lstrlenA(szPath);
 	    WideCharToMultiByte(CP_ACP, 0, lpszDisplayName, -1, szPath + len, MAX_PATH - len, NULL, NULL);
 	    pidlTemp = _ILCreateFromPathA(szPath);
+
+	    if (!pidlTemp)
+		hr = 0x80070002L;   /* file not found */
 	} else {
 	    pidlTemp = _ILCreateMyComputer();
 	}
Index: shfldr_fs.c
===================================================================
RCS file: /CVS/ReactOS/reactos/lib/shell32/shfldr_fs.c,v
retrieving revision 1.7
diff -u -p -d -r1.7 shfldr_fs.c
--- shfldr_fs.c	11 Apr 2004 13:24:29 -0000	1.7
+++ shfldr_fs.c	13 Apr 2004 20:51:06 -0000
@@ -354,7 +354,9 @@ IShellFolder_fnParseDisplayName (IShellF
 
 	/* get the pidl */
 	pidlTemp = _ILCreateFromPathA(szPath);
-	if (pidlTemp) {
+	if (!pidlTemp)
+	    hr = 0x80070002L;   /* file not found */
+	else {
 	    if (szNext && *szNext) {
 		/* try to analyse the next element */
 		hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
@@ -748,8 +750,11 @@ static HRESULT WINAPI IShellFolder_fnSet
     szDest[MAX_PATH - 1] = 0;
     TRACE ("src=%s dest=%s\n", szSrc, szDest);
     if (MoveFileA (szSrc, szDest)) {
-	if (pPidlOut)
+	if (pPidlOut) {
 	    *pPidlOut = _ILCreateFromPathA(szDest);
+	    if (!*pPidlOut)
+	        return 0x80070002L;   /* file not found */
+	}
 	SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest);
 	return S_OK;
     }
@@ -977,9 +982,15 @@ static HRESULT WINAPI ISFHelper_fnAddFol
     bRes = CreateDirectoryA (lpstrNewDir, NULL);
     if (bRes) {
 	SHChangeNotify (SHCNE_MKDIR, SHCNF_PATHA, lpstrNewDir, NULL);
-	if (ppidlOut)
-	    *ppidlOut = _ILCreateFromPathA(lpstrNewDir);
+
 	hres = S_OK;
+
+	if (ppidlOut) {
+    	    *ppidlOut = _ILCreateFromPathA(lpstrNewDir);
+
+	    if (!*ppidlOut)
+		hres = 0x80070002L;   /* file not found */
+	}
     } else {
 	char lpstrText[128 + MAX_PATH];
 	char lpstrTempText[128];





More information about the wine-patches mailing list