3 * Copyright (C) 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: close.c,v 1.2 2002/05/01 13:15:42 ekohl Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/cdfs/close.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
39 /* FUNCTIONS ****************************************************************/
42 CdfsCloseFile(PDEVICE_EXTENSION DeviceExt
,
43 PFILE_OBJECT FileObject
)
45 * FUNCTION: Closes a file
50 DPRINT("CdfsCloseFile(DeviceExt %x, FileObject %x)\n",
54 Ccb
= (PCCB
)(FileObject
->FsContext2
);
56 DPRINT("Ccb %x\n", Ccb
);
59 return(STATUS_SUCCESS
);
62 FileObject
->FsContext2
= NULL
;
64 if (FileObject
->FileName
.Buffer
)
66 // This a FO, that was created outside from FSD.
67 // Some FO's are created with IoCreateStreamFileObject() insid from FSD.
68 // This FO's don't have a FileName.
69 CdfsReleaseFCB(DeviceExt
,
75 return(STATUS_SUCCESS
);
80 CdfsClose(PDEVICE_OBJECT DeviceObject
,
83 PDEVICE_EXTENSION DeviceExtension
;
84 PIO_STACK_LOCATION Stack
;
85 PFILE_OBJECT FileObject
;
88 DPRINT("CdfsClose() called\n");
90 Stack
= IoGetCurrentIrpStackLocation(Irp
);
91 FileObject
= Stack
->FileObject
;
92 DeviceExtension
= DeviceObject
->DeviceExtension
;
94 Status
= CdfsCloseFile(DeviceExtension
,FileObject
);
96 Irp
->IoStatus
.Status
= Status
;
97 Irp
->IoStatus
.Information
= 0;
99 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);