forked from grayver/mi-vigem
-
Notifications
You must be signed in to change notification settings - Fork 13
/
hid.h
51 lines (40 loc) · 1.27 KB
/
hid.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
/*
* hid.h -- Routines for interacting with HID devices.
*/
#ifndef HID_H
#define HID_H
#include <wtypes.h>
struct hid_device_info;
struct hid_device_info
{
LPTSTR path;
LPTSTR description;
struct hid_device_info *next;
};
struct hid_device
{
LPTSTR path;
HANDLE handle;
BOOL read_pending;
BOOL write_pending;
USHORT input_report_size;
USHORT output_report_size;
USHORT feature_report_size;
BYTE *input_buffer;
BYTE *output_buffer;
BYTE *feature_buffer;
OVERLAPPED input_ol;
OVERLAPPED output_ol;
};
GUID hid_get_class();
struct hid_device_info *hid_enumerate(const LPTSTR *path_filters);
BOOL hid_reenable_device(LPTSTR path);
BOOL check_vendor_and_product(LPTSTR path, USHORT vendor_id, USHORT product_id);
void hid_free_device_info(struct hid_device_info *device_info);
struct hid_device *hid_open_device(LPTSTR path, BOOL access_rw, BOOL shared);
INT hid_get_input_report(struct hid_device *device, DWORD timeout);
INT hid_send_output_report(struct hid_device *device, const void *data, size_t length, DWORD timeout);
INT hid_send_feature_report(struct hid_device *device, const void *data, size_t length);
void hid_close_device(struct hid_device *device);
void hid_free_device(struct hid_device *device);
#endif /* HID_H */