1 | #if !defined (KBD32_SHARED_DATA_H)
|
---|
2 | #define KBD32_SHARED_DATA_H
|
---|
3 |
|
---|
4 | #include "vio32Private.h"
|
---|
5 | #include "vio32Utils.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | // this object represents the shared memory
|
---|
9 | class kbd32SharedData {
|
---|
10 | // size of the partially used buffer
|
---|
11 | int nOfWindows;
|
---|
12 | // the hwnd client
|
---|
13 | HWND clientWindows[MAX_VIO32];
|
---|
14 | // the hwnd frame
|
---|
15 | HWND frameWindows[MAX_VIO32];
|
---|
16 | // the task to be served
|
---|
17 | ULONG processId[MAX_VIO32];
|
---|
18 | // the task to be served
|
---|
19 | ULONG mode[MAX_VIO32];
|
---|
20 | //
|
---|
21 | VIO32EVENTINFO events[MAX_VIO32*MAX_PRIMARY_Q_LEN];
|
---|
22 | //
|
---|
23 | VIO32EVENTINFO *pos[MAX_VIO32];
|
---|
24 |
|
---|
25 | public:
|
---|
26 | ///
|
---|
27 | void Init();
|
---|
28 | /// installs a patch for the vio kbd stream for the current task
|
---|
29 | APIRET InstallApplication(ULONG pid,BOOL windowed=TRUE);
|
---|
30 | ///
|
---|
31 | APIRET UninstallApplication(ULONG pid);
|
---|
32 | ///
|
---|
33 | APIRET SetMode(ULONG mode,ULONG pid);
|
---|
34 | ///
|
---|
35 | APIRET GetMode(ULONG &mode,ULONG pid);
|
---|
36 | /// gets a buffer
|
---|
37 | VIO32EVENTINFO *getBuffer(int ix);
|
---|
38 | /// automatically updates the pointer
|
---|
39 | void advanceBuffer(int ix){ pos[ix]++; }
|
---|
40 | ///
|
---|
41 | BOOL searchByHwndClient(HWND hwndClient,HWND &hwndFrame,PID &pid,int &ix);
|
---|
42 | ///
|
---|
43 | BOOL searchByHwndFrame(HWND hwndFrame,HWND &hwndClient,PID &pid,int &ix);
|
---|
44 | ///
|
---|
45 | BOOL searchByPid(PID pid,HWND &hwndClient,HWND &hwndFrame,int &ix);
|
---|
46 | ///
|
---|
47 | ULONG getMode(int ix){ return mode[ix]; }
|
---|
48 | };
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 | #endif
|
---|