Author: dchapyshev
Date: Thu Jan 8 04:29:19 2009
New Revision: 38640
URL:
http://svn.reactos.org/svn/reactos?rev=38640&view=rev
Log:
- Fix bug with incorrect a working directory. Patch by Evgeny Boltik (bstsoft(a)narod.ru)
with my small changes
See issue #4006 for more details.
Modified:
trunk/reactos/dll/win32/shell32/shv_def_cmenu.c
Modified: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_def_cmenu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shv_def_cmenu.c [iso-8859-1] Thu Jan 8 04:29:19 2009
@@ -1186,6 +1186,8 @@
{
WCHAR szPath[MAX_PATH];
WCHAR szTarget[MAX_PATH] = {0};
+ WCHAR szDirPath[MAX_PATH];
+ LPWSTR pszFile;
STRRET strFile;
LPWSTR pszExt;
HRESULT hr;
@@ -1230,7 +1232,11 @@
return E_FAIL;
}
- if (SUCCEEDED(IShellLinkW_SetPath(nLink, szPath)))
+ GetFullPathName(szPath, MAX_PATH, szDirPath, &pszFile);
+ if (pszFile) pszFile[0] = 0;
+
+ if (SUCCEEDED(IShellLinkW_SetPath(nLink, szPath)) &&
+ SUCCEEDED(IShellLinkW_SetWorkingDirectory(nLink, szDirPath)))
{
if (SUCCEEDED(IShellLinkW_QueryInterface(nLink, &IID_IPersistFile,
(LPVOID*)&ipf)))
{