-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusbhid.h
41 lines (34 loc) · 950 Bytes
/
usbhid.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
#pragma once
#include <iostream>
#include <Windows.h>
#include <winusb.h>
#include <Setupapi.h>
#include <string>
#include <hidsdi.h>
#include <string>
#include <string.h>
#define UNKNOWN_DEVICE L"vid_0483"
#define STM32_USBVID L"vid_03eb"
extern GUID Guid;
extern HANDLE HidDeviceObject;
extern HIDP_CAPS Capabilities;
extern OVERLAPPED HIDOverlapped;
extern DWORD NumberOfBytesRead;
extern DWORD NumberOfBytesWriten;
extern wchar_t DevicePath[MAX_PATH];
extern HANDLE ReadThread;
extern DWORD ReadThreadId;
extern HANDLE WriteThread;
extern DWORD WriteThreadId;
extern bool WRITE_ROPRT;
extern BYTE InputReport[256];
extern BYTE OutputReport[256];
extern int Use_Setxxx;
/*èíèöèàëèçàöèÿ USB*/
void init(const wchar_t* device);
/*ïîëó÷åíèå ïóòè óñòðîéñòâà USB*/
bool get_path(const wchar_t *device);
/*ñîçäàíèå ïîòîêîâ äëÿ ÷òåíèÿ/çàïèñè*/
void CreateReadWriteThread();
DWORD WINAPI ReadReport(void*);
DWORD WINAPI WriteReport(void*);