Hi all,
Yesterday I found that there is no Windows implementation of the file
epicsFindSymbol.c which provides epicsLoadLibrary(), epicsLoadError(),
and epicsFindSymbol().
Since I find calling epicsLoadLibrary from the iocsh quite useful, I
have written the windows implementation.
Usage:
1) copy the attached file to
<base>/src/libCom/osi/os/WIN32/osdFindSymbol.c
2) rebuild base
Dirk
/*************************************************************************\
* 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);
}
- Replies:
- Re: Missing Windows Implementation of epicsLoadLibrary Andrew Johnson
- Navigate by Date:
- Prev:
CONNECTING SIEMENS CPU314C-2 PN/DP Papu, Joseph
- Next:
dbFreeLink called but link type unknown Michael Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
CONNECTING SIEMENS CPU314C-2 PN/DP Papu, Joseph
- Next:
Re: Missing Windows Implementation of epicsLoadLibrary Andrew Johnson
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|