Commit 26df0863 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ntdll: Added more NtOpenKey tests.

parent 808c2d6c
......@@ -340,6 +340,7 @@ static void test_NtOpenKey(void)
NTSTATUS status;
OBJECT_ATTRIBUTES attr;
ACCESS_MASK am = KEY_READ;
UNICODE_STRING str;
/* All NULL */
status = pNtOpenKey(NULL, 0, NULL);
......@@ -361,6 +362,27 @@ static void test_NtOpenKey(void)
status = pNtOpenKey(&key, am, &attr);
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08x\n", status);
/* Calling without parent key requres full registry path. */
pRtlCreateUnicodeStringFromAsciiz( &str, "Machine" );
InitializeObjectAttributes(&attr, &str, 0, 0, 0);
status = pNtOpenKey(&key, KEY_READ, &attr);
todo_wine ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "NtOpenKey Failed: 0x%08x\n", status);
if (!status)
pNtClose(key);
/* Open is case sensitive unless OBJ_CASE_INSENSITIVE is specified. */
pRtlCreateUnicodeStringFromAsciiz( &str, "\\Registry\\Machine" );
status = pNtOpenKey(&key, KEY_READ, &attr);
todo_wine ok(status == STATUS_OBJECT_PATH_NOT_FOUND, "NtOpenKey Failed: 0x%08x\n", status);
if (!status)
pNtClose(key);
attr.Attributes = OBJ_CASE_INSENSITIVE;
status = pNtOpenKey(&key, KEY_READ, &attr);
ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status);
if (!status)
pNtClose(key);
if (!pNtOpenKeyEx)
{
win_skip("NtOpenKeyEx not available\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment