Author: jgardou
Date: Wed Oct 1 15:59:54 2014
New Revision: 64439
URL:
http://svn.reactos.org/svn/reactos?rev=64439&view=rev
Log:
[ADVAPI32_APITEST]
- Add more tests for HKCR subkeys creation.
CORE-8582
Modified:
trunk/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c
Modified: trunk/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/advapi32/HKEY_CL…
==============================================================================
--- trunk/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/advapi32/HKEY_CLASSES_ROOT.c [iso-8859-1] Wed Oct 1 15:59:54
2014
@@ -432,6 +432,26 @@
ok(IS_HKCR(ClassesRootKey), "\n");
ok_key_name(ClassesRootKey, &HKCU_ClassesPath, L"Apitest_HKCU");
+ /* Try creating a subkey with this HKCR handle, which points to a subkey in HKCU. */
+ ErrorCode = RegCreateKeyExW(
+ ClassesRootKey,
+ L"HKCR_Subkey",
+ 0,
+ NULL,
+ 0,
+ MAXIMUM_ALLOWED,
+ NULL,
+ &ClassesRootSubKey,
+ NULL);
+ ok_dec(ErrorCode, ERROR_SUCCESS);
+ ok(IS_HKCR(ClassesRootSubKey), "\n");
+ /* It is in fact created in HKLM */
+ ok_key_name(ClassesRootSubKey, &HKLM_ClassesPath,
L"Apitest_HKCU\\HKCR_Subkey");
+ /* Let's see if we can delete it */
+ RegDeleteKeyW(ClassesRootKey, L"HKCR_Subkey");
+ ok_key_deleted(ClassesRootSubKey);
+ RegCloseKey(ClassesRootSubKey);
+
/* Create a corresponding subkey in HKLM */
ErrorCode = RegCreateKeyExW(
HKEY_LOCAL_MACHINE,
@@ -446,7 +466,8 @@
ok_dec(ErrorCode, ERROR_SUCCESS);
ok(!IS_HKCR(MachineSubKey), "\n");
- /* Open it as an HKCR subkey */
+ /* Open it from the HKCR handle (which is still pointing to HKCU) */
+ ok_key_name(ClassesRootKey, &HKCU_ClassesPath, L"Apitest_HKCU");
ErrorCode = RegOpenKeyExW(
ClassesRootKey,
L"HKLM_Subkey",
@@ -472,6 +493,27 @@
ok_dec(ErrorCode, ERROR_SUCCESS);
ok_key_deleted(MachineSubKey);
ok_key_deleted(ClassesRootSubKey);
+
+ /* Rery creating a subkey with this HKCR handle (which points to HKCU).
+ * It should now be created in the HKLM view. */
+ ok_key_name(ClassesRootKey, &HKCU_ClassesPath, L"Apitest_HKCU");
+ ErrorCode = RegCreateKeyExW(
+ ClassesRootKey,
+ L"HKCR_Subkey",
+ 0,
+ NULL,
+ 0,
+ MAXIMUM_ALLOWED,
+ NULL,
+ &ClassesRootSubKey,
+ NULL);
+ ok_dec(ErrorCode, ERROR_SUCCESS);
+ ok(IS_HKCR(ClassesRootSubKey), "\n");
+ ok_key_name(ClassesRootSubKey, &HKLM_ClassesPath,
L"Apitest_HKCU\\HKCR_Subkey");
+ RegDeleteKeyW(MachineKey, L"HKCR_Subkey");
+ ok_key_deleted(ClassesRootSubKey);
+ RegCloseKey(ClassesRootSubKey);
+
RegCloseKey(MachineSubKey);
RegCloseKey(ClassesRootSubKey);