Skip to content

Commit

Permalink
WIN32: osdFindSymbol() use psapi
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Apr 1, 2020
1 parent 2810ddf commit d02a9d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure/os/CONFIG.linux-x86.win32-x86-mingw
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
GNU_LDLIBS_YES =

# Link with system libraries
OP_SYS_LDLIBS = -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
OP_SYS_LDLIBS = -lpsapi -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
2 changes: 1 addition & 1 deletion configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
GNU_LDLIBS_YES =

# Link with system libraries
OP_SYS_LDLIBS = -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
OP_SYS_LDLIBS = -lpsapi -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
2 changes: 1 addition & 1 deletion configure/os/CONFIG.win32-x86.win32-x86
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ OBJ_CXXFLAG = -Fo
STATIC_CXXFLAGS_YES= -MT$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS)
STATIC_CXXFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL

STATIC_LDLIBS_YES=ws2_32.lib advapi32.lib user32.lib kernel32.lib winmm.lib dbghelp.lib
STATIC_LDLIBS_YES=psapi.lib ws2_32.lib advapi32.lib user32.lib kernel32.lib winmm.lib dbghelp.lib
STATIC_LDLIBS_NO=
STATIC_LDFLAGS=
RANLIB=
Expand Down
7 changes: 1 addition & 6 deletions modules/libcom/src/osi/os/WIN32/osdFindSymbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
\*************************************************************************/
/* osi/os/WIN32/osdFindSymbol.c */

/* avoid need to link against psapi.dll
* requires windows 7 or later
*/
#define NTDDI_VERSION NTDDI_WIN7

#include <windows.h>
#include <psapi.h>

Expand Down Expand Up @@ -63,7 +58,7 @@ epicsShareFunc void * epicsShareAPI epicsFindSymbol(const char *name)
/* As a handle returned by LoadLibrary() isn't available to us,
* try all loaded modules in arbitrary order.
*/
if(K32EnumProcessModules(GetCurrentProcess(), dlls, sizeof(dlls), &ndlls)) {
if(EnumProcessModules(GetCurrentProcess(), dlls, sizeof(dlls), &ndlls)) {
for(i=0; !ret && i<ndlls; i++) {
ret = GetProcAddress(dlls[i], name);
}
Expand Down

0 comments on commit d02a9d9

Please sign in to comment.