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.

104 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1989-2001 Microsoft Corporation
  3. Module Name:
  4. Driver.c
  5. Abstract:
  6. This module implements the DRIVER_INITIALIZATION routine for the
  7. SMB Transport and other routines that are specific to the NT implementation
  8. of a driver.
  9. Author:
  10. Jiandong Ruan
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #include "driver.tmh"
  15. NTSTATUS
  16. DriverEntry(
  17. IN PDRIVER_OBJECT DriverObject,
  18. IN PUNICODE_STRING RegistryPath
  19. );
  20. VOID
  21. SmbUnload2(
  22. IN PDRIVER_OBJECT DriverObject
  23. );
  24. //******************* Pageable Routine Declarations ****************
  25. #ifdef ALLOC_PRAGMA
  26. #pragma alloc_text(INIT, DriverEntry)
  27. #pragma alloc_text(PAGE, SmbUnload2)
  28. #endif
  29. //******************* Pageable Routine Declarations ****************
  30. NTSTATUS
  31. DriverEntry(
  32. IN PDRIVER_OBJECT DriverObject,
  33. IN PUNICODE_STRING RegistryPath
  34. )
  35. /*++
  36. Routine Description:
  37. This is the initialization routine for the SMB device driver.
  38. This routine creates the device object for the SMB
  39. device and calls a routine to perform other driver initialization.
  40. Arguments:
  41. DriverObject - Pointer to driver object created by the system.
  42. Return Value:
  43. NTSTATUS - The function value is the final status from the initialization
  44. operation.
  45. --*/
  46. {
  47. NTSTATUS status;
  48. PAGED_CODE();
  49. WPP_INIT_TRACING(DriverObject, RegistryPath);
  50. status = SmbDriverEntry(DriverObject, RegistryPath, NULL);
  51. BAIL_OUT_ON_ERROR(status);
  52. DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)SmbDispatchCreate;
  53. DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH)SmbDispatchDevCtrl;
  54. DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = (PDRIVER_DISPATCH)SmbDispatchInternalCtrl;
  55. DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (PDRIVER_DISPATCH)SmbDispatchCleanup;
  56. DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)SmbDispatchClose;
  57. DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH)SmbDispatchPnP;
  58. DriverObject->DriverUnload = SmbUnload2;
  59. return (status);
  60. cleanup:
  61. SmbUnload2(DriverObject);
  62. return status;
  63. }
  64. VOID
  65. SmbUnload2(
  66. IN PDRIVER_OBJECT DriverObject
  67. )
  68. {
  69. PAGED_CODE();
  70. SmbUnload(DriverObject);
  71. WPP_CLEANUP(DriverObject);
  72. }