test: cdfs_rec.c Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# cdfs_rec.c

Go to the documentation of this file.

    00001 /*++
    00002
    00003 Copyright (c) 1992  Microsoft Corporation
    00004
    00005 Module Name:
    00006
    00007     cdfs_rec.c
    00008
    00009 Abstract:
    00010
    00011     This module contains the mini-file system recognizer for CDFS.
    00012
    00013 Author:
    00014
    00015     Darryl E. Havens (darrylh) 8-dec-1992
    00016
    00017 Environment:
    00018
    00019     Kernel mode, local to I/O system
    00020
    00021 Revision History:
    00022
    00023
    00024 --*/
    00025
    00026 #include "fs_rec.h"
    00027
    00028 //
    00029 //  The local debug trace level
    00030 //
    00031
    00032 #define Dbg                              (FSREC_DEBUG_LEVEL_CDFS)
    00033
    00034 #ifdef ALLOC_PRAGMA
    00035 #pragma alloc_text(PAGE,CdfsRecFsControl)
    00036 #endif // ALLOC_PRAGMA
    00037
    00038
    00039 NTSTATUS
    00040 CdfsRecFsControl(
    00041     IN PDEVICE_OBJECT DeviceObject,
    00042     IN PIRP Irp
    00043     )
    00044
    00045 /*++
    00046
    00047 Routine Description:
    00048
    00049     This function performs the mount and driver reload functions for this mini-
    00050     file system recognizer driver.
    00051
    00052 Arguments:
    00053
    00054     DeviceObject - Pointer to this driver's device object.
    00055
    00056     Irp - Pointer to the I/O Request Packet (IRP) representing the function to
    00057         be performed.
    00058
    00059 Return Value:
    00060
    00061     The function value is the final status of the operation.
    00062
    00063
    00064  -*/
    00065
    00066 {
    00067     NTSTATUS status;
    00068     PIO_STACK_LOCATION irpSp;
    00069     PDEVICE_EXTENSION deviceExtension;
    00070
    00071     PAGED_CODE();
    00072
    00073     //
    00074     // Begin by determining what function that is to be performed.
    00075     //
    00076
    00077     deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
    00078     irpSp = IoGetCurrentIrpStackLocation( Irp );
    00079
    00080     switch ( irpSp->MinorFunction ) {
    00081
    00082     case IRP_MN_MOUNT_VOLUME:
    00083
    00084         //
    00085         //  Always request the filesystem driver.
    00086         //
    00087
    00088         status = STATUS_FS_DRIVER_REQUIRED;
    00089         break;
    00090
    00091     case IRP_MN_LOAD_FILE_SYSTEM:
    00092
    00093         status = FsRecLoadFileSystem( DeviceObject,
    00094                                       L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs" );
    00095         break;
    00096
    00097     default:
    00098
    00099         status = STATUS_INVALID_DEVICE_REQUEST;
    00100         break;
    00101     }
    00102
    00103     //
    00104     // Finally, complete the request and return the same status code to the
    00105     // caller.
    00106     //
    00107
    00108     Irp->IoStatus.Status = status;
    00109     IoCompleteRequest( Irp, IO_NO_INCREMENT );
    00110
    00111     return status;
    00112 }