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.

183 lines
2.9 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1999
  3. Module Name:
  4. mchgr.h
  5. Abstract:
  6. SCSI Medium Changer class driver
  7. Environment:
  8. kernel mode only
  9. Notes:
  10. Revision History:
  11. --*/
  12. #ifndef _MCHGR_H_
  13. #define _MCHGR_H_
  14. #include "stdarg.h"
  15. #include "ntddk.h"
  16. #include "mcd.h"
  17. #include "initguid.h"
  18. #include "ntddstor.h"
  19. #include <wmidata.h>
  20. #include <wmistr.h>
  21. #include <stdarg.h>
  22. //
  23. // WMI guid list for changer.
  24. //
  25. extern GUIDREGINFO ChangerWmiFdoGuidList[];
  26. //
  27. // Changer class device extension
  28. //
  29. typedef struct _MCD_CLASS_DATA {
  30. LONG DeviceOpen;
  31. UNICODE_STRING MediumChangerInterfaceString;
  32. BOOLEAN DosNameCreated;
  33. } MCD_CLASS_DATA, *PMCD_CLASS_DATA;
  34. NTSTATUS
  35. ChangerClassCreateClose (
  36. IN PDEVICE_OBJECT DeviceObject,
  37. IN PIRP Irp
  38. );
  39. NTSTATUS
  40. ChangerClassDeviceControl (
  41. IN PDEVICE_OBJECT DeviceObject,
  42. IN PIRP Irp
  43. );
  44. VOID
  45. ChangerClassError(
  46. PDEVICE_OBJECT DeviceObject,
  47. PSCSI_REQUEST_BLOCK Srb,
  48. NTSTATUS *Status,
  49. BOOLEAN *Retry
  50. );
  51. NTSTATUS
  52. ChangerAddDevice(
  53. IN PDRIVER_OBJECT DriverObject,
  54. IN PDEVICE_OBJECT PhysicalDeviceObject
  55. );
  56. NTSTATUS
  57. ChangerStartDevice(
  58. IN PDEVICE_OBJECT Fdo
  59. );
  60. NTSTATUS
  61. ChangerStopDevice(
  62. IN PDEVICE_OBJECT DeviceObject,
  63. IN UCHAR Type
  64. );
  65. NTSTATUS
  66. ChangerInitDevice(
  67. IN PDEVICE_OBJECT Fdo
  68. );
  69. NTSTATUS
  70. ChangerRemoveDevice(
  71. IN PDEVICE_OBJECT DeviceObject,
  72. IN UCHAR Type
  73. );
  74. NTSTATUS
  75. DriverEntry(
  76. IN PDRIVER_OBJECT DriverObject,
  77. IN PUNICODE_STRING RegistryPath
  78. );
  79. VOID
  80. ChangerUnload(
  81. IN PDRIVER_OBJECT DriverObject
  82. );
  83. NTSTATUS
  84. CreateChangerDeviceObject(
  85. IN PDRIVER_OBJECT DriverObject,
  86. IN PDEVICE_OBJECT PhysicalDeviceObject
  87. );
  88. NTSTATUS
  89. ChangerReadWriteVerification(
  90. IN PDEVICE_OBJECT DeviceObject,
  91. IN PIRP Irp
  92. );
  93. //
  94. // WMI routines
  95. //
  96. NTSTATUS
  97. ChangerFdoQueryWmiRegInfo(
  98. IN PDEVICE_OBJECT DeviceObject,
  99. OUT ULONG *RegFlags,
  100. OUT PUNICODE_STRING InstanceName
  101. );
  102. NTSTATUS
  103. ChangerFdoQueryWmiDataBlock(
  104. IN PDEVICE_OBJECT DeviceObject,
  105. IN PIRP Irp,
  106. IN ULONG GuidIndex,
  107. IN ULONG BufferAvail,
  108. OUT PUCHAR Buffer
  109. );
  110. NTSTATUS
  111. ChangerFdoSetWmiDataBlock(
  112. IN PDEVICE_OBJECT DeviceObject,
  113. IN PIRP Irp,
  114. IN ULONG GuidIndex,
  115. IN ULONG BufferSize,
  116. IN PUCHAR Buffer
  117. );
  118. NTSTATUS
  119. ChangerFdoSetWmiDataItem(
  120. IN PDEVICE_OBJECT DeviceObject,
  121. IN PIRP Irp,
  122. IN ULONG GuidIndex,
  123. IN ULONG DataItemId,
  124. IN ULONG BufferSize,
  125. IN PUCHAR Buffer
  126. );
  127. NTSTATUS
  128. ChangerFdoExecuteWmiMethod(
  129. IN PDEVICE_OBJECT DeviceObject,
  130. IN PIRP Irp,
  131. IN ULONG GuidIndex,
  132. IN ULONG MethodId,
  133. IN ULONG InBufferSize,
  134. IN ULONG OutBufferSize,
  135. IN PUCHAR Buffer
  136. );
  137. NTSTATUS
  138. ChangerWmiFunctionControl(
  139. IN PDEVICE_OBJECT DeviceObject,
  140. IN PIRP Irp,
  141. IN ULONG GuidIndex,
  142. IN CLASSENABLEDISABLEFUNCTION Function,
  143. IN BOOLEAN Enable
  144. );
  145. #endif // _MCHGR_H_