Author: jgardou
Date: Tue Sep 30 20:00:17 2014
New Revision: 64417
URL:
http://svn.reactos.org/svn/reactos?rev=64417&view=rev
Log:
[ADVAPI32]
- Mark the HKEY_CLASSES_ROOT key as belonging to the HKEY_CLASSES_ROOT tree.
CORE-8582
Added:
trunk/reactos/dll/win32/advapi32/reg/reg.h (with props)
Modified:
trunk/reactos/dll/win32/advapi32/reg/reg.c
Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Tue Sep 30 20:00:17 2014
@@ -18,6 +18,8 @@
#include <ndk/cmfuncs.h>
#include <pseh/pseh2.h>
+#include "reg.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(reg);
/* DEFINES ******************************************************************/
@@ -231,10 +233,11 @@
static NTSTATUS
-OpenClassesRootKey(PHANDLE KeyHandle)
+OpenClassesRootKey(_Out_ PHANDLE KeyHandle)
{
OBJECT_ATTRIBUTES Attributes;
UNICODE_STRING KeyName =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\CLASSES");
+ NTSTATUS Status;
TRACE("OpenClassesRootKey()\n");
@@ -243,9 +246,17 @@
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
- return NtOpenKey(KeyHandle,
- MAXIMUM_ALLOWED,
- &Attributes);
+ Status = NtOpenKey(KeyHandle,
+ MAXIMUM_ALLOWED,
+ &Attributes);
+
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ /* Mark it as HKCR */
+ MakeHKCRKey((HKEY*)KeyHandle);
+
+ return Status;
}
Added: trunk/reactos/dll/win32/advapi32/reg/reg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/reg/reg.h (added)
+++ trunk/reactos/dll/win32/advapi32/reg/reg.h [iso-8859-1] Tue Sep 30 20:00:17 2014
@@ -0,0 +1,23 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: lib/advapi32/reg/reg.c
+ * PURPOSE: Registry functions
+ */
+
+#pragma once
+
+/* FUNCTIONS ****************************************************************/
+FORCEINLINE
+BOOL
+IsHKCRKey(_In_ HKEY hKey)
+{
+ return ((ULONG_PTR)hKey & 0x2) != 0;
+}
+
+FORCEINLINE
+void
+MakeHKCRKey(_Inout_ HKEY* hKey)
+{
+ *hKey = (HKEY)((ULONG_PTR)*hKey | 0x2);
+}
Propchange: trunk/reactos/dll/win32/advapi32/reg/reg.h
------------------------------------------------------------------------------
charset = UTF-8
Propchange: trunk/reactos/dll/win32/advapi32/reg/reg.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/dll/win32/advapi32/reg/reg.h
------------------------------------------------------------------------------
svn:mime-type = text/plain