mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
Remove unneeded variable for GetLastError();
No other usage of GetLastError has the result assigned to a variable first in this code, so it is better if we make check_user_is_admin the same in that regard.
This commit is contained in:
@@ -479,7 +479,7 @@ bool check_user_is_admin()
|
||||
};
|
||||
|
||||
HANDLE hToken;
|
||||
DWORD dwSize = 0, dwResult = 0;
|
||||
DWORD dwSize = 0;
|
||||
PTOKEN_GROUPS pGroupInfo;
|
||||
SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
|
||||
PSID pSID = NULL;
|
||||
@@ -493,8 +493,7 @@ bool check_user_is_admin()
|
||||
// Call GetTokenInformation to get the buffer size.
|
||||
if (!GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize))
|
||||
{
|
||||
dwResult = GetLastError();
|
||||
if (dwResult != ERROR_INSUFFICIENT_BUFFER)
|
||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user