-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwinioprovider.h
52 lines (43 loc) · 1.25 KB
/
winioprovider.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
#ifndef WINIOPROVIDER_H
#define WINIOPROVIDER_H
#include <QObject>
#include <QLibrary>
#ifdef Q_WS_WIN
#define _WIN32_WINNT 0x501
#include <windows.h>
#else
typedef unsigned int UINT;
typedef char* LPCTSTR;
typedef unsigned int DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef unsigned int* PDWORD;
#endif
class WinIOProvider
{
#ifdef Q_WS_WIN
typedef bool (__stdcall *PrototypeBoolVoid)();
typedef void (__stdcall *PrototypeVoidVoid)();
typedef bool (__stdcall *PrototypeWordPdwordByte)(WORD A, PDWORD B, BYTE C);
typedef bool (__stdcall *PrototypeWordDwordByte)(WORD A, DWORD B, BYTE C);
#else
typedef bool (*PrototypeBoolVoid)();
typedef void (*PrototypeVoidVoid)();
typedef bool (*PrototypeWordPdwordByte)(WORD A, PDWORD B, BYTE C);
typedef bool (*PrototypeWordDwordByte)(WORD A, DWORD B, BYTE C);
#endif
QLibrary lib;
bool initOk;
PrototypeBoolVoid InitializeWinIo;
PrototypeVoidVoid ShutdownWinIo;
PrototypeWordPdwordByte GetPortVal;
PrototypeWordDwordByte SetPortVal;
public:
WinIOProvider();
int load();
void unload();
void setPort(unsigned int port,unsigned char value);
unsigned char getPort(unsigned int port);
~WinIOProvider();
};
#endif // WINIOPROVIDER_H