diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index d2464baaa..a9698ec90 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,11 @@ +

Added osdFindSymbol for Windows

+ +

Dirk Zimoch implemented the epicsLoadLibrary(), epicsLoadError() and +epicsFindSymbol() routines for Windows OS targets.

+

More dbStatic commands accept "" or "*" to mean 'all'

The IOC commands dbDumpRecordType, dbDumpMenu and dbDumpRecord will now diff --git a/src/libCom/osi/os/WIN32/osdFindSymbol.c b/src/libCom/osi/os/WIN32/osdFindSymbol.c new file mode 100644 index 000000000..ed2b79c95 --- /dev/null +++ b/src/libCom/osi/os/WIN32/osdFindSymbol.c @@ -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 + +#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); +}