mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-10 05:03:33 +01:00
Windows: Fix bug in disabling of Windows privileges, they were completely removed instead
This started to cause issues after latest changes to disable privileges when they are no more needed. Because of the bug, the privileges could not be enabled again because they were wrongly removed.
This commit is contained in:
parent
f024653450
commit
0970a98c84
@ -13706,11 +13706,11 @@ BOOL SetPrivilege(LPTSTR szPrivilegeName, BOOL bEnable)
|
||||
&tkp.Privileges[0].Luid))
|
||||
{
|
||||
tkp.PrivilegeCount = 1;
|
||||
tkp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : SE_PRIVILEGE_REMOVED;
|
||||
tkp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : 0;
|
||||
|
||||
bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
|
||||
dwLastError = GetLastError ();
|
||||
if ( ERROR_SUCCESS != dwLastError)
|
||||
if (bRet && (ERROR_NOT_ALL_ASSIGNED == dwLastError))
|
||||
{
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user