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