Commit 8630b8ab authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Use wine_get_dos_file_name rather than relying on GetFullPathNameW

hack.
parent 6ab0b019
......@@ -1265,12 +1265,19 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
/* special case for "My Documents", map to $HOME */
if (home)
{
WCHAR homeW[MAX_PATH];
LPWSTR homeW = wine_get_dos_file_name(home);
MultiByteToWideChar(CP_UNIXCP, 0, home, -1, homeW, MAX_PATH);
if (GetFullPathNameW(homeW, MAX_PATH, pszPath, NULL) != 0 &&
PathIsDirectoryW(pszPath))
hr = S_OK;
if (homeW)
{
if (PathIsDirectoryW(homeW))
{
lstrcpynW(pszPath, homeW, MAX_PATH);
hr = S_OK;
}
HeapFree(GetProcessHeap(), 0, homeW);
}
else
hr = HRESULT_FROM_WIN32(GetLastError());
}
break;
}
......@@ -1282,13 +1289,22 @@ static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
/* special case for Desktop, map to $HOME/Desktop if it exists */
if (home)
{
WCHAR desktopW[MAX_PATH];
LPWSTR homeW = wine_get_dos_file_name(home);
MultiByteToWideChar(CP_UNIXCP, 0, home, -1, desktopW, MAX_PATH);
PathAppendW(desktopW, DesktopW);
if (GetFullPathNameW(desktopW, MAX_PATH, pszPath, NULL) != 0 &&
PathIsDirectoryW(pszPath))
hr = S_OK;
if (homeW)
{
lstrcpynW(pszPath, homeW, MAX_PATH);
if (PathAppendW(pszPath, DesktopW))
{
if (PathIsDirectoryW(pszPath))
hr = S_OK;
}
else
hr = HRESULT_FROM_WIN32(GetLastError());
HeapFree(GetProcessHeap(), 0, homeW);
}
else
hr = HRESULT_FROM_WIN32(GetLastError());
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment