[ros-diffs] [hpoussin] 29946: Initialize CurrentDirectory before sending it to CreateProcessAsUserW()
hpoussin at svn.reactos.org
hpoussin at svn.reactos.org
Mon Oct 29 11:59:11 CET 2007
Author: hpoussin
Date: Mon Oct 29 13:59:10 2007
New Revision: 29946
URL: http://svn.reactos.org/svn/reactos?rev=29946&view=rev
Log:
Initialize CurrentDirectory before sending it to CreateProcessAsUserW()
Modified:
trunk/reactos/dll/win32/msgina/msgina.c
Modified: trunk/reactos/dll/win32/msgina/msgina.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?rev=29946&r1=29945&r2=29946&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.c (original)
+++ trunk/reactos/dll/win32/msgina/msgina.c Mon Oct 29 13:59:10 2007
@@ -222,6 +222,7 @@
}
ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
+ ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
StartupInfo.cb = sizeof(STARTUPINFOW);
StartupInfo.lpTitle = pszCmdLine;
StartupInfo.dwX = StartupInfo.dwY = StartupInfo.dwXSize = StartupInfo.dwYSize = 0L;
@@ -229,6 +230,12 @@
StartupInfo.wShowWindow = SW_SHOW;
StartupInfo.lpDesktop = pszDesktopName;
+ len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH);
+ if (len == 0 || len > MAX_PATH)
+ {
+ WARN("GetWindowsDirectoryW() failed\n");
+ return FALSE;
+ }
ret = CreateProcessAsUserW(
hAppToken,
pszCmdLine,
@@ -413,7 +420,7 @@
BOOL bResult;
if (!LogonUserW(UserName, Domain, Password,
- LOGON32_LOGON_INTERACTIVE, /* FIXME - use LOGON32_LOGON_UNLOCK instead! */
+ LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT,
&pgContext->UserToken))
{
More information about the Ros-diffs
mailing list