mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-27 21:43:29 +01:00
Windows: Make SetPrivilege return error if AdjustTokenPrivileges cannot adjust privileges
This commit is contained in:
parent
d4ae2ce893
commit
0e4f1ecee3
@ -13976,8 +13976,11 @@ BOOL SetPrivilege(LPTSTR szPrivilegeName, BOOL bEnable)
|
|||||||
tkp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : SE_PRIVILEGE_REMOVED;
|
tkp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : SE_PRIVILEGE_REMOVED;
|
||||||
|
|
||||||
bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
|
bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
|
||||||
if (!bRet)
|
|
||||||
dwLastError = GetLastError ();
|
dwLastError = GetLastError ();
|
||||||
|
if ( ERROR_SUCCESS != dwLastError)
|
||||||
|
{
|
||||||
|
bRet = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dwLastError = GetLastError ();
|
dwLastError = GetLastError ();
|
||||||
|
Loading…
Reference in New Issue
Block a user