diff --git a/reactos/lib/shell32/brsfolder.c b/reactos/lib/shell32/brsfolder.c index 9110ed2515e..944117fdd05 100644 --- a/reactos/lib/shell32/brsfolder.c +++ b/reactos/lib/shell32/brsfolder.c @@ -391,7 +391,8 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, switch (wParam) { case IDOK: pdump ( pidlRet ); - SHGetPathFromIDListW(pidlRet, lpBrowseInfo->pszDisplayName); + if (lpBrowseInfo->pszDisplayName) + SHGetPathFromIDListW(pidlRet, lpBrowseInfo->pszDisplayName); EndDialog(hWnd, (DWORD) ILClone(pidlRet)); return TRUE; @@ -438,7 +439,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc(HWND hWnd, UINT msg, WPARAM wParam, return FALSE; } -static WCHAR swBrowseTempName[] = {'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; +static const WCHAR swBrowseTempName[] = {'S','H','B','R','S','F','O','R','F','O','L','D','E','R','_','M','S','G','B','O','X',0}; /************************************************************************* * SHBrowseForFolderA [SHELL32.@] @@ -460,9 +461,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi) bi.pidlRoot = lpbi->pidlRoot; if (lpbi->pszDisplayName) { - len = MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, NULL, 0); - bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, len); + /*lpbi->pszDisplayName is assumed to be MAX_PATH (MSDN) */ + bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, MAX_PATH); } else bi.pszDisplayName = NULL; diff --git a/reactos/lib/shell32/shlfileop.c b/reactos/lib/shell32/shlfileop.c index bae85725e06..2acb2ed6004 100644 --- a/reactos/lib/shell32/shlfileop.c +++ b/reactos/lib/shell32/shlfileop.c @@ -53,9 +53,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define FO_MASK 0xF CHAR aWildcardFile[] = {'*','.','*',0}; -WCHAR wWildcardFile[] = {'*','.','*',0}; -WCHAR wWildcardChars[] = {'*','?',0}; -WCHAR wBackslash[] = {'\\',0}; +static const WCHAR wWildcardFile[] = {'*','.','*',0}; +static const WCHAR wWildcardChars[] = {'*','?',0}; +static const WCHAR wBackslash[] = {'\\',0}; static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec); @@ -1310,3 +1310,14 @@ BOOL WINAPI IsNetDrive(DWORD drive) root[0] += (char)drive; return (GetDriveTypeA(root) == DRIVE_REMOTE); } + + +/************************************************************************* + * RealDriveType [SHELL32.524] + */ +INT WINAPI RealDriveType(INT drive, BOOL bQueryNet) +{ + char root[] = "A:\\"; + root[0] += (char)drive; + return GetDriveTypeA(root); +}