xref: /reactos/sdk/include/ddk/usbstorioctl.h (revision c2c66aff)
1*c2c66affSColin Finck #pragma once
2*c2c66affSColin Finck 
3*c2c66affSColin Finck #ifndef MAX_PATH
4*c2c66affSColin Finck #define MAX_PATH 260
5*c2c66affSColin Finck #endif
6*c2c66affSColin Finck 
7*c2c66affSColin Finck typedef struct tagACT_AUTHZ_STATE {
8*c2c66affSColin Finck   UCHAR ACT;
9*c2c66affSColin Finck   BOOLEAN fAuthorized;
10*c2c66affSColin Finck } ACT_AUTHZ_STATE, *PACT_AUTHZ_STATE;
11*c2c66affSColin Finck 
12*c2c66affSColin Finck typedef struct tagSILO_COMMAND {
13*c2c66affSColin Finck   UCHAR SiloIndex;
14*c2c66affSColin Finck   UCHAR Command;
15*c2c66affSColin Finck   ULONG cbCommandBuffer;
16*c2c66affSColin Finck   UCHAR rgbCommandBuffer[ANYSIZE_ARRAY];
17*c2c66affSColin Finck } SILO_COMMAND, *PSILO_COMMAND;
18*c2c66affSColin Finck 
19*c2c66affSColin Finck typedef enum _PDO_TYPE {
20*c2c66affSColin Finck   PDO_TYPE_UNDEFINED = 0,
21*c2c66affSColin Finck   PDO_TYPE_DISK,
22*c2c66affSColin Finck   PDO_TYPE_CONTROL,
23*c2c66affSColin Finck   PDO_TYPE_SILO,
24*c2c66affSColin Finck   PDO_TYPE_THIS = 256
25*c2c66affSColin Finck } PDO_TYPE;
26*c2c66affSColin Finck 
27*c2c66affSColin Finck typedef enum _PDO_STATE {
28*c2c66affSColin Finck   PDO_STATE_UNDEFINED = 0,
29*c2c66affSColin Finck   PDO_STATE_STARTED,
30*c2c66affSColin Finck   PDO_STATE_NOT_STARTED
31*c2c66affSColin Finck } PDO_STATE;
32*c2c66affSColin Finck 
33*c2c66affSColin Finck typedef enum _PDO_CAPS {
34*c2c66affSColin Finck   PDO_CAPABILITY_UNDEFINED = 0,
35*c2c66affSColin Finck   PDO_CAPABILITY_INC512_SET = 1,
36*c2c66affSColin Finck   PDO_CAPABILITY_INC512_CLEAR = 2
37*c2c66affSColin Finck } PDO_CAPS;
38*c2c66affSColin Finck 
39*c2c66affSColin Finck typedef struct _ENUM_PDO_ENTRY {
40*c2c66affSColin Finck   UCHAR type;
41*c2c66affSColin Finck   UCHAR state;
42*c2c66affSColin Finck   UCHAR capabilities;
43*c2c66affSColin Finck   ULONG ulSTID;
44*c2c66affSColin Finck   UCHAR bSpecificationMajor;
45*c2c66affSColin Finck   UCHAR bSpecificationMinor;
46*c2c66affSColin Finck   UCHAR bImplementationMajor;
47*c2c66affSColin Finck   UCHAR bImplementationMinor;
48*c2c66affSColin Finck   WCHAR wszDeviceInstancePath[(2 * MAX_PATH) + 1];
49*c2c66affSColin Finck } ENUM_PDO_ENTRY, *PENUM_PDO_ENTRY;
50*c2c66affSColin Finck 
51*c2c66affSColin Finck typedef struct _ENUM_PDO_RESULTS {
52*c2c66affSColin Finck   ULONG cEntries;
53*c2c66affSColin Finck   ENUM_PDO_ENTRY rgEntries[ANYSIZE_ARRAY];
54*c2c66affSColin Finck } ENUM_PDO_RESULTS, *PENUM_PDO_RESULTS;
55*c2c66affSColin Finck 
56*c2c66affSColin Finck #define SIZE_ENUM_PDO_RESULTS_HEADER (sizeof(ENUM_PDO_RESULTS) - sizeof(ENUM_PDO_ENTRY))
57*c2c66affSColin Finck 
58*c2c66affSColin Finck #define IOCTL_EHSTOR_DEVICE_SET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x501, METHOD_BUFFERED, FILE_ANY_ACCESS)
59*c2c66affSColin Finck #define IOCTL_EHSTOR_DEVICE_GET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x502, METHOD_BUFFERED, FILE_ANY_ACCESS)
60*c2c66affSColin Finck #define IOCTL_EHSTOR_DEVICE_SILO_COMMAND      CTL_CODE(IOCTL_STORAGE_BASE, 0x503, METHOD_BUFFERED, FILE_ANY_ACCESS)
61*c2c66affSColin Finck #define IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS    CTL_CODE(IOCTL_STORAGE_BASE, 0x504, METHOD_BUFFERED, FILE_ANY_ACCESS)
62*c2c66affSColin Finck 
63*c2c66affSColin Finck DEFINE_GUID(GUID_USBSTOR_EHSTOR_SILO_INTERFACE, 0x7c2bcf57, 0x2bea, 0x46da, 0xad, 0x26, 0x78, 0xfd, 0xc8, 0x3c, 0xee, 0x46);
64*c2c66affSColin Finck DEFINE_GUID(GUID_USBSTOR_EHSTOR_CONTROL_INTERFACE, 0x4f40006f, 0xb933, 0x4550, 0xb5, 0x32, 0x2b, 0x58, 0xce, 0xe6, 0x14, 0xd3);
65