mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
Better check of GetWindowsDirectory() return value
svn path=/trunk/; revision=29846
This commit is contained in:
parent
9fdfadf2fa
commit
5bce4dda0c
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue