mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:15:52 +00:00
[REACTOS] Fix GetTokenInformation() usage (#2997)
The first call to GetTokenInformation is used to determine the size of a TokenInformation buffer. It should fail and return ERROR_INSUFFICIENT_BUFFER
This commit is contained in:
parent
b338fb7beb
commit
98bbe8358c
4 changed files with 11 additions and 12 deletions
|
@ -53,14 +53,14 @@ DwInitializeSdFromThreadToken (
|
|||
}
|
||||
|
||||
/* Get the size of the token's user */
|
||||
if ((GetTokenInformation(hToken, TokenUser, NULL, 0, &dwUserLength) == FALSE) ||
|
||||
if ((GetTokenInformation(hToken, TokenUser, NULL, 0, &dwUserLength) != FALSE) ||
|
||||
(GetLastError() != ERROR_INSUFFICIENT_BUFFER))
|
||||
{
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
/* Get the size of the token's primary group */
|
||||
if ((GetTokenInformation(hToken, TokenPrimaryGroup, NULL, 0, &dwGroupLength) == FALSE) ||
|
||||
if ((GetTokenInformation(hToken, TokenPrimaryGroup, NULL, 0, &dwGroupLength) != FALSE) ||
|
||||
(GetLastError() != ERROR_INSUFFICIENT_BUFFER))
|
||||
{
|
||||
return GetLastError();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue