From e2cdcc595804a671459eadd0f6a8fab04079538e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 29 Oct 2007 10:59:10 +0000 Subject: [PATCH] Initialize CurrentDirectory before sending it to CreateProcessAsUserW() svn path=/trunk/; revision=29946 --- reactos/dll/win32/msgina/msgina.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index 8b1a24aff61..11b1c857843 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -222,6 +222,7 @@ WlxStartApplication( } 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 @@ WlxStartApplication( 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 @@ DoLoginTasks( BOOL bResult; if (!LogonUserW(UserName, Domain, Password, - LOGON32_LOGON_INTERACTIVE, /* FIXME - use LOGON32_LOGON_UNLOCK instead! */ + LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &pgContext->UserToken)) {