From 358bfbd6c80d0f3a99751a6ec3d06981f9a7aaec Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 3 Feb 2013 20:15:54 +0000 Subject: [PATCH] [NTOSKRNL:OB] - Actually fail when the maximum number of reparse attempts is reached in ObpLookupObjectName. It previously returned a pointer to whatever object was currently in charge of parsing, but without taking a reference to it. - Fixes 'Header->HandleCount == 0' assertion failure (on \REGISTRY object) after running ntdll_winetest:reg three times (and also fixes the remaining test failure) svn path=/trunk/; revision=58281 --- reactos/ntoskrnl/ob/obname.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/ob/obname.c b/reactos/ntoskrnl/ob/obname.c index 8aeb89fd88c..38e0574c50e 100644 --- a/reactos/ntoskrnl/ob/obname.c +++ b/reactos/ntoskrnl/ob/obname.c @@ -437,7 +437,7 @@ ObpLookupObjectName(IN HANDLE RootHandle OPTIONAL, } else if (!(ObjectName->Length) || !(ObjectName->Buffer)) { - /* Just return the Root Directory if we didn't get a name*/ + /* Just return the Root Directory if we didn't get a name */ Status = ObReferenceObjectByPointer(RootDirectory, 0, ObjectType, @@ -719,7 +719,7 @@ ParseFromRoot: if (ObjectNameInfo->Name.Buffer) { /* Free it */ - ExFreePoolWithTag(ObjectNameInfo->Name.Buffer, OB_NAME_TAG ); + ExFreePoolWithTag(ObjectNameInfo->Name.Buffer, OB_NAME_TAG); } /* Write new one */ @@ -796,6 +796,11 @@ ReparseObject: /* Reparse again */ Reparse = TRUE; --MaxReparse; + if (MaxReparse == 0) + { + Object = NULL; + break; + } /* Start over from root if we got sent back there */ if ((Status == STATUS_REPARSE_OBJECT) || -- 2.17.1