From 4f0d1c02bdf4adf56caf48de967c41d2d4d9ff2d Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 23 Apr 2018 12:56:02 +0200 Subject: Windows: Don't start EFI system encryption process if SecureBoot is enabled and VeraCrypt-DCS custom keys were not loaded in the machine firmware. --- src/Setup/Setup.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src/Setup/Setup.c') diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index 46583c46..485d333c 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -387,44 +387,6 @@ void SearchAndDeleteRegistrySubString (HKEY hKey, const wchar_t *subKey, const w } } -/* Set the given privilege of the current process */ -BOOL SetPrivilege(LPTSTR szPrivilegeName, BOOL bEnable) -{ - TOKEN_PRIVILEGES tp; - LUID luid; - HANDLE hProcessToken; - BOOL bStatus = FALSE; - - if ( OpenProcessToken(GetCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - &hProcessToken) ) - { - if ( LookupPrivilegeValue( - NULL, - szPrivilegeName, - &luid ) ) - { - - tp.PrivilegeCount = 1; - tp.Privileges[0].Luid = luid; - tp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : SE_PRIVILEGE_REMOVED; - - // Enable the privilege - bStatus = AdjustTokenPrivileges( - hProcessToken, - FALSE, - &tp, - sizeof(TOKEN_PRIVILEGES), - (PTOKEN_PRIVILEGES) NULL, - (PDWORD) NULL); - } - - CloseHandle(hProcessToken); - } - - return bStatus; -} - /* * Creates a VT_LPWSTR propvariant. * we use our own implementation to use SHStrDupW function pointer -- cgit v1.2.3