From 717888776fec913a2771e3d93824d89ec2b78761 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 29 May 2005 15:37:47 +0000 Subject: [PATCH] Lock the directory while it is parsed. svn path=/trunk/; revision=15664 --- reactos/ntoskrnl/ob/namespc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index fb276a5aa25..46f058d1a3a 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -364,6 +364,7 @@ ObpParseDirectory(PVOID Object, PWSTR Start; PWSTR End; PVOID FoundObject; + KIRQL oldlvl; DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n", Object,Path,*Path); @@ -385,9 +386,11 @@ ObpParseDirectory(PVOID Object, *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 @@ ObpParseDirectory(PVOID Object, STANDARD_RIGHTS_REQUIRED, NULL, UserMode); - + KeReleaseSpinLock(&(((PDIRECTORY_OBJECT)Object)->Lock), oldlvl); if (End != NULL) { *End = L'\\';