! * \brief Query for function pointer in library * \details This takes a shared module handle returned from LoadSharedLibrary, and a text string of a symbol * to load from the module, and returns a pointer to that symbol. If the symbol is not found, NULL * is returned. If the module handle is NULL, NULL is returned. * \param[in] libHandle Platform handle to the dynamic library * \param[in
| 111 | * |
| 112 | */ |
| 113 | inline void* LoadFunctionAddr(void* libHandle, std::string funcName) |
| 114 | { |
| 115 | if (libHandle == NULL) |
| 116 | return NULL; |
| 117 | |
| 118 | #if defined( _WIN32 ) |
| 119 | HMODULE fileHandle = reinterpret_cast<HMODULE>(libHandle); |
| 120 | |
| 121 | void* pFunc = reinterpret_cast<void*>(::GetProcAddress(fileHandle, funcName.c_str())); |
| 122 | #else |
| 123 | void* pFunc = ::dlsym( libHandle, funcName.c_str( ) ); |
| 124 | #endif |
| 125 | |
| 126 | return pFunc; |
| 127 | } |
| 128 | |
| 129 | #endif // _SHAREDLIBRARY_H_ |
no outgoing calls
no test coverage detected