Jacek Caban : ntdll: Added more NtOpenKey tests.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Nov 19 09:05:05 CST 2015
Module: wine
Branch: master
Commit: 26df0863ca6d57c2d5ce24b79a5cd9f5e711ae83
URL: http://source.winehq.org/git/wine.git/?a=commit;h=26df0863ca6d57c2d5ce24b79a5cd9f5e711ae83
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Nov 19 12:48:22 2015 +0100
ntdll: Added more NtOpenKey tests.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/tests/reg.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c
index 0e00f99..e688fd2 100644
--- a/dlls/ntdll/tests/reg.c
+++ b/dlls/ntdll/tests/reg.c
@@ -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");
More information about the wine-cvs
mailing list