Go to the source code of this file.
◆ OpenRegistryKeyHandle()
Definition at line 12 of file NtSaveKey.c.
15{
18
25
27}
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ACCESS_MASK AccessMask
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Referenced by START_TEST().
◆ START_TEST()
Definition at line 29 of file NtSaveKey.c.
30{
36
37
40
41
44 0,
50 {
52 return;
53 }
54
55
58 {
59 skip(
"NtOpenKey failed with status: 0x%08lX\n",
Status);
61 return;
62 }
63
66
68
69
73 &OldPrivilegeStatus);
75 {
76 skip(
"RtlAdjustPrivilege failed with status: 0x%08lX\n", (
ULONG)
Status);
78 return;
79 }
80
81
84 {
85 skip(
"NtOpenKey failed with status: 0x%08lX\n",
Status);
87 }
88
91
93
94
97 {
98 skip(
"NtOpenKey failed with status: 0x%08lX\n",
Status);
100 }
101
104
106
107
110 {
111 skip(
"NtOpenKey failed with status: 0x%08lX\n",
Status);
113 }
114
117
119
121
122
124 OldPrivilegeStatus,
126 &OldPrivilegeStatus);
127
128
130}
#define STATUS_PRIVILEGE_NOT_HELD
static NTSTATUS OpenRegistryKeyHandle(PHANDLE KeyHandle, ACCESS_MASK AccessMask, PWCHAR RegistryPath)
#define ok_ntstatus(status, expected)
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
static const WCHAR Cleanup[]
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_FLAG_DELETE_ON_CLOSE
#define SE_BACKUP_PRIVILEGE
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle)
#define STATUS_ACCESS_DENIED
DWORD WINAPI GetLastError(void)