1 /* $Id: close.c,v 1.3 2000/12/29 23:17:12 dwelch 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 ("FsdCloseFile(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
);
46 if (pFcb
->RefCount
<= 0)
48 KeAcquireSpinLock (&DeviceExt
->FcbListLock
, &oldIrql
);
49 RemoveEntryList (&pFcb
->FcbListEntry
);
50 KeReleaseSpinLock (&DeviceExt
->FcbListLock
, oldIrql
);
54 return STATUS_SUCCESS
;
58 VfatClose (PDEVICE_OBJECT DeviceObject
, PIRP Irp
)
60 * FUNCTION: Closes a file
63 PIO_STACK_LOCATION Stack
= IoGetCurrentIrpStackLocation (Irp
);
64 PFILE_OBJECT FileObject
= Stack
->FileObject
;
65 PDEVICE_EXTENSION DeviceExtension
= DeviceObject
->DeviceExtension
;
68 DPRINT ("FsdClose(DeviceObject %x, Irp %x)\n", DeviceObject
, Irp
);
70 Status
= VfatCloseFile (DeviceExtension
, FileObject
);
72 Irp
->IoStatus
.Status
= Status
;
73 Irp
->IoStatus
.Information
= 0;
75 IoCompleteRequest (Irp
, IO_NO_INCREMENT
);