2
* MUSCLE SmartCard Development ( http://www.linuxnet.com )
5
* David Corcoran <corcoran@linuxnet.com>
7
* $Id: dyn_win32.c,v 1.7 2005-11-27 17:02:43 rousseau Exp $
12
* @brief This abstracts dynamic library loading functions and timing.
21
#include "dyn_generic.h"
24
int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
27
*pvLHandle = LoadLibrary(pcLibrary);
29
if (*pvLHandle == NULL)
32
Log2(PCSC_LOG_ERROR, "DYN_LoadLibrary: dlerror() reports %s", dlerror());
34
return SCARD_F_UNKNOWN_ERROR;
37
return SCARD_S_SUCCESS;
40
int DYN_CloseLibrary(void **pvLHandle)
44
ret = FreeLibrary(*pvLHandle);
47
/* If the function fails, the return value is zero. To get extended error
48
* information, call GetLastError. */
52
Log2(PCSC_LOG_ERROR, "DYN_CloseLibrary: dlerror() reports %s", dlerror());
54
return SCARD_F_UNKNOWN_ERROR;
57
return SCARD_S_SUCCESS;
60
int DYN_GetAddress(void *pvLHandle, void **pvFHandle, char *pcFunction)
69
pcFunctionName = NULL;
71
pcFunctionName = pcFunction;
74
*pvFHandle = GetProcAddress(pvLHandle, pcFunctionName);
76
if (*pvFHandle == NULL)
79
Log2(PCSC_LOG_ERROR, "DYN_GetAddress: dlerror() reports %s", dlerror());
81
rv = SCARD_F_UNKNOWN_ERROR;