mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Merge pull request #7815 from pi1024e/patch-1
Remove unneeded variable for GetLastError();
This commit is contained in:
@@ -479,7 +479,7 @@ bool check_user_is_admin()
|
|||||||
};
|
};
|
||||||
|
|
||||||
HANDLE hToken;
|
HANDLE hToken;
|
||||||
DWORD dwSize = 0, dwResult = 0;
|
DWORD dwSize = 0;
|
||||||
PTOKEN_GROUPS pGroupInfo;
|
PTOKEN_GROUPS pGroupInfo;
|
||||||
SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
|
SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
|
||||||
PSID pSID = NULL;
|
PSID pSID = NULL;
|
||||||
@@ -493,8 +493,7 @@ bool check_user_is_admin()
|
|||||||
// Call GetTokenInformation to get the buffer size.
|
// Call GetTokenInformation to get the buffer size.
|
||||||
if (!GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize))
|
if (!GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize))
|
||||||
{
|
{
|
||||||
dwResult = GetLastError();
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||||
if (dwResult != ERROR_INSUFFICIENT_BUFFER)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -636,4 +635,4 @@ std::optional<std::string> exec_and_read_output(const std::wstring_view command,
|
|||||||
exit:
|
exit:
|
||||||
CancelIo(readPipe.get());
|
CancelIo(readPipe.get());
|
||||||
return childOutput;
|
return childOutput;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user