diff --git a/reactos/apps/tests/hivetest/.cvsignore b/reactos/apps/tests/hivetest/.cvsignore new file mode 100644 index 00000000000..7e878167e8e --- /dev/null +++ b/reactos/apps/tests/hivetest/.cvsignore @@ -0,0 +1,5 @@ +*.o +*.d +*.exe +*.coff +*.sym diff --git a/reactos/apps/tests/hivetest/hivetest.c b/reactos/apps/tests/hivetest/hivetest.c new file mode 100644 index 00000000000..a4415ffb76d --- /dev/null +++ b/reactos/apps/tests/hivetest/hivetest.c @@ -0,0 +1,1031 @@ +#include +#include +#include +#include +#include + +HANDLE OutputHandle; +HANDLE InputHandle; + +void dprintf(char* fmt, ...) +{ + va_list args; + char buffer[255]; + + va_start(args,fmt); + vsprintf(buffer,fmt,args); + WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL); + va_end(args); +} + +void do_enumeratekey(PWSTR Name) +{ + ULONG Index,Length,i; + KEY_BASIC_INFORMATION KeyInformation[5]; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE hKey1; + UNICODE_STRING KeyName; + + RtlInitUnicodeString(&KeyName, Name); + InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE + , NULL, NULL); + Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes); + dprintf("NtEnumerateKey : \n"); + Index=0; + while(Status == STATUS_SUCCESS) + { + Status=NtEnumerateKey(hKey1,Index++,KeyBasicInformation + ,&KeyInformation[0], sizeof(KeyInformation) + ,&Length); + if(Status== STATUS_SUCCESS) + { + dprintf("\tSubKey Name = "); + for (i=0;i