- Removed some wrong calls to MmUnlockAddressSpace.
- Dereference the section object after creating the section.
Modified: trunk/reactos/ntoskrnl/ps/process.c

Modified: trunk/reactos/ntoskrnl/ps/process.c
--- trunk/reactos/ntoskrnl/ps/process.c	2005-02-01 16:24:10 UTC (rev 13377)
+++ trunk/reactos/ntoskrnl/ps/process.c	2005-02-01 16:35:30 UTC (rev 13378)
@@ -954,7 +954,6 @@
    MmUnlockAddressSpace(&Process->AddressSpace);
    if (!NT_SUCCESS(Status))
      {
-        MmUnlockAddressSpace(&Process->AddressSpace); /* FIXME ? */
         DPRINT1("Failed to create shared data page\n");
 	ObDereferenceObject(Process);
         goto exitdereferenceobjects;
@@ -972,7 +971,6 @@
 			    &hProcess);
    if (!NT_SUCCESS(Status))
      {
-        MmUnlockAddressSpace(&Process->AddressSpace); /* FIXME ? */
         DPRINT1("Failed to create a handle for the process\n");
 	ObDereferenceObject(Process);
         goto exitdereferenceobjects;
@@ -987,7 +985,6 @@
    if (!NT_SUCCESS(Status))
      {
 	DbgPrint("LdrpMapSystemDll failed (Status %x)\n", Status);
-	MmUnlockAddressSpace(&Process->AddressSpace); /* FIXME ? */
 	ObDereferenceObject(Process);
         goto exitdereferenceobjects;
      }
@@ -1009,11 +1006,10 @@
                                     0,
                                     MEM_COMMIT,
                                     PAGE_READWRITE);
-                                    
+        ObDereferenceObject(SectionObject);                            
 	if (!NT_SUCCESS(Status))
 	  {
 	     DbgPrint("Failed to map the process section (Status %x)\n", Status);
-	     MmUnlockAddressSpace(&Process->AddressSpace); /* FIXME ? */
 	     ObDereferenceObject(Process);
              goto exitdereferenceobjects;
 	  }