[proxy,modules] Declare proxy module entry function

When building static proxy modules export the entry function name as
<module_name>_proxy_module_entry_point instead of only
proxy_module_entry_point when using shared linking
This commit is contained in:
akallabeth
2025-08-11 08:16:24 +02:00
parent a2510d1f5d
commit 00a5775fc4
6 changed files with 75 additions and 24 deletions

View File

@@ -40,6 +40,7 @@ include(CXXCompilerFlags)
set(SRCS bitmap-filter.cpp)
addtargetwithresourcefile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:BUILD_SHARED_LIBS>)
target_link_libraries(${PROJECT_NAME} winpr freerdp)
installwithrpath(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@@ -445,16 +445,7 @@ static BOOL filter_server_session_end(proxyPlugin* plugin, proxyData* pdata, voi
return TRUE;
}
#ifdef __cplusplus
extern "C"
{
#endif
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
#ifdef __cplusplus
}
#endif
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
proxyPlugin plugin = {};
@@ -477,3 +468,26 @@ BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userda
return plugins_manager->RegisterPlugin(plugins_manager, &plugin);
}
#ifdef __cplusplus
extern "C"
{
#endif
#if defined(BUILD_SHARED_LIBS)
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#else
FREERDP_API BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
void* userdata);
BOOL bitmap_filter_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -40,6 +40,7 @@ include(CXXCompilerFlags)
set(SRCS demo.cpp)
addtargetwithresourcefile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:BUILD_SHARED_LIBS>)
target_link_libraries(${PROJECT_NAME} winpr)
installwithrpath(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@@ -408,16 +408,7 @@ static BOOL demo_dyn_channel_intercept([[maybe_unused]] proxyPlugin* plugin,
return TRUE;
}
#ifdef __cplusplus
extern "C"
{
#endif
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
#ifdef __cplusplus
}
#endif
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
struct demo_custom_data* custom = nullptr;
proxyPlugin plugin = {};
@@ -467,3 +458,26 @@ BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userda
return plugins_manager->RegisterPlugin(plugins_manager, &plugin);
}
#ifdef __cplusplus
extern "C"
{
#endif
#if defined(BUILD_SHARED_LIBS)
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#else
FREERDP_API BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
void* userdata);
BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -39,6 +39,7 @@ include(ProjectCXXStandard)
set(SRCS dyn-channel-dump.cpp)
addtargetwithresourcefile(${PROJECT_NAME} FALSE "${PROJECT_VERSION}" SRCS FALSE)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<BOOL:${BUILD_SHARED_LIBS}>:BUILD_SHARED_LIBS>)
target_link_libraries(${PROJECT_NAME} PRIVATE winpr freerdp freerdp-client freerdp-server freerdp-server-proxy)
installwithrpath(TARGETS ${PROJECT_NAME} DESTINATION ${FREERDP_PROXY_PLUGINDIR})

View File

@@ -423,10 +423,7 @@ static BOOL dump_unload(proxyPlugin* plugin)
return TRUE;
}
extern "C" FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager,
void* userdata);
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
static BOOL int_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
proxyPlugin plugin = {};
@@ -448,3 +445,26 @@ BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userda
return plugins_manager->RegisterPlugin(plugins_manager, &plugin);
}
#ifdef __cplusplus
extern "C"
{
#endif
#if defined(BUILD_SHARED_LIBS)
FREERDP_API BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata);
BOOL proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#else
FREERDP_API BOOL demo_proxy_module_entry_point(proxyPluginsManager* plugins_manager,
void* userdata);
BOOL dyn_channel_dump_proxy_module_entry_point(proxyPluginsManager* plugins_manager, void* userdata)
{
return int_proxy_module_entry_point(plugins_manager, userdata);
}
#endif
#ifdef __cplusplus
}
#endif