channels: make rail, drdynvc, cliprdr and rdpsnd built-in channels

This commit is contained in:
Marc-André Moreau 2012-10-08 22:48:17 -04:00
parent e95b5b5a24
commit ac7e1a3aea
17 changed files with 63 additions and 88 deletions

View File

@ -1,4 +1,4 @@
# FreeRDP: A Remote Desktop Protocol Client
# FreeRDP: A Remote Desktop Protocol Implementation
# FreeRDP cmake build script
#
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
@ -15,9 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
if(WITH_STATIC_PLUGINS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(FILENAME "ChannelOptions.cmake")
file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")

View File

@ -31,16 +31,17 @@ foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
if(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL "VirtualChannelEntry")
set(ENTRY_POINT_NAME "${${STATIC_MODULE}_CLIENT_NAME}_${${STATIC_MODULE}_CLIENT_ENTRY}")
set(ENTRY_POINT_IMPORT "extern int ${ENTRY_POINT_NAME}(PCHANNEL_ENTRY_POINTS pEntryPoints);")
set(VIRTUAL_CHANNEL_ENTRY_IMPORTS "${VIRTUAL_CHANNEL_ENTRY_IMPORTS}\n${VIRTUAL_CHANNEL_ENTRY_IMPORTS}${ENTRY_POINT_IMPORT}")
set(VIRTUAL_CHANNEL_ENTRY_IMPORTS "${VIRTUAL_CHANNEL_ENTRY_IMPORTS}\n${ENTRY_POINT_IMPORT}")
set(VIRTUAL_CHANNEL_ENTRY_TABLE "${VIRTUAL_CHANNEL_ENTRY_TABLE}\n\t{ \"${STATIC_MODULE_NAME}\", ${ENTRY_POINT_NAME} },")
endif()
if(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL "DeviceServiceEntry")
set(ENTRY_POINT_NAME "${${STATIC_MODULE}_CLIENT_NAME}_${${STATIC_MODULE}_CLIENT_ENTRY}")
set(ENTRY_POINT_IMPORT "extern int ${ENTRY_POINT_NAME}(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints);")
set(DEVICE_SERVICE_ENTRY_IMPORTS "${DEVICE_SERVICE_ENTRY_IMPORTS}\n${DEVICE_SERVICE_ENTRY_IMPORTS}${ENTRY_POINT_IMPORT}")
set(DEVICE_SERVICE_ENTRY_IMPORTS "${DEVICE_SERVICE_ENTRY_IMPORTS}\n${ENTRY_POINT_IMPORT}")
set(DEVICE_SERVICE_ENTRY_TABLE "${DEVICE_SERVICE_ENTRY_TABLE}\n\t{ \"${STATIC_MODULE_NAME}\", ${ENTRY_POINT_NAME} },")
endif()
endforeach()
set(VIRTUAL_CHANNEL_ENTRY_TABLE "${VIRTUAL_CHANNEL_ENTRY_TABLE}\n\t{ \"\", NULL }")

View File

@ -25,19 +25,13 @@ set(${MODULE_PREFIX}_SRCS
cliprdr_main.c
cliprdr_main.h)
if(MSVC AND (NOT WITH_STATIC_PLUGINS))
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
endif()
# cliprdr is always built-in
if(NOT WITH_STATIC_PLUGINS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")

View File

@ -271,9 +271,8 @@ static void cliprdr_process_terminate(rdpSvcPlugin* plugin)
xfree(plugin);
}
#ifdef WITH_STATIC_PLUGINS
/* cliprdr is always built-in */
#define VirtualChannelEntry cliprdr_VirtualChannelEntry
#endif
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{

View File

@ -25,15 +25,13 @@ set(${MODULE_PREFIX}_SRCS
dvcman.c
dvcman.h)
if(NOT WITH_STATIC_PLUGINS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
# drdynvc is always built-in
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
@ -43,7 +41,5 @@ else()
target_link_libraries(${MODULE_NAME} freerdp-utils winpr-synch)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH})
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client")

View File

@ -365,9 +365,8 @@ static void drdynvc_process_terminate(rdpSvcPlugin* plugin)
xfree(drdynvc);
}
#ifdef WITH_STATIC_PLUGINS
/* drdynvc is always built-in */
#define VirtualChannelEntry drdynvc_VirtualChannelEntry
#endif
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{

View File

@ -24,15 +24,13 @@ set(${MODULE_PREFIX}_SRCS
rail_orders.c
rail_orders.h)
if(NOT WITH_STATIC_PLUGINS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
# rail is always built-in
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")

View File

@ -252,9 +252,8 @@ static void rail_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
freerdp_event_free(event);
}
#ifdef WITH_STATIC_PLUGINS
/* rail is always built-in */
#define VirtualChannelEntry rail_VirtualChannelEntry
#endif
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{

View File

@ -28,19 +28,13 @@ set(${MODULE_PREFIX}_SRCS
rdpdr_capabilities.c
rdpdr_capabilities.h)
if(MSVC AND (NOT WITH_STATIC_PLUGINS))
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
endif()
# rdpdr is always built-in
if(NOT WITH_STATIC_PLUGINS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
@ -50,7 +44,5 @@ else()
target_link_libraries(${MODULE_NAME} freerdp-utils winpr-crt winpr-synch winpr-thread winpr-interlocked)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH})
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${MODULE_NAME}/Client")

View File

@ -32,6 +32,7 @@
#include <freerdp/utils/list.h>
#include <freerdp/utils/svc_plugin.h>
#include <freerdp/utils/load_plugin.h>
#include <freerdp/client/channels.h>
#include "rdpdr_main.h"
#include "devman.h"
@ -70,10 +71,22 @@ static void devman_register_device(DEVMAN* devman, DEVICE* device)
boolean devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data)
{
char* name;
DEVICE_SERVICE_ENTRY_POINTS ep;
PDEVICE_SERVICE_ENTRY entry;
PDEVICE_SERVICE_ENTRY entry = NULL;
entry = freerdp_load_plugin((char*) plugin_data->data[0], "DeviceServiceEntry");
name = (char*) plugin_data->data[0];
entry = (PDEVICE_SERVICE_ENTRY) freerdp_channels_find_static_device_service_entry(name);
if (!entry)
{
printf("loading device service %s (plugin)\n", name);
entry = freerdp_load_plugin(name, "DeviceServiceEntry");
}
else
{
printf("loading device service %s (static)\n", name);
}
if (entry == NULL)
return false;

View File

@ -1,3 +0,0 @@
LIBRARY "rdpdr"
EXPORTS
VirtualChannelEntry @1

View File

@ -316,9 +316,8 @@ static void rdpdr_process_terminate(rdpSvcPlugin* plugin)
xfree(plugin);
}
#ifdef WITH_STATIC_PLUGINS
/* rdpdr is always built-in */
#define VirtualChannelEntry rdpdr_VirtualChannelEntry
#endif
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{

View File

@ -22,15 +22,13 @@ set(${MODULE_PREFIX}_SRCS
rdpsnd_main.c
rdpsnd_main.h)
if(NOT WITH_STATIC_PLUGINS)
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
else()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
# rdpsnd is always built-in
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
endif()
set(${MODULE_PREFIX}_STATIC ON PARENT_SCOPE)
set(${MODULE_PREFIX}_NAME ${MODULE_NAME} PARENT_SCOPE)
set(${MODULE_PREFIX}_ENTRY "VirtualChannelEntry" PARENT_SCOPE)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")

View File

@ -565,9 +565,8 @@ static void rdpsnd_process_terminate(rdpSvcPlugin* plugin)
xfree(plugin);
}
#ifdef WITH_STATIC_PLUGINS
/* rdpsnd is always built-in */
#define VirtualChannelEntry rdpsnd_VirtualChannelEntry
#endif
const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
@ -591,4 +590,3 @@ const int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
return 1;
}

