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.

783 lines
24 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddchgr.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing medium changer devices.
  8. Author:
  9. chuckp (Charles Park)
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDCHGR_H_
  13. #define _NTDDCHGR_H_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. //
  18. // Device Name - this string is the name of the device. It is the name
  19. // that should be passed to NtOpenFile when accessing the device.
  20. //
  21. // Note: For devices that support multiple units, it should be suffixed
  22. // with the Ascii representation of the unit number.
  23. //
  24. #define DD_CHANGER_DEVICE_NAME "\\Device\\Changer"
  25. //
  26. // NtDeviceIoControlFile IoControlCode values for changer devices.
  27. //
  28. // begin_winioctl
  29. #define IOCTL_CHANGER_BASE FILE_DEVICE_CHANGER
  30. #define IOCTL_CHANGER_GET_PARAMETERS CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
  31. #define IOCTL_CHANGER_GET_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  32. #define IOCTL_CHANGER_GET_PRODUCT_DATA CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
  33. #define IOCTL_CHANGER_SET_ACCESS CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  34. #define IOCTL_CHANGER_GET_ELEMENT_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  35. #define IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
  36. #define IOCTL_CHANGER_SET_POSITION CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
  37. #define IOCTL_CHANGER_EXCHANGE_MEDIUM CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
  38. #define IOCTL_CHANGER_MOVE_MEDIUM CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS)
  39. #define IOCTL_CHANGER_REINITIALIZE_TRANSPORT CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
  40. #define IOCTL_CHANGER_QUERY_VOLUME_TAGS CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  41. // end_winioctl
  42. //
  43. // The following file contains the IOCTL_STORAGE class ioctls
  44. //
  45. #include <ntddstor.h>
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. // begin_winioctl
  50. #define MAX_VOLUME_ID_SIZE 36
  51. #define MAX_VOLUME_TEMPLATE_SIZE 40
  52. #define VENDOR_ID_LENGTH 8
  53. #define PRODUCT_ID_LENGTH 16
  54. #define REVISION_LENGTH 4
  55. #define SERIAL_NUMBER_LENGTH 32
  56. //
  57. // Common structures describing elements.
  58. //
  59. typedef enum _ELEMENT_TYPE {
  60. AllElements, // As defined by SCSI
  61. ChangerTransport, // As defined by SCSI
  62. ChangerSlot, // As defined by SCSI
  63. ChangerIEPort, // As defined by SCSI
  64. ChangerDrive, // As defined by SCSI
  65. ChangerDoor, // Front panel, used to access internal of cabinet.
  66. ChangerKeypad, // Keypad/input on front panel.
  67. ChangerMaxElement // Placeholder only. Not a valid type.
  68. } ELEMENT_TYPE, *PELEMENT_TYPE;
  69. typedef struct _CHANGER_ELEMENT {
  70. ELEMENT_TYPE ElementType;
  71. ULONG ElementAddress;
  72. } CHANGER_ELEMENT, *PCHANGER_ELEMENT;
  73. typedef struct _CHANGER_ELEMENT_LIST {
  74. CHANGER_ELEMENT Element;
  75. ULONG NumberOfElements;
  76. } CHANGER_ELEMENT_LIST , *PCHANGER_ELEMENT_LIST;
  77. //
  78. // Definitions for IOCTL_CHANGER_GET_PARAMETERS
  79. //
  80. //
  81. // Definitions for Features0 of GET_CHANGER_PARAMETERS
  82. //
  83. #define CHANGER_BAR_CODE_SCANNER_INSTALLED 0x00000001 // The medium-changer has a bar code scanner installed.
  84. #define CHANGER_INIT_ELEM_STAT_WITH_RANGE 0x00000002 // The medium-changer has the ability to initialize elements within a specified range.
  85. #define CHANGER_CLOSE_IEPORT 0x00000004 // The medium-changer has the ability to close the i/e port door.
  86. #define CHANGER_OPEN_IEPORT 0x00000008 // The medium-changer can open the i/e port door.
  87. #define CHANGER_STATUS_NON_VOLATILE 0x00000010 // The medium-changer uses non-volatile memory for element status information.
  88. #define CHANGER_EXCHANGE_MEDIA 0x00000020 // The medium-changer supports exchange operations.
  89. #define CHANGER_CLEANER_SLOT 0x00000040 // The medium-changer has a fixed slot designated for cleaner cartridges.
  90. #define CHANGER_LOCK_UNLOCK 0x00000080 // The medium-changer can be (un)secured to (allow)prevent media removal.
  91. #define CHANGER_CARTRIDGE_MAGAZINE 0x00000100 // The medium-changer uses cartridge magazines for some storage slots.
  92. #define CHANGER_MEDIUM_FLIP 0x00000200 // The medium-changer can flip medium.
  93. #define CHANGER_POSITION_TO_ELEMENT 0x00000400 // The medium-changer can position the transport to a particular element.
  94. #define CHANGER_REPORT_IEPORT_STATE 0x00000800 // The medium-changer can determine whether media is present
  95. // in the IE Port.
  96. #define CHANGER_STORAGE_DRIVE 0x00001000 // The medium-changer can use a drive as an independent storage element.
  97. #define CHANGER_STORAGE_IEPORT 0x00002000 // The medium-changer can use a i/e port as an independent storage element.
  98. #define CHANGER_STORAGE_SLOT 0x00004000 // The medium-changer can use a slot as an independent storage element.
  99. #define CHANGER_STORAGE_TRANSPORT 0x00008000 // The medium-changer can use a transport as an independent storage element.
  100. #define CHANGER_DRIVE_CLEANING_REQUIRED 0x00010000 // The drives controlled by the medium changer require periodic cleaning
  101. // initiated by an application.
  102. #define CHANGER_PREDISMOUNT_EJECT_REQUIRED 0x00020000 // The medium-changer requires a drive eject command to be issued, before a changer
  103. // move / exchange command can be issued to the drive.
  104. #define CHANGER_CLEANER_ACCESS_NOT_VALID 0x00040000 // The access bit in GES isn't valid for cleaner cartridges.
  105. #define CHANGER_PREMOUNT_EJECT_REQUIRED 0x00080000 // The medium-changer requires a drive eject command to be issued
  106. // before a move / exchange command can be issued with the drive as src/dst.
  107. #define CHANGER_VOLUME_IDENTIFICATION 0x00100000 // The medium-changer supports volume identification.
  108. #define CHANGER_VOLUME_SEARCH 0x00200000 // The medium-changer can search for volume information.
  109. #define CHANGER_VOLUME_ASSERT 0x00400000 // The medium-changer can verify volume information.
  110. #define CHANGER_VOLUME_REPLACE 0x00800000 // The medium-changer can replace volume information.
  111. #define CHANGER_VOLUME_UNDEFINE 0x01000000 // The medium-changer can undefine volume information.
  112. #define CHANGER_SERIAL_NUMBER_VALID 0x04000000 // The serial number reported in GetProductData is valid
  113. // and unique.
  114. #define CHANGER_DEVICE_REINITIALIZE_CAPABLE 0x08000000 // The medium-changer can be issued a ChangerReinitializeUnit.
  115. #define CHANGER_KEYPAD_ENABLE_DISABLE 0x10000000 // Indicates that the keypad can be enabled/disabled.
  116. #define CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS 0x20000000 // Drives must be empty before access via the door is possible.
  117. #define CHANGER_RESERVED_BIT 0x80000000 // Will be used to indicate Features1 capability bits.
  118. //
  119. // Definitions for Features1 of GET_CHANGER_PARAMETERS
  120. //
  121. #define CHANGER_PREDISMOUNT_ALIGN_TO_SLOT 0x80000001 // The transport must be prepositioned to the slot prior to ejecting the media.
  122. #define CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE 0x80000002 // The transport must be prepositioned to the drive prior to ejecting the media.
  123. #define CHANGER_CLEANER_AUTODISMOUNT 0x80000004 // The device will move the cleaner cartridge back into the slot when cleaning has completed.
  124. #define CHANGER_TRUE_EXCHANGE_CAPABLE 0x80000008 // Device can do src -> dest2 exchanges.
  125. #define CHANGER_SLOTS_USE_TRAYS 0x80000010 // Slots have removable trays, requiring multiple moves for inject/eject.
  126. #define CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR 0x80000020 // Media must be returned to the slot from which it originated after a move to another element.
  127. #define CHANGER_CLEANER_OPS_NOT_SUPPORTED 0x80000040 // Automated cleaning operations are not supported on this device.
  128. #define CHANGER_IEPORT_USER_CONTROL_OPEN 0x80000080 // Indicates that user action is necessary to open a closed ieport.
  129. #define CHANGER_IEPORT_USER_CONTROL_CLOSE 0x80000100 // Indicates that user action is necessary to close an opened ieport.
  130. #define CHANGER_MOVE_EXTENDS_IEPORT 0x80000200 // Indicates that a move media to the ieport extends the tray.
  131. #define CHANGER_MOVE_RETRACTS_IEPORT 0x80000400 // Indicates that a move media from the ieport retracts the tray.
  132. //
  133. // Definitions for MoveFrom, ExchangeFrom, and PositionCapabilities
  134. //
  135. #define CHANGER_TO_TRANSPORT 0x01 // The device can carry out the operation to a transport from the specified element.
  136. #define CHANGER_TO_SLOT 0x02 // The device can carry out the operation to a slot from the specified element.
  137. #define CHANGER_TO_IEPORT 0x04 // The device can carry out the operation to an IE Port from the specified element.
  138. #define CHANGER_TO_DRIVE 0x08 // The device can carry out the operation to a drive from the specified element.
  139. //
  140. // Definitions for LockUnlockCapabilities
  141. //
  142. #define LOCK_UNLOCK_IEPORT 0x01 // The device can lock/unlock the ieport(s).
  143. #define LOCK_UNLOCK_DOOR 0x02 // The device can lock/unlock the door(s).
  144. #define LOCK_UNLOCK_KEYPAD 0x04 // The device can lock/unlock the keypad.
  145. typedef struct _GET_CHANGER_PARAMETERS {
  146. //
  147. // Size of the structure. Can be used for versioning.
  148. //
  149. ULONG Size;
  150. //
  151. // Number of N element(s) as defined by the Element Address Page (or equivalent...).
  152. //
  153. USHORT NumberTransportElements;
  154. USHORT NumberStorageElements; // for data cartridges only
  155. USHORT NumberCleanerSlots; // for cleaner cartridges
  156. USHORT NumberIEElements;
  157. USHORT NumberDataTransferElements;
  158. //
  159. // Number of doors/front panels (allows user entry into the cabinet).
  160. //
  161. USHORT NumberOfDoors;
  162. //
  163. // The device-specific address (from user manual of the device) of the first N element. Used
  164. // by the UI to relate the various elements to the user.
  165. //
  166. USHORT FirstSlotNumber;
  167. USHORT FirstDriveNumber;
  168. USHORT FirstTransportNumber;
  169. USHORT FirstIEPortNumber;
  170. USHORT FirstCleanerSlotAddress;
  171. //
  172. // Indicates the capacity of each magazine, if they exist.
  173. //
  174. USHORT MagazineSize;
  175. //
  176. // Specifies the approximate number of seconds for when a cleaning should be completed.
  177. // Only applicable if drive cleaning is supported. See Features0.
  178. //
  179. ULONG DriveCleanTimeout;
  180. //
  181. // See features bits, above.
  182. //
  183. ULONG Features0;
  184. ULONG Features1;
  185. //
  186. // Bitmask defining Move from N element to element. Defined by Device Capabilities Page (or equivalent).
  187. // AND-masking with the TO_XXX values will indicate legal destinations.
  188. //
  189. UCHAR MoveFromTransport;
  190. UCHAR MoveFromSlot;
  191. UCHAR MoveFromIePort;
  192. UCHAR MoveFromDrive;
  193. //
  194. // Bitmask defining Exchange from N element to element. Defined by Device Capabilities Page (or equivalent).
  195. // AND-masking with the TO_XXX values will indicate legal destinations.
  196. //
  197. UCHAR ExchangeFromTransport;
  198. UCHAR ExchangeFromSlot;
  199. UCHAR ExchangeFromIePort;
  200. UCHAR ExchangeFromDrive;
  201. //
  202. // Bitmask defining which elements are capable of lock/unlock. Valid only if
  203. // CHANGER_LOCK_UNLOCK is set in Features0.
  204. //
  205. UCHAR LockUnlockCapabilities;
  206. //
  207. // Bitmask defining which elements valid for positioning operations. Valid only if
  208. // CHANGER_POSITION_TO_ELEMENT is set in Features0.
  209. //
  210. UCHAR PositionCapabilities;
  211. //
  212. // For future expansion.
  213. //
  214. UCHAR Reserved1[2];
  215. ULONG Reserved2[2];
  216. } GET_CHANGER_PARAMETERS, * PGET_CHANGER_PARAMETERS;
  217. //
  218. // Definitions for IOCTL_CHANGER_GET_PRODUCT_DATA
  219. //
  220. typedef struct _CHANGER_PRODUCT_DATA {
  221. //
  222. // Device manufacturer's name - based on inquiry data
  223. //
  224. UCHAR VendorId[VENDOR_ID_LENGTH];
  225. //
  226. // Product identification as defined by the vendor - based on Inquiry data
  227. //
  228. UCHAR ProductId[PRODUCT_ID_LENGTH];
  229. //
  230. // Product revision as defined by the vendor.
  231. //
  232. UCHAR Revision[REVISION_LENGTH];
  233. //
  234. // Vendor unique value used to globally identify this device. Can
  235. // be from Vital Product Data, for example.
  236. //
  237. UCHAR SerialNumber[SERIAL_NUMBER_LENGTH];
  238. //
  239. // Indicates device type of data transports, as defined by SCSI-2.
  240. //
  241. UCHAR DeviceType;
  242. } CHANGER_PRODUCT_DATA, *PCHANGER_PRODUCT_DATA;
  243. //
  244. // Definitions for IOCTL_CHANGER_SET_ACCESS
  245. //
  246. #define LOCK_ELEMENT 0
  247. #define UNLOCK_ELEMENT 1
  248. #define EXTEND_IEPORT 2
  249. #define RETRACT_IEPORT 3
  250. typedef struct _CHANGER_SET_ACCESS {
  251. //
  252. // Element can be ChangerIEPort, ChangerDoor, ChangerKeypad
  253. //
  254. CHANGER_ELEMENT Element;
  255. //
  256. // See above for possible operations.
  257. //
  258. ULONG Control;
  259. } CHANGER_SET_ACCESS, *PCHANGER_SET_ACCESS;
  260. //
  261. // Definitions for IOCTL_CHANGER_GET_ELEMENT_STATUS
  262. //
  263. //
  264. // Input buffer.
  265. //
  266. typedef struct _CHANGER_READ_ELEMENT_STATUS {
  267. //
  268. // List describing the elements and range on which to return information.
  269. //
  270. CHANGER_ELEMENT_LIST ElementList;
  271. //
  272. // Indicates whether volume tag information is to be returned.
  273. //
  274. BOOLEAN VolumeTagInfo;
  275. } CHANGER_READ_ELEMENT_STATUS, *PCHANGER_READ_ELEMENT_STATUS;
  276. //
  277. // Output buffer.
  278. //
  279. typedef struct _CHANGER_ELEMENT_STATUS {
  280. //
  281. // Element to which this structure refers.
  282. //
  283. CHANGER_ELEMENT Element;
  284. //
  285. // Address of the element from which the media was originally moved.
  286. // Valid if ELEMENT_STATUS_SVALID bit of Flags ULONG is set.
  287. // Needs to be converted to a zero-based offset from the device-unique value.
  288. //
  289. CHANGER_ELEMENT SrcElementAddress;
  290. //
  291. // See below.
  292. //
  293. ULONG Flags;
  294. //
  295. // See below for possible values.
  296. //
  297. ULONG ExceptionCode;
  298. //
  299. // Scsi Target Id of this element.
  300. // Valid only if ELEMENT_STATUS_ID_VALID is set in Flags.
  301. //
  302. UCHAR TargetId;
  303. //
  304. // LogicalUnitNumber of this element.
  305. // Valid only if ELEMENT_STATUS_LUN_VALID is set in Flags.
  306. //
  307. UCHAR Lun;
  308. USHORT Reserved;
  309. //
  310. // Primary volume identification for the media.
  311. // Valid only if ELEMENT_STATUS_PVOLTAG bit is set in Flags.
  312. //
  313. UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE];
  314. //
  315. // Alternate volume identification for the media.
  316. // Valid for two-sided media only, and pertains to the id. of the inverted side.
  317. // Valid only if ELEMENT_STATUS_AVOLTAG bit is set in Flags.
  318. //
  319. UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE];
  320. } CHANGER_ELEMENT_STATUS, *PCHANGER_ELEMENT_STATUS;
  321. //
  322. // Output buffer. This is same as CHANGER_ELEMENT_STATUS with
  323. // the addition of product info fields. New applications should
  324. // use this struct instead of the older CHANGER_ELEMENT_STATUS
  325. //
  326. typedef struct _CHANGER_ELEMENT_STATUS_EX {
  327. //
  328. // Element to which this structure refers.
  329. //
  330. CHANGER_ELEMENT Element;
  331. //
  332. // Address of the element from which the media was originally moved.
  333. // Valid if ELEMENT_STATUS_SVALID bit of Flags ULONG is set.
  334. // Needs to be converted to a zero-based offset from the device-unique value.
  335. //
  336. CHANGER_ELEMENT SrcElementAddress;
  337. //
  338. // See below.
  339. //
  340. ULONG Flags;
  341. //
  342. // See below for possible values.
  343. //
  344. ULONG ExceptionCode;
  345. //
  346. // Scsi Target Id of this element.
  347. // Valid only if ELEMENT_STATUS_ID_VALID is set in Flags.
  348. //
  349. UCHAR TargetId;
  350. //
  351. // LogicalUnitNumber of this element.
  352. // Valid only if ELEMENT_STATUS_LUN_VALID is set in Flags.
  353. //
  354. UCHAR Lun;
  355. USHORT Reserved;
  356. //
  357. // Primary volume identification for the media.
  358. // Valid only if ELEMENT_STATUS_PVOLTAG bit is set in Flags.
  359. //
  360. UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE];
  361. //
  362. // Alternate volume identification for the media.
  363. // Valid for two-sided media only, and pertains to the id. of the inverted side.
  364. // Valid only if ELEMENT_STATUS_AVOLTAG bit is set in Flags.
  365. //
  366. UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE];
  367. //
  368. // Vendor ID
  369. //
  370. UCHAR VendorIdentification[VENDOR_ID_LENGTH];
  371. //
  372. // Product ID
  373. //
  374. UCHAR ProductIdentification[PRODUCT_ID_LENGTH];
  375. //
  376. // Serial number
  377. //
  378. UCHAR SerialNumber[SERIAL_NUMBER_LENGTH];
  379. } CHANGER_ELEMENT_STATUS_EX, *PCHANGER_ELEMENT_STATUS_EX;
  380. //
  381. // Possible flag values
  382. //
  383. #define ELEMENT_STATUS_FULL 0x00000001 // Element contains a unit of media.
  384. #define ELEMENT_STATUS_IMPEXP 0x00000002 // Media in i/e port was placed there by an operator.
  385. #define ELEMENT_STATUS_EXCEPT 0x00000004 // Element is in an abnormal state; check ExceptionCode field for more information.
  386. #define ELEMENT_STATUS_ACCESS 0x00000008 // Access to the i/e port from the medium changer is allowed.
  387. #define ELEMENT_STATUS_EXENAB 0x00000010 // Export of media is supported.
  388. #define ELEMENT_STATUS_INENAB 0x00000020 // Import of media is supported.
  389. #define ELEMENT_STATUS_PRODUCT_DATA 0x00000040 // Serial number valid for the drive
  390. #define ELEMENT_STATUS_LUN_VALID 0x00001000 // Lun information is valid.
  391. #define ELEMENT_STATUS_ID_VALID 0x00002000 // SCSI Id information is valid.
  392. #define ELEMENT_STATUS_NOT_BUS 0x00008000 // Lun and SCSI Id fields are not on same bus as medium changer.
  393. #define ELEMENT_STATUS_INVERT 0x00400000 // Media in element was inverted (valid only if ELEMENT_STATUS_SVALID bit is set)
  394. #define ELEMENT_STATUS_SVALID 0x00800000 // SourceElementAddress field and ELEMENT_STATUS_INVERT bit are valid.
  395. #define ELEMENT_STATUS_PVOLTAG 0x10000000 // Primary volume information is valid.
  396. #define ELEMENT_STATUS_AVOLTAG 0x20000000 // Alternate volume information is valid.
  397. //
  398. // ExceptionCode values.
  399. //
  400. #define ERROR_LABEL_UNREADABLE 0x00000001 // Bar code scanner could not read bar code label.
  401. #define ERROR_LABEL_QUESTIONABLE 0x00000002 // Label could be invalid due to unit attention condition.
  402. #define ERROR_SLOT_NOT_PRESENT 0x00000004 // Slot is currently not addressable in the device.
  403. #define ERROR_DRIVE_NOT_INSTALLED 0x00000008 // Drive is not installed.
  404. #define ERROR_TRAY_MALFUNCTION 0x00000010 // Media tray is malfunctioning/broken.
  405. #define ERROR_INIT_STATUS_NEEDED 0x00000011 // An Initialize Element Status command is needed.
  406. #define ERROR_UNHANDLED_ERROR 0xFFFFFFFF // Unknown error condition
  407. //
  408. // Definitions for IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS
  409. //
  410. typedef struct _CHANGER_INITIALIZE_ELEMENT_STATUS {
  411. //
  412. // List describing the elements and range on which to initialize.
  413. //
  414. CHANGER_ELEMENT_LIST ElementList;
  415. //
  416. // Indicates whether a bar code scan should be used. Only applicable if
  417. // CHANGER_BAR_CODE_SCANNER_INSTALLED is set in Features0 of CHANGER_GET_PARAMETERS.
  418. //
  419. BOOLEAN BarCodeScan;
  420. } CHANGER_INITIALIZE_ELEMENT_STATUS, *PCHANGER_INITIALIZE_ELEMENT_STATUS;
  421. //
  422. // Definitions for IOCTL_CHANGER_SET_POSITION
  423. //
  424. typedef struct _CHANGER_SET_POSITION {
  425. //
  426. // Indicates which transport to move.
  427. //
  428. CHANGER_ELEMENT Transport;
  429. //
  430. // Indicates the final destination of the transport.
  431. //
  432. CHANGER_ELEMENT Destination;
  433. //
  434. // Indicates whether the media currently carried by Transport, should be flipped.
  435. //
  436. BOOLEAN Flip;
  437. } CHANGER_SET_POSITION, *PCHANGER_SET_POSITION;
  438. //
  439. // Definitions for IOCTL_CHANGER_EXCHANGE_MEDIUM
  440. //
  441. typedef struct _CHANGER_EXCHANGE_MEDIUM {
  442. //
  443. // Indicates which transport to use for the exchange operation.
  444. //
  445. CHANGER_ELEMENT Transport;
  446. //
  447. // Indicates the source for the media that is to be moved.
  448. //
  449. CHANGER_ELEMENT Source;
  450. //
  451. // Indicates the final destination of the media originally at Source.
  452. //
  453. CHANGER_ELEMENT Destination1;
  454. //
  455. // Indicates the destination of the media moved from Destination1.
  456. //
  457. CHANGER_ELEMENT Destination2;
  458. //
  459. // Indicates whether the medium should be flipped.
  460. //
  461. BOOLEAN Flip1;
  462. BOOLEAN Flip2;
  463. } CHANGER_EXCHANGE_MEDIUM, *PCHANGER_EXCHANGE_MEDIUM;
  464. //
  465. // Definitions for IOCTL_CHANGER_MOVE_MEDIUM
  466. //
  467. typedef struct _CHANGER_MOVE_MEDIUM {
  468. //
  469. // Indicates which transport to use for the move operation.
  470. //
  471. CHANGER_ELEMENT Transport;
  472. //
  473. // Indicates the source for the media that is to be moved.
  474. //
  475. CHANGER_ELEMENT Source;
  476. //
  477. // Indicates the destination of the media originally at Source.
  478. //
  479. CHANGER_ELEMENT Destination;
  480. //
  481. // Indicates whether the media should be flipped.
  482. //
  483. BOOLEAN Flip;
  484. } CHANGER_MOVE_MEDIUM, *PCHANGER_MOVE_MEDIUM;
  485. //
  486. // Definitions for IOCTL_QUERY_VOLUME_TAGS
  487. //
  488. //
  489. // Input buffer.
  490. //
  491. typedef struct _CHANGER_SEND_VOLUME_TAG_INFORMATION {
  492. //
  493. // Describes the starting element for which to return information.
  494. //
  495. CHANGER_ELEMENT StartingElement;
  496. //
  497. // Indicates the specific action to perform. See below.
  498. //
  499. ULONG ActionCode;
  500. //
  501. // Template used by the device to search for volume ids.
  502. //
  503. UCHAR VolumeIDTemplate[MAX_VOLUME_TEMPLATE_SIZE];
  504. } CHANGER_SEND_VOLUME_TAG_INFORMATION, *PCHANGER_SEND_VOLUME_TAG_INFORMATION;
  505. //
  506. // Output buffer.
  507. //
  508. typedef struct _READ_ELEMENT_ADDRESS_INFO {
  509. //
  510. // Number of elements matching criteria set forth by ActionCode.
  511. //
  512. ULONG NumberOfElements;
  513. //
  514. // Array of CHANGER_ELEMENT_STATUS structures, one for each element that corresponded
  515. // with the information passed in with the CHANGER_SEND_VOLUME_TAG_INFORMATION structure.
  516. //
  517. CHANGER_ELEMENT_STATUS ElementStatus[1];
  518. } READ_ELEMENT_ADDRESS_INFO, *PREAD_ELEMENT_ADDRESS_INFO;
  519. //
  520. // Possible ActionCode values. See Features0 of CHANGER_GET_PARAMETERS for compatibility with
  521. // the current device.
  522. //
  523. #define SEARCH_ALL 0x0 // Translate - search all defined volume tags.
  524. #define SEARCH_PRIMARY 0x1 // Translate - search only primary volume tags.
  525. #define SEARCH_ALTERNATE 0x2 // Translate - search only alternate volume tags.
  526. #define SEARCH_ALL_NO_SEQ 0x4 // Translate - search all defined volume tags but ignore sequence numbers.
  527. #define SEARCH_PRI_NO_SEQ 0x5 // Translate - search only primary volume tags but ignore sequence numbers.
  528. #define SEARCH_ALT_NO_SEQ 0x6 // Translate - search only alternate volume tags but ignore sequence numbers.
  529. #define ASSERT_PRIMARY 0x8 // Assert - as the primary volume tag - if tag now undefined.
  530. #define ASSERT_ALTERNATE 0x9 // Assert - as the alternate volume tag - if tag now undefined.
  531. #define REPLACE_PRIMARY 0xA // Replace - the primary volume tag - current tag ignored.
  532. #define REPLACE_ALTERNATE 0xB // Replace - the alternate volume tag - current tag ignored.
  533. #define UNDEFINE_PRIMARY 0xC // Undefine - the primary volume tag - current tag ignored.
  534. #define UNDEFINE_ALTERNATE 0xD // Undefine - the alternate volume tag - current tag ignored.
  535. //
  536. // Changer diagnostic test related definitions
  537. //
  538. typedef enum _CHANGER_DEVICE_PROBLEM_TYPE {
  539. DeviceProblemNone,
  540. DeviceProblemHardware,
  541. DeviceProblemCHMError,
  542. DeviceProblemDoorOpen,
  543. DeviceProblemCalibrationError,
  544. DeviceProblemTargetFailure,
  545. DeviceProblemCHMMoveError,
  546. DeviceProblemCHMZeroError,
  547. DeviceProblemCartridgeInsertError,
  548. DeviceProblemPositionError,
  549. DeviceProblemSensorError,
  550. DeviceProblemCartridgeEjectError,
  551. DeviceProblemGripperError,
  552. DeviceProblemDriveError
  553. } CHANGER_DEVICE_PROBLEM_TYPE, *PCHANGER_DEVICE_PROBLEM_TYPE;
  554. // end_winioctl
  555. #ifdef __cplusplus
  556. }
  557. #endif
  558. #endif // _NTDDCHGR_H_