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.

64 lines
1.4 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1998
  3. Module Name:
  4. device.c
  5. Abstract:
  6. Device entry point and hardware validation.
  7. --*/
  8. #include "mskssrv.h"
  9. #ifdef ALLOC_PRAGMA
  10. NTSTATUS
  11. DriverEntry(
  12. IN PDRIVER_OBJECT DriverObject,
  13. IN PUNICODE_STRING RegistryPathName
  14. );
  15. #pragma alloc_text(INIT, DriverEntry)
  16. #endif // ALLOC_PRAGMA
  17. NTSTATUS
  18. DriverEntry(
  19. IN PDRIVER_OBJECT DriverObject,
  20. IN PUNICODE_STRING RegistryPathName
  21. )
  22. /*++
  23. Routine Description:
  24. Sets up the driver object to handle the KS interface and PnP Add Device
  25. request. Does not set up a handler for PnP Irp's, as they are all dealt
  26. with directly by the PDO.
  27. Arguments:
  28. DriverObject -
  29. Driver object for this instance.
  30. RegistryPathName -
  31. Contains the registry path which was used to load this instance.
  32. Return Values:
  33. Returns STATUS_SUCCESS.
  34. --*/
  35. {
  36. DriverObject->MajorFunction[IRP_MJ_PNP] = KsDefaultDispatchPnp;
  37. DriverObject->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower;
  38. DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = KsDefaultForwardIrp;
  39. DriverObject->DriverExtension->AddDevice = PnpAddDevice;
  40. DriverObject->DriverUnload = KsNullDriverUnload;
  41. KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CREATE);
  42. KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CLOSE);
  43. KsSetMajorFunctionHandler(DriverObject, IRP_MJ_DEVICE_CONTROL);
  44. return STATUS_SUCCESS;
  45. }