mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:22:58 +00:00
Better check of GetWindowsDirectory() return value
svn path=/trunk/; revision=29846
This commit is contained in:
parent
9fdfadf2fa
commit
5bce4dda0c
1 changed files with 7 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue