ReactOS  0.4.15-dev-489-g75a0787
usbscan.h
Go to the documentation of this file.
1 /*
2  * usbscan.h
3  *
4  * USB scanner definitions
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 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #if (NTDDI_VERSION >= NTDDI_WIN2K)
30 
31 #pragma pack(push,8)
32 
33 #ifndef MAX_NUM_PIPES
34 #define MAX_NUM_PIPES 8
35 #endif
36 
37 #define BULKIN_FLAG 0x80
38 
39 typedef struct _DRV_VERSION {
42  _Out_ ULONG internal;
44 
45 typedef struct _IO_BLOCK {
51 
52 typedef struct _IO_BLOCK_EX {
61 
62 typedef struct _CHANNEL_INFO {
67 
68 typedef enum _PIPE_TYPE {
73 } PIPE_TYPE;
74 
75 typedef struct _USBSCAN_GET_DESCRIPTOR {
80 
81 typedef struct _DEVICE_DESCRIPTOR {
87 
88 typedef enum _RAW_PIPE_TYPE {
94 
95 typedef struct _USBSCAN_PIPE_INFORMATION {
101 
106 
107 #if (NTDDI_VERSION >= NTDDI_WINXP)
108 typedef struct _USBSCAN_TIMEOUT {
113 #endif
114 
115 #define FILE_DEVICE_USB_SCAN 0x8000
116 #define IOCTL_INDEX 0x0800
117 
118 #define IOCTL_GET_VERSION \
119  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 0, METHOD_BUFFERED,FILE_ANY_ACCESS)
120 
121 #define IOCTL_CANCEL_IO \
122  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 1, METHOD_BUFFERED,FILE_ANY_ACCESS)
123 
124 #define IOCTL_WAIT_ON_DEVICE_EVENT \
125  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 2, METHOD_BUFFERED,FILE_ANY_ACCESS)
126 
127 #define IOCTL_READ_REGISTERS \
128  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 3, METHOD_BUFFERED,FILE_ANY_ACCESS)
129 
130 #define IOCTL_WRITE_REGISTERS \
131  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
132 
133 #define IOCTL_GET_CHANNEL_ALIGN_RQST \
134  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 5, METHOD_BUFFERED,FILE_ANY_ACCESS)
135 
136 #define IOCTL_GET_DEVICE_DESCRIPTOR \
137  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 6, METHOD_BUFFERED,FILE_ANY_ACCESS)
138 
139 #define IOCTL_RESET_PIPE \
140  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 7, METHOD_BUFFERED,FILE_ANY_ACCESS)
141 
142 #define IOCTL_GET_USB_DESCRIPTOR \
143  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 8, METHOD_BUFFERED,FILE_ANY_ACCESS)
144 
145 #define IOCTL_SEND_USB_REQUEST \
146  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 9, METHOD_BUFFERED,FILE_ANY_ACCESS)
147 
148 #define IOCTL_GET_PIPE_CONFIGURATION \
149  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 10,METHOD_BUFFERED,FILE_ANY_ACCESS)
150 
151 #if (NTDDI_VERSION >= NTDDI_WINXP)
152 #define IOCTL_SET_TIMEOUT \
153  CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 11,METHOD_BUFFERED,FILE_ANY_ACCESS)
154 #endif
155 
156 #pragma pack(pop)
157 
158 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
159 
160 #ifdef __cplusplus
161 }
162 #endif
_Out_ ULONG NumberOfPipes
Definition: usbscan.h:103
_In_ UCHAR Index
Definition: usbscan.h:77
#define IN
Definition: typedefs.h:39
struct _USBSCAN_PIPE_INFORMATION * PUSBSCAN_PIPE_INFORMATION
_PIPE_TYPE
Definition: usbscan.h:68
_Out_ USHORT usProductId
Definition: usbscan.h:83
unsigned char * PUCHAR
Definition: retypes.h:3
_Out_writes_(NumberOfPipes) USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES]
_In_ ULONG uLength
Definition: usbscan.h:54
_RAW_PIPE_TYPE
Definition: usbscan.h:88
_In_ UCHAR bmRequestType
Definition: usbscan.h:58
_In_ ULONG uOffset
Definition: usbscan.h:53
IN ULONG TimeoutWrite
Definition: usbscan.h:110
struct _IO_BLOCK * PIO_BLOCK
IN ULONG TimeoutEvent
Definition: usbscan.h:111
_In_ UCHAR fTransferDirectionIn
Definition: usbscan.h:59
struct _IO_BLOCK_EX * PIO_BLOCK_EX
_Inout_updates_bytes_(uLength) PUCHAR pbyData
IN ULONG TimeoutRead
Definition: usbscan.h:109
_Out_ ULONG major
Definition: usbscan.h:40
struct _CHANNEL_INFO * PCHANNEL_INFO
#define _Out_
Definition: no_sal2.h:323
RAW_PIPE_TYPE PipeType
Definition: usbscan.h:99
_In_ ULONG uIndex
Definition: usbscan.h:49
struct _USBSCAN_GET_DESCRIPTOR USBSCAN_GET_DESCRIPTOR
_In_ PUSBD_PIPE_INFORMATION PipeInfo
Definition: hubbusif.h:294
_Out_ USHORT usVendorId
Definition: usbscan.h:82
struct _IO_BLOCK_EX IO_BLOCK_EX
struct _DRV_VERSION DRV_VERSION
_In_ USHORT LanguageId
Definition: usbscan.h:78
struct _USBSCAN_PIPE_CONFIGURATION USBSCAN_PIPE_CONFIGURATION
struct _DEVICE_DESCRIPTOR * PDEVICE_DESCRIPTOR
unsigned char UCHAR
Definition: xmlstorage.h:181
_Out_ USHORT usBcdDevice
Definition: usbscan.h:84
_Out_ ULONG minor
Definition: usbscan.h:41
_In_ UCHAR DescriptorType
Definition: usbscan.h:76
_Out_ ULONG uReadDataAlignment
Definition: usbscan.h:64
struct _USBSCAN_PIPE_CONFIGURATION * PUSBSCAN_PIPE_CONFIGURATION
#define MAX_NUM_PIPES
Definition: usbscan.h:34
_In_ ULONG uOffset
Definition: usbscan.h:46
_Inout_updates_bytes_(uLength) PUCHAR pbyData
struct _USBSCAN_GET_DESCRIPTOR * PUSBSCAN_GET_DESCRIPTOR
#define _In_
Definition: no_sal2.h:204
struct _USBSCAN_TIMEOUT USBSCAN_TIMEOUT
_Out_ ULONG uWriteDataAlignment
Definition: usbscan.h:65
_Out_ USHORT usLanguageId
Definition: usbscan.h:85
_In_ ULONG uLength
Definition: usbscan.h:47
unsigned short USHORT
Definition: pedump.c:61
enum _RAW_PIPE_TYPE RAW_PIPE_TYPE
struct _USBSCAN_PIPE_INFORMATION USBSCAN_PIPE_INFORMATION
_Out_ ULONG EventChannelSize
Definition: usbscan.h:63
struct _IO_BLOCK IO_BLOCK
struct _CHANNEL_INFO CHANNEL_INFO
struct _DEVICE_DESCRIPTOR DEVICE_DESCRIPTOR
unsigned int ULONG
Definition: retypes.h:1
_In_ UCHAR bRequest
Definition: usbscan.h:57
_In_ ULONG uIndex
Definition: usbscan.h:56
struct _USBSCAN_TIMEOUT * PUSBSCAN_TIMEOUT
struct _DRV_VERSION * PDRV_VERSION
enum _PIPE_TYPE PIPE_TYPE