mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 10:31:43 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
103
drivers/filesystems/fastfat/close.c
Normal file
103
drivers/filesystems/fastfat/close.c
Normal file
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/filesystems/fastfat/close.c
|
||||
* PURPOSE: VFAT Filesystem
|
||||
* PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include "vfat.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
/*
|
||||
* FUNCTION: Closes a file
|
||||
*/
|
||||
NTSTATUS
|
||||
VfatCloseFile(
|
||||
PDEVICE_EXTENSION DeviceExt,
|
||||
PFILE_OBJECT FileObject)
|
||||
{
|
||||
PVFATFCB pFcb;
|
||||
PVFATCCB pCcb;
|
||||
BOOLEAN IsVolume;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
DPRINT("VfatCloseFile(DeviceExt %p, FileObject %p)\n",
|
||||
DeviceExt, FileObject);
|
||||
|
||||
/* FIXME : update entry in directory? */
|
||||
pCcb = (PVFATCCB) (FileObject->FsContext2);
|
||||
pFcb = (PVFATFCB) (FileObject->FsContext);
|
||||
|
||||
if (pFcb == NULL)
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
IsVolume = BooleanFlagOn(pFcb->Flags, FCB_IS_VOLUME);
|
||||
if (IsVolume)
|
||||
{
|
||||
DPRINT("Volume\n");
|
||||
FileObject->FsContext2 = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, pFcb);
|
||||
}
|
||||
|
||||
FileObject->FsContext2 = NULL;
|
||||
FileObject->FsContext = NULL;
|
||||
FileObject->SectionObjectPointer = NULL;
|
||||
|
||||
if (pCcb)
|
||||
{
|
||||
vfatDestroyCCB(pCcb);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SWAPOUT
|
||||
if (IsVolume && DeviceExt->OpenHandleCount == 0)
|
||||
{
|
||||
VfatCheckForDismount(DeviceExt, FALSE);
|
||||
}
|
||||
#endif
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: Closes a file
|
||||
*/
|
||||
NTSTATUS
|
||||
VfatClose(
|
||||
PVFAT_IRP_CONTEXT IrpContext)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("VfatClose(DeviceObject %p, Irp %p)\n", IrpContext->DeviceObject, IrpContext->Irp);
|
||||
|
||||
if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject)
|
||||
{
|
||||
DPRINT("Closing file system\n");
|
||||
IrpContext->Irp->IoStatus.Information = 0;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource, BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
|
||||
{
|
||||
return VfatMarkIrpContextForQueue(IrpContext);
|
||||
}
|
||||
|
||||
Status = VfatCloseFile(IrpContext->DeviceExt, IrpContext->FileObject);
|
||||
ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource);
|
||||
|
||||
IrpContext->Irp->IoStatus.Information = 0;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue