mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-31 19:26:42 +00:00
Better check of GetWindowsDirectory() return value
svn path=/trunk/; revision=29846
This commit is contained in:
@@ -207,6 +207,13 @@ WlxStartApplication(
|
||||
UINT len;
|
||||
BOOL ret;
|
||||
|
||||
len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH);
|
||||
if (len == 0 || len > MAX_PATH)
|
||||
{
|
||||
WARN("GetWindowsDirectoryW() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ret = DuplicateTokenEx(pgContext->UserToken, MAXIMUM_ALLOWED, NULL, SecurityImpersonation, TokenPrimary, &hAppToken);
|
||||
if (!ret)
|
||||
{
|
||||
@@ -222,13 +229,6 @@ WlxStartApplication(
|
||||
StartupInfo.wShowWindow = SW_SHOW;
|
||||
StartupInfo.lpDesktop = pszDesktopName;
|
||||
|
||||
len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH);
|
||||
if (len > MAX_PATH)
|
||||
{
|
||||
WARN("GetWindowsDirectoryW() failed\n");
|
||||
CloseHandle(hAppToken);
|
||||
return FALSE;
|
||||
}
|
||||
ret = CreateProcessAsUserW(
|
||||
hAppToken,
|
||||
pszCmdLine,
|
||||
|
||||
Reference in New Issue
Block a user