Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. cdfs_rec.c
  5. Abstract:
  6. This module contains the mini-file system recognizer for CDFS.
  7. Author:
  8. Darryl E. Havens (darrylh) 8-dec-1992
  9. Environment:
  10. Kernel mode, local to I/O system
  11. Revision History:
  12. --*/
  13. #include "fs_rec.h"
  14. //
  15. // The local debug trace level
  16. //
  17. #define Dbg (FSREC_DEBUG_LEVEL_CDFS)
  18. #ifdef ALLOC_PRAGMA
  19. #pragma alloc_text(PAGE,CdfsRecFsControl)
  20. #endif // ALLOC_PRAGMA
  21. NTSTATUS
  22. CdfsRecFsControl(
  23. IN PDEVICE_OBJECT DeviceObject,
  24. IN PIRP Irp
  25. )
  26. /*++
  27. Routine Description:
  28. This function performs the mount and driver reload functions for this mini-
  29. file system recognizer driver.
  30. Arguments:
  31. DeviceObject - Pointer to this driver's device object.
  32. Irp - Pointer to the I/O Request Packet (IRP) representing the function to
  33. be performed.
  34. Return Value:
  35. The function value is the final status of the operation.
  36. -*/
  37. {
  38. NTSTATUS status;
  39. PIO_STACK_LOCATION irpSp;
  40. PDEVICE_EXTENSION deviceExtension;
  41. PAGED_CODE();
  42. //
  43. // Begin by determining what function that is to be performed.
  44. //
  45. deviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  46. irpSp = IoGetCurrentIrpStackLocation( Irp );
  47. switch ( irpSp->MinorFunction ) {
  48. case IRP_MN_MOUNT_VOLUME:
  49. //
  50. // Always request the filesystem driver.
  51. //
  52. status = STATUS_FS_DRIVER_REQUIRED;
  53. break;
  54. case IRP_MN_LOAD_FILE_SYSTEM:
  55. status = FsRecLoadFileSystem( DeviceObject,
  56. L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs" );
  57. break;
  58. default:
  59. status = STATUS_INVALID_DEVICE_REQUEST;
  60. break;
  61. }
  62. //
  63. // Finally, complete the request and return the same status code to the
  64. // caller.
  65. //
  66. Irp->IoStatus.Status = status;
  67. IoCompleteRequest( Irp, IO_NO_INCREMENT );
  68. return status;
  69. }