[CMLIB] Adjust parameter types and annotations. Add diagnostic assertions.

This commit is contained in:
Hermès Bélusca-Maïto 2018-10-14 00:16:04 +02:00
parent 801b71b9bf
commit bf8a7d2db0
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 10 additions and 7 deletions

View file

@ -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
);

View file

@ -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;

View file

@ -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)
{