11#define TOKEN_WITH_EVERYONE_GROUP 1
12#define TOKEN_WITHOUT_EVERYONE_GROUP 0
23 skip(
"OpenThread() has failed to open the current process' thread (error code: %lu)\n",
GetLastError());
38 L"SYSTEM\\CurrentControlSet\\Control\\Lsa",
44 skip(
"RegOpenKeyExW() has failed to open the key (error code: %li)\n",
Result);
49 L"EveryoneIncludesAnonymous",
56 skip(
"RegSetValueExW() has failed to set the value (error code: %li)\n",
Result);
static HANDLE GetThreadFromCurrentProcess(_In_ DWORD DesiredAccess)
#define TOKEN_WITHOUT_EVERYONE_GROUP
#define TOKEN_WITH_EVERYONE_GROUP
static VOID ImpersonateTokenWithEveryoneOrWithout(_In_ DWORD Value)
#define ok_hex(expression, result)
#define RegCloseKey(hKey)
#define STATUS_INVALID_HANDLE
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
#define THREAD_IMPERSONATE
NTSTATUS NTAPI NtImpersonateAnonymousToken(_In_ HANDLE ThreadHandle)
Allows the calling thread to impersonate the system's anonymous logon token.
#define STATUS_ACCESS_DENIED
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
BOOL WINAPI RevertToSelf(void)
#define HKEY_LOCAL_MACHINE
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO