OpenCBM
i_opencbm.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2004 Spiro Trikaliotis
8  *
9  */
10 
19 #ifndef I_OPENCBM_H
20 #define I_OPENCBM_H
21 
22 #include "configuration.h"
23 #include "opencbm.h"
24 
25 extern BOOL cbm_ioctl(IN CBM_FILE HandleDevice, IN DWORD ControlCode,
26 #if DBG
27  IN char *TextControlCode,
28 #endif // #if DBG
29  IN PVOID InBuffer, IN ULONG InBufferSize,
30  OUT PVOID OutBuffer, IN ULONG OutBufferSize);
31 
36 #if DBG
37  #define CBMCTRL( _x_ ) CBMCTRL_##_x_, "CBMCTRL_" #_x_
38 #else // #if DBG
39  #define CBMCTRL( _x_ ) CBMCTRL_##_x_
40 #endif // #if DBG
41 
42 extern BOOL cbm_driver_stop(VOID);
43 extern BOOL cbm_driver_start(VOID);
44 
45 extern BOOL cbm_driver_install(OUT PULONG Buffer, IN ULONG BufferLen);
46 
47 extern LONG RegGetDWORD(IN HKEY RegKey, IN char *SubKey, OUT LPDWORD Value);
48 extern BOOL IsDriverStartedAutomatically(VOID);
49 
50 extern VOID WaitForIoCompletionInit(VOID);
51 extern VOID WaitForIoCompletionDeinit(VOID);
52 extern VOID WaitForIoCompletionCancelAll(VOID);
53 extern VOID WaitForIoCompletionConstruct(LPOVERLAPPED Overlapped);
54 extern BOOL WaitForIoCompletion(BOOL Result, CBM_FILE HandleDevice, LPOVERLAPPED Overlapped, DWORD *BytesTransferred);
55 
57 #define REGKEY_EVENTLOG \
58  "System\\CurrentControlSet\\Services\\Eventlog\\System\\opencbm"
59 
60 extern PCHAR FormatErrorMessage(DWORD Error);
61 extern BOOL CbmInstall(IN LPCTSTR DriverName, IN LPCTSTR ServiceExe, IN BOOL AutomaticStart);
62 
63 extern BOOL CbmRemove(IN LPCTSTR DriverName);
64 extern BOOL CbmCheckPresence(IN LPCTSTR DriverName);
65 
66 extern int CbmCheckDriver(void);
67 
68 
69 extern VOID CbmParportRestart(VOID);
70 
71 extern BOOL CbmUpdateParameter(IN ULONG DefaultLpt,
72  IN ULONG IecCableType,
73  IN ULONG PermanentlyLock,
74  IN BOOL DebugFlagsDriverPresent, IN ULONG DebugFlagsDriver,
75  IN BOOL DebugFlagsDllPresent, IN ULONG DebugFlagsDll);
76 
77 #if DBG
78 extern VOID CbmOutputDebuggingBuffer(VOID);
79 #endif
80 
81 #endif /* I_OPENCBM_H */
BOOL cbm_driver_install(OUT PULONG Buffer, IN ULONG BufferLen)
Complete driver installation, "direct version".
Definition: i_opencbm.c:704
BOOL cbm_driver_stop(VOID)
Stop a device driver.
Definition: i_opencbm.c:639
BOOL CbmCheckPresence(IN LPCTSTR DriverName)
Check for the presence of the driver.
Definition: service.c:510
VOID WaitForIoCompletionConstruct(LPOVERLAPPED Overlapped)
Boilerplate code for asynchronous I/O requests.
Definition: i_opencbm.c:217
LONG RegGetDWORD(IN HKEY RegKey, IN char *SubKey, OUT LPDWORD Value)
Get a DWORD value from the registry.
Definition: registry.c:54
BOOL CbmRemove(IN LPCTSTR DriverName)
Remove the driver.
Definition: service.c:437
BOOL cbm_driver_start(VOID)
Start a device driver.
Definition: i_opencbm.c:564
VOID WaitForIoCompletionDeinit(VOID)
Uninitialize WaitForIoCompletion()
Definition: i_opencbm.c:158
#define CBM_FILE
Definition: opencbm.h:87
Shared library / DLL for accessing the driver Read configuration file.
BOOL WaitForIoCompletion(BOOL Result, CBM_FILE HandleDevice, LPOVERLAPPED Overlapped, DWORD *BytesTransferred)
Wait for the completion of an I/O operation.
Definition: i_opencbm.c:258
BOOL IsDriverStartedAutomatically(VOID)
Is the driver started automatically?
Definition: i_opencbm.c:763
VOID WaitForIoCompletionInit(VOID)
Initialize WaitForIoCompletion()
Definition: i_opencbm.c:129
DLL interface for accessing the driver.
VOID CbmParportRestart(VOID)
Restart the parallel port.
Definition: parport.c:143
BOOL CbmInstall(IN LPCTSTR DriverName, IN LPCTSTR ServiceExe, IN BOOL AutomaticStart)
Install the driver.
Definition: service.c:294
int CbmCheckDriver(void)
Check for the correct installation.
Definition: startstop.c:465
VOID WaitForIoCompletionCancelAll(VOID)
Cancel any running WaitForIoCompletion()
Definition: i_opencbm.c:179
BOOL cbm_ioctl(IN CBM_FILE HandleDevice, IN DWORD ControlCode, IN char *TextControlCode, IN PVOID InBuffer, IN ULONG InBufferSize, OUT PVOID OutBuffer, IN ULONG OutBufferSize)
Perform an ioctl on the driver.
Definition: i_opencbm.c:506
BOOL CbmUpdateParameter(IN ULONG DefaultLpt, IN ULONG IecCableType, IN ULONG PermanentlyLock, IN BOOL DebugFlagsDriverPresent, IN ULONG DebugFlagsDriver, IN BOOL DebugFlagsDllPresent, IN ULONG DebugFlagsDll)
Update the parameter of the driver.
Definition: service.c:404