2006-05-24 22:07:11 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2008-08-16 17:53:28 +00:00
|
|
|
* FILE: ntoskrnl/ob/obinit.c
|
2006-05-24 22:07:11 +00:00
|
|
|
* PURPOSE: Handles Object Manager Initialization and Shutdown
|
|
|
|
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
|
|
|
* Eric Kohl
|
|
|
|
* Thomas Weidenmueller (w3seek@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
|
|
|
#include <ntoskrnl.h>
|
|
|
|
#define NDEBUG
|
2007-01-08 07:54:57 +00:00
|
|
|
#include <debug.h>
|
2006-05-24 22:07:11 +00:00
|
|
|
|
2007-01-08 07:54:57 +00:00
|
|
|
/* GLOBALS *******************************************************************/
|
2006-05-24 22:07:11 +00:00
|
|
|
|
|
|
|
GENERIC_MAPPING ObpTypeMapping =
|
|
|
|
{
|
|
|
|
STANDARD_RIGHTS_READ,
|
|
|
|
STANDARD_RIGHTS_WRITE,
|
|
|
|
STANDARD_RIGHTS_EXECUTE,
|
|
|
|
0x000F0001
|
|
|
|
};
|
|
|
|
|
|
|
|
GENERIC_MAPPING ObpDirectoryMapping =
|
|
|
|
{
|
|
|
|
STANDARD_RIGHTS_READ | DIRECTORY_QUERY |
|
|
|
|
DIRECTORY_TRAVERSE,
|
|
|
|
STANDARD_RIGHTS_WRITE | DIRECTORY_CREATE_SUBDIRECTORY |
|
|
|
|
DIRECTORY_CREATE_OBJECT,
|
|
|
|
STANDARD_RIGHTS_EXECUTE | DIRECTORY_QUERY |
|
|
|
|
DIRECTORY_TRAVERSE,
|
|
|
|
DIRECTORY_ALL_ACCESS
|
|
|
|
};
|
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
GENERIC_MAPPING ObpSymbolicLinkMapping =
|
|
|
|
{
|
|
|
|
STANDARD_RIGHTS_READ | SYMBOLIC_LINK_QUERY,
|
|
|
|
STANDARD_RIGHTS_WRITE,
|
|
|
|
STANDARD_RIGHTS_EXECUTE | SYMBOLIC_LINK_QUERY,
|
|
|
|
SYMBOLIC_LINK_ALL_ACCESS
|
|
|
|
};
|
|
|
|
|
2006-05-24 22:07:11 +00:00
|
|
|
PDEVICE_MAP ObSystemDeviceMap = NULL;
|
2007-03-25 14:33:54 +00:00
|
|
|
ULONG ObpTraceLevel = 0;
|
2006-05-24 22:07:11 +00:00
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2006-09-16 20:37:49 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PsInitializeQuotaSystem(VOID);
|
|
|
|
|
2006-10-02 15:05:03 +00:00
|
|
|
ULONG ObpInitializationPhase;
|
|
|
|
|
2019-05-18 08:28:32 +00:00
|
|
|
ULONG ObpObjectSecurityMode = 0;
|
2019-05-21 06:34:16 +00:00
|
|
|
ULONG ObpProtectionMode = 0;
|
2019-05-18 08:28:32 +00:00
|
|
|
|
2006-05-24 22:07:11 +00:00
|
|
|
/* PRIVATE FUNCTIONS *********************************************************/
|
|
|
|
|
2017-03-05 21:28:10 +00:00
|
|
|
static
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2017-03-05 21:28:10 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2017-03-13 00:10:23 +00:00
|
|
|
ObpCreateKernelObjectsSD(OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
|
2017-03-05 21:28:10 +00:00
|
|
|
{
|
2017-03-13 00:10:23 +00:00
|
|
|
PSECURITY_DESCRIPTOR Sd = NULL;
|
2017-03-05 21:28:10 +00:00
|
|
|
PACL Dacl;
|
2017-03-13 00:10:23 +00:00
|
|
|
ULONG AclSize, SdSize;
|
2017-03-05 21:28:10 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
AclSize = sizeof(ACL) +
|
|
|
|
sizeof(ACE) + RtlLengthSid(SeWorldSid) +
|
|
|
|
sizeof(ACE) + RtlLengthSid(SeAliasAdminsSid) +
|
|
|
|
sizeof(ACE) + RtlLengthSid(SeLocalSystemSid);
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
SdSize = sizeof(SECURITY_DESCRIPTOR) + AclSize;
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
/* Allocate the SD and ACL */
|
|
|
|
Sd = ExAllocatePoolWithTag(PagedPool, SdSize, TAG_SD);
|
|
|
|
if (Sd == NULL)
|
2017-03-05 21:28:10 +00:00
|
|
|
{
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
/* Initialize the SD */
|
|
|
|
Status = RtlCreateSecurityDescriptor(Sd,
|
|
|
|
SECURITY_DESCRIPTOR_REVISION);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
Dacl = (PACL)((INT_PTR)Sd + sizeof(SECURITY_DESCRIPTOR));
|
|
|
|
|
2017-03-05 21:28:10 +00:00
|
|
|
/* Initialize the DACL */
|
2017-03-13 00:10:23 +00:00
|
|
|
RtlCreateAcl(Dacl, AclSize, ACL_REVISION);
|
2017-03-05 21:28:10 +00:00
|
|
|
|
|
|
|
/* Add the ACEs */
|
|
|
|
RtlAddAccessAllowedAce(Dacl,
|
|
|
|
ACL_REVISION,
|
|
|
|
GENERIC_READ,
|
|
|
|
SeWorldSid);
|
|
|
|
|
|
|
|
RtlAddAccessAllowedAce(Dacl,
|
|
|
|
ACL_REVISION,
|
|
|
|
GENERIC_ALL,
|
|
|
|
SeAliasAdminsSid);
|
|
|
|
|
|
|
|
RtlAddAccessAllowedAce(Dacl,
|
|
|
|
ACL_REVISION,
|
|
|
|
GENERIC_ALL,
|
|
|
|
SeLocalSystemSid);
|
|
|
|
|
|
|
|
/* Attach the DACL to the SD */
|
2017-03-13 00:10:23 +00:00
|
|
|
Status = RtlSetDaclSecurityDescriptor(Sd,
|
2017-03-05 21:28:10 +00:00
|
|
|
TRUE,
|
|
|
|
Dacl,
|
|
|
|
FALSE);
|
2017-03-13 00:10:23 +00:00
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
goto done;
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
*SecurityDescriptor = Sd;
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2017-03-13 00:10:23 +00:00
|
|
|
done:
|
|
|
|
if (!NT_SUCCESS(Status))
|
2017-03-05 21:28:10 +00:00
|
|
|
{
|
2017-03-13 00:10:23 +00:00
|
|
|
if (Sd != NULL)
|
|
|
|
ExFreePoolWithTag(Sd, TAG_SD);
|
2017-03-05 21:28:10 +00:00
|
|
|
}
|
2017-03-13 00:10:23 +00:00
|
|
|
|
|
|
|
return Status;
|
2017-03-05 21:28:10 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2020-05-23 13:56:10 +00:00
|
|
|
BOOLEAN
|
2006-10-02 15:05:03 +00:00
|
|
|
NTAPI
|
2006-05-29 03:32:43 +00:00
|
|
|
ObInit2(VOID)
|
|
|
|
{
|
2006-10-26 01:49:51 +00:00
|
|
|
CCHAR i;
|
2006-05-29 03:32:43 +00:00
|
|
|
PKPRCB Prcb;
|
2008-04-01 19:27:58 +00:00
|
|
|
PGENERAL_LOOKASIDE CurrentList = NULL;
|
2006-05-29 03:32:43 +00:00
|
|
|
|
|
|
|
/* Now allocate the per-processor lists */
|
|
|
|
for (i = 0; i < KeNumberProcessors; i++)
|
|
|
|
{
|
|
|
|
/* Get the PRCB for this CPU */
|
2007-11-06 21:36:47 +00:00
|
|
|
Prcb = KiProcessorBlock[(int)i];
|
2006-05-29 03:32:43 +00:00
|
|
|
|
|
|
|
/* Set the OBJECT_CREATE_INFORMATION List */
|
2008-04-01 19:27:58 +00:00
|
|
|
Prcb->PPLookasideList[LookasideCreateInfoList].L = &ObpCreateInfoLookasideList;
|
2006-05-29 03:32:43 +00:00
|
|
|
CurrentList = ExAllocatePoolWithTag(NonPagedPool,
|
2008-04-01 19:27:58 +00:00
|
|
|
sizeof(GENERAL_LOOKASIDE),
|
2009-08-24 18:19:53 +00:00
|
|
|
'ICbO');
|
2006-05-29 03:32:43 +00:00
|
|
|
if (CurrentList)
|
|
|
|
{
|
|
|
|
/* Initialize it */
|
2008-04-01 19:27:58 +00:00
|
|
|
ExInitializeSystemLookasideList(CurrentList,
|
|
|
|
NonPagedPool,
|
2006-05-29 03:32:43 +00:00
|
|
|
sizeof(OBJECT_CREATE_INFORMATION),
|
2009-08-24 18:19:53 +00:00
|
|
|
'ICbO',
|
2008-04-01 19:27:58 +00:00
|
|
|
32,
|
|
|
|
&ExSystemLookasideListHead);
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No list, use the static buffer */
|
2008-04-01 19:27:58 +00:00
|
|
|
CurrentList = &ObpCreateInfoLookasideList;
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Link it */
|
2008-04-01 19:27:58 +00:00
|
|
|
Prcb->PPLookasideList[LookasideCreateInfoList].P = CurrentList;
|
2006-05-29 03:32:43 +00:00
|
|
|
|
|
|
|
/* Set the captured UNICODE_STRING Object Name List */
|
2008-04-01 19:27:58 +00:00
|
|
|
Prcb->PPLookasideList[LookasideNameBufferList].L = &ObpNameBufferLookasideList;
|
2006-05-29 03:32:43 +00:00
|
|
|
CurrentList = ExAllocatePoolWithTag(NonPagedPool,
|
2008-04-01 19:27:58 +00:00
|
|
|
sizeof(GENERAL_LOOKASIDE),
|
2009-08-24 18:19:53 +00:00
|
|
|
'MNbO');
|
2006-05-29 03:32:43 +00:00
|
|
|
if (CurrentList)
|
|
|
|
{
|
|
|
|
/* Initialize it */
|
2008-04-01 19:27:58 +00:00
|
|
|
ExInitializeSystemLookasideList(CurrentList,
|
|
|
|
PagedPool,
|
2006-05-29 03:32:43 +00:00
|
|
|
248,
|
2009-08-24 18:19:53 +00:00
|
|
|
'MNbO',
|
2008-04-01 19:27:58 +00:00
|
|
|
16,
|
|
|
|
&ExSystemLookasideListHead);
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No list, use the static buffer */
|
2008-04-01 19:27:58 +00:00
|
|
|
CurrentList = &ObpNameBufferLookasideList;
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Link it */
|
2008-04-01 19:27:58 +00:00
|
|
|
Prcb->PPLookasideList[LookasideNameBufferList].P = CurrentList;
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
2006-10-02 15:05:03 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2006-05-29 03:32:43 +00:00
|
|
|
}
|
|
|
|
|
2020-10-06 19:44:01 +00:00
|
|
|
CODE_SEG("INIT")
|
2020-05-23 13:56:10 +00:00
|
|
|
BOOLEAN
|
2006-10-02 15:05:03 +00:00
|
|
|
NTAPI
|
2008-08-14 19:30:32 +00:00
|
|
|
ObInitSystem(VOID)
|
2006-05-24 22:07:11 +00:00
|
|
|
{
|
|
|
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
|
|
UNICODE_STRING Name;
|
|
|
|
OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
|
|
|
|
OBP_LOOKUP_CONTEXT Context;
|
2006-10-17 05:14:57 +00:00
|
|
|
HANDLE Handle;
|
2006-10-02 15:05:03 +00:00
|
|
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
PLIST_ENTRY ListHead, NextEntry;
|
|
|
|
POBJECT_HEADER Header;
|
|
|
|
POBJECT_HEADER_CREATOR_INFO CreatorInfo;
|
|
|
|
POBJECT_HEADER_NAME_INFO NameInfo;
|
2017-03-13 00:10:23 +00:00
|
|
|
PSECURITY_DESCRIPTOR KernelObjectsSD = NULL;
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
NTSTATUS Status;
|
2006-10-02 15:05:03 +00:00
|
|
|
|
|
|
|
/* Check if this is actually Phase 1 initialization */
|
|
|
|
if (ObpInitializationPhase != 0) goto ObPostPhase0;
|
|
|
|
|
|
|
|
/* Initialize the OBJECT_CREATE_INFORMATION List */
|
2008-04-01 19:27:58 +00:00
|
|
|
ExInitializeSystemLookasideList(&ObpCreateInfoLookasideList,
|
|
|
|
NonPagedPool,
|
2006-10-02 15:05:03 +00:00
|
|
|
sizeof(OBJECT_CREATE_INFORMATION),
|
2009-08-24 18:19:53 +00:00
|
|
|
'ICbO',
|
2008-04-01 19:27:58 +00:00
|
|
|
32,
|
|
|
|
&ExSystemLookasideListHead);
|
2006-10-02 15:05:03 +00:00
|
|
|
|
|
|
|
/* Set the captured UNICODE_STRING Object Name List */
|
2008-04-01 19:27:58 +00:00
|
|
|
ExInitializeSystemLookasideList(&ObpNameBufferLookasideList,
|
|
|
|
PagedPool,
|
2006-10-02 15:05:03 +00:00
|
|
|
248,
|
2009-08-24 18:19:53 +00:00
|
|
|
'MNbO',
|
2008-04-01 19:27:58 +00:00
|
|
|
16,
|
|
|
|
&ExSystemLookasideListHead);
|
2006-10-02 15:05:03 +00:00
|
|
|
|
|
|
|
/* Temporarily setup both pointers to the shared list */
|
2008-04-01 19:27:58 +00:00
|
|
|
Prcb->PPLookasideList[LookasideCreateInfoList].L = &ObpCreateInfoLookasideList;
|
|
|
|
Prcb->PPLookasideList[LookasideCreateInfoList].P = &ObpCreateInfoLookasideList;
|
|
|
|
Prcb->PPLookasideList[LookasideNameBufferList].L = &ObpNameBufferLookasideList;
|
|
|
|
Prcb->PPLookasideList[LookasideNameBufferList].P = &ObpNameBufferLookasideList;
|
2006-05-24 22:07:11 +00:00
|
|
|
|
|
|
|
/* Initialize the security descriptor cache */
|
|
|
|
ObpInitSdCache();
|
|
|
|
|
|
|
|
/* Initialize the Default Event */
|
2008-04-01 19:27:58 +00:00
|
|
|
KeInitializeEvent(&ObpDefaultObject, NotificationEvent, TRUE);
|
2006-05-24 22:07:11 +00:00
|
|
|
|
2011-04-25 16:08:00 +00:00
|
|
|
/* Initialize the Dos Device Map mutex */
|
|
|
|
KeInitializeGuardedMutex(&ObpDeviceMapLock);
|
|
|
|
|
2007-01-15 20:54:40 +00:00
|
|
|
/* Setup default access for the system process */
|
|
|
|
PsGetCurrentProcess()->GrantedAccess = PROCESS_ALL_ACCESS;
|
|
|
|
PsGetCurrentThread()->GrantedAccess = THREAD_ALL_ACCESS;
|
|
|
|
|
2006-05-29 00:18:36 +00:00
|
|
|
/* Setup the Object Reaper */
|
|
|
|
ExInitializeWorkItem(&ObpReaperWorkItem, ObpReapObject, NULL);
|
|
|
|
|
2006-09-16 20:37:49 +00:00
|
|
|
/* Initialize default Quota block */
|
|
|
|
PsInitializeQuotaSystem();
|
|
|
|
|
|
|
|
/* Create kernel handle table */
|
|
|
|
PsGetCurrentProcess()->ObjectTable = ExCreateHandleTable(NULL);
|
|
|
|
ObpKernelHandleTable = PsGetCurrentProcess()->ObjectTable;
|
|
|
|
|
2006-05-24 22:07:11 +00:00
|
|
|
/* Create the Type Type */
|
|
|
|
RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer));
|
|
|
|
RtlInitUnicodeString(&Name, L"Type");
|
|
|
|
ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
|
|
|
|
ObjectTypeInitializer.ValidAccessMask = OBJECT_TYPE_ALL_ACCESS;
|
|
|
|
ObjectTypeInitializer.UseDefaultObject = TRUE;
|
|
|
|
ObjectTypeInitializer.MaintainTypeList = TRUE;
|
|
|
|
ObjectTypeInitializer.PoolType = NonPagedPool;
|
|
|
|
ObjectTypeInitializer.GenericMapping = ObpTypeMapping;
|
|
|
|
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(OBJECT_TYPE);
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK;
|
2008-04-01 19:27:58 +00:00
|
|
|
ObjectTypeInitializer.DeleteProcedure = ObpDeleteObjectType;
|
2007-02-19 18:52:23 +00:00
|
|
|
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObpTypeObjectType);
|
2006-05-29 03:32:43 +00:00
|
|
|
|
2006-05-24 22:07:11 +00:00
|
|
|
/* Create the Directory Type */
|
|
|
|
RtlInitUnicodeString(&Name, L"Directory");
|
2012-09-02 22:06:42 +00:00
|
|
|
ObjectTypeInitializer.PoolType = PagedPool;
|
2006-05-24 22:07:11 +00:00
|
|
|
ObjectTypeInitializer.ValidAccessMask = DIRECTORY_ALL_ACCESS;
|
2008-04-01 19:27:58 +00:00
|
|
|
ObjectTypeInitializer.CaseInsensitive = TRUE;
|
2006-05-24 22:07:11 +00:00
|
|
|
ObjectTypeInitializer.MaintainTypeList = FALSE;
|
|
|
|
ObjectTypeInitializer.GenericMapping = ObpDirectoryMapping;
|
2008-04-01 19:27:58 +00:00
|
|
|
ObjectTypeInitializer.DeleteProcedure = NULL;
|
2006-05-24 22:07:11 +00:00
|
|
|
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(OBJECT_DIRECTORY);
|
2018-02-13 20:33:04 +00:00
|
|
|
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObpDirectoryObjectType);
|
|
|
|
ObpDirectoryObjectType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
|
2006-05-24 22:07:11 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Create 'symbolic link' object type */
|
|
|
|
RtlInitUnicodeString(&Name, L"SymbolicLink");
|
2008-04-01 19:27:58 +00:00
|
|
|
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(OBJECT_SYMBOLIC_LINK);
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
ObjectTypeInitializer.GenericMapping = ObpSymbolicLinkMapping;
|
|
|
|
ObjectTypeInitializer.ValidAccessMask = SYMBOLIC_LINK_ALL_ACCESS;
|
|
|
|
ObjectTypeInitializer.ParseProcedure = ObpParseSymbolicLink;
|
|
|
|
ObjectTypeInitializer.DeleteProcedure = ObpDeleteSymbolicLink;
|
2018-02-13 20:33:04 +00:00
|
|
|
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ObpSymbolicLinkObjectType);
|
|
|
|
ObpSymbolicLinkObjectType->TypeInfo.ValidAccessMask &= ~SYNCHRONIZE;
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
|
2006-10-02 15:05:03 +00:00
|
|
|
/* Phase 0 initialization complete */
|
|
|
|
ObpInitializationPhase++;
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
ObPostPhase0:
|
|
|
|
|
|
|
|
/* Re-initialize lookaside lists */
|
|
|
|
ObInit2();
|
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Initialize Object Types directory attributes */
|
|
|
|
RtlInitUnicodeString(&Name, L"\\");
|
2006-05-24 22:07:11 +00:00
|
|
|
InitializeObjectAttributes(&ObjectAttributes,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
&Name,
|
|
|
|
OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
|
2006-05-24 22:07:11 +00:00
|
|
|
NULL,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
SePublicDefaultUnrestrictedSd);
|
|
|
|
|
|
|
|
/* Create the directory */
|
|
|
|
Status = NtCreateDirectoryObject(&Handle,
|
|
|
|
DIRECTORY_ALL_ACCESS,
|
|
|
|
&ObjectAttributes);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
|
|
|
/* Get a handle to it */
|
|
|
|
Status = ObReferenceObjectByHandle(Handle,
|
|
|
|
0,
|
2018-02-13 20:33:04 +00:00
|
|
|
ObpDirectoryObjectType,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
KernelMode,
|
2007-02-19 18:52:23 +00:00
|
|
|
(PVOID*)&ObpRootDirectoryObject,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
NULL);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
|
|
|
/* Close the extra handle */
|
|
|
|
Status = NtClose(Handle);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
2017-03-05 21:28:10 +00:00
|
|
|
/* Create a custom security descriptor for the KernelObjects directory */
|
|
|
|
Status = ObpCreateKernelObjectsSD(&KernelObjectsSD);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Initialize the KernelObjects directory attributes */
|
2008-04-01 19:27:58 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"\\KernelObjects");
|
|
|
|
InitializeObjectAttributes(&ObjectAttributes,
|
|
|
|
&Name,
|
|
|
|
OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
|
|
|
|
NULL,
|
2017-03-13 00:10:23 +00:00
|
|
|
KernelObjectsSD);
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2008-04-01 19:27:58 +00:00
|
|
|
/* Create the directory */
|
|
|
|
Status = NtCreateDirectoryObject(&Handle,
|
|
|
|
DIRECTORY_ALL_ACCESS,
|
|
|
|
&ObjectAttributes);
|
2017-03-13 00:10:23 +00:00
|
|
|
ExFreePoolWithTag(KernelObjectsSD, TAG_SD);
|
2008-04-01 19:27:58 +00:00
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
2017-03-05 21:28:10 +00:00
|
|
|
|
2008-04-01 19:27:58 +00:00
|
|
|
/* Close the extra handle */
|
|
|
|
Status = NtClose(Handle);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
2017-03-05 21:28:10 +00:00
|
|
|
/* Initialize ObjectTypes directory attributes */
|
2006-05-24 22:07:11 +00:00
|
|
|
RtlInitUnicodeString(&Name, L"\\ObjectTypes");
|
|
|
|
InitializeObjectAttributes(&ObjectAttributes,
|
|
|
|
&Name,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
|
2006-05-24 22:07:11 +00:00
|
|
|
NULL,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Create the directory */
|
|
|
|
Status = NtCreateDirectoryObject(&Handle,
|
|
|
|
DIRECTORY_ALL_ACCESS,
|
|
|
|
&ObjectAttributes);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
|
|
|
/* Get a handle to it */
|
|
|
|
Status = ObReferenceObjectByHandle(Handle,
|
|
|
|
0,
|
2018-02-13 20:33:04 +00:00
|
|
|
ObpDirectoryObjectType,
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
KernelMode,
|
|
|
|
(PVOID*)&ObpTypeDirectoryObject,
|
|
|
|
NULL);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
|
|
|
/* Close the extra handle */
|
|
|
|
Status = NtClose(Handle);
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
|
|
|
|
2021-09-24 22:03:56 +00:00
|
|
|
/* Initialize the lookup context and lock it */
|
2008-06-18 12:28:29 +00:00
|
|
|
ObpInitializeLookupContext(&Context);
|
2021-09-24 22:03:56 +00:00
|
|
|
ObpAcquireLookupContextLock(&Context, ObpTypeDirectoryObject);
|
2007-01-08 07:54:57 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Loop the object types */
|
2007-02-19 18:52:23 +00:00
|
|
|
ListHead = &ObpTypeObjectType->TypeList;
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
NextEntry = ListHead->Flink;
|
|
|
|
while (ListHead != NextEntry)
|
2006-05-24 22:07:11 +00:00
|
|
|
{
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Get the creator info from the list */
|
|
|
|
CreatorInfo = CONTAINING_RECORD(NextEntry,
|
|
|
|
OBJECT_HEADER_CREATOR_INFO,
|
|
|
|
TypeList);
|
2006-05-24 22:07:11 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Recover the header and the name header from the creator info */
|
|
|
|
Header = (POBJECT_HEADER)(CreatorInfo + 1);
|
|
|
|
NameInfo = OBJECT_HEADER_TO_NAME_INFO(Header);
|
2006-05-24 22:07:11 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Make sure we have a name, and aren't inserted yet */
|
|
|
|
if ((NameInfo) && !(NameInfo->Directory))
|
|
|
|
{
|
|
|
|
/* Do the initial lookup to setup the context */
|
|
|
|
if (!ObpLookupEntryDirectory(ObpTypeDirectoryObject,
|
|
|
|
&NameInfo->Name,
|
|
|
|
OBJ_CASE_INSENSITIVE,
|
|
|
|
FALSE,
|
|
|
|
&Context))
|
|
|
|
{
|
|
|
|
/* Insert this object type */
|
|
|
|
ObpInsertEntryDirectory(ObpTypeDirectoryObject,
|
|
|
|
&Context,
|
|
|
|
Header);
|
|
|
|
}
|
|
|
|
}
|
2006-10-17 05:14:57 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Move to the next entry */
|
|
|
|
NextEntry = NextEntry->Flink;
|
|
|
|
}
|
2006-10-17 05:14:57 +00:00
|
|
|
|
2007-01-09 09:07:36 +00:00
|
|
|
/* Cleanup after lookup */
|
2008-06-18 12:28:29 +00:00
|
|
|
ObpReleaseLookupContext(&Context);
|
2007-01-08 07:54:57 +00:00
|
|
|
|
- Set OBJ_OPENLINK invalid for core object types.
- Initialize symbolic link in-line with other core object types.
- Use the SePublicDefaultUnrestrictedSd directly instead of building another SD.
- Create core directory objects with Nt* functions instead of Ob*, to insure full accounting and error-handling.
- Create core objects with OBJ_CASE_INSENSITIVE.
- Fix the huge ObInit hack which was manually inserting Directory and Type object types in the type directory, and now loop the type list. Now we don't skip the Process, Token, Thread, Job, Section types anymore.
- Support Quota Information during object allocation and deallocation isntead of ignoring it.
- Use interlocked decrement when touching the object type (since it's a shared structure. We don't use the lock yet, but we won't for this anyways, since it's a simple lockable operation).
- Use the right object key when freeing the object.
- Modify the allocation function for a more optimized way of allocating objects instead of having to keep track of two sets of variables.
- Add various accounting variables.
- Make sure to properly handle allocations without object create info (ie, for object types). Now they get creator info and name info (which allowed us to cleanp the hack in ObInit).
- Add checks to see if Quota informatio is needed.
- Clear CreatorBackTraceIndex during allocation.
- Remove CreatorUniqueProcess hack from back when the idle thread was NULL.
- Do not zero out the header during allocation anymore, since this slows down the routine (instead, simply zero out the 2 fields that are NULL).
- Locate and clearly display that the fact we zero objects on creation is a HACK that needs to be fixed. (The Token code makes this assumption).
- Update HighWaterNumberOfObjects when needed.
- If caller didn't give pool charges, use the one from the object type.
- Clear the Total/HighWater* values for newly created object types instead of using random values.
- Properly typecast the WCHAR tag as CHAR.
- Insert each new object type in the ObTypeObjectType Type List.
- Set the Index member of each new object type and insert each new object type in the ObpObjectTypes array. This is crucial for object type enumeration when implemented.
- Fixup the way we insert new object types into the tree. Allow failure and don't return a type if we couldn't insert it, and only reference the type directory object if it actually exists.
- Move DOS Devices\"??" initialization in its own routine and fix it:
- Use Nt APIs for all operations instead of raw I/O.
- Create GLOBALROOT link to \
- Create \??\Global link to \??
svn path=/trunk/; revision=24568
2006-10-19 02:20:32 +00:00
|
|
|
/* Initialize DOS Devices Directory and related Symbolic Links */
|
|
|
|
Status = ObpCreateDosDevicesDirectory();
|
|
|
|
if (!NT_SUCCESS(Status)) return FALSE;
|
2006-10-02 15:05:03 +00:00
|
|
|
return TRUE;
|
2006-05-24 22:07:11 +00:00
|
|
|
}
|
2006-10-02 15:05:03 +00:00
|
|
|
|
2006-05-24 22:07:11 +00:00
|
|
|
/* EOF */
|