Etterna
0.74.4
Loading...
Searching...
No Matches
src
archutils
Win32
USB.h
1
/* WindowsFileIO - Windows device I/O. */
2
3
#ifndef WIN32_USB_H
4
#define WIN32_USB_H
5
6
#include <vector>
7
#include <windows.h>
8
9
class
WindowsFileIO
10
{
11
public
:
12
WindowsFileIO
();
13
~WindowsFileIO
();
14
bool
Open(
const
std::string& sPath,
int
iBlockSize);
15
bool
IsOpen()
const
;
16
17
/* Nonblocking read. size must always be the same. Returns the number of
18
* bytes read, or 0. */
19
int
read(
void
* p);
20
static
int
read_several(
const
std::vector<WindowsFileIO*>& sources,
21
void
* p,
22
int
& actual,
23
float
timeout);
24
25
private
:
26
void
queue_read();
27
int
finish_read(
void
* p);
28
29
HANDLE m_Handle;
30
OVERLAPPED m_Overlapped;
31
char
* m_pBuffer;
32
int
m_iBlockSize;
33
};
34
35
/* WindowsFileIO - Windows USB I/O */
36
class
USBDevice
37
{
38
public
:
39
int
GetPadEvent();
40
bool
Open(
int
iVID,
41
int
iPID,
42
int
iBlockSize,
43
int
iNum,
44
void
(*pfnInit)(HANDLE));
45
bool
IsOpen()
const
;
46
47
WindowsFileIO
m_IO;
48
};
49
50
#endif
USBDevice
Definition
USB.h:37
WindowsFileIO
Definition
USB.h:10
Generated by
1.9.8