Author: dgorbachev
Date: Sun Apr 8 18:57:34 2007
New Revision: 26283
URL:
http://svn.reactos.org/svn/reactos?rev=26283&view=rev
Log:
Fix "registry error" bug (see bugzilla report #1998).
Modified:
trunk/reactos/ntoskrnl/cm/ntfunc.c
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/ntfunc.c (original)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c Sun Apr 8 18:57:34 2007
@@ -120,10 +120,8 @@
Handle = ObMarkHandleAsKernelHandle(Handle);
}
- if(InterlockedIncrement(&ObjectHeader->HandleCount) == 1)
- {
- ObReferenceObject(ObjectBody);
- }
+ InterlockedIncrement(&ObjectHeader->HandleCount);
+ ObReferenceObject(ObjectBody);
*HandleReturn = Handle;
@@ -578,7 +576,7 @@
}
if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName);
if (FreeRemainingPath) RtlFreeUnicodeString(&RemainingPath);
- //if (Object != NULL) ObDereferenceObject(Object);
+ if (Object != NULL) ObDereferenceObject(Object);
return Status;
}