forked from microsoft/Windows-driver-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhclient.h
153 lines (111 loc) · 2.78 KB
/
hclient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*++
Copyright (c) Microsoft 1998, All Rights Reserved
Module Name:
hclient.h
Abstract:
This module contains the public declarations and definitions that are
defined in hclient.c and available to other modules outside of it.
Environment:
User mode
Revision History:
Nov-97 : Created
--*/
#ifndef __HCLIENT_H__
#define __HCLIENT_H__
#define WM_UNREGISTER_HANDLE WM_USER+1
#define WM_DISPLAY_READ_DATA WM_USER+2
#define WM_READ_DONE WM_USER+3
#define READ_THREAD_TIMEOUT 1000
#define HCLIENT_ERROR "HClient Error"
#define INFINITE_READS ((ULONG)-1)
typedef struct _READ_THREAD_CONTEXT
{
PHID_DEVICE HidDevice;
HWND DisplayWindow;
HANDLE DisplayEvent;
ULONG NumberOfReads;
BOOL TerminateThread;
} READ_THREAD_CONTEXT, *PREAD_THREAD_CONTEXT;
typedef NTSTATUS __stdcall GETEXTATTRIB (
HIDP_REPORT_TYPE,
USHORT,
PHIDP_PREPARSED_DATA,
PHIDP_EXTENDED_ATTRIBUTES,
PULONG);
typedef GETEXTATTRIB *PGETEXTATTRIB;
typedef NTSTATUS __stdcall INITREPORT (
HIDP_REPORT_TYPE,
UCHAR,
PHIDP_PREPARSED_DATA,
PCHAR,
ULONG);
typedef INITREPORT *PINITREPORT;
extern PGETEXTATTRIB pfnHidP_GetExtendedAttributes;
extern PINITREPORT pfnHidP_InitializeReportForID;
VOID
vDisplayDeviceAttributes(
IN PHIDD_ATTRIBUTES pAttrib,
IN HWND hControl
);
VOID
vDisplayButtonAttributes(
IN PHIDP_BUTTON_CAPS pButton,
IN HWND hControl
);
VOID
vDisplayDataAttributes(
PHIDP_DATA pData,
BOOL IsButton,
HWND hControl
);
VOID
vCreateUsageAndPageString(
_In_ PUSAGE_AND_PAGE pUsageList,
_Out_writes_(uiStringSize) CHAR szString[],
_In_ UINT uiStringSize
);
VOID
vCreateUsageString(
_In_ PUSAGE pUsageList,
_Out_writes_(uiStringSize) CHAR szString[],
_In_ UINT uiStringSize
);
VOID
vDisplayDeviceCaps(
IN PHIDP_CAPS pCaps,
IN HWND hControl
);
VOID
vDisplayValueAttributes(
IN PHIDP_VALUE_CAPS pValue,
IN HWND hControl
);
VOID
vDisplayLinkCollectionNode(
IN PHIDP_LINK_COLLECTION_NODE pLCNode,
IN ULONG ulLinkIndex,
IN HWND hControl
);
VOID
vCreateUsageValueStringFromArray(
_In_reads_(uiBufferSize)PCHAR pBuffer,
_In_ UINT uiBufferSize,
_In_ USHORT BitSize,
_In_ USHORT UsageIndex,
_Out_writes_(uiStringSize) CHAR szString[],
_In_ UINT uiStringSize
);
VOID
vDisplayValueAttributes(
IN PHIDP_VALUE_CAPS pValue,
IN HWND hControl
);
DWORD WINAPI
AsynchReadThreadProc(
PREAD_THREAD_CONTEXT Context
);
DWORD WINAPI
SynchReadThreadProc(
PREAD_THREAD_CONTEXT Context
);
#endif