Commit aef84332 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comdlg32: Expand initial directory path for file open dialog.

parent b7cc4409
...@@ -504,15 +504,17 @@ static BOOL GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) ...@@ -504,15 +504,17 @@ static BOOL GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
else else
fodInfos.filename = NULL; fodInfos.filename = NULL;
fodInfos.initdir = NULL;
if(ofn->lpstrInitialDir) if(ofn->lpstrInitialDir)
{ {
/* fodInfos.initdir = strdupW(ofn->lpstrInitialDir); */ /* fodInfos.initdir = strdupW(ofn->lpstrInitialDir); */
DWORD len = lstrlenW(ofn->lpstrInitialDir)+1; DWORD len = ExpandEnvironmentStringsW(ofn->lpstrInitialDir, NULL, 0);
fodInfos.initdir = MemAlloc(len*sizeof(WCHAR)); if (len)
memcpy(fodInfos.initdir,ofn->lpstrInitialDir,len*sizeof(WCHAR)); {
fodInfos.initdir = MemAlloc(len * sizeof(WCHAR));
ExpandEnvironmentStringsW(ofn->lpstrInitialDir, fodInfos.initdir, len);
}
} }
else
fodInfos.initdir = NULL;
/* save current directory */ /* save current directory */
if (ofn->Flags & OFN_NOCHANGEDIR) if (ofn->Flags & OFN_NOCHANGEDIR)
......
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