Fixed hivetest.

svn path=/trunk/; revision=19253
This commit is contained in:
Hartmut Birr 2005-11-15 18:08:07 +00:00
parent 4f27be0f0b
commit 296abe764c
3 changed files with 26 additions and 18 deletions

View file

@ -103,9 +103,9 @@
<directory name="hello"> <directory name="hello">
<xi:include href="hello/hello.xml" /> <xi:include href="hello/hello.xml" />
</directory> </directory>
<directory name="hivetest">
<!-- fixme: hivetest --> <xi:include href="hivetest/hivetest.xml" />
</directory>
<directory name="icontest"> <directory name="icontest">
<xi:include href="icontest/icontest.xml" /> <xi:include href="icontest/icontest.xml" />
</directory> </directory>

View file

@ -5,6 +5,14 @@
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>
#include <ndk/rtltypes.h>
#define RtlRosInitUnicodeStringFromLiteral(__Name__, __Value__) \
{ \
(__Name__)->Buffer = (__Value__); \
(__Name__)->Length = sizeof(__Value__) - sizeof(WCHAR); \
(__Name__)->MaximumLength = sizeof(__Value__); \
}
HANDLE OutputHandle; HANDLE OutputHandle;
HANDLE InputHandle; HANDLE InputHandle;
@ -54,7 +62,7 @@ void do_enumeratekey(PWSTR Name)
void CreateKeyTest(void) void CreateKeyTest(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status; NTSTATUS Status;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
@ -86,7 +94,7 @@ void DeleteKeyTest(void)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
HKEY hKey; HANDLE hKey;
NTSTATUS Status; NTSTATUS Status;
dprintf("Delete key '\\Registry\\Machine\\Software\\testkey':\n"); dprintf("Delete key '\\Registry\\Machine\\Software\\testkey':\n");
@ -113,7 +121,7 @@ void DeleteKeyTest(void)
void EnumerateKeyTest(void) void EnumerateKeyTest(void)
{ {
HKEY hKey = NULL; HANDLE hKey = NULL;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status; NTSTATUS Status;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software");
@ -180,7 +188,7 @@ void EnumerateKeyTest(void)
void SetValueTest1(void) void SetValueTest1(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue"); UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue");
@ -221,7 +229,7 @@ void SetValueTest1(void)
void SetValueTest2(void) void SetValueTest2(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue"); UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue");
@ -264,7 +272,7 @@ void DeleteValueTest(void)
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue"); UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"TestValue");
HKEY KeyHandle; HANDLE KeyHandle;
NTSTATUS Status; NTSTATUS Status;
dprintf("Open key '\\Registry\\Machine\\Software\\testkey':\n"); dprintf("Open key '\\Registry\\Machine\\Software\\testkey':\n");
@ -300,7 +308,7 @@ void EnumerateValueTest(void)
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\testkey");
ULONG Index,Length,i; ULONG Index,Length,i;
HKEY hKey = NULL; HANDLE hKey = NULL;
NTSTATUS Status; NTSTATUS Status;
dprintf("Open key '\\Registry\\Machine\\Software\\testkey':\n"); dprintf("Open key '\\Registry\\Machine\\Software\\testkey':\n");
@ -357,7 +365,7 @@ void EnumerateValueTest(void)
void test1(void) void test1(void)
{ {
HKEY hKey = NULL, hKey1; HANDLE hKey = NULL, hKey1;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status; NTSTATUS Status;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software");
@ -414,7 +422,7 @@ void test1(void)
void test3(void) void test3(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName;
NTSTATUS Status; NTSTATUS Status;
@ -614,7 +622,7 @@ void test4(void)
void test5(void) void test5(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName;
NTSTATUS Status; NTSTATUS Status;
@ -637,7 +645,7 @@ void test5(void)
/* registry link create test */ /* registry link create test */
void test6(void) void test6(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName; UNICODE_STRING KeyName,ValueName;
NTSTATUS Status; NTSTATUS Status;
@ -746,7 +754,7 @@ void test6(void)
/* registry link delete test */ /* registry link delete test */
void test7(void) void test7(void)
{ {
HKEY hKey; HANDLE hKey;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName; UNICODE_STRING KeyName,ValueName;
NTSTATUS Status; NTSTATUS Status;
@ -828,7 +836,7 @@ void test8(void)
RtlRosInitUnicodeStringFromLiteral(&KeyName,L"test5"); RtlRosInitUnicodeStringFromLiteral(&KeyName,L"test5");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL); , NULL, NULL);
Status = NtLoadKey(HKEY_LOCAL_MACHINE,&ObjectAttributes); Status = NtLoadKey((HANDLE)HKEY_LOCAL_MACHINE,&ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status); dprintf("\t\t\t\tStatus =%x\n",Status);
dwError=RegLoadKey(HKEY_LOCAL_MACHINE,"def" dwError=RegLoadKey(HKEY_LOCAL_MACHINE,"def"
,"test5"); ,"test5");
@ -852,7 +860,7 @@ void test8(void)
void test9(void) void test9(void)
{ {
HKEY hKey = NULL, hKey1; HANDLE hKey = NULL, hKey1;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status; NTSTATUS Status;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry"); UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry");

View file

@ -1,4 +1,4 @@
<module name="hivetest" type="win32gui" installbase="bin" installname="hivetest.exe" allowwarnings="true"> <module name="hivetest" type="win32gui" installbase="bin" installname="hivetest.exe">
<define name="_WIN32_IE">0x0501</define> <define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define> <define name="_WIN32_WINNT">0x0501</define>
<define name="__USE_W32API" /> <define name="__USE_W32API" />