ReactOS  0.4.15-dev-1054-gd029a62
ntddchgr.h
Go to the documentation of this file.
1 /*
2  * ntddchgr.h
3  *
4  * Media changer IOCTL interface.
5  *
6  * This file is part of the w32api package.
7  *
8  * Contributors:
9  * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #pragma once
24 
25 #include "ntddstor.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define DD_CHANGER_DEVICE_NAME "\\Device\\Changer"
32 #define DD_CHANGER_DEVICE_NAME_U L"\\Device\\Changer"
33 
34 #define IOCTL_CHANGER_BASE FILE_DEVICE_CHANGER
35 
36 #define IOCTL_CHANGER_EXCHANGE_MEDIUM \
37  CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
38 
39 #define IOCTL_CHANGER_GET_ELEMENT_STATUS \
40  CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
41 
42 #define IOCTL_CHANGER_GET_PARAMETERS \
43  CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
44 
45 #define IOCTL_CHANGER_GET_PRODUCT_DATA \
46  CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
47 
48 #define IOCTL_CHANGER_GET_STATUS \
49  CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
50 
51 #define IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS \
52  CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
53 
54 #define IOCTL_CHANGER_MOVE_MEDIUM \
55  CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS)
56 
57 #define IOCTL_CHANGER_QUERY_VOLUME_TAGS \
58  CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
59 
60 #define IOCTL_CHANGER_REINITIALIZE_TRANSPORT \
61  CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
62 
63 #define IOCTL_CHANGER_SET_ACCESS \
64  CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
65 
66 #define IOCTL_CHANGER_SET_POSITION \
67  CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
68 
69 #define MAX_VOLUME_ID_SIZE 36
70 #define MAX_VOLUME_TEMPLATE_SIZE 40
71 
72 #define VENDOR_ID_LENGTH 8
73 #define PRODUCT_ID_LENGTH 16
74 #define REVISION_LENGTH 4
75 #define SERIAL_NUMBER_LENGTH 32
76 
77 /* GET_CHANGER_PARAMETERS.Features0 constants */
78 #define CHANGER_BAR_CODE_SCANNER_INSTALLED 0x00000001
79 #define CHANGER_INIT_ELEM_STAT_WITH_RANGE 0x00000002
80 #define CHANGER_CLOSE_IEPORT 0x00000004
81 #define CHANGER_OPEN_IEPORT 0x00000008
82 #define CHANGER_STATUS_NON_VOLATILE 0x00000010
83 #define CHANGER_EXCHANGE_MEDIA 0x00000020
84 #define CHANGER_CLEANER_SLOT 0x00000040
85 #define CHANGER_LOCK_UNLOCK 0x00000080
86 #define CHANGER_CARTRIDGE_MAGAZINE 0x00000100
87 #define CHANGER_MEDIUM_FLIP 0x00000200
88 #define CHANGER_POSITION_TO_ELEMENT 0x00000400
89 #define CHANGER_REPORT_IEPORT_STATE 0x00000800
90 #define CHANGER_STORAGE_DRIVE 0x00001000
91 #define CHANGER_STORAGE_IEPORT 0x00002000
92 #define CHANGER_STORAGE_SLOT 0x00004000
93 #define CHANGER_STORAGE_TRANSPORT 0x00008000
94 #define CHANGER_DRIVE_CLEANING_REQUIRED 0x00010000
95 #define CHANGER_PREDISMOUNT_EJECT_REQUIRED 0x00020000
96 #define CHANGER_CLEANER_ACCESS_NOT_VALID 0x00040000
97 #define CHANGER_PREMOUNT_EJECT_REQUIRED 0x00080000
98 #define CHANGER_VOLUME_IDENTIFICATION 0x00100000
99 #define CHANGER_VOLUME_SEARCH 0x00200000
100 #define CHANGER_VOLUME_ASSERT 0x00400000
101 #define CHANGER_VOLUME_REPLACE 0x00800000
102 #define CHANGER_VOLUME_UNDEFINE 0x01000000
103 #define CHANGER_SERIAL_NUMBER_VALID 0x04000000
104 #define CHANGER_DEVICE_REINITIALIZE_CAPABLE 0x08000000
105 #define CHANGER_KEYPAD_ENABLE_DISABLE 0x10000000
106 #define CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS 0x20000000
107 #define CHANGER_RESERVED_BIT 0x80000000
108 
109 /* GET_CHANGER_PARAMETERS.Features1 constants */
110 #define CHANGER_PREDISMOUNT_ALIGN_TO_SLOT 0x80000001
111 #define CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE 0x80000002
112 #define CHANGER_CLEANER_AUTODISMOUNT 0x80000004
113 #define CHANGER_TRUE_EXCHANGE_CAPABLE 0x80000008
114 #define CHANGER_SLOTS_USE_TRAYS 0x80000010
115 #define CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR 0x80000020
116 #define CHANGER_CLEANER_OPS_NOT_SUPPORTED 0x80000040
117 #define CHANGER_IEPORT_USER_CONTROL_OPEN 0x80000080
118 #define CHANGER_IEPORT_USER_CONTROL_CLOSE 0x80000100
119 #define CHANGER_MOVE_EXTENDS_IEPORT 0x80000200
120 #define CHANGER_MOVE_RETRACTS_IEPORT 0x80000400
121 
122 /* GET_CHANGER_PARAMETERS.MoveFrom,ExchangeFrom,PositionCapabilities constants */
123 #define CHANGER_TO_TRANSPORT 0x01
124 #define CHANGER_TO_SLOT 0x02
125 #define CHANGER_TO_IEPORT 0x04
126 #define CHANGER_TO_DRIVE 0x08
127 
128 /* GET_CHANGER_PARAMETERS.LockUnlockCapabilities constants */
129 #define LOCK_UNLOCK_IEPORT 0x01
130 #define LOCK_UNLOCK_DOOR 0x02
131 #define LOCK_UNLOCK_KEYPAD 0x04
132 
133 /* CHANGER_SET_ACCESS.Control constants */
134 #define LOCK_ELEMENT 0
135 #define UNLOCK_ELEMENT 1
136 #define EXTEND_IEPORT 2
137 #define RETRACT_IEPORT 3
138 
139 /* CHANGER_ELEMENT_STATUS(_EX).Flags constants */
140 #define ELEMENT_STATUS_FULL 0x00000001
141 #define ELEMENT_STATUS_IMPEXP 0x00000002
142 #define ELEMENT_STATUS_EXCEPT 0x00000004
143 #define ELEMENT_STATUS_ACCESS 0x00000008
144 #define ELEMENT_STATUS_EXENAB 0x00000010
145 #define ELEMENT_STATUS_INENAB 0x00000020
146 #define ELEMENT_STATUS_PRODUCT_DATA 0x00000040
147 #define ELEMENT_STATUS_LUN_VALID 0x00001000
148 #define ELEMENT_STATUS_ID_VALID 0x00002000
149 #define ELEMENT_STATUS_NOT_BUS 0x00008000
150 #define ELEMENT_STATUS_INVERT 0x00400000
151 #define ELEMENT_STATUS_SVALID 0x00800000
152 #define ELEMENT_STATUS_PVOLTAG 0x10000000
153 #define ELEMENT_STATUS_AVOLTAG 0x20000000
154 
155 /* CHANGER_ELEMENT_STATUS(_EX).ExceptionCode constants */
156 #define ERROR_LABEL_UNREADABLE 0x00000001
157 #define ERROR_LABEL_QUESTIONABLE 0x00000002
158 #define ERROR_SLOT_NOT_PRESENT 0x00000004
159 #define ERROR_DRIVE_NOT_INSTALLED 0x00000008
160 #define ERROR_TRAY_MALFUNCTION 0x00000010
161 #define ERROR_INIT_STATUS_NEEDED 0x00000011
162 #define ERROR_UNHANDLED_ERROR 0xFFFFFFFF
163 
164 /* CHANGER_SEND_VOLUME_TAG_INFORMATION.ActionCode constants */
165 #define SEARCH_ALL 0x0
166 #define SEARCH_PRIMARY 0x1
167 #define SEARCH_ALTERNATE 0x2
168 #define SEARCH_ALL_NO_SEQ 0x4
169 #define SEARCH_PRI_NO_SEQ 0x5
170 #define SEARCH_ALT_NO_SEQ 0x6
171 #define ASSERT_PRIMARY 0x8
172 #define ASSERT_ALTERNATE 0x9
173 #define REPLACE_PRIMARY 0xA
174 #define REPLACE_ALTERNATE 0xB
175 #define UNDEFINE_PRIMARY 0xC
176 #define UNDEFINE_ALTERNATE 0xD
177 
178 typedef enum _ELEMENT_TYPE {
188 
189 typedef struct _CHANGER_ELEMENT {
193 
194 typedef struct _CHANGER_ELEMENT_LIST {
198 
199 typedef struct _GET_CHANGER_PARAMETERS {
229 
230 typedef struct _CHANGER_PRODUCT_DATA {
237 
238 typedef struct _CHANGER_SET_ACCESS {
242 
247 
248 typedef struct _CHANGER_ELEMENT_STATUS {
259 
274 
279 
280 typedef struct _CHANGER_SET_POSITION {
285 
286 typedef struct _CHANGER_EXCHANGE_MEDIUM {
294 
295 typedef struct _CHANGER_MOVE_MEDIUM {
301 
307 
312 
329 
330 #ifdef __cplusplus
331 }
332 #endif
struct _CHANGER_INITIALIZE_ELEMENT_STATUS * PCHANGER_INITIALIZE_ELEMENT_STATUS
_ELEMENT_TYPE
Definition: ntddchgr.h:178
CHANGER_ELEMENT Transport
Definition: ntddchgr.h:287
CHANGER_ELEMENT Element
Definition: ntddchgr.h:261
UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE]
Definition: ntddchgr.h:257
enum _ELEMENT_TYPE ELEMENT_TYPE
CHANGER_ELEMENT Element
Definition: ntddchgr.h:195
UCHAR VolumeIDTemplate[MAX_VOLUME_TEMPLATE_SIZE]
Definition: ntddchgr.h:305
UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE]
Definition: ntddchgr.h:268
USHORT NumberTransportElements
Definition: ntddchgr.h:201
CHANGER_ELEMENT_STATUS ElementStatus[1]
Definition: ntddchgr.h:310
struct _CHANGER_READ_ELEMENT_STATUS * PCHANGER_READ_ELEMENT_STATUS
ELEMENT_TYPE ElementType
Definition: ntddchgr.h:190
CHANGER_ELEMENT Transport
Definition: ntddchgr.h:281
struct _CHANGER_SET_ACCESS * PCHANGER_SET_ACCESS
struct _CHANGER_SET_ACCESS CHANGER_SET_ACCESS
struct _CHANGER_ELEMENT_STATUS CHANGER_ELEMENT_STATUS
CHANGER_ELEMENT Source
Definition: ntddchgr.h:297
#define REVISION_LENGTH
Definition: ntddchgr.h:74
struct _CHANGER_EXCHANGE_MEDIUM CHANGER_EXCHANGE_MEDIUM
UCHAR SerialNumber[SERIAL_NUMBER_LENGTH]
Definition: ntddchgr.h:272
UCHAR SerialNumber[SERIAL_NUMBER_LENGTH]
Definition: ntddchgr.h:234
CHANGER_ELEMENT SrcElementAddress
Definition: ntddchgr.h:250
struct _CHANGER_SET_POSITION CHANGER_SET_POSITION
struct READ_ELEMENT_ADDRESS_INFO READ_ELEMENT_ADDRESS_INFO
CHANGER_ELEMENT Element
Definition: ntddchgr.h:249
USHORT NumberStorageElements
Definition: ntddchgr.h:202
struct _CHANGER_ELEMENT_LIST CHANGER_ELEMENT_LIST
#define MAX_VOLUME_TEMPLATE_SIZE
Definition: ntddchgr.h:70
#define VENDOR_ID_LENGTH
Definition: ntddchgr.h:72
unsigned char BOOLEAN
USHORT NumberDataTransferElements
Definition: ntddchgr.h:205
enum _CHANGER_DEVICE_PROBLEM_TYPE * PCHANGER_DEVICE_PROBLEM_TYPE
_CHANGER_DEVICE_PROBLEM_TYPE
Definition: ntddchgr.h:313
UCHAR Revision[REVISION_LENGTH]
Definition: ntddchgr.h:233
UCHAR ProductId[PRODUCT_ID_LENGTH]
Definition: ntddchgr.h:232
struct _CHANGER_SEND_VOLUME_TAG_INFORMATION CHANGER_SEND_VOLUME_TAG_INFORMATION
struct _CHANGER_ELEMENT_STATUS * PCHANGER_ELEMENT_STATUS
struct _CHANGER_MOVE_MEDIUM * PCHANGER_MOVE_MEDIUM
struct _GET_CHANGER_PARAMETERS * PGET_CHANGER_PARAMETERS
struct _GET_CHANGER_PARAMETERS GET_CHANGER_PARAMETERS
CHANGER_ELEMENT Transport
Definition: ntddchgr.h:296
CHANGER_ELEMENT Element
Definition: ntddchgr.h:239
CHANGER_ELEMENT Destination
Definition: ntddchgr.h:282
struct _CHANGER_PRODUCT_DATA * PCHANGER_PRODUCT_DATA
CHANGER_ELEMENT_LIST ElementList
Definition: ntddchgr.h:276
struct _CHANGER_ELEMENT * PCHANGER_ELEMENT
unsigned char UCHAR
Definition: xmlstorage.h:181
CHANGER_ELEMENT Source
Definition: ntddchgr.h:288
USHORT FirstCleanerSlotAddress
Definition: ntddchgr.h:211
#define MAX_VOLUME_ID_SIZE
Definition: ntddchgr.h:69
struct _CHANGER_PRODUCT_DATA CHANGER_PRODUCT_DATA
struct _CHANGER_EXCHANGE_MEDIUM * PCHANGER_EXCHANGE_MEDIUM
struct _CHANGER_ELEMENT_LIST * PCHANGER_ELEMENT_LIST
#define PRODUCT_ID_LENGTH
Definition: ntddchgr.h:73
struct _CHANGER_SEND_VOLUME_TAG_INFORMATION * PCHANGER_SEND_VOLUME_TAG_INFORMATION
unsigned short USHORT
Definition: pedump.c:61
#define SERIAL_NUMBER_LENGTH
Definition: ntddchgr.h:75
enum _CHANGER_DEVICE_PROBLEM_TYPE CHANGER_DEVICE_PROBLEM_TYPE
UCHAR ProductIdentification[PRODUCT_ID_LENGTH]
Definition: ntddchgr.h:271
CHANGER_ELEMENT_LIST ElementList
Definition: ntddchgr.h:244
struct _CHANGER_MOVE_MEDIUM CHANGER_MOVE_MEDIUM
UCHAR VendorId[VENDOR_ID_LENGTH]
Definition: ntddchgr.h:231
struct _CHANGER_INITIALIZE_ELEMENT_STATUS CHANGER_INITIALIZE_ELEMENT_STATUS
CHANGER_ELEMENT SrcElementAddress
Definition: ntddchgr.h:262
UCHAR PrimaryVolumeID[MAX_VOLUME_ID_SIZE]
Definition: ntddchgr.h:256
ULONG ElementAddress
Definition: ntddchgr.h:191
unsigned int ULONG
Definition: retypes.h:1
CHANGER_ELEMENT Destination2
Definition: ntddchgr.h:290
struct READ_ELEMENT_ADDRESS_INFO * PREAD_ELEMENT_ADDRESS_INFO
CHANGER_ELEMENT Destination1
Definition: ntddchgr.h:289
UCHAR VendorIdentification[VENDOR_ID_LENGTH]
Definition: ntddchgr.h:270
enum _ELEMENT_TYPE * PELEMENT_TYPE
struct _CHANGER_ELEMENT_STATUS_EX * PCHANGER_ELEMENT_STATUS_EX
UCHAR AlternateVolumeID[MAX_VOLUME_ID_SIZE]
Definition: ntddchgr.h:269
struct _CHANGER_ELEMENT_STATUS_EX CHANGER_ELEMENT_STATUS_EX
struct _CHANGER_READ_ELEMENT_STATUS CHANGER_READ_ELEMENT_STATUS
CHANGER_ELEMENT Destination
Definition: ntddchgr.h:298
struct _CHANGER_SET_POSITION * PCHANGER_SET_POSITION
struct _CHANGER_ELEMENT CHANGER_ELEMENT