{
return 0;
}
+
+VOID
+NTAPI
+KeBugCheckEx(
+ _In_ ULONG BugCheckCode,
+ _In_ ULONG_PTR BugCheckParameter1,
+ _In_ ULONG_PTR BugCheckParameter2,
+ _In_ ULONG_PTR BugCheckParameter3,
+ _In_ ULONG_PTR BugCheckParameter4)
+{
+ __assume(0);
+}
cmindex.c
cmname.c
cmtools.c
+ cmvalue.c
hivebin.c
hivecell.c
hiveinit.c
//
#define VALUE_COMP_NAME 0x0001
+//
+// CM_KEY_VALUE Types
+//
+#define CM_KEY_VALUE_SMALL 0x4
+#define CM_KEY_VALUE_BIG 0x3FD8
+#define CM_KEY_VALUE_SPECIAL_SIZE 0x80000000
+
#include <pshpack1.h>
//
#include <wchar.h>
#include "hivedata.h"
#include "cmdata.h"
+#include "bugcodes.h"
#if defined(_TYPEDEFS_HOST_H) || defined(__FREELDR_H)
extern ULONG CmlibTraceLevel;
+//
+// Hack since bigkeys are not yet supported
+//
+#define ASSERT_VALUE_BIG(h, s) \
+ ASSERTMSG("Big keys not supported!", !CmpIsKeyValueBig(h, s));
+
+//
+// Returns whether or not this is a small valued key
+//
+static inline
+BOOLEAN
+CmpIsKeyValueSmall(OUT PULONG RealLength,
+ IN ULONG Length)
+{
+ /* Check if the length has the special size value */
+ if (Length >= CM_KEY_VALUE_SPECIAL_SIZE)
+ {
+ /* It does, so this is a small key: return the real length */
+ *RealLength = Length - CM_KEY_VALUE_SPECIAL_SIZE;
+ return TRUE;
+ }
+
+ /* This is not a small key, return the length we read */
+ *RealLength = Length;
+ return FALSE;
+}
+
+//
+// Returns whether or not this is a big valued key
+//
+static inline
+BOOLEAN
+CmpIsKeyValueBig(IN PHHIVE Hive,
+ IN ULONG Length)
+{
+ /* Check if the hive is XP Beta 1 or newer */
+ if (Hive->Version >= HSYS_WHISTLER_BETA1)
+ {
+ /* Check if the key length is valid for a big value key */
+ if ((Length < CM_KEY_VALUE_SPECIAL_SIZE) && (Length > CM_KEY_VALUE_BIG))
+ {
+ /* Yes, this value is big */
+ return TRUE;
+ }
+ }
+
+ /* Not a big value key */
+ return FALSE;
+}
+
/*
* Public Hive functions.
*/
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: ntoskrnl/config/cmvalue.c
- * PURPOSE: Configuration Manager - Cell Values
+ * FILE: lib/cmlib/cmvalue.c
+ * PURPOSE: Configuration Manager Library - Cell Values
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
-#include "ntoskrnl.h"
+#include "cmlib.h"
#define NDEBUG
-#include "debug.h"
+#include <debug.h>
/* FUNCTIONS *****************************************************************/
return STATUS_SUCCESS;
}
+HCELL_INDEX
+NTAPI
+CmpCopyCell(IN PHHIVE SourceHive,
+ IN HCELL_INDEX SourceCell,
+ IN PHHIVE DestinationHive,
+ IN HSTORAGE_TYPE StorageType)
+{
+ PCELL_DATA SourceData;
+ PCELL_DATA DestinationData = NULL;
+ HCELL_INDEX DestinationCell = HCELL_NIL;
+ LONG DataSize;
+ PAGED_CODE();
+
+ /* Get the data and the size of the source cell */
+ SourceData = HvGetCell(SourceHive, SourceCell);
+ DataSize = HvGetCellSize(SourceHive, SourceData);
+
+ /* Allocate a new cell in the destination hive */
+ DestinationCell = HvAllocateCell(DestinationHive,
+ DataSize,
+ StorageType,
+ HCELL_NIL);
+ if (DestinationCell == HCELL_NIL) goto Cleanup;
+
+ /* Get the data of the destination cell */
+ DestinationData = HvGetCell(DestinationHive, DestinationCell);
+
+ /* Copy the data from the source cell to the destination cell */
+ RtlMoveMemory(DestinationData, SourceData, DataSize);
+
+Cleanup:
+
+ /* Release the cells */
+ if (SourceData) HvReleaseCell(SourceHive, SourceCell);
+ if (DestinationData) HvReleaseCell(DestinationHive, DestinationCell);
+
+ /* Return the destination cell index */
+ return DestinationCell;
+}
+
NTSTATUS
NTAPI
CmpCopyKeyValueList(IN PHHIVE SourceHive,
return SubKeys;
}
-HCELL_INDEX
-NTAPI
-CmpCopyCell(IN PHHIVE SourceHive,
- IN HCELL_INDEX SourceCell,
- IN PHHIVE DestinationHive,
- IN HSTORAGE_TYPE StorageType)
-{
- PCELL_DATA SourceData;
- PCELL_DATA DestinationData = NULL;
- HCELL_INDEX DestinationCell = HCELL_NIL;
- LONG DataSize;
- PAGED_CODE();
-
- /* Get the data and the size of the source cell */
- SourceData = HvGetCell(SourceHive, SourceCell);
- DataSize = HvGetCellSize(SourceHive, SourceData);
-
- /* Allocate a new cell in the destination hive */
- DestinationCell = HvAllocateCell(DestinationHive,
- DataSize,
- StorageType,
- HCELL_NIL);
- if (DestinationCell == HCELL_NIL) goto Cleanup;
-
- /* Get the data of the destination cell */
- DestinationData = HvGetCell(DestinationHive, DestinationCell);
-
- /* Copy the data from the source cell to the destination cell */
- RtlMoveMemory(DestinationData, SourceData, DataSize);
-
-Cleanup:
-
- /* Release the cells */
- if (SourceData) HvReleaseCell(SourceHive, SourceCell);
- if (DestinationData) HvReleaseCell(DestinationHive, DestinationCell);
-
- /* Return the destination cell index */
- return DestinationCell;
-}
-
static
NTSTATUS
NTAPI
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
-//
-// Returns whether or not this is a small valued key
-//
-FORCEINLINE
-BOOLEAN
-CmpIsKeyValueSmall(OUT PULONG RealLength,
- IN ULONG Length)
-{
- /* Check if the length has the special size value */
- if (Length >= CM_KEY_VALUE_SPECIAL_SIZE)
- {
- /* It does, so this is a small key: return the real length */
- *RealLength = Length - CM_KEY_VALUE_SPECIAL_SIZE;
- return TRUE;
- }
-
- /* This is not a small key, return the length we read */
- *RealLength = Length;
- return FALSE;
-}
-
-//
-// Returns whether or not this is a big valued key
-//
-FORCEINLINE
-BOOLEAN
-CmpIsKeyValueBig(IN PHHIVE Hive,
- IN ULONG Length)
-{
- /* Check if the hive is XP Beta 1 or newer */
- if (Hive->Version >= HSYS_WHISTLER_BETA1)
- {
- /* Check if the key length is valid for a big value key */
- if ((Length < CM_KEY_VALUE_SPECIAL_SIZE) && (Length > CM_KEY_VALUE_BIG))
- {
- /* Yes, this value is big */
- return TRUE;
- }
- }
-
- /* Not a big value key */
- return FALSE;
-}
-
//
// Returns the hashkey corresponding to a convkey
//
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmsecach.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmsysini.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmvalche.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmvalue.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmwraprs.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/ntapi.c
${REACTOS_SOURCE_DIR}/ntoskrnl/dbgk/dbgkobj.c