From 04201ba76264eb5eecdf5dad8410f78aac686bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 20 Jun 2017 23:29:54 +0000 Subject: [PATCH] [CMLIB]: Use the generic allocator functions, and fix build. svn path=/trunk/; revision=75159 --- reactos/sdk/lib/cmlib/cmlib.h | 4 ++-- reactos/sdk/lib/cmlib/hivecell.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/sdk/lib/cmlib/cmlib.h b/reactos/sdk/lib/cmlib/cmlib.h index 8e142c6f69a..ee84f85a4d8 100644 --- a/reactos/sdk/lib/cmlib/cmlib.h +++ b/reactos/sdk/lib/cmlib/cmlib.h @@ -722,13 +722,13 @@ CmpAllocate( IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag - ); +); VOID NTAPI CmpFree( IN PVOID Ptr, IN ULONG Quota - ); +); #endif /* _CMLIB_H_ */ diff --git a/reactos/sdk/lib/cmlib/hivecell.c b/reactos/sdk/lib/cmlib/hivecell.c index ad41172415f..a267130e494 100644 --- a/reactos/sdk/lib/cmlib/hivecell.c +++ b/reactos/sdk/lib/cmlib/hivecell.c @@ -569,7 +569,9 @@ HvTrackCellRef( if (CellRef->Count == CellRef->Max) { /* Allocate a new reference table */ - NewCellArray = ExAllocatePoolWithTag(PagedPool, (CellRef->Max + CELL_REF_INCREMENT) * sizeof(HV_HIVE_CELL_PAIR), TAG_CM); + NewCellArray = CmpAllocate((CellRef->Max + CELL_REF_INCREMENT) * sizeof(HV_HIVE_CELL_PAIR), + TRUE, + TAG_CM); if (!NewCellArray) { DPRINT1("HvTrackCellRef: Cannot reallocate the reference table.\n"); @@ -585,7 +587,7 @@ HvTrackCellRef( RtlCopyMemory(NewCellArray, CellRef->CellArray, CellRef->Max * sizeof(HV_HIVE_CELL_PAIR)); - ExFreePoolWithTag(CellRef->CellArray, TAG_CM); + CmpFree(CellRef->CellArray, 0); // TAG_CM } CellRef->CellArray = NewCellArray; CellRef->Max += CELL_REF_INCREMENT; @@ -643,7 +645,7 @@ HvReleaseFreeCellRefArray( } /* We can reuse the dynamic array */ - ExFreePoolWithTag(CellRef->CellArray, TAG_CM); + CmpFree(CellRef->CellArray, 0); // TAG_CM CellRef->CellArray = NULL; CellRef->Count = CellRef->Max = 0; }