From 73eb67f51b1d32f55f09e8e5f9dba89f8c7df328 Mon Sep 17 00:00:00 2001 From: Robert Dickenson Date: Sun, 10 Nov 2002 13:47:03 +0000 Subject: [PATCH] just some code to to some specific key reading tests. svn path=/trunk/; revision=3727 --- reactos/apps/tests/regtest/regtest.c | 120 ++++++++++++++++++++++++++- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/reactos/apps/tests/regtest/regtest.c b/reactos/apps/tests/regtest/regtest.c index 88e11b2c654..9eb8582f68b 100644 --- a/reactos/apps/tests/regtest/regtest.c +++ b/reactos/apps/tests/regtest/regtest.c @@ -51,7 +51,7 @@ void do_enumeratekey(PWSTR Name) void test1(void) { - HKEY hKey = NULL,hKey1; + HKEY hKey = NULL, hKey1; OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status; UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry"); @@ -826,6 +826,119 @@ void test8(void) dprintf("\t\t\t\tStatus =%x\n",Status); } +void test9(void) +{ + HKEY hKey = NULL, hKey1; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry"); + ULONG Index,Length,i; + KEY_BASIC_INFORMATION KeyInformation[5]; + KEY_VALUE_FULL_INFORMATION KeyValueInformation[5]; + + dprintf("NtOpenKey \\Registry : "); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes); + dprintf("\t\t\t\tStatus =%x\n",Status); + if (Status == 0) { + dprintf("NtQueryKey : "); + Status = NtQueryKey(hKey1, KeyBasicInformation, &KeyInformation[0], sizeof(KeyInformation), &Length); + dprintf("\t\t\t\t\tStatus =%x\n",Status); + if (Status == STATUS_SUCCESS) { + dprintf("\tKey Name = "); + for (i=0;i