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 along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS kernel
22 * FILE: services/fs/cdfs/cleanup.c
23 * PURPOSE: CDROM (ISO 9660) filesystem driver
28 /* INCLUDES *****************************************************************/
35 /* FUNCTIONS ****************************************************************/
38 CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt
,
39 PFILE_OBJECT FileObject
)
41 * FUNCTION: Cleans up after a file has been closed.
46 DPRINT("CdfsCleanupFile(DeviceExt %p, FileObject %p)\n",
50 Fcb
= FileObject
->FsContext
;
53 return STATUS_SUCCESS
;
56 /* Notify about the cleanup */
57 FsRtlNotifyCleanup(DeviceExt
->NotifySync
,
58 &(DeviceExt
->NotifyList
),
59 FileObject
->FsContext2
);
61 /* Uninitialize file cache if initialized for this file object. */
62 if (FileObject
->SectionObjectPointer
&& FileObject
->SectionObjectPointer
->SharedCacheMap
)
64 CcUninitializeCacheMap (FileObject
, NULL
, NULL
);
67 return STATUS_SUCCESS
;
72 PCDFS_IRP_CONTEXT IrpContext
)
75 PDEVICE_OBJECT DeviceObject
;
76 PDEVICE_EXTENSION DeviceExtension
;
77 PIO_STACK_LOCATION Stack
;
78 PFILE_OBJECT FileObject
;
81 DPRINT("CdfsCleanup() called\n");
85 Irp
= IrpContext
->Irp
;
86 DeviceObject
= IrpContext
->DeviceObject
;
87 Stack
= IrpContext
->Stack
;
89 if (DeviceObject
== CdfsGlobalData
->DeviceObject
)
91 DPRINT("Closing file system\n");
92 Status
= STATUS_SUCCESS
;
96 FileObject
= Stack
->FileObject
;
97 DeviceExtension
= DeviceObject
->DeviceExtension
;
99 KeEnterCriticalRegion();
100 ExAcquireResourceExclusiveLite(&DeviceExtension
->DirResource
, TRUE
);
102 Status
= CdfsCleanupFile(DeviceExtension
, FileObject
);
104 ExReleaseResourceLite(&DeviceExtension
->DirResource
);
105 KeLeaveCriticalRegion();
108 Irp
->IoStatus
.Information
= 0;