#include "precomp.h"
#include <ndk/cmfuncs.h>
Go to the source code of this file.
◆ IS_HKCR
◆ ok_key_deleted
◆ ok_key_name
◆ ok_key_not_deleted
◆ _test_key_deleted()
Definition at line 68 of file HKEY_CLASSES_ROOT.c.
69{
70 DWORD ErrorCode =
RegQueryInfoKeyW(
hKey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
73 else
75}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
_In_ NDIS_ERROR_CODE ErrorCode
#define ERROR_KEY_DELETED
◆ _test_key_name()
Definition at line 79 of file HKEY_CLASSES_ROOT.c.
80{
83
87
91
93
95 "Key name is %.*S, expected %.*S\n",
98
100}
static void GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_In_ __drv_aliasesMem PSTRING Prefix
◆ DeleteSubKey()
Definition at line 20 of file HKEY_CLASSES_ROOT.c.
21{
24
28 0,
34
36}
#define ok_dec(expression, result)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
root entry for file system trees
Referenced by Test_CreateOpenKey().
◆ GetKeyName()
Definition at line 40 of file HKEY_CLASSES_ROOT.c.
41{
46
47
48 InfoLength = 0;
51
52
54 ok(NameInformation !=
NULL,
"\n");
55
58
62
64
65 RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
66}
#define ok_ntstatus(status, expected)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
NTSTATUS NTAPI NtQueryKey(IN HANDLE KeyHandle, IN KEY_INFORMATION_CLASS KeyInformationClass, OUT PVOID KeyInformation, IN ULONG Length, OUT PULONG ResultLength)
#define STATUS_BUFFER_TOO_SMALL
Referenced by _test_key_name(), and START_TEST().
◆ START_TEST()
Definition at line 607 of file HKEY_CLASSES_ROOT.c.
608{
611
612
615 L"Software\\Classes",
616 0,
618 &UserKey);
622
625}
static UNICODE_STRING HKCU_ClassesPath
static void Test_DuplicateHandle(void)
static void Test_CreateOpenKey(void)
#define HKEY_CURRENT_USER
◆ Test_CreateOpenKey()
Definition at line 106 of file HKEY_CLASSES_ROOT.c.
107{
108 HKEY MachineKey, MachineSubKey;
109 HKEY UserKey, UserSubKey;
110 HKEY ClassesRootKey, ClassesRootSubKey;
113
114
117 L"Software\\Classes\\Apitest_HKLM",
118 0,
120 0,
123 &MachineKey,
125
127 {
128 win_skip(
"Please run those tests with Administrator rights\n");
129 return;
130 }
131
134
135
139 0,
141 &ClassesRootKey);
145
146
150 L"Software\\Classes\\Apitest_HKLM",
151 0,
153 &UserKey);
156
157
162
163
167 0,
169 0,
172 &ClassesRootKey,
177
178
181 L"Software\\Classes\\Apitest_HKCR",
182 0,
184 &MachineKey);
187
188
192 L"Software\\Classes\\Apitest_HKCR",
193 0,
195 &UserKey);
198
199
206
207
211 L"Software\\Classes\\Apitest_HKCR",
212 0,
214 &MachineKey);
217
218
221 L"Software\\Classes\\Apitest_HKCU",
222 0,
224 0,
227 &UserKey,
231
232
236 0,
238 &ClassesRootKey);
242
243
246 L"Software\\Classes\\Apitest_HKCU",
247 0,
249 &MachineKey);
252
259
260
264 L"Software\\Classes\\Apitest_HKCU",
265 0,
267 &UserKey);
270
271
274 L"Software\\Classes\\Apitest_HKLM_HKCU",
275 0,
277 0,
280 &UserKey,
284
287 L"Software\\Classes\\Apitest_HKLM_HKCU",
288 0,
290 0,
293 &MachineKey,
297
298
301 L"Apitest_HKLM_HKCU",
302 0,
304 &ClassesRootKey);
307
309
310
314 L"Apitest_HKLM_HKCU",
315 0,
317 0,
320 &ClassesRootKey,
324
327
328
334
337
338
343
344
347 L"Software\\Classes\\Apitest_HKLM",
348 0,
350 0,
353 &MachineKey,
357
358
362 0,
364 &ClassesRootKey);
368
369
372 L"Software\\Classes\\Apitest_HKLM\\HKCU_Subkey",
373 0,
375 0,
378 &UserSubKey,
382
383
385 ClassesRootKey,
387 0,
389 &ClassesRootSubKey);
393
394
397 ClassesRootKey,
399 0,
401 0,
404 &ClassesRootSubKey,
408
411
412
415 L"Software\\Classes\\Apitest_HKLM",
416 0,
418 &UserKey);
421
422
429
430
436
437
443
444
447 L"Software\\Classes\\Apitest_HKCU",
448 0,
450 0,
453 &UserKey,
457
458
462 0,
464 &ClassesRootKey);
468
469
471 ClassesRootKey,
473 0,
475 0,
478 &ClassesRootSubKey,
482
484
488
489
492 L"Software\\Classes\\Apitest_HKCU\\HKLM_Subkey",
493 0,
495 0,
498 &MachineSubKey,
502
503
506 ClassesRootKey,
508 0,
510 &ClassesRootSubKey);
514
515
518 L"Software\\Classes\\Apitest_HKCU",
519 0,
521 &MachineKey);
524
525
530
531
534 L"Software\\Classes\\Apitest_HKCU\\HKCU_Subkey",
535 0,
537 0,
540 &UserSubKey,
544
545
548 ClassesRootKey,
550 0,
552 0,
555 &ClassesRootSubKey,
559
562
568
571
572
579
580
584}
static LONG DeleteSubKey(HKEY hKey, LPWSTR Root, LPWSTR SubKey)
#define ok_key_not_deleted(hKey)
#define ok_key_name(hKey, Prefix, Name)
static UNICODE_STRING HKLM_ClassesPath
#define ok_key_deleted(hKey)
#define ok_hex(expression, result)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
#define ERROR_ACCESS_DENIED
#define ERROR_FILE_NOT_FOUND
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
#define REG_OPENED_EXISTING_KEY
#define HKEY_LOCAL_MACHINE
#define HKEY_CLASSES_ROOT
Referenced by START_TEST().
◆ Test_DuplicateHandle()
static void Test_DuplicateHandle |
( |
void |
| ) |
|
|
static |
Definition at line 588 of file HKEY_CLASSES_ROOT.c.
589{
593
597
599 ok(Duplicated,
"\n");
600 ok(DupHandle !=
NULL,
"\n");
602
605}
#define GetCurrentProcess()
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
#define DUPLICATE_SAME_ACCESS
Referenced by START_TEST().
◆ HKCU_ClassesPath
◆ HKLM_ClassesPath