Merge branch 'master' of github.com:FreeRDP/FreeRDP into tsg

This commit is contained in:
Marc-André Moreau 2012-05-05 18:42:51 -04:00
commit 4419515a50
13 changed files with 97 additions and 24 deletions

View File

@ -22,7 +22,7 @@ set(AUDIN_PULSE_SRCS
)
include_directories(..)
include_directories(${PULSE_INCLUDE_DIRS})
include_directories(${PULSEAUDIO_INCLUDE_DIR})
add_library(audin_pulse ${AUDIN_PULSE_SRCS})
set_target_properties(audin_pulse PROPERTIES PREFIX "")

View File

@ -22,7 +22,7 @@ set(TSMF_PULSE_SRCS
)
include_directories(..)
include_directories(${PULSE_INCLUDE_DIRS})
include_directories(${PULSEAUDIO_INCLUDE_DIR})
add_library(tsmf_pulse ${TSMF_PULSE_SRCS})
set_target_properties(tsmf_pulse PROPERTIES PREFIX "")

View File

@ -125,9 +125,8 @@ static void printer_cups_close_printjob(rdpPrintJob* printjob)
#endif
xfree(cups_printjob);
((rdpCupsPrinter*)printjob->printer)->printjob = NULL;
xfree(cups_printjob) ;
}
static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, uint32 id)

View File

@ -22,7 +22,7 @@ set(RDPSND_PULSE_SRCS
)
include_directories(..)
include_directories(${PULSE_INCLUDE_DIRS})
include_directories(${PULSEAUDIO_INCLUDE_DIR})
add_library(rdpsnd_pulse ${RDPSND_PULSE_SRCS})
set_target_properties(rdpsnd_pulse PROPERTIES PREFIX "")

View File

@ -1180,7 +1180,7 @@ int xfreerdp_run(freerdp* instance)
/** Entry point for the thread that will deal with the session.
* It just calls xfreerdp_run() using the given instance as parameter.
* @param - pointer to a thread_data structure that contains the initialized connection.
* @param param - pointer to a thread_data structure that contains the initialized connection.
*/
void* thread_func(void* param)
{

View File

@ -4,7 +4,7 @@ if (PKG_CONFIG_FOUND)
pkg_check_modules(PULSEAUDIO libpulse)
endif()
find_path(PULSEAUDIO_INCLUDE_DIR pulseaudio.h PATHS ${PULSEAUDIO_INCLUDE_DIRS} PATH_SUFFIXES pulse )
find_path(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h PATHS ${PULSEAUDIO_INCLUDE_DIRS} PATH_SUFFIXES pulse )
find_library(PULSEAUDIO_LIBRARY pulse PATHS ${PULSEAUDIO_LIBRARY_DIRS})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PulseAudio DEFAULT_MSG PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY)

View File

