From 4a2d9295d714c64cf33c50d53771927fceb66a05 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sat, 5 Dec 2015 11:42:34 -0800 Subject: [PATCH] sys: IRP_MJ_CREATE --- src/sys/create.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sys/create.c b/src/sys/create.c index 463b487d..6b2d8f6c 100644 --- a/src/sys/create.c +++ b/src/sys/create.c @@ -403,12 +403,14 @@ VOID FspFsvolCreateComplete( FsContext->UserContext = Response->Rsp.Create.UserContext; FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.UserContext2; - /* lock the file system volume device while accessing its generic table */ + /* + * The following must be done under the file system volume device Resource, + * because we are manipulating its GenericTable and accessing foreign FsContext's. + */ ExAcquireResourceExclusiveLite(&FsvolDeviceExtension->Base.Resource, TRUE); try { - /* insert the new FsContext into our generic table */ - Result = STATUS_SUCCESS; + /* attempt to insert the newly created FsContext into our generic table */ FsContext = FspFsvolDeviceInsertContext(DeviceObject, FsContext->UserContext, FsContext, &Inserted); if (0 == FsContext) @@ -426,6 +428,7 @@ VOID FspFsvolCreateComplete( IoSetShareAccess(DesiredAccess, ShareAccess, FileObject, &FsContext->ShareAccess); FspFileContextOpen(FsContext); + Result = STATUS_SUCCESS; } else {