1 | /* $Id: hmparport.h,v 1.6 2001-12-05 14:16:05 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
5 | *
|
---|
6 | * Win32 Parallel Port device access class
|
---|
7 | *
|
---|
8 | * 2001 Patrick Haller <patrick.haller@innotek.de>
|
---|
9 | *
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef _HM_PARPORT_H_
|
---|
13 | #define _HM_PARPORT_H_
|
---|
14 |
|
---|
15 | class HMDeviceParPortClass : public HMDeviceHandler
|
---|
16 | {
|
---|
17 | public:
|
---|
18 |
|
---|
19 | HMDeviceParPortClass(LPCSTR lpDeviceName);
|
---|
20 |
|
---|
21 | //checks if device name belongs to this class
|
---|
22 | virtual BOOL FindDevice(LPCSTR lpClassDevName, LPCSTR lpDeviceName, int namelength);
|
---|
23 |
|
---|
24 | /* this is the handler method for calls to CreateFile() */
|
---|
25 | virtual DWORD CreateFile (LPCSTR lpFileName,
|
---|
26 | PHMHANDLEDATA pHMHandleData,
|
---|
27 | PVOID lpSecurityAttributes,
|
---|
28 | PHMHANDLEDATA pHMHandleDataTemplate);
|
---|
29 |
|
---|
30 | /* this is the handler method for calls to CloseHandle() */
|
---|
31 | virtual BOOL CloseHandle(PHMHANDLEDATA pHMHandleData);
|
---|
32 |
|
---|
33 | virtual BOOL GetCommProperties( PHMHANDLEDATA pHMHandleData,
|
---|
34 | LPCOMMPROP lpcmmp);
|
---|
35 |
|
---|
36 | virtual BOOL ClearCommError( PHMHANDLEDATA pHMHandleData,
|
---|
37 | LPDWORD lpdwErrors,
|
---|
38 | LPCOMSTAT lpcst);
|
---|
39 |
|
---|
40 | virtual BOOL SetCommConfig( PHMHANDLEDATA pHMHandleData,
|
---|
41 | LPCOMMCONFIG lpCC,
|
---|
42 | DWORD dwSize );
|
---|
43 |
|
---|
44 | virtual BOOL GetCommConfig( PHMHANDLEDATA pHMHandleData,
|
---|
45 | LPCOMMCONFIG lpCC,
|
---|
46 | LPDWORD lpdwSize );
|
---|
47 |
|
---|
48 | virtual BOOL SetDefaultCommConfig( PHMHANDLEDATA pHMHandleData,
|
---|
49 | LPCOMMCONFIG lpCC,
|
---|
50 | DWORD dwSize);
|
---|
51 |
|
---|
52 | virtual BOOL GetDefaultCommConfig( PHMHANDLEDATA pHMHandleData,
|
---|
53 | LPCOMMCONFIG lpCC,
|
---|
54 | LPDWORD lpdwSize);
|
---|
55 |
|
---|
56 | /* this is a handler method for calls to DeviceIoControl() */
|
---|
57 | virtual BOOL DeviceIoControl (PHMHANDLEDATA pHMHandleData, DWORD dwIoControlCode,
|
---|
58 | LPVOID lpInBuffer, DWORD nInBufferSize,
|
---|
59 | LPVOID lpOutBuffer, DWORD nOutBufferSize,
|
---|
60 | LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
|
---|
61 |
|
---|
62 |
|
---|
63 | /* this is a handler method for calls to ReadFile/Ex */
|
---|
64 | virtual BOOL ReadFile (PHMHANDLEDATA pHMHandleData,
|
---|
65 | LPCVOID lpBuffer,
|
---|
66 | DWORD nNumberOfBytesToRead,
|
---|
67 | LPDWORD lpNumberOfBytesRead,
|
---|
68 | LPOVERLAPPED lpOverlapped,
|
---|
69 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
70 |
|
---|
71 | /* this is a handler method for calls to WriteFile/Ex */
|
---|
72 | virtual BOOL WriteFile (PHMHANDLEDATA pHMHandleData,
|
---|
73 | LPCVOID lpBuffer,
|
---|
74 | DWORD nNumberOfBytesToWrite,
|
---|
75 | LPDWORD lpNumberOfBytesWritten,
|
---|
76 | LPOVERLAPPED lpOverlapped,
|
---|
77 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
|
---|
78 |
|
---|
79 | private:
|
---|
80 | // The number of physically present parallel ports in the system,
|
---|
81 | // LAN-redirectors don't count. See note in ::CreateFile()
|
---|
82 | BYTE bNumberOfParallelPorts;
|
---|
83 | };
|
---|
84 |
|
---|
85 |
|
---|
86 | #endif // _HM_PARPORT_H_
|
---|