Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

parport.c File Reference

Program to handle the parallel port for the OPENCBM driver. More...

#include <windows.h>
#include <stdio.h>
#include "instcbm.h"
#include <setupapi.h>
#include <cfgmgr32.h>
#include <initguid.h>
#include <ntddpar.h>
#include "debug.h"

Go to the source code of this file.

Defines

#define DBG_USERMODE
#define DBG_PROGNAME   "INSTCBM.EXE"
#define GET_PROC_ADDRESS(_xxx)

Typedefs

typedef CMAPI CONFIGRET(* P_CM_Get_Device_ID_ExA )(IN DEVINST dnDevInst, OUT PTCHAR Buffer, IN ULONG BufferLen, IN ULONG ulFlags, IN HMACHINE hMachine)
typedef WINSETUPAPI BOOL(* P_SetupDiGetDeviceInfoListDetailA )(IN HDEVINFO DeviceInfoSet, OUT PSP_DEVINFO_LIST_DETAIL_DATA DeviceInfoSetDetailData)
typedef * PSETUPAPI

Functions

VOID CbmParportRestart (VOID)
 Restart the parallel port.


Detailed Description

Program to handle the parallel port for the OPENCBM driver.

**************************************************************

Author:
Spiro Trikaliotis
Version:
Id
parport.c,v 1.13 2006/03/22 18:18:09 trikalio Exp


Definition in file parport.c.


Define Documentation

#define DBG_PROGNAME   "INSTCBM.EXE"
 

The name of the executable

Definition at line 36 of file parport.c.

#define DBG_USERMODE
 

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

Definition at line 33 of file parport.c.

#define GET_PROC_ADDRESS _xxx   ) 
 

Value:

if (SetupApi && SetupApi->HandleSetupApiDll) \
    { \
        SetupApi->_xxx##_p = (P_##_xxx) GetProcAddress(SetupApi->HandleSetupApiDll, #_xxx); \
        \
        DBG_SUCCESS((DBG_PREFIX "p_CM_Get_Device_ID_Ex = %p", SetupApi->_xxx##_p)); \
        \
        if (SetupApi->_xxx##_p == NULL) \
        { \
            DBG_WARN((DBG_PREFIX "GetProcAddress(\"" #_xxx "\") FAILED!")); \
            FreeDynamicalAddresses(SetupApi); \
        } \
     }
Get the address of the given function from the DLL

Definition at line 102 of file parport.c.


Typedef Documentation

typedef CMAPI CONFIGRET(* P_CM_Get_Device_ID_ExA)(IN DEVINST dnDevInst, OUT PTCHAR Buffer, IN ULONG BufferLen, IN ULONG ulFlags, IN HMACHINE hMachine)
 

Pointer to the CM_Get_Device_ID_Ex function. As this function is not supported on NT4, we have to dynamically get its address, because our driver would refuse to load on NT4 else.

Definition at line 59 of file parport.c.

typedef WINSETUPAPI BOOL(* P_SetupDiGetDeviceInfoListDetailA)(IN HDEVINFO DeviceInfoSet, OUT PSP_DEVINFO_LIST_DETAIL_DATA DeviceInfoSetDetailData)
 

Pointer to the SetupDiGetDeviceInfoListDetailA function. As this function is not supported on NT4, we have to dynamically get its address, because our driver would refuse to load on NT4 else.

Definition at line 67 of file parport.c.

typedef * PSETUPAPI
 

PSETUPAPI is a pointer to SETUAPI


Function Documentation

VOID CbmParportRestart VOID   ) 
 

Restart the parallel port.

This function tries to restart the parallel port, so that registry changes can take effect.

Definition at line 142 of file parport.c.

References DBG_ASSERT, DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, DBGDO, FUNC_ENTER, and FUNC_LEAVE.

Referenced by CbmCheckCorrectInstallation().


Generated on Sun Apr 30 18:46:13 2006 for opencbm by  doxygen 1.4.2