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

i_opencbm_vice.c File Reference

Helper functions for the DLL for accessing the driver, and the install functions. More...

#include <windows.h>
#include <windowsx.h>
#include "debug.h"
#include <winioctl.h>
#include "cbmioctl.h"
#include <stdlib.h>
#include <stddef.h>
#include "i_opencbm.h"
#include "version.h"
#include "archlib.h"
#include "vice_comm.h"

Go to the source code of this file.

Defines

#define DBG_USERMODE
#define DBG_PROGNAME   "OPENCBM.DLL"

Functions

LONG RegGetDWORD (IN HKEY RegKey, IN char *SubKey, OUT LPDWORD Value)
 Get a DWORD value from the registry.
const char * cbmarch_get_driver_name (int PortNumber)
 Get the name of the driver for a specific parallel port.
int cbmarch_driver_open (CBM_FILE *HandleDevice, int PortNumber)
 Opens the driver.
void cbmarch_driver_close (CBM_FILE HandleDevice)
 Closes the driver.


Detailed Description

Helper functions for the DLL for accessing the driver, and the install functions.

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

Author:
Spiro Trikaliotis
Version:
Id
i_opencbm_vice.c,v 1.2 2006/02/24 12:01:13 trikalio Exp

Authors:
Based on code from Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>

Definition in file i_opencbm_vice.c.


Define Documentation

#define DBG_PROGNAME   "OPENCBM.DLL"
 

The name of the executable

Definition at line 34 of file i_opencbm_vice.c.

#define DBG_USERMODE
 

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

Definition at line 30 of file i_opencbm_vice.c.


Function Documentation

void cbmarch_driver_close CBM_FILE  HandleDevice  ) 
 

Closes the driver.

Closes the driver, which has be opened with cbm_driver_open() before.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
cbm_driver_close() should be called to balance a previous call to cbm_driver_open().

If cbm_driver_open() did not succeed, it is illegal to call cbm_driver_close().

Definition at line 278 of file i_opencbm_vice.c.

References FUNC_ENTER, and FUNC_LEAVE.

int cbmarch_driver_open CBM_FILE *  HandleDevice,
int  PortNumber
 

Opens the driver.

This function Opens the driver.

Parameters:
HandleDevice Pointer to a CBM_FILE which will contain the file handle of the driver.
PortNumber The port number of the driver to open. 0 means "default" driver, while values != 0 enumerate each driver.
Returns:
==0: This function completed successfully !=0: otherwise
PortNumber is not allowed to exceed 10.

cbm_driver_open() should be balanced with cbm_driver_close().

Definition at line 227 of file i_opencbm_vice.c.

References FUNC_ENTER, and FUNC_LEAVE_INT.

const char* cbmarch_get_driver_name int  PortNumber  ) 
 

Get the name of the driver for a specific parallel port.

Get the name of the driver for a specific parallel port.

Parameters:
PortNumber The port number for the driver to open. 0 means "default" driver, while values != 0 enumerate each driver.
Returns:
Returns a pointer to a null-terminated string containing the driver name, or NULL if an error occurred.
Bug:
PortNumber is not allowed to exceed 10.
Todo:
do not hard-code the driver name

Definition at line 196 of file i_opencbm_vice.c.

References FUNC_ENTER, and FUNC_LEAVE_STRING.

LONG RegGetDWORD IN HKEY  RegKey,
IN char *  SubKey,
OUT LPDWORD  Value
 

Get a DWORD value from the registry.

This function gets a DWORD value in the registry. It is a simple wrapper for convenience.

Parameters:
RegKey A handle to an already opened registry key.
SubKey Pointer to a null-terminiated string which holds the name of the value to be created or changed.
Value Pointer to a variable which will contain the value from the registry
Returns:
ERROR_SUCCESS on success, -1 otherwise
If this function returns -1, the given Value will not be changed at all!

Definition at line 77 of file i_opencbm_vice.c.

References DBG_ASSERT, DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, FUNC_ENTER, FUNC_LEAVE_INT, and FUNC_PARAM.


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