libCom: Added osi/os/WIN32/osdFindSymbol.c

Implemented by Dirk Zimoch.
This commit is contained in:
Andrew Johnson
2013-05-28 14:16:22 -05:00
parent e0bc071de3
commit 7f82c2f32e
2 changed files with 51 additions and 0 deletions
+5
View File
@@ -13,6 +13,11 @@
<!-- Insert new items immediately below here ... -->
<h4>Added osdFindSymbol for Windows</h4>
<p>Dirk Zimoch implemented the epicsLoadLibrary(), epicsLoadError() and
epicsFindSymbol() routines for Windows OS targets.</p>
<h4>More dbStatic commands accept "" or "*" to mean 'all'</h4>
<p>The IOC commands dbDumpRecordType, dbDumpMenu and dbDumpRecord will now
+46
View File
@@ -0,0 +1,46 @@
/*************************************************************************\
* Copyright (c) 2013 Dirk Zimoch, PSI
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* osi/os/WIN32/epicsFindSymbol.c */
#include <windows.h>
#define epicsExportSharedSymbols
#include "epicsFindSymbol.h"
static int epicsLoadErrorCode = 0;
epicsShareFunc void * epicsLoadLibrary(const char *name)
{
HMODULE lib;
epicsLoadErrorCode = 0;
lib = LoadLibrary(name);
if (lib == NULL)
{
epicsLoadErrorCode = GetLastError();
}
return lib;
}
epicsShareFunc const char *epicsLoadError(void)
{
static char buffer[100];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
epicsLoadErrorCode,
0,
buffer,
sizeof(buffer)-1, NULL );
return buffer;
}
epicsShareFunc void * epicsShareAPI epicsFindSymbol(const char *name)
{
return GetProcAddress(0, name);
}