@ -287,6 +287,12 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
PCHANNEL_DEF lchannel_def;
struct channel_data* lchannel_data;
if (ppInitHandle == NULL)
{
DEBUG_CHANNELS("error bad pphan");
return CHANNEL_RC_BAD_INIT_HANDLE;
}
channels = g_init_channels;
channels->init_handles[channels->num_init_handles].channels = channels;
*ppInitHandle = &channels->init_handles[channels->num_init_handles];
@ -300,12 +306,6 @@ static uint32 FREERDP_CC MyVirtualChannelInit(void** ppInitHandle, PCHANNEL_DEF
return CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY;
}
if (ppInitHandle == 0)
{
DEBUG_CHANNELS("error bad pphan");
return CHANNEL_RC_BAD_INIT_HANDLE;
}
if (channels->num_channels_data + channelCount >= CHANNEL_MAX_COUNT)
{
DEBUG_CHANNELS("error too many channels");

View File

@ -310,11 +310,13 @@ boolean WTSVirtualChannelWrite(
wts_data_item* item;
boolean result = false;
rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle;
WTSVirtualChannelManager* vcm = channel->vcm;
WTSVirtualChannelManager* vcm ;
if (channel == NULL)
return false;
vcm = channel->vcm ;
if (channel->channel_type == RDP_PEER_CHANNEL_TYPE_SVC)
{
item = xnew(wts_data_item);

View File

@ -381,7 +381,10 @@ boolean tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname)
if (certificate_status && hostname_match)
{
if (common_name)
{
xfree(common_name);
common_name=NULL ;
}
verification_status = true; /* success! */
}

View File

@ -1598,7 +1598,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
{
time_t t;
struct tm* local_time;
TIME_ZONE_ENTRY* timezone;
TIME_ZONE_ENTRY* tz;
time(&t);
local_time = localtime(&t);
@ -1628,18 +1628,18 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
clientTimeZone->daylightBias = clientTimeZone->bias + 60;
}
timezone = freerdp_detect_windows_time_zone(clientTimeZone->bias);
tz = freerdp_detect_windows_time_zone(clientTimeZone->bias);
if (timezone != NULL)
if (tz!= NULL)
{
clientTimeZone->bias = timezone->Bias;
sprintf(clientTimeZone->standardName, "%s", timezone->StandardName);
sprintf(clientTimeZone->daylightName, "%s", timezone->DaylightName);
clientTimeZone->bias = tz->Bias;
sprintf(clientTimeZone->standardName, "%s", tz->StandardName);
sprintf(clientTimeZone->daylightName, "%s", tz->DaylightName);
if ((timezone->SupportsDST) && (timezone->RuleTableCount > 0))
if ((tz->SupportsDST) && (tz->RuleTableCount > 0))
{
TIME_ZONE_RULE_ENTRY* rule;
rule = freerdp_get_current_time_zone_rule(timezone->RuleTable, timezone->RuleTableCount);
rule = freerdp_get_current_time_zone_rule(tz->RuleTable, tz->RuleTableCount);
if (rule != NULL)
{
@ -1666,7 +1666,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
}
}
xfree(timezone);
xfree(tz);
}
else
{

View File

@ -46,6 +46,20 @@
#endif
/**
* UNUSED
* This function opens a handle on the specified library in order to load symbols from it.
* It is just a wrapper over dlopen(), but provides some logs in case of error.
*
* The returned pointer can be used to load a symbol from the library, using the freerdp_get_library_symbol() call.
* The returned pointer should be closed using the freerdp_close_library() call.
*
* @see freerdp_get_library_symbol
* @see freerdp_close_library
*
* @param file [IN] - library name
* @return Pointer to the loaded library. NULL if an error occurs.
*/
void* freerdp_open_library(const char* file)
{
void* library;
@ -61,6 +75,20 @@ void* freerdp_open_library(const char* file)
return library;
}
/**
* UNUSED
* This function retrieves a pointer to the specified symbol from the given (loaded) library.
* It is a wrapper over the dlsym() function, but provides some logs in case of error.
*
* @see freerdp_open_library
* @see freerdp_close_library
*
* @param library [IN] - a valid pointer to the opened library.
* This pointer should come from a successful call to freerdp_open_library()
* @param name [IN] - name of the symbol that must be loaded
*
* @return A pointer to the loaded symbol. NULL if an error occured.
*/
void* freerdp_get_library_symbol(void* library, const char* name)
{
void* symbol;
@ -76,6 +104,16 @@ void* freerdp_get_library_symbol(void* library, const char* name)
return symbol;
}
/**
* UNUSED
* This function closes a library handle that was previously opened by freerdp_open_library().
* It is a wrapper over dlclose(), but provides logs in case of error.
*
* @see freerdp_open_library
* @see freerdp_get_library_symbol
*
* @return true if the close succeeded. false otherwise.
*/
boolean freerdp_close_library(void* library)
{
int status;
@ -95,6 +133,17 @@ boolean freerdp_close_library(void* library)
return true;
}
/**
* This function will load the specified library, retrieve the specified symbol in it, and return a pointer to it.
* It is used in freerdp_load_plugin() and freerdp_load_channel_plugin().
* It seems there is no way to unload the library once this call is made. Now since this is used for plugins,
* we probably don't need to take care of unloading them, as it will be done only at shutdown.
*
* @param file [IN] - library name
* @param name [IN] - symbol name to find in the library
*
* @return pointer to the referenced symbol. NULL if an error occured.
*/
void* freerdp_load_library_symbol(const char* file, const char* name)
{
void* library;
@ -119,6 +168,17 @@ void* freerdp_load_library_symbol(const char* file, const char* name)
return symbol;
}
/**
* This function is used to load plugins. It will load the specified library, retrieve the specified symbol,
* and return a pointer to it.
* There is no way to unload the library once it has been loaded this way - since it is used for plugins only,
* maybe it's not a must.
*
* @param name [IN] - name of the library to load
* @param entry_name [IN] - name of the symbol to find and load from the library
*
* @return Pointer to the loaded symbol. NULL if an error occurred.
*/
void* freerdp_load_plugin(const char* name, const char* entry_name)
{
char* path;
@ -152,6 +212,13 @@ void* freerdp_load_plugin(const char* name, const char* entry_name)
return entry;
}
/**
* UNUSED
* This function was meant to be used to load channel plugins.
* It was initially called from freerdp_channels_load_plugin() but now we use the freerdp_load_plugin() function
* which is more generic.
*
*/
void* freerdp_load_channel_plugin(rdpSettings* settings, const char* name, const char* entry_name)
{
char* path;

View File

@ -141,6 +141,8 @@ wchar_t* xwcsdup(const wchar_t* wstr)
#ifdef _WIN32
mem = _wcsdup(wstr);
#elif sun
mem = wsdup(wstr);
#else
mem = wcsdup(wstr);
#endif

View File

@ -261,7 +261,7 @@ int krb_decode_cname(STREAM* s, uint8 tag, char** str)
if(verlen != len)
{
xfree(str);
xfree(*str);
*str = NULL;
goto err;
}