Merge branch 'master' of github.com:mrthebunny/FreeRDP

This commit is contained in:
Marc-André Moreau 2013-11-07 13:58:33 -05:00
commit 7fa5ab7ced
7 changed files with 22 additions and 12 deletions

View File

@ -199,7 +199,6 @@ void AppDelegate_ConnectionResultEventHandler(void* ctx, ConnectionResultEventAr
// Making sure this should be invoked on the main UI thread.
[_singleDelegate performSelectorOnMainThread:@selector(rdpConnectError:) withObject:message waitUntilDone:FALSE];
[message release];
}
}
}

View File

@ -133,7 +133,7 @@ int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const c
return 0;
}
int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, BYTE* buffer, size_t size)
int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, const BYTE* buffer, size_t size)
{
rdpFile* file;
int status = -1;

View File

@ -305,7 +305,9 @@ void freerdp_client_parse_rdp_file_string_unicode(rdpFile* file, WCHAR* name, WC
void freerdp_client_parse_rdp_file_string_ascii(rdpFile* file, char* name, char* value)
{
freerdp_client_rdp_file_set_string(file, name, value);
char* valueA = _strdup(value);
if (!freerdp_client_rdp_file_set_string(file, name, valueA))
free(valueA);
}
void freerdp_client_parse_rdp_file_option_unicode(rdpFile* file, WCHAR* option)
@ -323,7 +325,7 @@ void freerdp_client_parse_rdp_file_option_ascii(rdpFile* file, char* option)
freerdp_client_add_option(file, option);
}
BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, BYTE* buffer, size_t size)
BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, const BYTE* buffer, size_t size)
{
int length;
char* line;
@ -395,7 +397,7 @@ next_line:
return TRUE;
}
BOOL freerdp_client_parse_rdp_file_buffer_unicode(rdpFile* file, BYTE* buffer, size_t size)
BOOL freerdp_client_parse_rdp_file_buffer_unicode(rdpFile* file, const BYTE* buffer, size_t size)
{
int length;
WCHAR* line;
@ -468,7 +470,7 @@ next_line:
return TRUE;
}
BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, BYTE* buffer, size_t size)
BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, const BYTE* buffer, size_t size)
{
if (size < 2)
return FALSE;
@ -631,7 +633,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
}
#define WRITE_RDP_FILE_DECLARE(_file, _buffer, _size) \
rdpFile* __rdpFile = file; \
const rdpFile* __rdpFile = file; \
char* __buffer = _buffer; \
size_t __size = _size; \
size_t __required_size = 0; \
@ -641,7 +643,11 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
#define WRITE_RDP_FILE_VALUE_INTEGER(_format, _field) \
if (~__rdpFile->_field) \
{ \
__count = sprintf_s(__buffer == NULL ? NULL : __buffer + __current, __buffer == NULL ? 0 : __size - __required_size, _format, (int) __rdpFile->_field); \
if (__buffer) \
__count = sprintf_s(__buffer + __current, __size - __required_size, _format, (int) __rdpFile->_field); \
else \
__count = _scprintf(_format, (int) __rdpFile->_field); \
\
__required_size += __count; \
__current += __count; \
}
@ -649,7 +655,11 @@ if (~__rdpFile->_field) \
#define WRITE_RDP_FILE_VALUE_STRING(_format, _field) \
if (~((size_t) __rdpFile->_field) && __rdpFile->_field != NULL) \
{ \
__count = sprintf_s(__buffer == NULL ? NULL : __buffer + __current, __buffer == NULL ? 0 : __size - __required_size, _format, __rdpFile->_field); \
if (__buffer) \
__count = sprintf_s(__buffer + __current, __size - __required_size, _format, __rdpFile->_field); \
else \
__count = _scprintf(_format, __rdpFile->_field); \
\
__required_size += __count; \
__current += __count; \
}

View File

@ -87,7 +87,7 @@ FREERDP_API HANDLE freerdp_client_get_thread(rdpContext* context);
FREERDP_API int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, char** argv);
FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const char* filename);
FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, BYTE* buffer, size_t size);
FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, const BYTE* buffer, size_t size);
FREERDP_API int freerdp_client_settings_write_connection_file(const rdpSettings* settings, const char* filename, BOOL unicode);
#ifdef __cplusplus

View File

@ -142,7 +142,7 @@ extern "C" {
#endif
FREERDP_API BOOL freerdp_client_parse_rdp_file(rdpFile* file, const char* name);
FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, BYTE* buffer, size_t size);
FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, const BYTE* buffer, size_t size);
FREERDP_API BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* settings);
FREERDP_API BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSettings* settings);

View File

@ -70,7 +70,7 @@ void profiler_print(PROFILER* profiler)
double elapsed_sec = stopwatch_get_elapsed_time_in_seconds(profiler->stopwatch);
double avg_sec = elapsed_sec / (double) profiler->stopwatch->count;
fprintf(stderr, "| %-30.30s| %10lu | %9f | %9f |\n",
fprintf(stderr, "| %-30.30s| %10du | %9f | %9f |\n",
profiler->name, profiler->stopwatch->count, elapsed_sec, avg_sec);
}

View File

@ -153,6 +153,7 @@ WINPR_API int lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
#endif
#define sprintf_s snprintf
#define _scprintf(_fmt, ...) snprintf(NULL, 0, _fmt, ## __VA_ARGS__)
#define _scprintf(_fmt, ...) snprintf(NULL, 0, _fmt, ## __VA_ARGS__)