ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cleanup.c
Go to the documentation of this file.
00001 /*
00002 *  ReactOS kernel
00003 *  Copyright (C) 2002 ReactOS Team
00004 *
00005 *  This program is free software; you can redistribute it and/or modify
00006 *  it under the terms of the GNU General Public License as published by
00007 *  the Free Software Foundation; either version 2 of the License, or
00008 *  (at your option) any later version.
00009 *
00010 *  This program is distributed in the hope that it will be useful,
00011 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 *  GNU General Public License for more details.
00014 *
00015 *  You should have received a copy of the GNU General Public License along
00016 *  with this program; if not, write to the Free Software Foundation, Inc.,
00017 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 */
00019 /* $Id: cleanup.c 43790 2009-10-27 10:34:16Z dgorbachev $
00020 *
00021 * COPYRIGHT:        See COPYING in the top level directory
00022 * PROJECT:          ReactOS kernel
00023 * FILE:             services/fs/cdfs/cleanup.c
00024 * PURPOSE:          CDROM (ISO 9660) filesystem driver
00025 * PROGRAMMER:
00026 * UPDATE HISTORY:
00027 */
00028 
00029 /* INCLUDES *****************************************************************/
00030 
00031 #include "cdfs.h"
00032 
00033 #define NDEBUG
00034 #include <debug.h>
00035 
00036 /* FUNCTIONS ****************************************************************/
00037 
00038 static NTSTATUS
00039 CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt,
00040                 PFILE_OBJECT FileObject)
00041                 /*
00042                 * FUNCTION: Cleans up after a file has been closed.
00043                 */
00044 {
00045 
00046     DPRINT("CdfsCleanupFile(DeviceExt %x, FileObject %x)\n",
00047         DeviceExt,
00048         FileObject);
00049 
00050 
00051     /* Uninitialize file cache if initialized for this file object. */
00052     if (FileObject->SectionObjectPointer && FileObject->SectionObjectPointer->SharedCacheMap)
00053     {
00054         CcUninitializeCacheMap (FileObject, NULL, NULL);
00055     }
00056 
00057     return STATUS_SUCCESS;
00058 }
00059 
00060 NTSTATUS NTAPI
00061 CdfsCleanup(PDEVICE_OBJECT DeviceObject,
00062             PIRP Irp)
00063 {
00064     PDEVICE_EXTENSION DeviceExtension;
00065     PIO_STACK_LOCATION Stack;
00066     PFILE_OBJECT FileObject;
00067     NTSTATUS Status;
00068 
00069     DPRINT("CdfsCleanup() called\n");
00070 
00071     if (DeviceObject == CdfsGlobalData->DeviceObject)
00072     {
00073         DPRINT("Closing file system\n");
00074         Status = STATUS_SUCCESS;
00075         goto ByeBye;
00076     }
00077 
00078     Stack = IoGetCurrentIrpStackLocation(Irp);
00079     FileObject = Stack->FileObject;
00080     DeviceExtension = DeviceObject->DeviceExtension;
00081 
00082     KeEnterCriticalRegion();
00083     ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource, TRUE);
00084 
00085     Status = CdfsCleanupFile(DeviceExtension, FileObject);
00086 
00087     ExReleaseResourceLite(&DeviceExtension->DirResource);
00088     KeLeaveCriticalRegion();
00089 
00090 
00091 ByeBye:
00092     Irp->IoStatus.Status = Status;
00093     Irp->IoStatus.Information = 0;
00094 
00095     IoCompleteRequest(Irp, IO_NO_INCREMENT);
00096     return(Status);
00097 }
00098 
00099 /* EOF */
00100 

Generated on Sun May 27 2012 04:21:22 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.