stos: ob: Pull object from cache on creation
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
+13
-7
@@ -66,14 +66,20 @@ ObCreateObject(const CHAR *Name, OBJECT_TYPE Type, VOID *Data, ST_OBJECT **Resul
|
|||||||
return STATUS_NAME_TOO_LONG;
|
return STATUS_NAME_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object = ExAllocatePoolWithTag(
|
/*
|
||||||
POOL_NON_PAGED,
|
* Try to pull an object from the cache, if there are not
|
||||||
sizeof(*Object),
|
* objects to pull then we'll allocate one.
|
||||||
OBJECT_POOL_TAG
|
*/
|
||||||
);
|
Object = ObPopFromCache(&gObCache);
|
||||||
|
|
||||||
if (Object == NULL) {
|
if (Object == NULL) {
|
||||||
return STATUS_NO_MEMORY;
|
Object = ExAllocatePoolWithTag(
|
||||||
|
POOL_NON_PAGED,
|
||||||
|
sizeof(*Object),
|
||||||
|
OBJECT_POOL_TAG
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Object == NULL)
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlMemSet(Object, 0, sizeof(*Object));
|
RtlMemSet(Object, 0, sizeof(*Object));
|
||||||
|
|||||||
Reference in New Issue
Block a user