Source code of Windows XP (NT5)
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.

110 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. init.c
  5. Abstract:
  6. This module provides the initialization and unload functions.
  7. Author:
  8. Andy Thornton (andrewth) 20-Oct-97
  9. Revision History:
  10. --*/
  11. #include "mfp.h"
  12. NTSTATUS
  13. DriverEntry(
  14. IN PDRIVER_OBJECT DriverObject,
  15. IN PUNICODE_STRING RegistryPath
  16. );
  17. VOID
  18. MfUnload(
  19. IN PDRIVER_OBJECT DriverObject
  20. );
  21. #ifdef ALLOC_PRAGMA
  22. #pragma alloc_text(INIT, DriverEntry)
  23. #pragma alloc_text(PAGE, MfUnload)
  24. #endif
  25. PDRIVER_OBJECT MfDriverObject;
  26. NTSTATUS
  27. DriverEntry(
  28. IN PDRIVER_OBJECT DriverObject,
  29. IN PUNICODE_STRING RegistryPath
  30. )
  31. /*++
  32. Routine Description:
  33. This is the entry point to MF.SYS and performs initialization.
  34. Arguments:
  35. DriverObject - The system owned driver object for MF
  36. RegistryPath - The path to MF's service entry
  37. Return Value:
  38. STATUS_SUCCESS
  39. --*/
  40. {
  41. DriverObject->DriverExtension->AddDevice = MfAddDevice;
  42. DriverObject->MajorFunction[IRP_MJ_PNP] = MfDispatchPnp;
  43. DriverObject->MajorFunction[IRP_MJ_POWER] = MfDispatchPower;
  44. DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = MfDispatchNop;
  45. DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = MfDispatchNop;
  46. DriverObject->DriverUnload = MfUnload;
  47. //
  48. // Remember the driver object
  49. //
  50. MfDriverObject = DriverObject;
  51. DEBUG_MSG(1, ("Completed DriverEntry for Driver 0x%08x\n", DriverObject));
  52. return STATUS_SUCCESS;
  53. }
  54. VOID
  55. MfUnload(
  56. IN PDRIVER_OBJECT DriverObject
  57. )
  58. /*++
  59. Routine Description:
  60. This is called to reverse any operations performed in DriverEntry before a
  61. driver is unloaded.
  62. Arguments:
  63. DriverObject - The system owned driver object for MF
  64. Return Value:
  65. STATUS_SUCCESS
  66. --*/
  67. {
  68. PAGED_CODE();
  69. DEBUG_MSG(1, ("Completed Unload for Driver 0x%08x\n", DriverObject));
  70. return;
  71. }