2
* This abstracts dynamic library loading functions and timing.
4
* MUSCLE SmartCard Development ( http://www.linuxnet.com )
7
* David Corcoran <corcoran@linuxnet.com>
9
* $Id: dyn_win32.c,v 1.4 2004/05/11 13:50:18 rousseau Exp $
18
#include "dyn_generic.h"
21
int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
24
*pvLHandle = LoadLibrary(pcLibrary);
26
if (*pvLHandle == NULL)
29
DebugLogB("DYN_LoadLibrary: dlerror() reports %s", dlerror());
31
return SCARD_F_UNKNOWN_ERROR;
34
return SCARD_S_SUCCESS;
37
int DYN_CloseLibrary(void **pvLHandle)
41
ret = FreeLibrary(*pvLHandle);
44
/* If the function fails, the return value is zero. To get extended error
45
* information, call GetLastError. */
49
DebugLogB("DYN_CloseLibrary: dlerror() reports %s", dlerror());
51
return SCARD_F_UNKNOWN_ERROR;
54
return SCARD_S_SUCCESS;
57
int DYN_GetAddress(void *pvLHandle, void **pvFHandle, char *pcFunction)
66
pcFunctionName = NULL;
68
pcFunctionName = pcFunction;
71
*pvFHandle = GetProcAddress(pvLHandle, pcFunctionName);
73
if (*pvFHandle == NULL)
76
DebugLogB("DYN_GetAddress: dlerror() reports %s", dlerror());
78
rv = SCARD_F_UNKNOWN_ERROR;