summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fff76a1)
- Mark the HKEY_CLASSES_ROOT key as belonging to the HKEY_CLASSES_ROOT tree.
CORE-8582
svn path=/trunk/; revision=64417
#include <ndk/cmfuncs.h>
#include <pseh/pseh2.h>
#include <ndk/cmfuncs.h>
#include <pseh/pseh2.h>
WINE_DEFAULT_DEBUG_CHANNEL(reg);
/* DEFINES ******************************************************************/
WINE_DEFAULT_DEBUG_CHANNEL(reg);
/* DEFINES ******************************************************************/
-OpenClassesRootKey(PHANDLE KeyHandle)
+OpenClassesRootKey(_Out_ PHANDLE KeyHandle)
{
OBJECT_ATTRIBUTES Attributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\CLASSES");
{
OBJECT_ATTRIBUTES Attributes;
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\CLASSES");
TRACE("OpenClassesRootKey()\n");
TRACE("OpenClassesRootKey()\n");
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
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;
--- /dev/null
+/*
+ * 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);
+}