Commit 058bfeed authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

advapi32/tests: Test creating registry keys with a NULL return key pointer.

parent d2045611
......@@ -1279,6 +1279,19 @@ static void test_reg_create_key(void)
PACL key_acl;
SECURITY_DESCRIPTOR *sd;
/* NULL return key check */
ret = RegCreateKeyA(hkey_main, "Subkey1", NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyW(hkey_main, L"Subkey1", NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL);
ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExW(hkey_main, L"Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, NULL, NULL);
ok(ret == ERROR_BADKEY, "Got unexpected ret %ld.\n", ret);
ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
ok(!ret, "RegCreateKeyExA failed with error %ld\n", ret);
/* should succeed: all versions of Windows ignore the access rights
......
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