OpenCBM
Macros | Functions
service.c File Reference

Functions for accessing the service control manager for the OPENCBM driver. More...

#include <windows.h>
#include <stdio.h>
#include "cbmioctl.h"
#include "i_opencbm.h"
#include "libmisc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define DBG_USERMODE
 
#define DBG_PROGNAME   "OPENCBM-XA1541.DLL"
 

Functions

BOOL CbmInstall (IN LPCTSTR DriverName, IN LPCTSTR ServiceExe, IN BOOL AutomaticStart)
 Install the driver. More...
 
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. More...
 
BOOL CbmRemove (IN LPCTSTR DriverName)
 Remove the driver. More...
 
BOOL CbmCheckPresence (IN LPCTSTR DriverName)
 Check for the presence of the driver. More...
 

Detailed Description

Functions for accessing the service control manager for the OPENCBM driver.



Author
Spiro Trikaliotis

Definition in file service.c.

Macro Definition Documentation

#define DBG_PROGNAME   "OPENCBM-XA1541.DLL"

The name of the executable

Definition at line 34 of file service.c.

#define DBG_USERMODE

Mark: We are in user-space (for debug.h)

Definition at line 31 of file service.c.

Function Documentation

BOOL CbmCheckPresence ( IN LPCTSTR  DriverName)

Check for the presence of the driver.

This function checks if the driver is present.

Parameters
DriverNameThe name under which the driver is installed.
Returns
TRUE if the driver is present, FALSE is not, or if there was an error.

Definition at line 510 of file service.c.

References FUNC_ENTER, and FUNC_LEAVE_BOOL.

Referenced by opencbm_plugin_install_do_uninstall().

BOOL CbmInstall ( IN LPCTSTR  DriverName,
IN LPCTSTR  ServiceExe,
IN BOOL  AutomaticStart 
)

Install the driver.

This function installs the opencbm driver on the machine.

Parameters
DriverNameThe name under which the driver should be installed.
ServiceExeThe path to the executable which contains the logging texts
AutomaticStartIf set to TRUE, then the driver start type should be set to "AUTOMATIC", that is, the driver is started on every boot. If FALSE, it is put to "MANUAL".
Returns
TRUE if an error occurred, else FALSE.

Definition at line 294 of file service.c.

References cbm_driver_start(), cbmlibmisc_format_error_message(), DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, DBG_WARN, FUNC_ENTER, and FUNC_LEAVE_BOOL.

Referenced by opencbm_plugin_install_do_install().

BOOL CbmRemove ( IN LPCTSTR  DriverName)

Remove the driver.

This function removes the opencbm driver from the machine.

Parameters
DriverNameThe name under which the driver is installed.
Returns
TRUE on success, else FALSE.

Definition at line 437 of file service.c.

References cbm_driver_stop(), cbmlibmisc_format_error_message(), DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, FUNC_ENTER, FUNC_LEAVE_BOOL, and REGKEY_EVENTLOG.

Referenced by opencbm_plugin_install_do_uninstall().

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.

This function updates the parameters of the driver.

Parameters
DefaultLptThe default LPT to be set
IecCableTypeThe IEC cable type
PermanentlyLockZero if driver should not permanently lock the parallel port, not zero otherwise.
DebugFlagsDriverPresentSpecifies if the following DebugFlagsDriver field should be used or not
DebugFlagsDriverThe DebugFlags to be set for the driver
DebugFlagsDllPresentSpecifies if the following DebugFlagsDll field should be used or not
DebugFlagsDllThe DebugFlags to be set for the DLL
Returns
TRUE on success, else FALSE.

Definition at line 404 of file service.c.

References FUNC_ENTER, and FUNC_LEAVE_BOOL.