Revert the sync.
[reactos.git] / include / ddk / d4drvif.h
1 /*
2 * d4drvif.h
3 *
4 * DOT4 driver 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 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #define MAX_SERVICE_LENGTH 40
30
31 #ifndef CTL_CODE
32
33 #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
34 ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
35 )
36
37 #define METHOD_BUFFERED 0
38 #define METHOD_IN_DIRECT 1
39 #define METHOD_OUT_DIRECT 2
40 #define METHOD_NEITHER 3
41
42 #define FILE_ANY_ACCESS 0
43 #define FILE_READ_ACCESS 0x0001
44 #define FILE_WRITE_ACCESS 0x0002
45
46 #endif /* CTL_CODE */
47
48 #define FILE_DEVICE_DOT4 0x3a
49 #define IOCTL_DOT4_USER_BASE 2049
50 #define IOCTL_DOT4_LAST IOCTL_DOT4_USER_BASE + 9
51
52 #define IOCTL_DOT4_ADD_ACTIVITY_BROADCAST \
53 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
54
55 #define IOCTL_DOT4_CLOSE_CHANNEL \
56 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
57
58 #define IOCTL_DOT4_CREATE_SOCKET \
59 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 7, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
60
61 #define IOCTL_DOT4_DESTROY_SOCKET \
62 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 9, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
63
64 #define IOCTL_DOT4_OPEN_CHANNEL \
65 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 0, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
66
67 #define IOCTL_DOT4_READ \
68 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 2, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
69
70 #define IOCTL_DOT4_REMOVE_ACTIVITY_BROADCAST \
71 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
72
73 #define IOCTL_DOT4_WAIT_ACTIVITY_BROADCAST \
74 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 6, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
75
76 #define IOCTL_DOT4_WAIT_FOR_CHANNEL \
77 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 8, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
78
79 #define IOCTL_DOT4_WRITE \
80 CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 3, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
81
82
83 typedef struct _DOT4_DC_CREATE_DATA {
84 unsigned char bPsid;
85 CHAR pServiceName[MAX_SERVICE_LENGTH + 1];
86 unsigned char bType;
87 ULONG ulBufferSize;
88 USHORT usMaxHtoPPacketSize;
89 USHORT usMaxPtoHPacketSize;
90 unsigned char bHsid;
91 } DOT4_DC_CREATE_DATA, *PDOT4_DC_CREATE_DATA;
92
93 typedef struct _DOT4_DC_DESTROY_DATA {
94 unsigned char bHsid;
95 } DOT4_DC_DESTROY_DATA, *PDOT4_DC_DESTROY_DATA;
96
97 typedef struct _DOT4_DC_OPEN_DATA {
98 unsigned char bHsid;
99 unsigned char fAddActivity;
100 CHANNEL_HANDLE hChannelHandle;
101 } DOT4_DC_OPEN_DATA, *PDOT4_DC_OPEN_DATA;
102
103 typedef struct _DOT4_DRIVER_CMD {
104 CHANNEL_HANDLE hChannelHandle;
105 ULONG ulSize;
106 ULONG ulOffset;
107 ULONG ulTimeout;
108 } DOT4_DRIVER_CMD, *PDOT4_DRIVER_CMD;
109
110 #ifdef __cplusplus
111 }
112 #endif