OpenCBM
Macros | Functions | Variables
WINDOWS/archlib.c File Reference

Shared library / DLL for accessing the driver, windows specific code. More...

#include <windows.h>
#include <stdlib.h>
#include "configuration.h"
#include "debug.h"
#include "getpluginaddress.h"
#include "archlib.h"
#include "archlib-windows.h"
#include "libmisc.h"

Go to the source code of this file.

Macros

#define DBG_USERMODE
 
#define DBG_DLL
 
#define DBG_PROGNAME   "OPENCBM.DLL"
 
#define DBG_IS_DEBUG_C
 
#define OPENCBM_PLUGIN   1
 mark: we are exporting plugin functions
 

Functions

BOOL WINAPI DllMain (IN HANDLE Module, IN DWORD Reason, IN LPVOID Reserved)
 DLL initialization und unloading. More...
 
BOOL CBMAPIDECL opencbm_plugin_install_generic (const char *DefaultPluginname, unsigned int DefaultLocation)
 @@@ More...
 
BOOL CBMAPIDECL opencbm_plugin_install_plugin_data (const char *Pluginname, const char *Filepath, const CbmPluginInstallProcessCommandlineData_t *CommandlineData)
 @@@ More...
 
EXTERN BOOL CBMAPIDECL opencbm_plugin_get_all_plugin_names (opencbm_plugin_get_all_plugin_names_context_t *Context)
 @@@ More...
 

Variables

opencbm_configuration_enum_sections_callback_t callback
 @@@ More...
 

Detailed Description

Shared library / DLL for accessing the driver, windows specific code.



Author
Michael Klein, Spiro Trikaliotis

Definition in file WINDOWS/archlib.c.

Macro Definition Documentation

#define DBG_DLL

Mark: We are building the DLL

Definition at line 27 of file WINDOWS/archlib.c.

#define DBG_IS_DEBUG_C

This file is "like" debug.c, that is, define some variables

Definition at line 33 of file WINDOWS/archlib.c.

#define DBG_PROGNAME   "OPENCBM.DLL"

The name of the executable

Definition at line 30 of file WINDOWS/archlib.c.

#define DBG_USERMODE

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

Definition at line 24 of file WINDOWS/archlib.c.

Function Documentation

BOOL WINAPI DllMain ( IN HANDLE  Module,
IN DWORD  Reason,
IN LPVOID  Reserved 
)

DLL initialization und unloading.

This function is called whenever the DLL is loaded or unloaded. It ensures that the driver is loaded to be able to call its functions.

Parameters
ModuleHandle of the module; this is not used.
ReasonDLL_PROCESS_ATTACH if the DLL is loaded, DLL_PROCESS_DETACH if it is unloaded.
ReservedNot used.
Returns
Returns TRUE on success, else FALSE.

If this function returns FALSE, windows reports that loading the DLL was not successful. If the DLL is linked statically, the executable refuses to load with STATUS_DLL_INIT_FAILED (0xC0000142)

Definition at line 70 of file WINDOWS/archlib.c.

References cbm_get_debugging_flags(), FUNC_ENTER, and FUNC_LEAVE_BOOL.

EXTERN BOOL CBMAPIDECL opencbm_plugin_get_all_plugin_names ( opencbm_plugin_get_all_plugin_names_context_t *  Context)
BOOL CBMAPIDECL opencbm_plugin_install_generic ( const char *  DefaultPluginname,
unsigned int  DefaultLocation 
)

@@@

Todo:
document
Parameters
DefaultPluginname
DefaultLocationMust be one of INDEX_DEFAULT_FILENAME_LOCAL, INDEX_DEFAULT_FILENAME_USERDIR or INDEX_DEFAULT_FILENAME_WINDIR.
Returns

Definition at line 101 of file WINDOWS/archlib.c.

References cbmlibmisc_strfree(), configuration_get_default_filename_for_install(), FUNC_ENTER, FUNC_LEAVE_BOOL, opencbm_configuration_close(), opencbm_configuration_create(), and opencbm_configuration_set_data().

BOOL CBMAPIDECL opencbm_plugin_install_plugin_data ( const char *  Pluginname,
const char *  Filepath,
const CbmPluginInstallProcessCommandlineData_t CommandlineData 
)

Variable Documentation

@@@

Todo:
document

Definition at line 233 of file WINDOWS/archlib.c.