https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf8a7d2db000cd54c92f2…
commit bf8a7d2db000cd54c92f25ad6b0329659c7bd93f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Oct 14 00:16:04 2018 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Oct 14 15:59:31 2018 +0200
[CMLIB] Adjust parameter types and annotations. Add diagnostic assertions.
---
sdk/lib/cmlib/cmlib.h | 6 +++---
sdk/lib/cmlib/cmname.c | 2 +-
sdk/lib/cmlib/cmvalue.c | 9 ++++++---
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/sdk/lib/cmlib/cmlib.h b/sdk/lib/cmlib/cmlib.h
index 46676a2122..b9431c750b 100644
--- a/sdk/lib/cmlib/cmlib.h
+++ b/sdk/lib/cmlib/cmlib.h
@@ -595,7 +595,7 @@ CmpFindNameInList(
IN PHHIVE Hive,
IN PCHILD_LIST ChildList,
IN PUNICODE_STRING Name,
- OUT PULONG ChildIndex,
+ OUT PULONG ChildIndex OPTIONAL,
OUT PHCELL_INDEX CellIndex
);
@@ -625,7 +625,7 @@ CmpSetValueDataNew(
IN PHHIVE Hive,
IN PVOID Data,
IN ULONG DataSize,
- IN ULONG StorageType,
+ IN HSTORAGE_TYPE StorageType,
IN HCELL_INDEX ValueCell,
OUT PHCELL_INDEX DataCell
);
@@ -636,7 +636,7 @@ CmpAddValueToList(
IN PHHIVE Hive,
IN HCELL_INDEX ValueCell,
IN ULONG Index,
- IN ULONG Type,
+ IN HSTORAGE_TYPE StorageType,
IN OUT PCHILD_LIST ChildList
);
diff --git a/sdk/lib/cmlib/cmname.c b/sdk/lib/cmlib/cmname.c
index 918cbb282d..b12374023c 100644
--- a/sdk/lib/cmlib/cmname.c
+++ b/sdk/lib/cmlib/cmname.c
@@ -149,7 +149,7 @@ NTAPI
CmpFindNameInList(IN PHHIVE Hive,
IN PCHILD_LIST ChildList,
IN PUNICODE_STRING Name,
- OUT PULONG ChildIndex,
+ OUT PULONG ChildIndex OPTIONAL,
OUT PHCELL_INDEX CellIndex)
{
PCELL_DATA CellData;
diff --git a/sdk/lib/cmlib/cmvalue.c b/sdk/lib/cmlib/cmvalue.c
index a038c776f3..86344a7707 100644
--- a/sdk/lib/cmlib/cmvalue.c
+++ b/sdk/lib/cmlib/cmvalue.c
@@ -207,7 +207,7 @@ NTAPI
CmpAddValueToList(IN PHHIVE Hive,
IN HCELL_INDEX ValueCell,
IN ULONG Index,
- IN ULONG Type,
+ IN HSTORAGE_TYPE StorageType,
IN OUT PCHILD_LIST ChildList)
{
HCELL_INDEX ListCell;
@@ -223,6 +223,8 @@ CmpAddValueToList(IN PHHIVE Hive,
ChildCount++;
if (ChildCount > 1)
{
+ ASSERT(ChildList->List != HCELL_NIL);
+
/* The cell should be dirty at this point */
ASSERT(HvIsCellDirty(Hive, ChildList->List));
@@ -249,7 +251,8 @@ CmpAddValueToList(IN PHHIVE Hive,
else
{
/* This is our first child, so allocate a single cell */
- ListCell = HvAllocateCell(Hive, sizeof(HCELL_INDEX), Type, HCELL_NIL);
+ ASSERT(ChildList->List == HCELL_NIL);
+ ListCell = HvAllocateCell(Hive, sizeof(HCELL_INDEX), StorageType, HCELL_NIL);
}
/* Fail if we couldn't get a cell */
@@ -286,7 +289,7 @@ NTAPI
CmpSetValueDataNew(IN PHHIVE Hive,
IN PVOID Data,
IN ULONG DataSize,
- IN ULONG StorageType,
+ IN HSTORAGE_TYPE StorageType,
IN HCELL_INDEX ValueCell,
OUT PHCELL_INDEX DataCell)
{