mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +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;
|
UINT len;
|
||||||
BOOL ret;
|
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);
|
ret = DuplicateTokenEx(pgContext->UserToken, MAXIMUM_ALLOWED, NULL, SecurityImpersonation, TokenPrimary, &hAppToken);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
@ -222,13 +229,6 @@ WlxStartApplication(
|
||||||
StartupInfo.wShowWindow = SW_SHOW;
|
StartupInfo.wShowWindow = SW_SHOW;
|
||||||
StartupInfo.lpDesktop = pszDesktopName;
|
StartupInfo.lpDesktop = pszDesktopName;
|
||||||
|
|
||||||
len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH);
|
|
||||||
if (len > MAX_PATH)
|
|
||||||
{
|
|
||||||
WARN("GetWindowsDirectoryW() failed\n");
|
|
||||||
CloseHandle(hAppToken);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
ret = CreateProcessAsUserW(
|
ret = CreateProcessAsUserW(
|
||||||
hAppToken,
|
hAppToken,
|
||||||
pszCmdLine,
|
pszCmdLine,
|
||||||
|
|
Loading…
Reference in a new issue