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.

190 lines
3.2 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. #if defined(_WIN64)
  32. //
  33. // Force PVOID alignment
  34. //
  35. ULONG_PTR Reserved;
  36. #endif
  37. UNICODE_STRING MediumChangerInterfaceString;
  38. BOOLEAN DosNameCreated;
  39. } MCD_CLASS_DATA, *PMCD_CLASS_DATA;
  40. NTSTATUS
  41. ChangerClassCreateClose (
  42. IN PDEVICE_OBJECT DeviceObject,
  43. IN PIRP Irp
  44. );
  45. NTSTATUS
  46. ChangerClassDeviceControl (
  47. IN PDEVICE_OBJECT DeviceObject,
  48. IN PIRP Irp
  49. );
  50. VOID
  51. ChangerClassError(
  52. PDEVICE_OBJECT DeviceObject,
  53. PSCSI_REQUEST_BLOCK Srb,
  54. NTSTATUS *Status,
  55. BOOLEAN *Retry
  56. );
  57. NTSTATUS
  58. ChangerAddDevice(
  59. IN PDRIVER_OBJECT DriverObject,
  60. IN PDEVICE_OBJECT PhysicalDeviceObject
  61. );
  62. NTSTATUS
  63. ChangerStartDevice(
  64. IN PDEVICE_OBJECT Fdo
  65. );
  66. NTSTATUS
  67. ChangerStopDevice(
  68. IN PDEVICE_OBJECT DeviceObject,
  69. IN UCHAR Type
  70. );
  71. NTSTATUS
  72. ChangerInitDevice(
  73. IN PDEVICE_OBJECT Fdo
  74. );
  75. NTSTATUS
  76. ChangerRemoveDevice(
  77. IN PDEVICE_OBJECT DeviceObject,
  78. IN UCHAR Type
  79. );
  80. NTSTATUS
  81. DriverEntry(
  82. IN PDRIVER_OBJECT DriverObject,
  83. IN PUNICODE_STRING RegistryPath
  84. );
  85. VOID
  86. ChangerUnload(
  87. IN PDRIVER_OBJECT DriverObject
  88. );
  89. NTSTATUS
  90. CreateChangerDeviceObject(
  91. IN PDRIVER_OBJECT DriverObject,
  92. IN PDEVICE_OBJECT PhysicalDeviceObject
  93. );
  94. NTSTATUS
  95. ChangerReadWriteVerification(
  96. IN PDEVICE_OBJECT DeviceObject,
  97. IN PIRP Irp
  98. );
  99. //
  100. // WMI routines
  101. //
  102. NTSTATUS
  103. ChangerFdoQueryWmiRegInfo(
  104. IN PDEVICE_OBJECT DeviceObject,
  105. OUT ULONG *RegFlags,
  106. OUT PUNICODE_STRING InstanceName
  107. );
  108. NTSTATUS
  109. ChangerFdoQueryWmiDataBlock(
  110. IN PDEVICE_OBJECT DeviceObject,
  111. IN PIRP Irp,
  112. IN ULONG GuidIndex,
  113. IN ULONG BufferAvail,
  114. OUT PUCHAR Buffer
  115. );
  116. NTSTATUS
  117. ChangerFdoSetWmiDataBlock(
  118. IN PDEVICE_OBJECT DeviceObject,
  119. IN PIRP Irp,
  120. IN ULONG GuidIndex,
  121. IN ULONG BufferSize,
  122. IN PUCHAR Buffer
  123. );
  124. NTSTATUS
  125. ChangerFdoSetWmiDataItem(
  126. IN PDEVICE_OBJECT DeviceObject,
  127. IN PIRP Irp,
  128. IN ULONG GuidIndex,
  129. IN ULONG DataItemId,
  130. IN ULONG BufferSize,
  131. IN PUCHAR Buffer
  132. );
  133. NTSTATUS
  134. ChangerFdoExecuteWmiMethod(
  135. IN PDEVICE_OBJECT DeviceObject,
  136. IN PIRP Irp,
  137. IN ULONG GuidIndex,
  138. IN ULONG MethodId,
  139. IN ULONG InBufferSize,
  140. IN ULONG OutBufferSize,
  141. IN PUCHAR Buffer
  142. );
  143. NTSTATUS
  144. ChangerWmiFunctionControl(
  145. IN PDEVICE_OBJECT DeviceObject,
  146. IN PIRP Irp,
  147. IN ULONG GuidIndex,
  148. IN CLASSENABLEDISABLEFUNCTION Function,
  149. IN BOOLEAN Enable
  150. );
  151. #endif // _MCHGR_H_