diff --git a/xtoskrnl/includes/ob/obmgr.hh b/xtoskrnl/includes/ob/obmgr.hh index 9c2e1f8..7badb5c 100644 --- a/xtoskrnl/includes/ob/obmgr.hh +++ b/xtoskrnl/includes/ob/obmgr.hh @@ -22,6 +22,11 @@ namespace OB STATIC GENERAL_LOOKASIDE NameBufferList; public: + STATIC XTFASTCALL VOID InitializeObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes, + IN PUNICODE_STRING ObjectName, + IN ULONG Attributes, + IN HANDLE Directory, + IN PVOID SecurityDescriptor); STATIC XTAPI XTSTATUS InitializeObjectManager(VOID); STATIC XTAPI VOID InitializeSystemLookasideList(VOID); }; diff --git a/xtoskrnl/ob/obmgr.cc b/xtoskrnl/ob/obmgr.cc index 0bb238e..4946d1f 100644 --- a/xtoskrnl/ob/obmgr.cc +++ b/xtoskrnl/ob/obmgr.cc @@ -9,6 +9,45 @@ #include +/** + * Initializes an object attributes structure. + * + * @param ObjectAttributes + * Supplies a pointer to the object attributes structure to be initialized. + * + * @param ObjectName + * Supplies an optional pointer to a Unicode string representing the object name. + * + * @param Attributes + * Supplies a bitmask of flags controlling object behavior. + * + * @param Directory + * Supplies an optional handle to the root directory for relative path parsing. + * + * @param SecurityDescriptor + * Supplies an optional pointer to a security descriptor for the object. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTFASTCALL +VOID +OB::Manager::InitializeObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes, + IN PUNICODE_STRING ObjectName, + IN ULONG Attributes, + IN HANDLE Directory, + IN PVOID SecurityDescriptor) +{ + /* Initialize the object attributes structure */ + ObjectAttributes->Attributes = Attributes; + ObjectAttributes->Length = sizeof(OBJECT_ATTRIBUTES); + ObjectAttributes->ObjectName = ObjectName; + ObjectAttributes->RootDirectory = Directory; + ObjectAttributes->SecurityDescriptor = SecurityDescriptor; + ObjectAttributes->SecurityQualityOfService = NULLPTR; +} + /** * Initializes the Object Manager subsystem. *