stos: ob: Add helper to create object directory

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-25 00:49:13 +00:00
parent 70c3a30f72
commit 4f399576a0
2 changed files with 47 additions and 0 deletions
+39
View File
@@ -10,6 +10,45 @@
#include <ex/pool.h>
#include <string.h>
ST_STATUS
ObCreateDirectory(const CHAR *Name, ST_OBJECT **Result)
{
ST_STATUS Status;
ST_OBJECT *DirecObj;
OBJECT_DIRECTORY *Direc;
if (Name == NULL || Result == NULL) {
return STATUS_INVALID_PARAM;
}
Status = ObCreateObject(
Name,
OBJECT_TYPE_DIRECTORY,
NULL,
&DirecObj
);
if (Status != STATUS_SUCCESS) {
return Status;
}
Direc = ExAllocatePoolWithTag(
POOL_NON_PAGED,
sizeof(*Direc),
OBJECT_POOL_TAG
);
/* FIXME: Free DirecObj */
if (Direc == NULL) {
return STATUS_NO_MEMORY;
}
RtlMemSet(Direc, 0, sizeof(*Direc));
DirecObj->Data = Direc;
*Result = DirecObj;
return STATUS_SUCCESS;
}
ST_STATUS
ObCreateObject(const CHAR *Name, OBJECT_TYPE Type, VOID *Data, ST_OBJECT **Result)
{