mirror of
https://github.com/reactos/reactos.git
synced 2024-10-23 14:36:11 +00:00
* Setting the DeviceObject and Vbp for given FileObject to zero
if the open operation fails. The close and cleanup call must not route throught the FSD if the open call failed. * Wait for the completion from FSD after the close/cleanup call. svn path=/trunk/; revision=3696
This commit is contained in:
parent
1d57b8f66d
commit
39537ca751
|
@ -1,4 +1,4 @@
|
|||
/* $Id: create.c,v 1.61 2002/09/08 10:23:24 chorns Exp $
|
||||
/* $Id: create.c,v 1.62 2002/11/05 20:24:33 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -432,6 +432,9 @@ IoCreateFile(OUT PHANDLE FileHandle,
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("Failing create request with status %x\n", Status);
|
||||
FileObject->DeviceObject = NULL;
|
||||
FileObject->Vpb = NULL;
|
||||
|
||||
ZwClose(*FileHandle);
|
||||
}
|
||||
if (IoStatusBlock)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: iomgr.c,v 1.29 2002/10/05 10:53:37 dwelch Exp $
|
||||
/* $Id: iomgr.c,v 1.30 2002/11/05 20:24:33 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -54,7 +54,7 @@ IopCloseFile(PVOID ObjectBody,
|
|||
|
||||
DPRINT("IopCloseFile()\n");
|
||||
|
||||
if (HandleCount > 0)
|
||||
if (HandleCount > 0 || FileObject->DeviceObject == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ IopCloseFile(PVOID ObjectBody,
|
|||
STANDARD_RIGHTS_REQUIRED,
|
||||
IoFileObjectType,
|
||||
UserMode);
|
||||
KeResetEvent( &FileObject->Event );
|
||||
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_CLEANUP,
|
||||
FileObject->DeviceObject,
|
||||
|
@ -75,6 +76,10 @@ IopCloseFile(PVOID ObjectBody,
|
|||
StackPtr->FileObject = FileObject;
|
||||
|
||||
Status = IoCallDriver(FileObject->DeviceObject, Irp);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
KeWaitForSingleObject(&FileObject->Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
|
@ -87,11 +92,14 @@ IopDeleteFile(PVOID ObjectBody)
|
|||
|
||||
DPRINT("IopDeleteFile()\n");
|
||||
|
||||
if (FileObject->DeviceObject)
|
||||
{
|
||||
ObReferenceObjectByPointer(ObjectBody,
|
||||
STANDARD_RIGHTS_REQUIRED,
|
||||
IoFileObjectType,
|
||||
UserMode);
|
||||
|
||||
KeResetEvent( &FileObject->Event );
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_CLOSE,
|
||||
FileObject->DeviceObject,
|
||||
NULL,
|
||||
|
@ -103,6 +111,11 @@ IopDeleteFile(PVOID ObjectBody)
|
|||
StackPtr->FileObject = FileObject;
|
||||
|
||||
Status = IoCallDriver(FileObject->DeviceObject, Irp);
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
KeWaitForSingleObject(&FileObject->Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (FileObject->FileName.Buffer != NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue