Module: wine Branch: master Commit: a4373db64e9c883c49cf41246d602855d962cb93 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a4373db64e9c883c49cf41246...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jul 5 13:59:43 2022 +0200
ntdll/tests: Add a few more tests for registry path names.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/tests/reg.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index a619241c8e5..a0d07c9fc21 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -412,6 +412,12 @@ static void test_NtOpenKey(void) ok( status == STATUS_OBJECT_TYPE_MISMATCH, "NtOpenKey failed: 0x%08lx\n", status ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "\\\" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_OBJECT_NAME_INVALID, "NtOpenKey failed: 0x%08lx\n", status ); + pRtlFreeUnicodeString( &str ); + pRtlCreateUnicodeStringFromAsciiz( &str, "\Registry" ); status = pNtOpenKey(&key, KEY_READ, &attr); todo_wine @@ -425,6 +431,13 @@ static void test_NtOpenKey(void) pNtClose( key ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "\Registry\\" ); + status = pNtOpenKey(&key, KEY_READ, &attr); + todo_wine + ok( status == STATUS_SUCCESS, "NtOpenKey failed: 0x%08lx\n", status ); + pNtClose( key ); + pRtlFreeUnicodeString( &str ); + pRtlCreateUnicodeStringFromAsciiz( &str, "\Foobar" ); status = pNtOpenKey(&key, KEY_READ, &attr); todo_wine @@ -493,7 +506,7 @@ static void test_NtCreateKey(void) { /*Create WineTest*/ OBJECT_ATTRIBUTES attr; - HANDLE key, subkey; + HANDLE key, subkey, subkey2; ACCESS_MASK am = GENERIC_ALL; NTSTATUS status; UNICODE_STRING str; @@ -545,11 +558,20 @@ static void test_NtCreateKey(void) ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08lx\n", status ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "test\\subkey" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08lx\n", status ); + pRtlFreeUnicodeString( &str ); + pRtlCreateUnicodeStringFromAsciiz( &str, "test\subkey\" ); status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08lx\n", status ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08lx\n", status ); + pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey\" ); status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08lx\n", status ); @@ -557,6 +579,18 @@ static void test_NtCreateKey(void) pNtClose( subkey ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey2\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08lx\n", status ); + pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey2\\test\\" ); + status = pNtCreateKey( &subkey2, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08lx\n", status ); + pRtlFreeUnicodeString( &str ); + pNtDeleteKey( subkey2 ); + pNtClose( subkey2 ); + pNtDeleteKey( subkey ); + pNtClose( subkey ); + pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey" ); status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08lx\n", status ); @@ -594,6 +628,14 @@ static void test_NtCreateKey(void) if (!status) pNtClose( subkey ); pRtlFreeUnicodeString( &str );
+ pRtlCreateUnicodeStringFromAsciiz( &str, "\Registry\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + todo_wine + ok( status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, + "NtCreateKey failed: 0x%08lx\n", status ); + if (!status) pNtClose( subkey ); + pRtlFreeUnicodeString( &str ); + pRtlCreateUnicodeStringFromAsciiz( &str, "\Foobar" ); status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); todo_wine