View File

@ -1,4 +1,4 @@
# FreeRDP: A Remote Desktop Protocol Client
# FreeRDP: A Remote Desktop Protocol Implementation
# FreeRDP X11 Client
#
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
@ -94,9 +94,7 @@ endif()
include_directories(${CMAKE_SOURCE_DIR}/resources)
if(WITH_STATIC_PLUGINS)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-channels-client)
endif()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-channels-client)
if(WITH_MONOLITHIC_BUILD)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp)
@ -114,3 +112,4 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/X11")

View File

@ -56,11 +56,8 @@
#include <freerdp/utils/signal.h>
#include <freerdp/utils/passphrase.h>
#include <freerdp/client/cliprdr.h>
#include <freerdp/rail.h>
#ifdef WITH_STATIC_PLUGINS
#include <freerdp/client/channels.h>
#endif
#include <freerdp/rail.h>
#include <winpr/synch.h>
@ -948,12 +945,9 @@ int xf_process_client_args(rdpSettings* settings, const char* opt, const char* v
*/
int xf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data)
{
void* entry;
void* entry = NULL;
rdpChannels* channels = (rdpChannels*) user_data;
entry = NULL;
#ifdef WITH_STATIC_PLUGINS
entry = freerdp_channels_find_static_virtual_channel_entry(name);
if (entry)
@ -964,7 +958,6 @@ int xf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_D
return 1;
}
}
#endif
printf("loading channel %s (plugin)\n", name);
freerdp_channels_load_plugin(channels, settings, name, plugin_data);

View File

@ -17,13 +17,14 @@
* limitations under the License.
*/
#ifndef __FREERDP_RDPSND_H
#define __FREERDP_RDPSND_H
#ifndef FREERDP_CHANNEL_RDPSND_H
#define FREERDP_CHANNEL_RDPSND_H
#include <freerdp/api.h>
#include <freerdp/types.h>
typedef struct rdpsnd_format rdpsndFormat;
struct rdpsnd_format
{
uint16 wFormatTag;
@ -56,4 +57,5 @@ struct rdpsnd_format
#define MEDIUM_QUALITY 0x0001
#define HIGH_QUALITY 0x0002
#endif
#endif /* FREERDP_CHANNEL_RDPSND_H */