ntdll: Added more NtOpenKey tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
808c2d6c7f
commit
26df0863ca
|
@ -340,6 +340,7 @@ static void test_NtOpenKey(void)
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
ACCESS_MASK am = KEY_READ;
|
ACCESS_MASK am = KEY_READ;
|
||||||
|
UNICODE_STRING str;
|
||||||
|
|
||||||
/* All NULL */
|
/* All NULL */
|
||||||
status = pNtOpenKey(NULL, 0, NULL);
|
status = pNtOpenKey(NULL, 0, NULL);
|
||||||
|
@ -361,6 +362,27 @@ static void test_NtOpenKey(void)
|
||||||
status = pNtOpenKey(&key, am, &attr);
|
status = pNtOpenKey(&key, am, &attr);
|
||||||
ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08x\n", status);
|
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)
|
if (!pNtOpenKeyEx)
|
||||||
{
|
{
|
||||||
win_skip("NtOpenKeyEx not available\n");
|
win_skip("NtOpenKeyEx not available\n");
|
||||||
|
|
Loading…
Reference in New Issue