Lock the directory while it is parsed.
Modified: trunk/reactos/ntoskrnl/ob/namespc.c

Modified: trunk/reactos/ntoskrnl/ob/namespc.c
--- trunk/reactos/ntoskrnl/ob/namespc.c	2005-05-29 15:17:38 UTC (rev 15663)
+++ trunk/reactos/ntoskrnl/ob/namespc.c	2005-05-29 15:37:47 UTC (rev 15664)
@@ -364,6 +364,7 @@
   PWSTR Start;
   PWSTR End;
   PVOID FoundObject;
+  KIRQL oldlvl;
 
   DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
 	 Object,Path,*Path);
@@ -385,9 +386,11 @@
       *End = 0;
     }
 
+  KeAcquireSpinLock(&(((PDIRECTORY_OBJECT)Object)->Lock), &oldlvl);
   FoundObject = ObpFindEntryDirectory(Object, Start, Attributes);
   if (FoundObject == NULL)
     {
+      KeReleaseSpinLock(&(((PDIRECTORY_OBJECT)Object)->Lock), oldlvl);
       if (End != NULL)
 	{
 	  *End = L'\\';
@@ -399,7 +402,7 @@
 			     STANDARD_RIGHTS_REQUIRED,
 			     NULL,
 			     UserMode);
-
+  KeReleaseSpinLock(&(((PDIRECTORY_OBJECT)Object)->Lock), oldlvl);
   if (End != NULL)
     {
       *End = L'\\';