ReactOS  0.4.15-dev-506-ga3ec01c
parallel.h
Go to the documentation of this file.
1 /*
2  * parallel.h
3  *
4  * ParPort driver 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 #ifndef __PARALLEL_H
24 #define __PARALLEL_H
25 
26 #include "ntddpar.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define DD_PARALLEL_PORT_BASE_NAME "ParallelPort"
33 #define DD_PARALLEL_PORT_BASE_NAME_U L"ParallelPort"
34 
35 #define IOCTL_INTERNAL_DESELECT_DEVICE \
36  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
37 #define IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO \
38  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS)
39 #define IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO \
40  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
41 #define IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO \
42  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
43 #define IOCTL_INTERNAL_INIT_1284_3_BUS \
44  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
45 #define IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE \
46  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
47 #define IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT \
48  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
49 #define IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT \
50  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
51 #define IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE \
52  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
53 #define IOCTL_INTERNAL_PARALLEL_PORT_FREE \
54  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 40, METHOD_BUFFERED, FILE_ANY_ACCESS)
55 #define IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE \
56  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS)
57 #define IOCTL_INTERNAL_RELEASE_PARALLEL_PORT_INFO \
58  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
59 #define IOCTL_INTERNAL_SELECT_DEVICE \
60  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
61 
62 
63 typedef struct _PARALLEL_1284_COMMAND {
68 
69 /* PARALLEL_1284_COMMAND.CommandFlags */
70 #define PAR_END_OF_CHAIN_DEVICE 0x00000001
71 #define PAR_HAVE_PORT_KEEP_PORT 0x00000002
72 
81 
82 typedef NTSTATUS
84  _In_ PVOID SetChipContext,
85  _In_ UCHAR ChipMode);
86 
87 typedef NTSTATUS
89  _In_ PVOID ClearChipContext,
90  _In_ UCHAR ChipMode);
91 
92 typedef NTSTATUS
94  _In_ PVOID ClearChipContext,
95  _In_ UCHAR ChipMode);
96 
97 typedef NTSTATUS
99  _In_ PVOID TrySelectContext,
100  _In_ PVOID TrySelectCommand);
101 
102 typedef NTSTATUS
104  _In_ PVOID DeselectContext,
105  _In_ PVOID DeselectCommand);
106 
107 /* PARALLEL_PNP_INFORMATION.HardwareCapabilities */
108 #define PPT_NO_HARDWARE_PRESENT 0x00000000
109 #define PPT_ECP_PRESENT 0x00000001
110 #define PPT_EPP_PRESENT 0x00000002
111 #define PPT_EPP_32_PRESENT 0x00000004
112 #define PPT_BYTE_PRESENT 0x00000008
113 #define PPT_BIDI_PRESENT 0x00000008
114 #define PPT_1284_3_PRESENT 0x00000010
115 
135 
136 typedef BOOLEAN
138  _In_ PVOID TryAllocateContext);
139 
140 typedef VOID
142  _In_ PVOID FreeContext);
143 
144 typedef ULONG
146  _In_ PVOID QueryAllocsContext);
147 
157 
158 /* PARALLEL_CHIP_MODE.ModeFlags */
159 #define INITIAL_MODE 0x00
160 #define PARCHIP_ECR_ARBITRATOR 0x01
161 
162 typedef struct _PARALLEL_CHIP_MODE {
166 
167 typedef VOID
170 
177 
178 
179 #define IOCTL_INTERNAL_DISCONNECT_IDLE \
180  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS)
181 #define IOCTL_INTERNAL_LOCK_PORT \
182  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS)
183 #define IOCTL_INTERNAL_LOCK_PORT_NO_SELECT \
184  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 52, METHOD_BUFFERED, FILE_ANY_ACCESS)
185 #define IOCTL_INTERNAL_PARCLASS_CONNECT \
186  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
187 #define IOCTL_INTERNAL_PARCLASS_DISCONNECT \
188  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
189 #define IOCTL_INTERNAL_UNLOCK_PORT \
190  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS)
191 #define IOCTL_INTERNAL_UNLOCK_PORT_NO_DESELECT \
192  CTL_CODE (FILE_DEVICE_PARALLEL_PORT, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
193 
194 typedef USHORT
196  _In_ PVOID Context);
197 
198 typedef enum _PARALLEL_SAFETY {
202 
203 typedef NTSTATUS
206  _In_ USHORT ModeMaskFwd,
207  _In_ USHORT ModeMaskRev,
208  _In_ PARALLEL_SAFETY ModeSafety,
209  _In_ BOOLEAN IsForward);
210 
211 typedef NTSTATUS
213  _In_ PVOID Context);
214 
215 typedef NTSTATUS
217  _In_ PVOID Context);
218 
219 typedef NTSTATUS
221  _In_ PVOID Context);
222 
223 typedef NTSTATUS
226  _Out_writes_bytes_to_(NumBytesToRead, *NumBytesRead) PVOID Buffer,
227  _In_ ULONG NumBytesToRead,
228  _Out_ PULONG NumBytesRead,
229  _In_ UCHAR Channel);
230 
231 typedef NTSTATUS
234  _In_reads_bytes_(NumBytesToWrite) PVOID Buffer,
235  _In_ ULONG NumBytesToWrite,
236  _Out_ PULONG NumBytesWritten,
237  _In_ UCHAR Channel);
238 
239 typedef NTSTATUS
243 
244 typedef NTSTATUS
248 
249 typedef struct _PARCLASS_INFORMATION {
267 
268 #ifdef __cplusplus
269 }
270 #endif
271 
272 #endif /* __PARALLEL_H */
PPARALLEL_IEEE_REV_TO_FWD IeeeRevToFwdMode
Definition: parallel.h:257
PPARALLEL_READ ParallelRead
Definition: parallel.h:258
PPARALLEL_QUERY_WAITERS_ROUTINE QueryNumWaiters
Definition: parallel.h:154
struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE PARALLEL_INTERRUPT_SERVICE_ROUTINE
struct _PARALLEL_PNP_INFORMATION * PPARALLEL_PNP_INFORMATION
enum _INTERFACE_TYPE INTERFACE_TYPE
USHORT(NTAPI * PDETERMINE_IEEE_MODES)(_In_ PVOID Context)
Definition: parallel.h:195
#define _Out_writes_bytes_to_(size, count)
Definition: no_sal2.h:374
NTSTATUS(NTAPI * PPARALLEL_SET_CHIP_MODE)(_In_ PVOID SetChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:83
struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE * PPARALLEL_INTERRUPT_SERVICE_ROUTINE
uint16_t * PWSTR
Definition: typedefs.h:55
unsigned char * PUCHAR
Definition: retypes.h:3
NTSTATUS(NTAPI * PNEGOTIATE_IEEE_MODE)(_In_ PVOID Context, _In_ USHORT ModeMaskFwd, _In_ USHORT ModeMaskRev, _In_ PARALLEL_SAFETY ModeSafety, _In_ BOOLEAN IsForward)
Definition: parallel.h:204
NTSTATUS(NTAPI * PPARALLEL_IEEE_FWD_TO_REV)(_In_ PVOID Context)
Definition: parallel.h:216
PHYSICAL_ADDRESS OriginalEcpController
Definition: parallel.h:117
PHYSICAL_ADDRESS OriginalController
Definition: parallel.h:149
enum _PARALLEL_SAFETY PARALLEL_SAFETY
_PARALLEL_SAFETY
Definition: parallel.h:198
PPARALLEL_TRY_SELECT_ROUTINE TrySelectDevice
Definition: parallel.h:129
PPARALLEL_DESELECT_ROUTINE DeselectDevice
Definition: parallel.h:130
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:500
struct _PARALLEL_PORT_INFORMATION * PPARALLEL_PORT_INFORMATION
PPARALLEL_SET_CHIP_MODE TrySetChipMode
Definition: parallel.h:122
struct _PARALLEL_PNP_INFORMATION PARALLEL_PNP_INFORMATION
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS(NTAPI * PPARALLEL_READ)(_In_ PVOID Context, _Out_writes_bytes_to_(NumBytesToRead, *NumBytesRead) PVOID Buffer, _In_ ULONG NumBytesToRead, _Out_ PULONG NumBytesRead, _In_ UCHAR Channel)
Definition: parallel.h:224
struct _MORE_PARALLEL_PORT_INFORMATION MORE_PARALLEL_PORT_INFORMATION
PKSERVICE_ROUTINE InterruptServiceRoutine
Definition: parallel.h:172
unsigned char BOOLEAN
enum _KINTERRUPT_MODE KINTERRUPT_MODE
struct _MORE_PARALLEL_PORT_INFORMATION * PMORE_PARALLEL_PORT_INFORMATION
PPARALLEL_TRYSELECT_DEVICE ParallelTryselect
Definition: parallel.h:264
#define _Out_
Definition: no_sal2.h:323
PPARALLEL_WRITE ParallelWrite
Definition: parallel.h:259
VOID(NTAPI * PPARALLEL_DEFERRED_ROUTINE)(_In_ PVOID DeferredContext)
Definition: parallel.h:168
PPARALLEL_TRY_ALLOCATE_ROUTINE TryAllocatePort
Definition: parallel.h:152
NTSTATUS(NTAPI * PPARALLEL_TRYSELECT_DEVICE)(_In_ PVOID Context, _In_ PARALLEL_1284_COMMAND Command)
Definition: parallel.h:240
PTERMINATE_IEEE_MODE TerminateIeeeMode
Definition: parallel.h:255
KINTERRUPT_MODE InterruptMode
Definition: parallel.h:79
struct _PARCLASS_INFORMATION * PPARCLASS_INFORMATION
struct _PARALLEL_PORT_INFORMATION PARALLEL_PORT_INFORMATION
struct _PARALLEL_CHIP_MODE * PPARALLEL_CHIP_MODE
PPARALLEL_CLEAR_CHIP_MODE ClearChipMode
Definition: parallel.h:123
PDETERMINE_IEEE_MODES DetermineIeeeModes
Definition: parallel.h:253
struct Command Command
NTSTATUS(NTAPI * PPARALLEL_DESELECT_ROUTINE)(_In_ PVOID DeselectContext, _In_ PVOID DeselectCommand)
Definition: parallel.h:103
struct _PARALLEL_CHIP_MODE PARALLEL_CHIP_MODE
struct _PARCLASS_INFORMATION PARCLASS_INFORMATION
unsigned char UCHAR
Definition: xmlstorage.h:181
PPARALLEL_IEEE_FWD_TO_REV IeeeFwdToRevMode
Definition: parallel.h:256
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
ULONG HardwareCapabilities
Definition: parallel.h:261
#define _In_
Definition: no_sal2.h:204
ULONG(NTAPI * PPARALLEL_QUERY_WAITERS_ROUTINE)(_In_ PVOID QueryAllocsContext)
Definition: parallel.h:145
NTSTATUS(NTAPI * PPARALLEL_WRITE)(_In_ PVOID Context, _In_reads_bytes_(NumBytesToWrite) PVOID Buffer, _In_ ULONG NumBytesToWrite, _Out_ PULONG NumBytesWritten, _In_ UCHAR Channel)
Definition: parallel.h:232
unsigned short USHORT
Definition: pedump.c:61
ULONG_PTR KAFFINITY
Definition: compat.h:75
PNEGOTIATE_IEEE_MODE NegotiateIeeeMode
Definition: parallel.h:254
NTSTATUS(NTAPI * PPARCHIP_CLEAR_CHIP_MODE)(_In_ PVOID ClearChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:93
VOID(NTAPI * PPARALLEL_FREE_ROUTINE)(_In_ PVOID FreeContext)
Definition: parallel.h:141
BOOLEAN(NTAPI * PPARALLEL_TRY_ALLOCATE_ROUTINE)(_In_ PVOID TryAllocateContext)
Definition: parallel.h:137
unsigned int * PULONG
Definition: retypes.h:1
INTERFACE_TYPE InterfaceType
Definition: parallel.h:74
struct _PARALLEL_1284_COMMAND PARALLEL_1284_COMMAND
NTSTATUS(NTAPI * PPARALLEL_IEEE_REV_TO_FWD)(_In_ PVOID Context)
Definition: parallel.h:220
#define BOOLEAN
Definition: pedump.c:73
PPARALLEL_DEFERRED_ROUTINE DeferredPortCheckRoutine
Definition: parallel.h:174
PHYSICAL_ADDRESS EppControllerPhysicalAddress
Definition: parallel.h:126
struct tagContext Context
Definition: acpixf.h:1034
PPARALLEL_FREE_ROUTINE FreePort
Definition: parallel.h:153
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS(NTAPI * PTERMINATE_IEEE_MODE)(_In_ PVOID Context)
Definition: parallel.h:212
NTSTATUS(NTAPI * PPARALLEL_TRY_SELECT_ROUTINE)(_In_ PVOID TrySelectContext, _In_ PVOID TrySelectCommand)
Definition: parallel.h:98
PPARALLEL_DESELECT_DEVICE ParallelDeSelect
Definition: parallel.h:265
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
struct _PARALLEL_1284_COMMAND * PPARALLEL_1284_COMMAND
NTSTATUS(NTAPI * PPARALLEL_CLEAR_CHIP_MODE)(_In_ PVOID ClearChipContext, _In_ UCHAR ChipMode)
Definition: parallel.h:88
NTSTATUS(NTAPI * PPARALLEL_DESELECT_DEVICE)(_In_ PVOID Context, _In_ PARALLEL_1284_COMMAND Command)
Definition: parallel.h:245
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675