Handle empty strings and invalid values in lpstrInitialDir for 32 bits

open file dialogs.
This commit is contained in:
Gerard Patel 2001-03-10 19:13:59 +00:00 committed by Alexandre Julliard
parent c2c004deeb
commit a9c889055b
2 changed files with 7 additions and 3 deletions

View File

@ -2693,7 +2693,7 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl)
* GetPidlFromName
*
* returns the pidl of the file name relative to folder
* NULL if an error occured
* NULL if an error occurred
*/
LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
{
@ -2704,7 +2704,8 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
TRACE("sf=%p file=%s\n", lpsf, lpcstrFileName);
if(!lpcstrFileName) return NULL;
if(!*lpcstrFileName) return NULL;
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH);
if(!lpsf)

View File

@ -682,7 +682,10 @@ static HRESULT WINAPI IShellFolder_fnParseDisplayName(
}
}
*ppidl = pidlTemp;
if (!hr)
*ppidl = pidlTemp;
else
*ppidl = NULL;
TRACE("(%p)->(-- pidl=%p ret=0x%08lx)\n", This, ppidl? *ppidl:0, hr);