1 /**
2  * @file d4iface.h
3  * Copyright 2012, 2013 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 /* Created by Casper S. Hornstrup <chorns@users.sourceforge.net> */
25 #ifndef __D4IFACE_H
26 #define __D4IFACE_H
27 #pragma GCC system_header
28 #include <_mingw.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include "ntddk.h"
35 
36 #define DOT4_MAX_CHANNELS                 128
37 #define NO_TIMEOUT                        0
38 
39 #define DOT4_CHANNEL                      0
40 #define HP_MESSAGE_PROCESSOR              1
41 #define PRINTER_CHANNEL                   2
42 #define SCANNER_CHANNEL                   4
43 #define MIO_COMMAND_PROCESSOR             5
44 #define ECHO_CHANNEL                      6
45 #define FAX_SEND_CHANNEL                  7
46 #define FAX_RECV_CHANNEL                  8
47 #define DIAGNOSTIC_CHANNEL                9
48 #define HP_RESERVED                       10
49 #define IMAGE_DOWNLOAD                    11
50 #define HOST_DATASTORE_UPLOAD             12
51 #define HOST_DATASTORE_DOWNLOAD           13
52 #define CONFIG_UPLOAD                     14
53 #define CONFIG_DOWNLOAD                   15
54 
55 #define STREAM_TYPE_CHANNEL               1
56 #define PACKET_TYPE_CHANNEL               2
57 
58 /* DOT4_ACTIVITY.ulMessage flags */
59 #define DOT4_STREAM_RECEIVED              0x100
60 #define DOT4_STREAM_CREDITS               0x101
61 #define DOT4_MESSAGE_RECEIVED             0x102
62 #define DOT4_DISCONNECT                   0x103
63 #define DOT4_CHANNEL_CLOSED               0x105
64 
65 typedef unsigned long CHANNEL_HANDLE, *PCHANNEL_HANDLE;
66 
67 typedef struct _DOT4_ACTIVITY {
68   ULONG  ulMessage;
69   ULONG  ulByteCount;
70   CHANNEL_HANDLE  hChannel;
71 } DOT4_ACTIVITY, *PDOT4_ACTIVITY;
72 
73 typedef struct _DOT4_WMI_XFER_INFO {
74   ULONG  ulStreamBytesWritten;
75   ULONG  ulStreamBytesRead;
76   ULONG  ulPacketBytesWritten;
77   ULONG  ulPacketBytesRead;
78 } DOT4_WMI_XFER_INFO, *PDOT4_WMI_XFER_INFO;
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* __D4IFACE_H */
85