[CMLIB/NTOSKRNL]:

- Move cmindex.c and cmname.c to cmlib, because bootmgr/winload use the kernel's cm implementation, unlike our freeldr which uses an almost copy-pasted-but-not-shared-because-hey-why-not-have-to-fix-the-bugs-in-two-places-instead-of-just-one implementation.
- Minor fixes to headers to allow those two files to be used/built outside of ntoskrnl.

svn path=/trunk/; revision=69444
This commit is contained in:
Alex Ionescu 2015-10-04 20:18:49 +00:00
parent f7a1eb0c1a
commit 85b39039dd
5 changed files with 94 additions and 37 deletions

View file

@ -6,6 +6,8 @@ add_definitions(
list(APPEND SOURCE
cminit.c
cmindex.c
cmname.c
cmtools.c
hivebin.c
hivecell.c

View file

@ -1,14 +1,14 @@
/*
* PROJECT: ReactOS Kernel
* PROJECT: ReactOS Registry Library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/config/cmindex.c
* FILE: lib/cmlib/cmindex.c
* PURPOSE: Configuration Manager - Cell Indexes
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cmlib.h"
#define NDEBUG
#include "debug.h"

View file

@ -55,6 +55,8 @@
#define OBJ_CASE_INSENSITIVE 0x00000040L
#define USHORT_MAX USHRT_MAX
#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
VOID NTAPI
KeQuerySystemTime(
OUT PLARGE_INTEGER CurrentTime);
@ -114,6 +116,8 @@
#include <ntdef.h>
#include <ntddk.h>
#undef PAGED_CODE
#define PAGED_CODE()
/* Prevent inclusion of Windows headers through <wine/unicode.h> */
#define _WINDEF_
@ -248,7 +252,7 @@ typedef struct _HV_TRACK_CELL_REF
extern ULONG CmlibTraceLevel;
/*
* Public functions.
* Public Hive functions.
*/
NTSTATUS CMAPI
HvInitialize(
@ -336,6 +340,41 @@ BOOLEAN CMAPI
HvWriteHive(
PHHIVE RegistryHive);
BOOLEAN
CMAPI
HvTrackCellRef(
PHV_TRACK_CELL_REF CellRef,
PHHIVE Hive,
HCELL_INDEX Cell
);
VOID
CMAPI
HvReleaseFreeCellRefArray(
PHV_TRACK_CELL_REF CellRef
);
/*
* Private functions.
*/
PHBIN CMAPI
HvpAddBin(
PHHIVE RegistryHive,
ULONG Size,
HSTORAGE_TYPE Storage);
NTSTATUS CMAPI
HvpCreateHiveFreeCellList(
PHHIVE Hive);
ULONG CMAPI
HvpHiveHeaderChecksum(
PHBASE_BLOCK HiveHeader);
/* Old-style Public "Cmlib" functions */
BOOLEAN CMAPI
CmCreateRootNode(
PHHIVE Hive,
@ -389,36 +428,54 @@ CmCopyKeyValueName(
_Out_ PWCHAR ValueNameBuffer,
_Inout_ ULONG BufferLength);
BOOLEAN
CMAPI
HvTrackCellRef(
PHV_TRACK_CELL_REF CellRef,
PHHIVE Hive,
HCELL_INDEX Cell
);
/* NT-style Public Cm functions */
LONG
NTAPI
CmpCompareCompressedName(
IN PCUNICODE_STRING SearchName,
IN PWCHAR CompressedName,
IN ULONG NameLength
);
USHORT
NTAPI
CmpCompressedNameSize(
IN PWCHAR Name,
IN ULONG Length
);
HCELL_INDEX
NTAPI
CmpFindSubKeyByName(
IN PHHIVE Hive,
IN PCM_KEY_NODE Parent,
IN PCUNICODE_STRING SearchName
);
/* To be implemented by the user of this library */
PVOID
NTAPI
CmpAllocate(
IN SIZE_T Size,
IN BOOLEAN Paged,
IN ULONG Tag
);
VOID
CMAPI
HvReleaseFreeCellRefArray(
PHV_TRACK_CELL_REF CellRef
);
NTAPI
CmpFree(
IN PVOID Ptr,
IN ULONG Quota
);
/*
* Private functions.
*/
PHBIN CMAPI
HvpAddBin(
PHHIVE RegistryHive,
ULONG Size,
HSTORAGE_TYPE Storage);
NTSTATUS CMAPI
HvpCreateHiveFreeCellList(
PHHIVE Hive);
ULONG CMAPI
HvpHiveHeaderChecksum(
PHBASE_BLOCK HiveHeader);
VOID
NTAPI
CmpCopyCompressedName(
IN PWCHAR Destination,
IN ULONG DestinationLength,
IN PWCHAR Source,
IN ULONG SourceLength
);
#endif /* _CMLIB_H_ */

View file

@ -1,14 +1,14 @@
/*
* PROJECT: ReactOS Kernel
* PROJECT: ReactOS Registry Library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/config/cmname.c
* FILE: lib/cmlib/cmname.c
* PURPOSE: Configuration Manager - Name Management
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cmlib.h"
#define NDEBUG
#include "debug.h"

View file

@ -56,13 +56,11 @@ list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmdelay.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmhook.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmhvlist.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmindex.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cminit.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmkcbncb.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmkeydel.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmlazy.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmmapvw.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmname.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmnotify.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmparse.c
${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmquota.c