MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / SetDebugPrivilege

Function SetDebugPrivilege

ReClass/Utils.cpp:210–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210bool SetDebugPrivilege( bool bEnable )
211{
212 NTSTATUS Status;
213 HANDLE hToken;
214
215 Status = ntdll::NtOpenProcessToken( GetCurrentProcess( ), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken );
216 if (!NT_SUCCESS( Status ))
217 return FALSE;
218
219 // Enable/Disable Debug Privilege
220 if (!SetPrivilege( hToken, SE_DEBUG_NAME, bEnable ))
221 {
222 CloseHandle( hToken );
223 return false;
224 }
225
226 CloseHandle( hToken );
227 return true;
228}
229
230
231bool IsWindowsVersionOrLater( OSType target )

Callers

nothing calls this directly

Calls 1

SetPrivilegeFunction · 0.85

Tested by

no test coverage detected