Correct return value in a couple of error cases.
authorJuan Lang <juan_lang@yahoo.com>
Thu, 15 Apr 2004 05:04:10 +0000 (05:04 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 15 Apr 2004 05:04:10 +0000 (05:04 +0000)
dlls/shell32/pidl.c

index 551ae49..3b366c0 100644 (file)
@@ -1621,6 +1621,9 @@ HRESULT _ILCreateFromPathA(LPCSTR szPath, LPITEMIDLIST* ppidl)
        HANDLE hFile;
        WIN32_FIND_DATAA stffile;
 
+    if (!ppidl)
+        return E_INVALIDARG;
+
        hFile = FindFirstFileA(szPath, &stffile);
 
        if (hFile == INVALID_HANDLE_VALUE)
@@ -1630,7 +1633,7 @@ HRESULT _ILCreateFromPathA(LPCSTR szPath, LPITEMIDLIST* ppidl)
 
        *ppidl = _ILCreateFromFindDataA(&stffile);
 
-       return S_OK;
+       return *ppidl ? S_OK : E_OUTOFMEMORY;
 }
 
 LPITEMIDLIST _ILCreateDrive(LPCWSTR lpszNew)