25 tp.PrivilegeCount = 1;
26 tp.Privileges[0].Luid = luid;
34 tp.Privileges[0].Attributes = 0;
140 L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
171 L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\");
217 wprintf(
L"SystemLoadGdiDriverInformation can only be used in kmode.\n");
221 wprintf(
L"SystemLoadGdiDriverInformation incorrectly loaded the driver\n");
229 wprintf(
L"LoadVia_SystemLoadGdiDriverInformation failed [%lu]\n",
err);
256 wprintf(
L"SystemExtendServiceTableInformation can only be used in kmode.\n");
260 wprintf(
L"SystemExtendServiceTableInformation incorrectly loaded the driver\n");
268 wprintf(
L"LoadVia_SystemExtendServiceTableInformation failed [%lu] - 0x%x\n",
err,
Status);
NTSYSAPI NTSTATUS NTAPI NtSetSystemInformation(IN INT SystemInformationClass, IN PVOID SystemInformation, IN ULONG SystemInformationLength)
struct _SYSTEM_GDI_DRIVER_INFORMATION SYSTEM_GDI_DRIVER_INFORMATION
NTSTATUS NtUnloadDriver(IN PUNICODE_STRING DriverServiceName)
#define STATUS_PRIVILEGE_NOT_HELD
#define SystemLoadGdiDriverInformation
#define SystemExtendServiceTableInformation
NTSTATUS NtQueryObject(IN HANDLE Handle, IN OBJECT_INFO_CLASS ObjectInformationClass, OUT PVOID ObjectInformation, IN ULONG ObjectInformationLength, OUT PULONG ReturnLength)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
struct _UNICODE_STRING UNICODE_STRING
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
BOOL NtStopDriver(LPCWSTR lpService)
static BOOL SetPrivilege(BOOL bSet)
BOOL ConvertPath(LPCWSTR lpPath, LPWSTR lpDevice)
BOOL LoadVia_SystemExtendServiceTableInformation(LPWSTR lpDriverPath)
BOOL NtStartDriver(LPCWSTR lpService)
BOOL LoadVia_SystemLoadGdiDriverInformation(LPWSTR lpDriverPath)
static POBJECTS_AND_NAME_A pObjName
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define LookupPrivilegeValue
DWORD WINAPI GetLastError(void)
#define SE_LOAD_DRIVER_NAME
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED