1 /* $Id: close.c,v 1.6 2001/05/04 01:21:45 rex Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: services/fs/vfat/close.c
6 * PURPOSE: VFAT Filesystem
7 * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
10 /* INCLUDES *****************************************************************/
12 #include <ddk/ntddk.h>
19 /* FUNCTIONS ****************************************************************/
22 VfatCloseFile (PDEVICE_EXTENSION DeviceExt
, PFILE_OBJECT FileObject
)
24 * FUNCTION: Closes a file
31 DPRINT ("VfatCloseFile(DeviceExt %x, FileObject %x)\n",
32 DeviceExt
, FileObject
);
34 /* FIXME : update entry in directory? */
35 pCcb
= (PVFATCCB
) (FileObject
->FsContext2
);
37 DPRINT ("pCcb %x\n", pCcb
);
40 return (STATUS_SUCCESS
);
47 if (pFcb
->RefCount
<= 0)
49 CcRosReleaseFileCache(FileObject
, pFcb
->RFCB
.Bcb
);
50 KeAcquireSpinLock (&DeviceExt
->FcbListLock
, &oldIrql
);
52 RemoveEntryList (&pFcb
->FcbListEntry
);
53 KeReleaseSpinLock (&DeviceExt
->FcbListLock
, oldIrql
);
58 return STATUS_SUCCESS
;
62 VfatClose (PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
64 * FUNCTION: Closes a file
67 PIO_STACK_LOCATION Stack
= IoGetCurrentIrpStackLocation (Irp
);
68 PFILE_OBJECT FileObject
= Stack
->FileObject
;
69 PDEVICE_EXTENSION DeviceExtension
= DeviceObject
->DeviceExtension
;
72 DPRINT ("VfatClose(DeviceObject %x, Irp %x)\n", DeviceObject
, Irp
);
74 Status
= VfatCloseFile (DeviceExtension
, FileObject
);
76 Irp
->IoStatus
.Status
= Status
;
77 Irp
->IoStatus
.Information
= 0;
79 IoCompleteRequest (Irp
, IO_NO_INCREMENT
);