| 40 | static LPCWSTR pwstrExcludeProcesses[]={L"skype.exe", L"chrome.exe", L"firefox.exe", L"iexplore.exe", L"qtcreator.exe"}; |
| 41 | |
| 42 | BOOL SetPrivilege(HANDLE hToken, LPCTSTR szPrivName, BOOL fEnable) { |
| 43 | |
| 44 | TOKEN_PRIVILEGES tp; |
| 45 | tp.PrivilegeCount = 1; |
| 46 | LookupPrivilegeValue(NULL, szPrivName, &tp.Privileges[0].Luid); |
| 47 | tp.Privileges[0].Attributes = fEnable ? SE_PRIVILEGE_ENABLED : 0; |
| 48 | AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof (tp), NULL, NULL); |
| 49 | return ((GetLastError() == ERROR_SUCCESS)); |
| 50 | |
| 51 | } |
| 52 | |
| 53 | BOOL AcquirePrivileges() { |
| 54 | |