Author: tfaber
Date: Thu Aug 7 13:02:59 2014
New Revision: 63833
URL: http://svn.reactos.org/svn/reactos?rev=63833&view=rev
Log:
[NTOS:OB]
- Mark object types as not having ObjectCreateInfo on creation. Otherwise ObpObjectType's TypeList gets corrupted when a handle to an object type is created (as kmtest:ObTypes does) and ObpIncrementHandleCount tries to insert the list entry a second time.
CORE-8423 #resolve
Modified:
trunk/reactos/ntoskrnl/ob/oblife.c
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=6…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] Thu Aug 7 13:02:59 2014
@@ -1231,8 +1231,15 @@
/* Get creator info and insert it into the type list */
CreatorInfo = OBJECT_HEADER_TO_CREATOR_INFO(Header);
- if (CreatorInfo) InsertTailList(&ObpTypeObjectType->TypeList,
- &CreatorInfo->TypeList);
+ if (CreatorInfo)
+ {
+ InsertTailList(&ObpTypeObjectType->TypeList,
+ &CreatorInfo->TypeList);
+
+ /* CORE-8423: Avoid inserting this a second time if someone creates a
+ * handle to the object type (bug in Windows 2003) */
+ Header->Flags &= ~OB_FLAG_CREATE_INFO;
+ }
/* Set the index and the entry into the object type array */
LocalObjectType->Index = ObpTypeObjectType->TotalNumberOfObjects;
Author: tfaber
Date: Thu Aug 7 00:16:21 2014
New Revision: 63825
URL: http://svn.reactos.org/svn/reactos?rev=63825&view=rev
Log:
[NTOS:OB]
- Use ObpTypeObjectType's lock when modifying object type global properties, not the new object type's
- Correctly free string returned by RtlUnicodeStringToAnsiString
Modified:
trunk/reactos/ntoskrnl/ob/oblife.c
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=6…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] Thu Aug 7 00:16:21 2014
@@ -1145,7 +1145,7 @@
/* Set the key and free the converted name */
LocalObjectType->Key = *(PULONG)AnsiName.Buffer;
- ExFreePool(AnsiName.Buffer);
+ RtlFreeAnsiString(&AnsiName);
}
else
{
@@ -1227,7 +1227,7 @@
InitializeListHead(&LocalObjectType->TypeList);
/* Lock the object type */
- ObpEnterObjectTypeMutex(LocalObjectType);
+ ObpEnterObjectTypeMutex(ObpTypeObjectType);
/* Get creator info and insert it into the type list */
CreatorInfo = OBJECT_HEADER_TO_CREATOR_INFO(Header);
@@ -1246,7 +1246,7 @@
}
/* Release the object type */
- ObpLeaveObjectTypeMutex(LocalObjectType);
+ ObpLeaveObjectTypeMutex(ObpTypeObjectType);
/* Check if we're actually creating the directory object itself */
if (!(ObpTypeDirectoryObject) ||