Merge remote branch 'upstream/master'

This commit is contained in:
Martin Fleisz 2011-11-23 03:08:55 -08:00
commit e1f2cf1090
132 changed files with 3861 additions and 3522 deletions

View File

@ -99,6 +99,10 @@ check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_files(netdb.h HAVE_NETDB_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(limits.h HAVE_LIMITS_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdbool.h HAVE_STDBOOL_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
# Libraries that we have a hard dependency on
find_required_package(OpenSSL)

View File

@ -43,6 +43,8 @@ void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIS
int i;
STREAM* s;
DEBUG_CLIPRDR("Sending Clipboard Format List");
if (cb_event->raw_format_data)
{
s = cliprdr_packet_new(CB_FORMAT_LIST, 0, cb_event->raw_format_data_size);
@ -80,33 +82,39 @@ void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIS
static void cliprdr_send_format_list_response(cliprdrPlugin* cliprdr)
{
STREAM* s;
DEBUG_CLIPRDR("Sending Clipboard Format List Response");
s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, CB_RESPONSE_OK, 0);
cliprdr_packet_send(cliprdr, s);
}
void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32 length, uint16 flags)
{
int i;
boolean ascii;
int num_formats;
uint8* end_mark;
CLIPRDR_FORMAT_NAME* format_name;
num_formats = length / 36;
if (num_formats <= 0)
{
cliprdr->format_names = NULL;
cliprdr->num_format_names = 0;
return;
}
if (num_formats * 36 != length)
DEBUG_WARN("dataLen %d not divided by 36!", length);
ascii = (flags & CB_ASCII_NAMES) ? True : False;
stream_get_mark(s, end_mark);
end_mark += length;
ascii = (flags & CB_ASCII_NAMES) ? true : false;
cliprdr->format_names = (CLIPRDR_FORMAT_NAME*) xmalloc(sizeof(CLIPRDR_FORMAT_NAME) * num_formats);
cliprdr->num_format_names = num_formats;
format_name = cliprdr->format_names;
while (s->p < end_mark)
for (i = 0; i < num_formats; i++)
{
format_name = &cliprdr->format_names[i];
stream_read_uint32(s, format_name->id);
if (ascii)
@ -121,8 +129,6 @@ void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint3
}
stream_seek(s, 32);
format_name++;
}
}
@ -149,17 +155,16 @@ void cliprdr_process_long_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32
cliprdr->format_names = (CLIPRDR_FORMAT_NAME*) xmalloc(sizeof(CLIPRDR_FORMAT_NAME) * num_formats);
cliprdr->num_format_names = num_formats;
format_name = cliprdr->format_names;
num_formats = 0;
while (s->p < end_mark)
{
format_name = &cliprdr->format_names[num_formats++];
stream_read_uint32(s, format_name->id);
format_name->name = freerdp_uniconv_in(cliprdr->uniconv, s->p, 32);
format_name->length = strlen(format_name->name);
stream_seek(s, 32);
format_name++;
}
}
@ -186,13 +191,15 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
else
cliprdr_process_short_format_names(cliprdr, s, dataLen, msgFlags);
format_name = cliprdr->format_names;
cb_event->formats = (uint32*) xmalloc(sizeof(uint32) * cliprdr->num_format_names);
if (cliprdr->num_format_names > 0)
cb_event->formats = (uint32*) xmalloc(sizeof(uint32) * cliprdr->num_format_names);
cb_event->num_formats = 0;
for (i = 0; i < cliprdr->num_format_names; i++)
{
supported = True;
supported = true;
format_name = &cliprdr->format_names[i];
format = format_name->id;
switch (format)
@ -206,6 +213,8 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
if (format_name->length > 0)
{
DEBUG_CLIPRDR("format: %s", format_name->name);
if (strcmp(format_name->name, "HTML Format") == 0)
{
format = CB_FORMAT_HTML;
@ -228,20 +237,21 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
}
}
supported = False;
supported = false;
break;
}
if (supported)
cb_event->formats[cb_event->num_formats++] = format;
if (format_name->name != NULL)
xfree(format_name->name);
format_name++;
}
xfree(cliprdr->format_names);
if (cliprdr->format_names != NULL)
{
xfree(cliprdr->format_names);
cliprdr->format_names = NULL;
}
cliprdr->num_format_names = 0;
svc_plugin_send_event((rdpSvcPlugin*) cliprdr, (RDP_EVENT*) cb_event);
cliprdr_send_format_list_response(cliprdr);
@ -249,6 +259,8 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, uint16 msgFlags)
{
/* where is this documented? */
#if 0
RDP_EVENT* event;
if ((msgFlags & CB_RESPONSE_FAIL) != 0)
@ -256,6 +268,7 @@ void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, uint16 msgFlag
event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_MONITOR_READY, NULL, NULL);
svc_plugin_send_event((rdpSvcPlugin*) cliprdr, event);
}
#endif
}
void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, STREAM* s)
@ -273,6 +286,8 @@ void cliprdr_process_format_data_response_event(cliprdrPlugin* cliprdr, RDP_CB_D
{
STREAM* s;
DEBUG_CLIPRDR("Sending Format Data Response");
if (cb_event->size > 0)
{
s = cliprdr_packet_new(CB_FORMAT_DATA_RESPONSE, CB_RESPONSE_OK, cb_event->size);
@ -289,6 +304,9 @@ void cliprdr_process_format_data_response_event(cliprdrPlugin* cliprdr, RDP_CB_D
void cliprdr_process_format_data_request_event(cliprdrPlugin* cliprdr, RDP_CB_DATA_REQUEST_EVENT* cb_event)
{
STREAM* s;
DEBUG_CLIPRDR("Sending Format Data Request");
s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, 0, 4);
stream_write_uint32(s, cb_event->format);
cliprdr_packet_send(cliprdr, s);

View File

@ -113,16 +113,18 @@ static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, STREAM* s
#endif
if (generalFlags & CB_USE_LONG_FORMAT_NAMES)
cliprdr->use_long_format_names = True;
cliprdr->use_long_format_names = true;
if (generalFlags & CB_STREAM_FILECLIP_ENABLED)
cliprdr->stream_fileclip_enabled = True;
cliprdr->stream_fileclip_enabled = true;
if (generalFlags & CB_FILECLIP_NO_FILE_PATHS)
cliprdr->fileclip_no_file_paths = True;
cliprdr->fileclip_no_file_paths = true;
if (generalFlags & CB_CAN_LOCK_CLIPDATA)
cliprdr->can_lock_clipdata = True;
cliprdr->can_lock_clipdata = true;
cliprdr->received_caps = true;
}
static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s)
@ -158,15 +160,20 @@ static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s)
static void cliprdr_send_clip_caps(cliprdrPlugin* cliprdr)
{
STREAM* s;
uint32 flags;
s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN);
DEBUG_CLIPRDR("Sending Capabilities");
flags = CB_USE_LONG_FORMAT_NAMES;
stream_write_uint16(s, 1); /* cCapabilitiesSets */
stream_write_uint16(s, 0); /* pad1 */
stream_write_uint16(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */
stream_write_uint16(s, CB_CAPSTYPE_GENERAL_LEN); /* lengthCapability */
stream_write_uint32(s, CB_CAPS_VERSION_2); /* version */
stream_write_uint32(s, 0); /* generalFlags */
stream_write_uint32(s, flags); /* generalFlags */
cliprdr_packet_send(cliprdr, s);
}
@ -175,7 +182,8 @@ static void cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr)
{
RDP_EVENT* event;
cliprdr_send_clip_caps(cliprdr);
if (cliprdr->received_caps)
cliprdr_send_clip_caps(cliprdr);
event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_MONITOR_READY, NULL, NULL);
svc_plugin_send_event((rdpSvcPlugin*) cliprdr, event);
@ -193,7 +201,7 @@ static void cliprdr_process_receive(rdpSvcPlugin* plugin, STREAM* s)
stream_read_uint32(s, dataLen);
DEBUG_CLIPRDR("msgType: %s (%d), msgFlags: %d dataLen: %d",
CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen);
CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen);
switch (msgType)
{
@ -234,21 +242,22 @@ static void cliprdr_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event)
switch (event->event_type)
{
case RDP_EVENT_TYPE_CB_FORMAT_LIST:
cliprdr_process_format_list_event((cliprdrPlugin*)plugin, (RDP_CB_FORMAT_LIST_EVENT*)event);
cliprdr_process_format_list_event((cliprdrPlugin*) plugin, (RDP_CB_FORMAT_LIST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_REQUEST:
cliprdr_process_format_data_request_event((cliprdrPlugin*)plugin, (RDP_CB_DATA_REQUEST_EVENT*)event);
cliprdr_process_format_data_request_event((cliprdrPlugin*) plugin, (RDP_CB_DATA_REQUEST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_RESPONSE:
cliprdr_process_format_data_response_event((cliprdrPlugin*)plugin, (RDP_CB_DATA_RESPONSE_EVENT*)event);
cliprdr_process_format_data_response_event((cliprdrPlugin*) plugin, (RDP_CB_DATA_RESPONSE_EVENT*) event);
break;
default:
DEBUG_WARN("unknown event type %d", event->event_type);
break;
}
freerdp_event_free(event);
}

View File

@ -36,6 +36,7 @@ struct cliprdr_plugin
{
rdpSvcPlugin plugin;
UNICONV* uniconv;
boolean received_caps;
boolean use_long_format_names;
boolean stream_fileclip_enabled;
boolean fileclip_no_file_paths;

View File

@ -61,7 +61,7 @@ static boolean audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_h
{
DEBUG_WARN("snd_pcm_hw_params_malloc (%s)",
snd_strerror(error));
return False;
return false;
}
snd_pcm_hw_params_any(capture_handle, hw_params);
snd_pcm_hw_params_set_access(capture_handle, hw_params,
@ -84,7 +84,7 @@ static boolean audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_h
alsa->actual_rate, alsa->actual_channels,
alsa->target_rate, alsa->target_channels);
}
return True;
return true;
}
static boolean audin_alsa_thread_receive(AudinALSADevice* alsa, uint8* src, int size)
@ -246,7 +246,7 @@ static boolean audin_alsa_format_supported(IAudinDevice* device, audinFormat* fo
(format->wBitsPerSample == 8 || format->wBitsPerSample == 16) &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
@ -255,11 +255,11 @@ static boolean audin_alsa_format_supported(IAudinDevice* device, audinFormat* fo
(format->wBitsPerSample == 4) &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
}
return False;
return false;
}
static void audin_alsa_set_format(IAudinDevice* device, audinFormat* format, uint32 FramesPerPacket)

View File

@ -222,7 +222,7 @@ static boolean audin_receive_wave_data(uint8* data, int size, void* user_data)
error = audin_send_incoming_data_pdu((IWTSVirtualChannelCallback*) callback);
if (error != 0)
return False;
return false;
out = stream_new(size + 1);
stream_write_uint8(out, MSG_SNDIN_DATA);
@ -230,7 +230,7 @@ static boolean audin_receive_wave_data(uint8* data, int size, void* user_data)
error = callback->channel->Write(callback->channel, stream_get_length(out), stream_get_head(out), NULL);
stream_free(out);
return (error == 0 ? True : False);
return (error == 0 ? true : false);
}
static int audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, STREAM* s)
@ -450,7 +450,7 @@ static boolean audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, R
}
if (entry == NULL)
{
return False;
return false;
}
entryPoints.plugin = pPlugin;
@ -459,10 +459,10 @@ static boolean audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, R
if (entry(&entryPoints) != 0)
{
DEBUG_WARN("%s entry returns error.", name);
return False;
return false;
}
return True;
return true;
}
static boolean audin_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* data)
@ -476,17 +476,17 @@ static boolean audin_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* d
if (data->data[1] && strcmp((char*)data->data[1], "format") == 0)
{
audin->fixed_format = atoi(data->data[2]);
return True;
return true;
}
else if (data->data[1] && strcmp((char*)data->data[1], "rate") == 0)
{
audin->fixed_rate = atoi(data->data[2]);
return True;
return true;
}
else if (data->data[1] && strcmp((char*)data->data[1], "channel") == 0)
{
audin->fixed_channel = atoi(data->data[2]);
return True;
return true;
}
else if (data->data[1] && ((char*)data->data[1])[0])
{
@ -511,7 +511,7 @@ static boolean audin_process_plugin_data(IWTSPlugin* pPlugin, RDP_PLUGIN_DATA* d
}
}
return True;
return true;
}
int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)

View File

@ -80,13 +80,13 @@ static boolean audin_pulse_connect(IAudinDevice* device)
AudinPulseDevice* pulse = (AudinPulseDevice*) device;
if (!pulse->context)
return False;
return false;
if (pa_context_connect(pulse->context, NULL, 0, NULL))
{
DEBUG_WARN("pa_context_connect failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
pa_threaded_mainloop_lock(pulse->mainloop);
if (pa_threaded_mainloop_start(pulse->mainloop) < 0)
@ -94,7 +94,7 @@ static boolean audin_pulse_connect(IAudinDevice* device)
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
for (;;)
{
@ -113,12 +113,12 @@ static boolean audin_pulse_connect(IAudinDevice* device)
if (state == PA_CONTEXT_READY)
{
DEBUG_DVC("connected");
return True;
return true;
}
else
{
pa_context_disconnect(pulse->context);
return False;
return false;
}
}
@ -163,7 +163,7 @@ static boolean audin_pulse_format_supported(IAudinDevice* device, audinFormat* f
(format->wBitsPerSample == 8 || format->wBitsPerSample == 16) &&
(format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX))
{
return True;
return true;
}
break;
@ -174,7 +174,7 @@ static boolean audin_pulse_format_supported(IAudinDevice* device, audinFormat* f
(format->wBitsPerSample == 8) &&
(format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX))
{
return True;
return true;
}
break;
@ -183,11 +183,11 @@ static boolean audin_pulse_format_supported(IAudinDevice* device, audinFormat* f
(format->wBitsPerSample == 4) &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
}
return False;
return false;
}
static void audin_pulse_set_format(IAudinDevice* device, audinFormat* format, uint32 FramesPerPacket)

View File

@ -50,11 +50,11 @@ static boolean tsmf_alsa_open_device(TSMFALSAAudioDevice* alsa)
if (error < 0)
{
DEBUG_WARN("failed to open device %s", alsa->device);
return False;
return false;
}
DEBUG_DVC("open device %s", alsa->device);
return True;
return true;
}
static boolean tsmf_alsa_open(ITSMFAudioDevice* audio, const char* device)
@ -84,7 +84,7 @@ static boolean tsmf_alsa_set_format(ITSMFAudioDevice* audio,
TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio;
if (!alsa->out_handle)
return False;
return false;
snd_pcm_drop(alsa->out_handle);
@ -96,7 +96,7 @@ static boolean tsmf_alsa_set_format(ITSMFAudioDevice* audio,
if (error < 0)
{
DEBUG_WARN("snd_pcm_hw_params_malloc failed");
return False;
return false;
}
snd_pcm_hw_params_any(alsa->out_handle, hw_params);
snd_pcm_hw_params_set_access(alsa->out_handle, hw_params,
@ -117,7 +117,7 @@ static boolean tsmf_alsa_set_format(ITSMFAudioDevice* audio,
if (error < 0)
{
DEBUG_WARN("snd_pcm_sw_params_malloc");
return False;
return false;
}
snd_pcm_sw_params_current(alsa->out_handle, sw_params);
snd_pcm_sw_params_set_start_threshold(alsa->out_handle, sw_params,
@ -138,7 +138,7 @@ static boolean tsmf_alsa_set_format(ITSMFAudioDevice* audio,
alsa->actual_rate, alsa->actual_channels,
alsa->source_rate, alsa->source_channels);
}
return True;
return true;
}
static boolean tsmf_alsa_play(ITSMFAudioDevice* audio, uint8* data, uint32 data_size)
@ -166,7 +166,6 @@ static boolean tsmf_alsa_play(ITSMFAudioDevice* audio, uint8* data, uint32 data_
{
resampled_data = NULL;
src = data;
data_size = data_size;
}
else
{
@ -210,7 +209,7 @@ static boolean tsmf_alsa_play(ITSMFAudioDevice* audio, uint8* data, uint32 data_
}
xfree(data);
return True;
return true;
}
static uint64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio)

View File

@ -58,10 +58,10 @@ static boolean tsmf_ffmpeg_init_context(ITSMFDecoder* decoder)
if (!mdecoder->codec_context)
{
DEBUG_WARN("avcodec_alloc_context failed.");
return False;
return false;
}
return True;
return true;
}
static boolean tsmf_ffmpeg_init_video_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type)
@ -76,7 +76,7 @@ static boolean tsmf_ffmpeg_init_video_stream(ITSMFDecoder* decoder, const TS_AM_
mdecoder->frame = avcodec_alloc_frame();
return True;
return true;
}
static boolean tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type)
@ -98,7 +98,7 @@ static boolean tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_
#endif
#endif
return True;
return true;
}
static boolean tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type)
@ -112,7 +112,7 @@ static boolean tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_
if (!mdecoder->codec)
{
DEBUG_WARN("avcodec_find_decoder failed.");
return False;
return false;
}
mdecoder->codec_context->codec_id = mdecoder->codec_id;
@ -121,12 +121,12 @@ static boolean tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_
if (mdecoder->media_type == AVMEDIA_TYPE_VIDEO)
{
if (!tsmf_ffmpeg_init_video_stream(decoder, media_type))
return False;
return false;
}
else if (mdecoder->media_type == AVMEDIA_TYPE_AUDIO)
{
if (!tsmf_ffmpeg_init_audio_stream(decoder, media_type))
return False;
return false;
}
if (media_type->ExtraData)
@ -167,7 +167,7 @@ static boolean tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_
if (mdecoder->codec->capabilities & CODEC_CAP_TRUNCATED)
mdecoder->codec_context->flags |= CODEC_FLAG_TRUNCATED;
return True;
return true;
}
static boolean tsmf_ffmpeg_prepare(ITSMFDecoder* decoder)
@ -177,12 +177,12 @@ static boolean tsmf_ffmpeg_prepare(ITSMFDecoder* decoder)
if (avcodec_open(mdecoder->codec_context, mdecoder->codec) < 0)
{
DEBUG_WARN("avcodec_open failed.");
return False;
return false;
}
mdecoder->prepared = 1;
return True;
return true;
}
static boolean tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type)
@ -198,7 +198,7 @@ static boolean tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m
mdecoder->media_type = AVMEDIA_TYPE_AUDIO;
break;
default:
return False;
return false;
}
switch (media_type->SubType)
{
@ -242,17 +242,17 @@ static boolean tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m
mdecoder->codec_id = CODEC_ID_AC3;
break;
default:
return False;
return false;
}
if (!tsmf_ffmpeg_init_context(decoder))
return False;
return false;
if (!tsmf_ffmpeg_init_stream(decoder, media_type))
return False;
return false;
if (!tsmf_ffmpeg_prepare(decoder))
return False;
return false;
return True;
return true;
}
static boolean tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions)
@ -261,7 +261,7 @@ static boolean tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const uint8* data
int decoded;
int len;
AVFrame* frame;
boolean ret = True;
boolean ret = true;
#if LIBAVCODEC_VERSION_MAJOR < 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR <= 20)
len = avcodec_decode_video(mdecoder->codec_context, mdecoder->frame, &decoded, data, data_size);
@ -280,12 +280,12 @@ static boolean tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const uint8* data
if (len < 0)
{
DEBUG_WARN("data_size %d, avcodec_decode_video failed (%d)", data_size, len);
ret = False;
ret = false;
}
else if (!decoded)
{
DEBUG_WARN("data_size %d, no frame is decoded.", data_size);
ret = False;
ret = false;
}
else
{
@ -401,7 +401,7 @@ static boolean tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const uint8* data
DEBUG_DVC("data_size %d decoded_size %d",
data_size, mdecoder->decoded_size);
return True;
return true;
}
static boolean tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions)
@ -423,7 +423,7 @@ static boolean tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const uint8* data, uint
return tsmf_ffmpeg_decode_audio(decoder, data, data_size, extensions);
default:
DEBUG_WARN("unknown media type.");
return False;
return false;
}
}
@ -463,11 +463,11 @@ static boolean tsmf_ffmpeg_get_decoded_dimension(ITSMFDecoder* decoder, uint32*
{
*width = mdecoder->codec_context->width;
*height = mdecoder->codec_context->height;
return True;
return true;
}
else
{
return False;
return false;
}
}
@ -490,7 +490,7 @@ static void tsmf_ffmpeg_free(ITSMFDecoder* decoder)
xfree(decoder);
}
static boolean initialized = False;
static boolean initialized = false;
ITSMFDecoder*
TSMFDecoderEntry(void)
@ -501,7 +501,7 @@ TSMFDecoderEntry(void)
{
avcodec_init();
avcodec_register_all();
initialized = True;
initialized = true;
}
decoder = xnew(TSMFFFmpegDecoder);

View File

@ -67,13 +67,13 @@ static boolean tsmf_pulse_connect(TSMFPulseAudioDevice* pulse)
pa_context_state_t state;
if (!pulse->context)
return False;
return false;
if (pa_context_connect(pulse->context, NULL, 0, NULL))
{
DEBUG_WARN("pa_context_connect failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
pa_threaded_mainloop_lock(pulse->mainloop);
if (pa_threaded_mainloop_start(pulse->mainloop) < 0)
@ -81,7 +81,7 @@ static boolean tsmf_pulse_connect(TSMFPulseAudioDevice* pulse)
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
for (;;)
{
@ -100,12 +100,12 @@ static boolean tsmf_pulse_connect(TSMFPulseAudioDevice* pulse)
if (state == PA_CONTEXT_READY)
{
DEBUG_DVC("connected");
return True;
return true;
}
else
{
pa_context_disconnect(pulse->context);
return False;
return false;
}
}
@ -122,23 +122,23 @@ static boolean tsmf_pulse_open(ITSMFAudioDevice* audio, const char* device)
if (!pulse->mainloop)
{
DEBUG_WARN("pa_threaded_mainloop_new failed");
return False;
return false;
}
pulse->context = pa_context_new(pa_threaded_mainloop_get_api(pulse->mainloop), "freerdp");
if (!pulse->context)
{
DEBUG_WARN("pa_context_new failed");
return False;
return false;
}
pa_context_set_state_callback(pulse->context, tsmf_pulse_context_state_callback, pulse);
if (tsmf_pulse_connect(pulse))
{
DEBUG_WARN("tsmf_pulse_connect failed");
return False;
return false;
}
DEBUG_DVC("open device %s", pulse->device);
return True;
return true;
}
static void tsmf_pulse_stream_success_callback(pa_stream* stream, int success, void* userdata)
@ -196,7 +196,7 @@ static void tsmf_pulse_stream_request_callback(pa_stream* stream, size_t length,
static boolean tsmf_pulse_close_stream(TSMFPulseAudioDevice* pulse)
{
if (!pulse->context || !pulse->stream)
return False;
return false;
DEBUG_DVC("");
@ -209,7 +209,7 @@ static boolean tsmf_pulse_close_stream(TSMFPulseAudioDevice* pulse)
pulse->stream = NULL;
pa_threaded_mainloop_unlock(pulse->mainloop);
return True;
return true;
}
static boolean tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
@ -218,7 +218,7 @@ static boolean tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
pa_buffer_attr buffer_attr = { 0 };
if (!pulse->context)
return False;
return false;
DEBUG_DVC("");
@ -230,7 +230,7 @@ static boolean tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_stream_new failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
pa_stream_set_state_callback(pulse->stream,
tsmf_pulse_stream_state_callback, pulse);
@ -249,7 +249,7 @@ static boolean tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
pa_context_errno(pulse->context));
return False;
return false;
}
for (;;)
@ -269,12 +269,12 @@ static boolean tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
if (state == PA_STREAM_READY)
{
DEBUG_DVC("connected");
return True;
return true;
}
else
{
tsmf_pulse_close_stream(pulse);
return False;
return false;
}
}
@ -333,7 +333,7 @@ static boolean tsmf_pulse_play(ITSMFAudioDevice* audio, uint8* data, uint32 data
}
xfree(data);
return True;
return true;
}
static uint64 tsmf_pulse_get_latency(ITSMFAudioDevice* audio)

View File

@ -261,7 +261,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
{
int i;
uint32 cbFormat;
boolean ret = True;
boolean ret = true;
memset(mediatype, 0, sizeof(TS_AM_MEDIA_TYPE));
@ -275,7 +275,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
}
mediatype->MajorType = tsmf_major_type_map[i].type;
if (mediatype->MajorType == TSMF_MAJOR_TYPE_UNKNOWN)
ret = False;
ret = false;
DEBUG_DVC("MajorType %s", tsmf_major_type_map[i].name);
stream_seek(s, 16);
@ -289,7 +289,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
}
mediatype->SubType = tsmf_sub_type_map[i].type;
if (mediatype->SubType == TSMF_SUB_TYPE_UNKNOWN)
ret = False;
ret = false;
DEBUG_DVC("SubType %s", tsmf_sub_type_map[i].name);
stream_seek(s, 16);
@ -306,7 +306,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
}
mediatype->FormatType = tsmf_format_type_map[i].type;
if (mediatype->FormatType == TSMF_FORMAT_TYPE_UNKNOWN)
ret = False;
ret = false;
DEBUG_DVC("FormatType %s", tsmf_format_type_map[i].name);
stream_seek(s, 16);
@ -362,7 +362,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
/* http://msdn.microsoft.com/en-us/library/dd390707.aspx */
i = tsmf_codec_parse_VIDEOINFOHEADER2(mediatype, s);
i += tsmf_codec_parse_BITMAPINFOHEADER(mediatype, s, True);
i += tsmf_codec_parse_BITMAPINFOHEADER(mediatype, s, true);
if (cbFormat > i)
{
mediatype->ExtraDataSize = cbFormat - i;
@ -372,7 +372,7 @@ boolean tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
case TSMF_FORMAT_TYPE_VIDEOINFO2:
i = tsmf_codec_parse_VIDEOINFOHEADER2(mediatype, s);
i += tsmf_codec_parse_BITMAPINFOHEADER(mediatype, s, False);
i += tsmf_codec_parse_BITMAPINFOHEADER(mediatype, s, false);
if (cbFormat > i)
{
mediatype->ExtraDataSize = cbFormat - i;

View File

@ -27,7 +27,7 @@ typedef struct _ITSMFDecoder ITSMFDecoder;
struct _ITSMFDecoder
{
/* Set the decoder format. Return True if supported. */
/* Set the decoder format. Return true if supported. */
boolean (*SetFormat) (ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type);
/* Decode a sample. */
boolean (*Decode) (ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions);

View File

@ -129,7 +129,7 @@ int tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman)
if (presentation == NULL)
error = 1;
tsmf_presentation_set_audio_device(presentation, ifman->audio_name, ifman->audio_device);
ifman->output_pending = True;
ifman->output_pending = true;
return error;
}
@ -155,7 +155,7 @@ int tsmf_ifman_add_stream(TSMF_IFMAN* ifman)
if (stream)
tsmf_stream_set_format(stream, ifman->decoder_name, ifman->input);
}
ifman->output_pending = True;
ifman->output_pending = true;
return error;
}
@ -193,7 +193,7 @@ int tsmf_ifman_remove_stream(TSMF_IFMAN* ifman)
else
error = 1;
}
ifman->output_pending = True;
ifman->output_pending = true;
return error;
}
@ -216,21 +216,21 @@ int tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman)
int tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
int tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
int tsmf_ifman_set_video_window(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
@ -294,21 +294,21 @@ int tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman)
}
tsmf_presentation_set_geometry_info(presentation, Left, Top, Width, Height, num_rects, rects);
}
ifman->output_pending = True;
ifman->output_pending = true;
return error;
}
int tsmf_ifman_set_allocator(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
int tsmf_ifman_notify_preroll(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
@ -354,7 +354,7 @@ int tsmf_ifman_on_sample(TSMF_IFMAN* ifman)
ifman->message_id, SampleStartTime, SampleEndTime, ThrottleDuration, SampleExtensions,
cbData, stream_get_tail(ifman->input));
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
@ -376,7 +376,7 @@ int tsmf_ifman_on_flush(TSMF_IFMAN* ifman)
tsmf_presentation_flush(presentation);
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
@ -429,14 +429,14 @@ int tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman)
int tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}
int tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman)
{
DEBUG_DVC("");
ifman->output_pending = True;
ifman->output_pending = true;
return 0;
}

View File

@ -101,9 +101,9 @@ boolean tsmf_push_event(IWTSVirtualChannelCallback* pChannelCallback,
if (error)
{
DEBUG_WARN("response error %d", error);
return False;
return false;
}
return True;
return true;
}
static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
@ -148,7 +148,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
ifman.input = input;
ifman.input_size = cbSize - 12;
ifman.output = output;
ifman.output_pending = False;
ifman.output_pending = false;
ifman.output_interface_id = InterfaceId;
switch (InterfaceId)
@ -175,7 +175,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
stream_seek(input, 16);
stream_read_uint32(input, callback->stream_id);
DEBUG_DVC("SET_CHANNEL_PARAMS StreamId=%d", callback->stream_id);
ifman.output_pending = True;
ifman.output_pending = true;
error = 0;
break;

View File

@ -137,7 +137,7 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync)
TSMF_STREAM* s;
LIST_ITEM* item;
TSMF_SAMPLE* sample;
boolean pending = False;
boolean pending = false;
TSMF_PRESENTATION* presentation = stream->presentation;
if (!stream->sample_list->head)
@ -157,7 +157,7 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync)
if (s != stream && !s->eos && s->last_end_time &&
s->last_end_time < stream->last_end_time - AUDIO_TOLERANCE)
{
pending = True;
pending = true;
break;
}
}
@ -168,7 +168,7 @@ static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync)
{
if (stream->last_end_time > presentation->audio_end_time)
{
pending = True;
pending = true;
}
}
}
@ -416,7 +416,7 @@ static void tsmf_sample_playback_audio(TSMF_SAMPLE* sample)
static void tsmf_sample_playback(TSMF_SAMPLE* sample)
{
boolean ret = False;
boolean ret = false;
uint32 width;
uint32 height;
uint32 pixfmt = 0;

View File

@ -148,11 +148,11 @@ void rail_read_server_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
switch (sysparam->param)
{
case SPI_SET_SCREEN_SAVE_ACTIVE:
sysparam->setScreenSaveActive = (body != 0) ? True : False;
sysparam->setScreenSaveActive = (body != 0) ? true : false;
break;
case SPI_SET_SCREEN_SAVE_SECURE:
sysparam->setScreenSaveSecure = (body != 0) ? True : False;
sysparam->setScreenSaveSecure = (body != 0) ? true : false;
break;
default:
@ -179,7 +179,7 @@ void rail_read_server_localmovesize_order(STREAM* s, RAIL_LOCALMOVESIZE_ORDER* l
stream_read_uint32(s, localmovesize->windowId); /* windowId (4 bytes) */
stream_read_uint16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
localmovesize->isMoveSizeStart = (isMoveSizeStart != 0) ? True : False;
localmovesize->isMoveSizeStart = (isMoveSizeStart != 0) ? true : false;
stream_read_uint16(s, localmovesize->moveSizeType); /* moveSizeType (2 bytes) */
stream_read_uint16(s, localmovesize->posX); /* posX (2 bytes) */
@ -335,16 +335,16 @@ void rail_recv_handshake_order(rdpRailOrder* rail_order, STREAM* s)
rail_order->sysparam.highContrast.flags = 0x7E;
rail_order->sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
rail_order->sysparam.mouseButtonSwap = False;
rail_order->sysparam.mouseButtonSwap = false;
rail_order->sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
rail_order->sysparam.keyboardPref = False;
rail_order->sysparam.keyboardPref = false;
rail_order->sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
rail_order->sysparam.dragFullWindows = False;
rail_order->sysparam.dragFullWindows = false;
rail_order->sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
rail_order->sysparam.keyboardCues = False;
rail_order->sysparam.keyboardCues = false;
rail_order->sysparam.params |= SPI_MASK_SET_WORK_AREA;
rail_order->sysparam.workArea.left = 0;

View File

@ -76,7 +76,7 @@ boolean devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data)
entry = freerdp_load_plugin((char*)plugin_data->data[0], "DeviceServiceEntry");
if (entry == NULL)
return False;
return false;
ep.devman = devman;
ep.RegisterDevice = devman_register_device;
@ -85,7 +85,7 @@ boolean devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data)
entry(&ep);
return True;
return true;
}
DEVICE* devman_get_device_by_id(DEVMAN* devman, uint32 id)

View File

@ -88,11 +88,11 @@ static boolean disk_file_remove_dir(const char* path)
struct dirent* pdirent;
struct stat st;
char* p;
boolean ret = True;
boolean ret = true;
dir = opendir(path);
if (dir == NULL)
return False;
return false;
pdirent = readdir(dir);
while (pdirent)
@ -108,7 +108,7 @@ static boolean disk_file_remove_dir(const char* path)
if (stat(p, &st) != 0)
{
DEBUG_WARN("stat %s failed.", p);
ret = False;
ret = false;
}
else if (S_ISDIR(st.st_mode))
{
@ -117,10 +117,10 @@ static boolean disk_file_remove_dir(const char* path)
else if (unlink(p) < 0)
{
DEBUG_WARN("unlink %s failed.", p);
ret = False;
ret = false;
}
else
ret = True;
ret = true;
xfree(p);
if (!ret)
@ -135,7 +135,7 @@ static boolean disk_file_remove_dir(const char* path)
if (rmdir(path) < 0)
{
DEBUG_WARN("rmdir %s failed.", path);
ret = False;
ret = false;
}
}
@ -162,21 +162,21 @@ static boolean disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 Crea
if (stat(file->fullpath, &st) == 0)
{
file->is_dir = (S_ISDIR(st.st_mode) ? True : False);
exists = True;
file->is_dir = (S_ISDIR(st.st_mode) ? true : false);
exists = true;
}
else
{
file->is_dir = ((CreateOptions & FILE_DIRECTORY_FILE) ? True : False);
file->is_dir = ((CreateOptions & FILE_DIRECTORY_FILE) ? true : false);
if (file->is_dir)
{
if (mkdir(file->fullpath, mode) != 0)
{
file->err = errno;
return True;
return true;
}
}
exists = False;
exists = false;
}
if (file->is_dir)
{
@ -184,7 +184,7 @@ static boolean disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 Crea
if (file->dir == NULL)
{
file->err = errno;
return True;
return true;
}
}
else
@ -212,7 +212,7 @@ static boolean disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 Crea
break;
}
if (!exists && (CreateOptions & FILE_DELETE_ON_CLOSE))
file->delete_pending = True;
file->delete_pending = true;
if ((DesiredAccess & GENERIC_ALL)
|| (DesiredAccess & GENERIC_WRITE)
@ -230,11 +230,11 @@ static boolean disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 Crea
if (file->fd == -1)
{
file->err = errno;
return True;
return true;
}
}
return True;
return true;
}
DISK_FILE* disk_file_new(const char* base_path, const char* path, uint32 id,
@ -278,12 +278,12 @@ void disk_file_free(DISK_FILE* file)
boolean disk_file_seek(DISK_FILE* file, uint64 Offset)
{
if (file->is_dir || file->fd == -1)
return False;
return false;
if (lseek(file->fd, Offset, SEEK_SET) == (off_t)-1)
return False;
return false;
return True;
return true;
}
boolean disk_file_read(DISK_FILE* file, uint8* buffer, uint32* Length)
@ -291,14 +291,14 @@ boolean disk_file_read(DISK_FILE* file, uint8* buffer, uint32* Length)
ssize_t r;
if (file->is_dir || file->fd == -1)
return False;
return false;
r = read(file->fd, buffer, *Length);
if (r < 0)
return False;
return false;
*Length = (uint32)r;
return True;
return true;
}
boolean disk_file_write(DISK_FILE* file, uint8* buffer, uint32 Length)
@ -306,18 +306,18 @@ boolean disk_file_write(DISK_FILE* file, uint8* buffer, uint32 Length)
ssize_t r;
if (file->is_dir || file->fd == -1)
return False;
return false;
while (Length > 0)
{
r = write(file->fd, buffer, Length);
if (r == -1)
return False;
return false;
Length -= r;
buffer += r;
}
return True;
return true;
}
boolean disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass, STREAM* output)
@ -327,7 +327,7 @@ boolean disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass,
if (stat(file->fullpath, &st) != 0)
{
stream_write_uint32(output, 0); /* Length */
return False;
return false;
}
switch (FsInformationClass)
{
@ -366,9 +366,9 @@ boolean disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass,
default:
stream_write_uint32(output, 0); /* Length */
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
return False;
return false;
}
return True;
return true;
}
boolean disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint32 Length, STREAM* input)
@ -396,7 +396,7 @@ boolean disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, ui
stream_read_uint32(input, FileAttributes);
if (fstat(file->fd, &st) != 0)
return False;
return false;
tv[0].tv_sec = st.st_atime;
tv[0].tv_usec = 0;
tv[1].tv_sec = (LastWriteTime > 0 ? FILE_TIME_RDP_TO_SYSTEM(LastWriteTime) : st.st_mtime);
@ -421,7 +421,7 @@ boolean disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, ui
/* http://msdn.microsoft.com/en-us/library/cc232076.aspx */
stream_read_uint64(input, size);
if (ftruncate(file->fd, size) != 0)
return False;
return false;
break;
case FileDispositionInformation:
@ -457,16 +457,16 @@ boolean disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, ui
{
DEBUG_WARN("rename %s to %s failed", file->fullpath, fullpath);
free(fullpath);
return False;
return false;
}
break;
default:
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
return False;
return false;
}
return True;
return true;
}
boolean disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, uint8 InitialQuery,
@ -491,7 +491,7 @@ boolean disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, ui
{
stream_write_uint32(output, 0); /* Length */
stream_write_uint8(output, 0); /* Padding */
return False;
return false;
}
memset(&st, 0, sizeof(struct stat));
@ -507,7 +507,7 @@ boolean disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, ui
ent_path = freerdp_uniconv_out(uniconv, ent->d_name, &len);
freerdp_uniconv_free(uniconv);
ret = True;
ret = true;
switch (FsInformationClass)
{
case FileDirectoryInformation:
@ -580,7 +580,7 @@ boolean disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, ui
stream_write_uint32(output, 0); /* Length */
stream_write_uint8(output, 0); /* Padding */
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
ret = False;
ret = false;
break;
}

View File

@ -255,7 +255,7 @@ static rdpPrinter* printer_cups_get_printer(rdpPrinterDriver* driver, const char
{
rdpCupsPrinterDriver* cups_driver = (rdpCupsPrinterDriver*)driver;
return printer_cups_new_printer(cups_driver, name, cups_driver->id_sequence == 1 ? True : False);
return printer_cups_new_printer(cups_driver, name, cups_driver->id_sequence == 1 ? true : false);
}
static rdpCupsPrinterDriver* cups_driver = NULL;

View File

@ -214,11 +214,11 @@ static boolean rdpdr_process_irp(rdpdrPlugin* rdpdr, STREAM* data_in)
irp = irp_new(rdpdr->devman, data_in);
if (irp == NULL)
return False;
return false;
IFCALL(irp->device->IRPRequest, irp->device, irp);
return True;
return true;
}
static void rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
@ -252,12 +252,12 @@ static void rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
case PAKID_CORE_CLIENTID_CONFIRM:
DEBUG_SVC("RDPDR_CTYP_CORE / PAKID_CORE_CLIENTID_CONFIRM");
rdpdr_process_server_clientid_confirm(rdpdr, data_in);
rdpdr_send_device_list_announce_request(rdpdr, False);
rdpdr_send_device_list_announce_request(rdpdr, false);
break;
case PAKID_CORE_USER_LOGGEDON:
DEBUG_SVC("RDPDR_CTYP_CORE / PAKID_CORE_USER_LOGGEDON");
rdpdr_send_device_list_announce_request(rdpdr, True);
rdpdr_send_device_list_announce_request(rdpdr, true);
break;
case PAKID_CORE_DEVICE_REPLY:

View File

@ -405,12 +405,12 @@ boolean serial_tty_read(SERIAL_TTY* tty, uint8* buffer, uint32* Length)
memset(buffer, 0, *Length);
r = read(tty->fd, buffer, *Length);
if (r < 0)
return False;
return false;
tty->event_txempty = r;
*Length = r;
return True;
return true;
}
boolean serial_tty_write(SERIAL_TTY* tty, uint8* buffer, uint32 Length)
@ -424,14 +424,14 @@ boolean serial_tty_write(SERIAL_TTY* tty, uint8* buffer, uint32 Length)
{
r = write(tty->fd, buffer, Length);
if (r < 0)
return False;
return false;
Length -= r;
buffer += r;
}
tty->event_txempty = event_txempty;
return True;
return true;
}
void serial_tty_free(SERIAL_TTY* tty)
@ -508,7 +508,7 @@ SERIAL_TTY* serial_tty_new(const char* path, uint32 id)
boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
int bytes;
boolean ret = False;
boolean ret = false;
DEBUG_SVC("in");
@ -520,7 +520,7 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
if (tty->wait_mask == 0)
{
tty->event_pending = 0;
return True;
return true;
}
ioctl(tty->fd, TIOCINQ, &bytes);
@ -536,7 +536,7 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
DEBUG_SVC("SERIAL_EV_RLSD");
*result |= SERIAL_EV_RLSD;
ret = True;
ret = true;
}
}
@ -545,13 +545,13 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
DEBUG_SVC("SERIAL_EV_RXFLAG bytes %d", bytes);
*result |= SERIAL_EV_RXFLAG;
ret = True;
ret = true;
}
if ((tty->wait_mask & SERIAL_EV_RXCHAR))
{
DEBUG_SVC("SERIAL_EV_RXCHAR bytes %d", bytes);
*result |= SERIAL_EV_RXCHAR;
ret = True;
ret = true;
}
}
@ -568,7 +568,7 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
DEBUG_SVC("SERIAL_EV_TXEMPTY");
*result |= SERIAL_EV_TXEMPTY;
ret = True;
ret = true;
}
tty->event_txempty = bytes;
#endif
@ -581,7 +581,7 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
DEBUG_SVC("SERIAL_EV_DSR %s", (bytes & TIOCM_DSR) ? "ON" : "OFF");
*result |= SERIAL_EV_DSR;
ret = True;
ret = true;
}
}
@ -592,7 +592,7 @@ boolean serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
{
DEBUG_SVC("SERIAL_EV_CTS %s", (bytes & TIOCM_CTS) ? "ON" : "OFF");
*result |= SERIAL_EV_CTS;
ret = True;
ret = true;
}
}
@ -610,7 +610,7 @@ static boolean tty_get_termios(SERIAL_TTY* tty)
DEBUG_SVC("tcgetattr? %d", tcgetattr(tty->fd, ptermios) >= 0);
if (tcgetattr(tty->fd, ptermios) < 0)
return False;
return false;
speed = cfgetispeed(ptermios);
switch (speed)
@ -750,7 +750,7 @@ static boolean tty_get_termios(SERIAL_TTY* tty)
tty->chars[SERIAL_CHAR_BREAK] = ptermios->c_cc[VINTR];
tty->chars[SERIAL_CHAR_ERROR] = ptermios->c_cc[VKILL];
return True;
return true;
}
static void tty_set_termios(SERIAL_TTY* tty)

View File

@ -46,7 +46,6 @@
#include "scard_main.h"
/* [MS-RDPESC] 3.1.4 */
#define SCARD_IOCTL_ESTABLISH_CONTEXT 0x00090014 /* EstablishContext */
#define SCARD_IOCTL_RELEASE_CONTEXT 0x00090018 /* ReleaseContext */
@ -75,12 +74,16 @@
#define SCARD_IOCTL_ACCESS_STARTED_EVENT 0x000900E0 /* SCardAccessStartedEvent */
#define SCARD_IOCTL_LOCATE_CARDS_BY_ATR 0x000900E8 /* LocateCardsByATR */
#define SCARD_INPUT_LINKED 0xFFFFFFFF
/* Decode Win CTL_CODE values */
#define WIN_CTL_FUNCTION(ctl_code) ((ctl_code & 0x3FFC) >> 2)
#define WIN_CTL_DEVICE_TYPE(ctl_code) (ctl_code >> 16)
static uint32
sc_output_string(IRP* irp, char *src, boolean wide)
#define WIN_FILE_DEVICE_SMARTCARD 0x00000031
static uint32 sc_output_string(IRP* irp, char *src, boolean wide)
{
uint8* p;
uint32 len;
@ -90,8 +93,8 @@ sc_output_string(IRP* irp, char *src, boolean wide)
if (wide)
{
// len = mbstowcs(p, src, len); // need to setlocale for 2byte wchar..
int i;
for (i = 0; i < len; i++ )
{
p[2 * i] = src[i] < 0 ? '?' : src[i];
@ -109,9 +112,7 @@ sc_output_string(IRP* irp, char *src, boolean wide)
return len;
}
static void
sc_output_alignment(IRP *irp, uint32 seed)
static void sc_output_alignment(IRP *irp, uint32 seed)
{
uint32 size = stream_get_length(irp->output) - 20;
uint32 add = (seed - (size % seed)) % seed;
@ -120,9 +121,7 @@ sc_output_alignment(IRP *irp, uint32 seed)
stream_write_zero(irp->output, add);
}
static void
sc_output_repos(IRP* irp, uint32 written)
static void sc_output_repos(IRP* irp, uint32 written)
{
uint32 add = (4 - (written % 4)) % 4;
@ -130,17 +129,13 @@ sc_output_repos(IRP* irp, uint32 written)
stream_write_zero(irp->output, add);
}
static uint32
sc_output_return(IRP* irp, uint32 rv)
static uint32 sc_output_return(IRP* irp, uint32 rv)
{
stream_write_zero(irp->output, 256);
return rv;
}
static void
sc_output_buffer_limit(IRP* irp, char *buffer, unsigned int length, unsigned int highLimit)
static void sc_output_buffer_limit(IRP* irp, char *buffer, unsigned int length, unsigned int highLimit)
{
int header = (length < 0) ? (0) : ((length > highLimit) ? (highLimit) : (length));
@ -160,16 +155,12 @@ sc_output_buffer_limit(IRP* irp, char *buffer, unsigned int length, unsigned int
}
}
static void
sc_output_buffer(IRP* irp, char *buffer, unsigned int length)
static void sc_output_buffer(IRP* irp, char *buffer, unsigned int length)
{
sc_output_buffer_limit(irp, buffer, length, 0x7FFFFFFF);
}
static void
sc_output_buffer_start_limit(IRP *irp, int length, int highLimit)
static void sc_output_buffer_start_limit(IRP *irp, int length, int highLimit)
{
int header = (length < 0) ? (0) : ((length > highLimit) ? (highLimit) : (length));
@ -177,16 +168,12 @@ sc_output_buffer_start_limit(IRP *irp, int length, int highLimit)
stream_write_uint32(irp->output, 0x00000001); /* Magic DWORD - any non zero */
}
static void
sc_output_buffer_start(IRP *irp, int length)
static void sc_output_buffer_start(IRP *irp, int length)
{
sc_output_buffer_start_limit(irp, length, 0x7FFFFFFF);
}
static uint32
sc_input_string(IRP* irp, char **dest, uint32 dataLength, boolean wide)
static uint32 sc_input_string(IRP* irp, char **dest, uint32 dataLength, boolean wide)
{
char *buffer;
int bufferSize;
@ -213,9 +200,7 @@ sc_input_string(IRP* irp, char **dest, uint32 dataLength, boolean wide)
return bufferSize;
}
static void
sc_input_repos(IRP* irp, uint32 read)
static void sc_input_repos(IRP* irp, uint32 read)
{
uint32 add = 4 - (read % 4);
@ -223,9 +208,7 @@ sc_input_repos(IRP* irp, uint32 read)
stream_seek(irp->input, add);
}
static void
sc_input_reader_name(IRP* irp, char **dest, boolean wide)
static void sc_input_reader_name(IRP* irp, char **dest, boolean wide)
{
uint32 dataLength;
@ -236,9 +219,7 @@ sc_input_reader_name(IRP* irp, char **dest, boolean wide)
sc_input_repos(irp, sc_input_string(irp, dest, dataLength, wide));
}
static void
sc_input_skip_linked(IRP* irp)
static void sc_input_skip_linked(IRP* irp)
{
uint32 len;
stream_read_uint32(irp->input, len);
@ -250,11 +231,10 @@ sc_input_skip_linked(IRP* irp)
}
}
static uint32
sc_map_state(uint32 state)
static uint32 sc_map_state(uint32 state)
{
// is this mapping still needed?
/* is this mapping still needed? */
if (state & SCARD_SPECIFIC)
state = 0x00000006;
else if (state & SCARD_NEGOTIABLE)
@ -273,9 +253,7 @@ sc_map_state(uint32 state)
return state;
}
static uint32
handle_EstablishContext(IRP* irp)
static uint32 handle_EstablishContext(IRP* irp)
{
uint32 len, rv;
uint32 scope;
@ -283,6 +261,7 @@ handle_EstablishContext(IRP* irp)
stream_seek(irp->input, 8);
stream_read_uint32(irp->input, len);
if (len != 8)
return SCARD_F_INTERNAL_ERROR;
@ -297,21 +276,18 @@ handle_EstablishContext(IRP* irp)
stream_write_uint32(irp->output, 4);
stream_write_uint32(irp->output, hContext);
// TODO: store hContext in allowed context list
/* TODO: store hContext in allowed context list */
return SCARD_S_SUCCESS;
}
static uint32
handle_ReleaseContext(IRP* irp)
static uint32 handle_ReleaseContext(IRP* irp)
{
uint32 len, rv;
SCARDCONTEXT hContext = -1;
stream_seek(irp->input, 8);
stream_read_uint32(irp->input, len);
// if (len != 16) return SCARD_F_INTERNAL_ERROR;
stream_seek(irp->input, 0x10);
stream_read_uint32(irp->input, hContext);
@ -325,14 +301,12 @@ handle_ReleaseContext(IRP* irp)
return rv;
}
static uint32
handle_IsValidContext(IRP* irp)
static uint32 handle_IsValidContext(IRP* irp)
{
uint32 rv;
SCARDCONTEXT hContext;
stream_seek(irp->input, 0x1c);
stream_seek(irp->input, 0x1C);
stream_read_uint32(irp->input, hContext);
rv = SCardIsValidContext(hContext);
@ -347,9 +321,7 @@ handle_IsValidContext(IRP* irp)
return rv;
}
static uint32
handle_ListReaders(IRP* irp, boolean wide)
static uint32 handle_ListReaders(IRP* irp, boolean wide)
{
uint32 len, rv;
SCARDCONTEXT hContext;
@ -387,7 +359,7 @@ handle_ListReaders(IRP* irp, boolean wide)
return rv;
}
DEBUG_SCARD("Success 0x%08x %d %d", (unsigned) hContext, (unsigned) cchReaders, (int) strlen(readerList));
/* DEBUG_SCARD("Success 0x%08x %d %d", (unsigned) hContext, (unsigned) cchReaders, (int) strlen(readerList));*/
poslen1 = stream_get_pos(irp->output);
stream_seek_uint32(irp->output);
@ -399,6 +371,7 @@ handle_ListReaders(IRP* irp, boolean wide)
walker = readerList;
dataLength = 0;
while (1)
{
elemLength = strlen(walker);
@ -433,9 +406,7 @@ handle_ListReaders(IRP* irp, boolean wide)
return rv;
}
static uint32
handle_GetStatusChange(IRP* irp, boolean wide)
static uint32 handle_GetStatusChange(IRP* irp, boolean wide)
{
LONG rv;
SCARDCONTEXT hContext;
@ -547,14 +518,12 @@ handle_GetStatusChange(IRP* irp, boolean wide)
return rv;
}
static uint32
handle_Cancel(IRP *irp) // TESTME
static uint32 handle_Cancel(IRP *irp)
{
LONG rv;
SCARDCONTEXT hContext;
stream_seek(irp->input, 0x1c);
stream_seek(irp->input, 0x1C);
stream_read_uint32(irp->input, hContext);
rv = SCardCancel(hContext);
@ -565,12 +534,11 @@ handle_Cancel(IRP *irp) // TESTME
DEBUG_SCARD("Success context: 0x%08x %s\n", (unsigned) hContext, pcsc_stringify_error(rv));
sc_output_alignment(irp, 8);
return rv;
}
static uint32
handle_Connect(IRP* irp, boolean wide)
static uint32 handle_Connect(IRP* irp, boolean wide)
{
LONG rv;
SCARDCONTEXT hContext;
@ -616,9 +584,7 @@ handle_Connect(IRP* irp, boolean wide)
return rv;
}
static uint32
handle_Reconnect(IRP* irp) // TESTME
static uint32 handle_Reconnect(IRP* irp)
{
LONG rv;
SCARDCONTEXT hContext;
@ -651,14 +617,12 @@ handle_Reconnect(IRP* irp) // TESTME
DEBUG_SCARD("Success (proto: 0x%08x)", (unsigned) dwActiveProtocol);
sc_output_alignment(irp, 8);
stream_write_uint32(irp->output, dwActiveProtocol); // reversed?
stream_write_uint32(irp->output, dwActiveProtocol); /* reversed? */
return rv;
}
static uint32
handle_Disconnect(IRP* irp)
static uint32 handle_Disconnect(IRP* irp)
{
LONG rv;
SCARDCONTEXT hContext;
@ -687,9 +651,7 @@ handle_Disconnect(IRP* irp)
return rv;
}
static uint32
handle_BeginTransaction(IRP* irp)
static uint32 handle_BeginTransaction(IRP* irp)
{
LONG rv;
SCARDCONTEXT hCard;
@ -709,9 +671,7 @@ handle_BeginTransaction(IRP* irp)
return rv;
}
static uint32
handle_EndTransaction(IRP* irp)
static uint32 handle_EndTransaction(IRP* irp)
{
LONG rv;
SCARDCONTEXT hCard;
@ -724,18 +684,18 @@ handle_EndTransaction(IRP* irp)
stream_read_uint32(irp->input, hCard);
rv = SCardEndTransaction(hCard, dwDisposition);
if (rv != SCARD_S_SUCCESS)
DEBUG_SCARD("Failure: %s (0x%08x)", pcsc_stringify_error(rv), (unsigned) rv);
else
DEBUG_SCARD("Success hcard: 0x%08x", (unsigned) hCard);
sc_output_alignment(irp, 8);
return rv;
}
static uint32
handle_State(IRP* irp) // TESTME
static uint32 handle_State(IRP* irp)
{
LONG rv;
SCARDHANDLE hCard;
@ -750,7 +710,7 @@ handle_State(IRP* irp) // TESTME
#endif
stream_seek(irp->input, 0x24);
stream_seek_uint32(irp->input); // atrLen
stream_seek_uint32(irp->input); /* atrLen */
stream_seek(irp->input, 0x0c);
stream_read_uint32(irp->input, hCard);
@ -804,9 +764,7 @@ handle_State(IRP* irp) // TESTME
return rv;
}
static DWORD
handle_Status(IRP *irp, boolean wide)
static DWORD handle_Status(IRP *irp, boolean wide)
{
LONG rv;
SCARDHANDLE hCard;
@ -888,7 +846,7 @@ handle_Status(IRP *irp, boolean wide)
sc_output_alignment(irp, 8);
#ifdef SCARD_AUTOALLOCATE
//SCardFreeMemory(NULL, readerName);
/* SCardFreeMemory(NULL, readerName); */
free(readerName);
#else
xfree(readerName);
@ -897,9 +855,7 @@ handle_Status(IRP *irp, boolean wide)
return rv;
}
static uint32
handle_Transmit(IRP* irp)
static uint32 handle_Transmit(IRP* irp)
{
LONG rv;
SCARDCONTEXT hCard;
@ -967,7 +923,7 @@ handle_Transmit(IRP* irp)
stream_read_uint32(irp->input, map[6]);
if (map[6] & SCARD_INPUT_LINKED)
{
// not sure what this is
/* not sure what this is */
stream_read_uint32(irp->input, linkedLen);
stream_seek(irp->input, linkedLen);
@ -1011,15 +967,14 @@ handle_Transmit(IRP* irp)
return rv;
}
static uint32
handle_Control(IRP* irp) // TESTME
static uint32 handle_Control(IRP* irp)
{
LONG rv;
SCARDCONTEXT hContext;
SCARDHANDLE hCard;
uint32 map[3];
uint32 controlCode;
uint32 controlFunction;
BYTE *recvBuffer = NULL, *sendBuffer = NULL;
uint32 recvLength;
DWORD nBytesReturned;
@ -1039,12 +994,21 @@ handle_Control(IRP* irp) // TESTME
stream_seek(irp->input, 0x4);
stream_read_uint32(irp->input, hCard);
/* Translate Windows SCARD_CTL_CODE's to corresponding local code */
if (WIN_CTL_DEVICE_TYPE(controlCode) == WIN_FILE_DEVICE_SMARTCARD)
{
controlFunction = WIN_CTL_FUNCTION(controlCode);
controlCode = SCARD_CTL_CODE(controlFunction);
}
DEBUG_SCARD("controlCode: 0x%08x", (unsigned) controlCode);
if (map[2] & SCARD_INPUT_LINKED)
{
/* read real input size */
stream_read_uint32(irp->input, recvLength);
recvBuffer = xmalloc(recvLength);
if (!recvBuffer)
return sc_output_return(irp, SCARD_E_NO_MEMORY);
@ -1053,6 +1017,7 @@ handle_Control(IRP* irp) // TESTME
nBytesReturned = outBufferSize;
sendBuffer = xmalloc(outBufferSize);
if (!sendBuffer)
return sc_output_return(irp, SCARD_E_NO_MEMORY);
@ -1082,21 +1047,19 @@ handle_Control(IRP* irp) // TESTME
return rv;
}
static uint32
handle_GetAttrib(IRP* irp)
static uint32 handle_GetAttrib(IRP* irp)
{
LONG rv;
SCARDHANDLE hCard;
DWORD dwAttrId = 0, dwAttrLen = 0;
DWORD attrLen = 0;
unsigned char *pbAttr;
uint8* pbAttr = NULL;
stream_seek(irp->input, 0x20);
stream_read_uint32(irp->input, dwAttrId);
stream_seek(irp->input, 0x4);
stream_read_uint32(irp->input, dwAttrLen);
stream_seek(irp->input, 0xc);
stream_seek(irp->input, 0xC);
stream_read_uint32(irp->input, hCard);
DEBUG_SCARD("hcard: 0x%08x, attrib: 0x%08x (%d bytes)\n",
@ -1113,17 +1076,17 @@ handle_GetAttrib(IRP* irp)
}
#endif
rv = SCardGetAttrib(hCard, dwAttrId, attrLen == 0 ? NULL : (unsigned char *)&pbAttr, &attrLen);
rv = SCardGetAttrib(hCard, dwAttrId, attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
if(dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME_A && rv == SCARD_E_UNSUPPORTED_FEATURE)
{
rv = SCardGetAttrib(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_W,
attrLen == 0 ? NULL : (unsigned char *)&pbAttr, &attrLen);
attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
}
if(dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME_W && rv == SCARD_E_UNSUPPORTED_FEATURE)
{
rv = SCardGetAttrib(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A,
attrLen == 0 ? NULL : (unsigned char *)&pbAttr, &attrLen);
attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
}
if(attrLen > dwAttrLen && pbAttr != NULL)
{
@ -1154,7 +1117,7 @@ handle_GetAttrib(IRP* irp)
stream_write(irp->output, pbAttr, dwAttrLen);
}
sc_output_repos(irp, dwAttrLen);
// Align to multiple of 4
/* align to multiple of 4 */
stream_write_uint32(irp->output, 0);
}
sc_output_alignment(irp, 8);
@ -1164,52 +1127,50 @@ handle_GetAttrib(IRP* irp)
return rv;
}
static uint32
handle_AccessStartedEvent(IRP* irp)
static uint32 handle_AccessStartedEvent(IRP* irp)
{
stream_write_zero(irp->output, 8);
return SCARD_S_SUCCESS;
}
void
scard_error(SCARD_DEVICE* scard, IRP* irp, uint32 ntstatus)
void scard_error(SCARD_DEVICE* scard, IRP* irp, uint32 ntstatus)
{
// [MS-RDPESC] 3.1.4.4
/* [MS-RDPESC] 3.1.4.4 */
printf("scard processing error %x\n", ntstatus);
stream_set_pos(irp->output, 0); // CHECKME
stream_set_pos(irp->output, 0); /* CHECKME */
irp->IoStatus = ntstatus;
irp->Complete(irp);
}
/* http://msdn.microsoft.com/en-gb/library/ms938473.aspx */
typedef struct _SERVER_SCARD_ATRMASK
{
uint32 cbAtr;
unsigned char rgbAtr[36];
unsigned char rgbMask[36];
uint8 rgbAtr[36];
uint8 rgbMask[36];
}
SERVER_SCARD_ATRMASK;
static uint32
handle_LocateCardsByATR(IRP* irp, boolean wide) // TESTME
static uint32 handle_LocateCardsByATR(IRP* irp, boolean wide)
{
int i, j, k;
LONG rv;
int i, j, k;
SCARDCONTEXT hContext;
SERVER_SCARD_ATRMASK *pAtrMasks, *curAtr;
uint32 atrMaskCount = 0;
uint32 readerCount = 0;
SCARD_READERSTATE *readerStates, *rsCur, *cur;
SCARD_READERSTATE* cur = NULL;
SCARD_READERSTATE* rsCur = NULL;
SCARD_READERSTATE* readerStates = NULL;
SERVER_SCARD_ATRMASK* curAtr = NULL;
SERVER_SCARD_ATRMASK* pAtrMasks = NULL;
stream_seek(irp->input, 0x2c);
stream_seek(irp->input, 0x2C);
stream_read_uint32(irp->input, hContext);
stream_read_uint32(irp->input, atrMaskCount);
pAtrMasks = xmalloc(atrMaskCount * sizeof(SERVER_SCARD_ATRMASK));
if (!pAtrMasks)
return sc_output_return(irp, SCARD_E_NO_MEMORY);
@ -1223,6 +1184,7 @@ handle_LocateCardsByATR(IRP* irp, boolean wide) // TESTME
stream_read_uint32(irp->input, readerCount);
readerStates = xzalloc(readerCount * sizeof(SCARD_READERSTATE));
if (!readerStates)
return sc_output_return(irp, SCARD_E_NO_MEMORY);
@ -1312,7 +1274,7 @@ handle_LocateCardsByATR(IRP* irp, boolean wide) // TESTME
stream_write_zero(irp->output, 4);
xfree((void *)cur->szReader);
xfree((void*) cur->szReader);
}
sc_output_alignment(irp, 8);
@ -1322,9 +1284,7 @@ handle_LocateCardsByATR(IRP* irp, boolean wide) // TESTME
return rv;
}
boolean
scard_async_op(IRP* irp)
boolean scard_async_op(IRP* irp)
{
uint32 ioctl_code;
@ -1342,7 +1302,7 @@ scard_async_op(IRP* irp)
case SCARD_IOCTL_RELEASE_CONTEXT:
case SCARD_IOCTL_IS_VALID_CONTEXT:
return False;
return false;
break;
/* async events */
@ -1353,7 +1313,7 @@ scard_async_op(IRP* irp)
case SCARD_IOCTL_STATUS:
case SCARD_IOCTL_STATUS + 4:
return True;
return true;
break;
default:
@ -1361,12 +1321,10 @@ scard_async_op(IRP* irp)
}
/* default to async */
return True;
return true;
}
void
scard_device_control(SCARD_DEVICE* scard, IRP* irp)
void scard_device_control(SCARD_DEVICE* scard, IRP* irp)
{
uint32 output_len, input_len, ioctl_code;
uint32 stream_len, result;
@ -1427,7 +1385,7 @@ scard_device_control(SCARD_DEVICE* scard, IRP* irp)
case SCARD_IOCTL_LIST_READER_GROUPS:
case SCARD_IOCTL_LIST_READER_GROUPS + 4:
// typically not used unless list_readers fail
/* typically not used unless list_readers fail */
result = SCARD_F_INTERNAL_ERROR;
break;
@ -1544,4 +1502,3 @@ scard_device_control(SCARD_DEVICE* scard, IRP* irp)
irp->Complete(irp);
}

View File

@ -206,7 +206,7 @@ static boolean rdpsnd_alsa_format_supported(rdpsndDevicePlugin* device, rdpsndFo
(format->wBitsPerSample == 8 || format->wBitsPerSample == 16) &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
@ -215,11 +215,11 @@ static boolean rdpsnd_alsa_format_supported(rdpsndDevicePlugin* device, rdpsndFo
format->wBitsPerSample == 4 &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
}
return False;
return false;
}
static void rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, uint32 value)

View File

@ -75,19 +75,19 @@ static boolean rdpsnd_pulse_connect(rdpsndDevicePlugin* device)
pa_context_state_t state;
if (!pulse->context)
return False;
return false;
if (pa_context_connect(pulse->context, NULL, 0, NULL))
{
DEBUG_WARN("pa_context_connect failed (%d)", pa_context_errno(pulse->context));
return False;
return false;
}
pa_threaded_mainloop_lock(pulse->mainloop);
if (pa_threaded_mainloop_start(pulse->mainloop) < 0)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)", pa_context_errno(pulse->context));
return False;
return false;
}
for (;;)
{
@ -105,12 +105,12 @@ static boolean rdpsnd_pulse_connect(rdpsndDevicePlugin* device)
if (state == PA_CONTEXT_READY)
{
DEBUG_SVC("connected");
return True;
return true;
}
else
{
pa_context_disconnect(pulse->context);
return False;
return false;
}
}
@ -337,7 +337,7 @@ static boolean rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, rdpsndF
rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device;
if (!pulse->context)
return False;
return false;
switch (format->wFormatTag)
{
@ -347,7 +347,7 @@ static boolean rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, rdpsndF
(format->wBitsPerSample == 8 || format->wBitsPerSample == 16) &&
(format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX))
{
return True;
return true;
}
break;
@ -358,7 +358,7 @@ static boolean rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, rdpsndF
(format->wBitsPerSample == 8) &&
(format->nChannels >= 1 && format->nChannels <= PA_CHANNELS_MAX))
{
return True;
return true;
}
break;
@ -367,11 +367,11 @@ static boolean rdpsnd_pulse_format_supported(rdpsndDevicePlugin* device, rdpsndF
(format->wBitsPerSample == 4) &&
(format->nChannels == 1 || format->nChannels == 2))
{
return True;
return true;
}
break;
}
return False;
return false;
}
static void rdpsnd_pulse_set_format(rdpsndDevicePlugin* device, rdpsndFormat* format, int latency)

View File

@ -128,7 +128,7 @@ static void rdpsnd_process_interval(rdpSvcPlugin* plugin)
{
if (rdpsnd->device)
IFCALL(rdpsnd->device->Close, rdpsnd->device);
rdpsnd->is_open = False;
rdpsnd->is_open = false;
rdpsnd->close_timestamp = 0;
DEBUG_SVC("processed close");
@ -306,7 +306,7 @@ static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_
stream_read(data_in, rdpsnd->waveData, 4);
rdpsnd->waveDataSize = BodySize - 8;
rdpsnd->wave_timestamp = get_mstime();
rdpsnd->expectingWave = True;
rdpsnd->expectingWave = true;
DEBUG_SVC("waveDataSize %d wFormatNo %d", rdpsnd->waveDataSize, wFormatNo);
@ -314,7 +314,7 @@ static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_
if (!rdpsnd->is_open)
{
rdpsnd->current_format = wFormatNo;
rdpsnd->is_open = True;
rdpsnd->is_open = true;
if (rdpsnd->device)
IFCALL(rdpsnd->device->Open, rdpsnd->device, &rdpsnd->supported_formats[wFormatNo],
rdpsnd->latency);
@ -455,7 +455,7 @@ static boolean rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name,
}
if (entry == NULL)
{
return False;
return false;
}
entryPoints.rdpsnd = rdpsnd;
@ -464,9 +464,9 @@ static boolean rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name,
if (entry(&entryPoints) != 0)
{
DEBUG_WARN("%s entry returns error.", name);
return False;
return false;
}
return True;
return true;
}
static void rdpsnd_process_plugin_data(rdpsndPlugin* rdpsnd, RDP_PLUGIN_DATA* data)

View File

@ -215,19 +215,19 @@ boolean df_event_process(freerdp* instance, DFBEvent* event)
break;
case DIET_BUTTONPRESS:
df_send_mouse_button_event(instance->input, True, input_event->button, pointer_x, pointer_y);
df_send_mouse_button_event(instance->input, true, input_event->button, pointer_x, pointer_y);
break;
case DIET_BUTTONRELEASE:
df_send_mouse_button_event(instance->input, False, input_event->button, pointer_x, pointer_y);
df_send_mouse_button_event(instance->input, false, input_event->button, pointer_x, pointer_y);
break;
case DIET_KEYPRESS:
df_send_keyboard_event(instance->input, True, input_event->key_id - DIKI_UNKNOWN);
df_send_keyboard_event(instance->input, true, input_event->key_id - DIKI_UNKNOWN);
break;
case DIET_KEYRELEASE:
df_send_keyboard_event(instance->input, False, input_event->key_id - DIKI_UNKNOWN);
df_send_keyboard_event(instance->input, false, input_event->key_id - DIKI_UNKNOWN);
break;
case DIET_UNKNOWN:
@ -235,5 +235,5 @@ boolean df_event_process(freerdp* instance, DFBEvent* event)
}
}
return True;
return true;
}

View File

@ -50,19 +50,19 @@ void df_context_free(freerdp* instance, rdpContext* context)
}
void df_begin_paint(rdpUpdate* update)
void df_begin_paint(rdpContext* context)
{
rdpGdi* gdi = update->context->gdi;
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
}
void df_end_paint(rdpUpdate* update)
void df_end_paint(rdpContext* context)
{
rdpGdi* gdi;
dfInfo* dfi;
gdi = update->context->gdi;
dfi = ((dfContext*) update->context)->dfi;
gdi = context->gdi;
dfi = ((dfContext*) context)->dfi;
if (gdi->primary->hdc->hwnd->invalid->null)
return;
@ -91,7 +91,7 @@ boolean df_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int
rfds[*rcount] = (void*)(long)(dfi->read_fds);
(*rcount)++;
return True;
return true;
}
boolean df_check_fds(freerdp* instance, fd_set* set)
@ -101,12 +101,12 @@ boolean df_check_fds(freerdp* instance, fd_set* set)
dfi = ((dfContext*) instance->context)->dfi;
if (!FD_ISSET(dfi->read_fds, set))
return True;
return true;
if (read(dfi->read_fds, &(dfi->event), sizeof(dfi->event)) > 0)
df_event_process(instance, &(dfi->event));
return True;
return true;
}
boolean df_pre_connect(freerdp* instance)
@ -121,28 +121,28 @@ boolean df_pre_connect(freerdp* instance)
settings = instance->settings;
settings->order_support[NEG_DSTBLT_INDEX] = True;
settings->order_support[NEG_PATBLT_INDEX] = True;
settings->order_support[NEG_SCRBLT_INDEX] = True;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = True;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = False;
settings->order_support[NEG_MULTIPATBLT_INDEX] = False;
settings->order_support[NEG_MULTISCRBLT_INDEX] = False;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_MEMBLT_INDEX] = True;
settings->order_support[NEG_MEM3BLT_INDEX] = False;
settings->order_support[NEG_SAVEBITMAP_INDEX] = True;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_GLYPH_INDEX] = True;
settings->order_support[NEG_POLYGON_SC_INDEX] = False;
settings->order_support[NEG_POLYGON_CB_INDEX] = False;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;
settings->order_support[NEG_SCRBLT_INDEX] = true;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_LINETO_INDEX] = true;
settings->order_support[NEG_POLYLINE_INDEX] = true;
settings->order_support[NEG_MEMBLT_INDEX] = true;
settings->order_support[NEG_MEM3BLT_INDEX] = false;
settings->order_support[NEG_SAVEBITMAP_INDEX] = true;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_GLYPH_INDEX] = true;
settings->order_support[NEG_POLYGON_SC_INDEX] = false;
settings->order_support[NEG_POLYGON_CB_INDEX] = false;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
dfi->clrconv = xnew(CLRCONV);
dfi->clrconv->alpha = 1;
@ -152,7 +152,7 @@ boolean df_pre_connect(freerdp* instance)
freerdp_channels_pre_connect(instance->context->channels, instance);
return True;
return true;
}
boolean df_post_connect(freerdp* instance)
@ -208,7 +208,7 @@ boolean df_post_connect(freerdp* instance)
freerdp_channels_post_connect(instance->context->channels, instance);
return True;
return true;
}
static int df_process_plugin_args(rdpSettings* settings, const char* name,
@ -240,7 +240,7 @@ boolean df_verify_certificate(freerdp* instance, char* subject, char* issuer, ch
if (answer == 'y' || answer == 'Y')
{
return True;
return true;
}
else if (answer == 'n' || answer == 'N')
{
@ -248,7 +248,7 @@ boolean df_verify_certificate(freerdp* instance, char* subject, char* issuer, ch
}
}
return False;
return false;
}
static int
@ -331,17 +331,17 @@ int dfreerdp_run(freerdp* instance)
rcount = 0;
wcount = 0;
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get FreeRDP file descriptor\n");
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get channel manager file descriptor\n");
break;
}
if (df_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (df_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get dfreerdp file descriptor\n");
break;
@ -377,17 +377,17 @@ int dfreerdp_run(freerdp* instance)
}
}
if (freerdp_check_fds(instance) != True)
if (freerdp_check_fds(instance) != true)
{
printf("Failed to check FreeRDP file descriptor\n");
break;
}
if (df_check_fds(instance, &rfds_set) != True)
if (df_check_fds(instance, &rfds_set) != true)
{
printf("Failed to check dfreerdp file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != True)
if (freerdp_channels_check_fds(channels, instance) != true)
{
printf("Failed to check channel manager file descriptor\n");
break;

View File

@ -20,15 +20,16 @@
#ifndef __DFREERDP_H
#define __DFREERDP_H
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <directfb.h>
#include <freerdp/freerdp.h>
#include <freerdp/graphics.h>
#include <freerdp/channels/channels.h>
#include <freerdp/gdi/gdi.h>
#include <freerdp/codec/color.h>
#include <freerdp/channels/channels.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <directfb.h>
typedef struct df_info dfInfo;

View File

@ -131,7 +131,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
rdpInput* input;
boolean processed;
processed = True;
processed = true;
ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA);
wfi = (wfInfo*) ptr;
@ -181,13 +181,13 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
break;
default:
processed = False;
processed = false;
break;
}
}
else
{
processed = False;
processed = false;
}
if (processed)

View File

@ -60,12 +60,12 @@ boolean wf_set_rop2(HDC hdc, int rop2)
if ((rop2 < 0x01) || (rop2 > 0x10))
{
printf("Unsupported ROP2: %d\n", rop2);
return False;
return false;
}
SetROP2(hdc, wf_rop2_table[rop2 - 1]);
return True;
return true;
}
wfBitmap* wf_glyph_new(wfInfo* wfi, GLYPH_DATA* glyph)
@ -470,7 +470,7 @@ void wf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
wfi->image->_bitmap.data = (uint8*) xrealloc(wfi->image->_bitmap.data,
wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
if ((surface_bits_command->bpp != 32) || (wfi->clrconv->alpha == True))
if ((surface_bits_command->bpp != 32) || (wfi->clrconv->alpha == true))
{
uint8* temp_image;

View File

@ -156,7 +156,7 @@ void wf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
status = bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp);
if (status != True)
if (status != true)
{
printf("Bitmap Decompression Failed\n");
}
@ -166,7 +166,7 @@ void wf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
freerdp_image_flip(data, bitmap->data, width, height, bpp);
}
bitmap->compressed = False;
bitmap->compressed = false;
bitmap->length = size;
bitmap->bpp = bpp;
}

View File

@ -138,28 +138,28 @@ boolean wf_pre_connect(freerdp* instance)
settings = instance->settings;
settings->order_support[NEG_DSTBLT_INDEX] = True;
settings->order_support[NEG_PATBLT_INDEX] = True;
settings->order_support[NEG_SCRBLT_INDEX] = True;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = True;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = False;
settings->order_support[NEG_MULTIPATBLT_INDEX] = False;
settings->order_support[NEG_MULTISCRBLT_INDEX] = False;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_MEMBLT_INDEX] = True;
settings->order_support[NEG_MEM3BLT_INDEX] = False;
settings->order_support[NEG_SAVEBITMAP_INDEX] = False;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = False;
settings->order_support[NEG_FAST_INDEX_INDEX] = False;
settings->order_support[NEG_FAST_GLYPH_INDEX] = False;
settings->order_support[NEG_POLYGON_SC_INDEX] = False;
settings->order_support[NEG_POLYGON_CB_INDEX] = False;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;
settings->order_support[NEG_SCRBLT_INDEX] = true;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_LINETO_INDEX] = true;
settings->order_support[NEG_POLYLINE_INDEX] = true;
settings->order_support[NEG_MEMBLT_INDEX] = true;
settings->order_support[NEG_MEM3BLT_INDEX] = false;
settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = false;
settings->order_support[NEG_FAST_INDEX_INDEX] = false;
settings->order_support[NEG_FAST_GLYPH_INDEX] = false;
settings->order_support[NEG_POLYGON_SC_INDEX] = false;
settings->order_support[NEG_POLYGON_CB_INDEX] = false;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
wfi->cursor = g_default_cursor;
@ -202,7 +202,7 @@ boolean wf_pre_connect(freerdp* instance)
settings->kbd_layout = (int) GetKeyboardLayout(0) & 0x0000FFFF;
freerdp_channels_pre_connect(instance->context->channels, instance);
return True;
return true;
}
boolean wf_post_connect(freerdp* instance)
@ -307,7 +307,7 @@ boolean wf_post_connect(freerdp* instance)
pointer_cache_register_callbacks(instance->update);
if (wfi->sw_gdi != True)
if (wfi->sw_gdi != true)
{
brush_cache_register_callbacks(instance->update);
bitmap_cache_register_callbacks(instance->update);
@ -318,12 +318,12 @@ boolean wf_post_connect(freerdp* instance)
freerdp_channels_post_connect(instance->context->channels, instance);
return True;
return true;
}
boolean wf_verify_certificate(freerdp* instance, char* subject, char* issuer, char* fingerprint)
{
return True;
return true;
}
@ -344,12 +344,12 @@ void wf_process_channel_event(rdpChannels* channels, freerdp* instance)
boolean wf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount)
{
return True;
return true;
}
boolean wf_check_fds(freerdp* instance)
{
return True;
return true;
}
int wf_process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data)
@ -384,7 +384,7 @@ int wfreerdp_run(freerdp* instance)
memset(rfds, 0, sizeof(rfds));
memset(wfds, 0, sizeof(wfds));
if (freerdp_connect(instance) != True)
if (freerdp_connect(instance) != true)
return 0;
channels = instance->context->channels;
@ -394,17 +394,17 @@ int wfreerdp_run(freerdp* instance)
rcount = 0;
wcount = 0;
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get FreeRDP file descriptor\n");
break;
}
if (wf_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (wf_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get wfreerdp file descriptor\n");
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get channel manager file descriptor\n");
break;
@ -435,17 +435,17 @@ int wfreerdp_run(freerdp* instance)
break;
}
if (freerdp_check_fds(instance) != True)
if (freerdp_check_fds(instance) != true)
{
printf("Failed to check FreeRDP file descriptor\n");
break;
}
if (wf_check_fds(instance) != True)
if (wf_check_fds(instance) != true)
{
printf("Failed to check wfreerdp file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != True)
if (freerdp_channels_check_fds(channels, instance) != true)
{
printf("Failed to check channel manager file descriptor\n");
break;

View File

@ -82,7 +82,7 @@ void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
cb->request_index = -1;
cb->root_window = DefaultRootWindow(xfi->display);
cb->clipboard_atom = XInternAtom(xfi->display, "CLIPBOARD", False);
cb->clipboard_atom = XInternAtom(xfi->display, "CLIPBOARD", false);
if (cb->clipboard_atom == None)
{
@ -90,8 +90,8 @@ void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
}
id = 1;
cb->property_atom = XInternAtom(xfi->display, "_FREERDP_CLIPRDR", False);
cb->identity_atom = XInternAtom(xfi->display, "_FREERDP_CLIPRDR_ID", False);
cb->property_atom = XInternAtom(xfi->display, "_FREERDP_CLIPRDR", false);
cb->identity_atom = XInternAtom(xfi->display, "_FREERDP_CLIPRDR_ID", false);
XChangeProperty(xfi->display, xfi->drawable, cb->identity_atom,
XA_INTEGER, 32, PropModeReplace, (uint8*) &id, 1);
@ -99,11 +99,11 @@ void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
XSelectInput(xfi->display, cb->root_window, PropertyChangeMask);
n = 0;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "_FREERDP_RAW", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "_FREERDP_RAW", false);
cb->format_mappings[n].format_id = CB_FORMAT_RAW;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "UTF8_STRING", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "UTF8_STRING", false);
cb->format_mappings[n].format_id = CB_FORMAT_UNICODETEXT;
n++;
@ -111,31 +111,31 @@ void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
cb->format_mappings[n].format_id = CB_FORMAT_TEXT;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/png", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/png", false);
cb->format_mappings[n].format_id = CB_FORMAT_PNG;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/jpeg", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/jpeg", false);
cb->format_mappings[n].format_id = CB_FORMAT_JPEG;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/gif", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/gif", false);
cb->format_mappings[n].format_id = CB_FORMAT_GIF;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/bmp", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "image/bmp", false);
cb->format_mappings[n].format_id = CB_FORMAT_DIB;
n++;
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "text/html", False);
cb->format_mappings[n].target_format = XInternAtom(xfi->display, "text/html", false);
cb->format_mappings[n].format_id = CB_FORMAT_HTML;
cb->num_format_mappings = n + 1;
cb->targets[0] = XInternAtom(xfi->display, "TIMESTAMP", False);
cb->targets[1] = XInternAtom(xfi->display, "TARGETS", False);
cb->targets[0] = XInternAtom(xfi->display, "TIMESTAMP", false);
cb->targets[1] = XInternAtom(xfi->display, "TARGETS", false);
cb->num_targets = 2;
cb->incr_atom = XInternAtom(xfi->display, "INCR", False);
cb->incr_atom = XInternAtom(xfi->display, "INCR", false);
}
void xf_cliprdr_uninit(xfInfo* xfi)
@ -231,7 +231,7 @@ static boolean xf_cliprdr_is_self_owned(xfInfo* xfi)
uint32 id = 0;
uint32* pid = NULL;
int format, result = 0;
unsigned long len, bytes_left;
unsigned long length, bytes_left;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
cb->owner = XGetSelectionOwner(xfi->display, cb->clipboard_atom);
@ -240,7 +240,7 @@ static boolean xf_cliprdr_is_self_owned(xfInfo* xfi)
{
result = XGetWindowProperty(xfi->display, cb->owner,
cb->identity_atom, 0, 4, 0, XA_INTEGER,
&type, &format, &len, &bytes_left, (uint8**) &pid);
&type, &format, &length, &bytes_left, (uint8**) &pid);
}
if (pid)
@ -249,13 +249,13 @@ static boolean xf_cliprdr_is_self_owned(xfInfo* xfi)
XFree(pid);
}
if (cb->owner == None || cb->owner == xfi->drawable)
return False;
if ((cb->owner == None) || (cb->owner == xfi->drawable))
return false;
if (result != Success)
return False;
return false;
return (id ? True : False);
return (id ? true : false);
}
static int xf_cliprdr_select_format_by_id(clipboardContext* cb, uint32 format_id)
@ -302,27 +302,27 @@ static void xf_cliprdr_send_raw_format_list(xfInfo* xfi)
Atom type;
uint8* format_data;
int format, result;
unsigned long len, bytes_left;
unsigned long length, bytes_left;
RDP_CB_FORMAT_LIST_EVENT* event;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
result = XGetWindowProperty(xfi->display, cb->root_window,
cb->property_atom, 0, 3600, 0, XA_STRING,
&type, &format, &len, &bytes_left, (uint8**) &format_data);
&type, &format, &length, &bytes_left, (uint8**) &format_data);
if (result != Success)
{
DEBUG_WARN("XGetWindowProperty failed");
return;
}
DEBUG_X11("format=%d len=%d bytes_left=%d", format, (int)len, (int)bytes_left);
DEBUG_X11("format=%d len=%d bytes_left=%d", format, (int) length, (int) bytes_left);
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL);
event->raw_format_data = (uint8*) xmalloc(len);
memcpy(event->raw_format_data, format_data, len);
event->raw_format_data_size = len;
event->raw_format_data = (uint8*) xmalloc(length);
memcpy(event->raw_format_data, format_data, length);
event->raw_format_data_size = length;
XFree(format_data);
freerdp_channels_send_event(cb->channels, (RDP_EVENT*) event);
@ -386,6 +386,7 @@ static void xf_cliprdr_send_data_request(xfInfo* xfi, uint32 format)
event = (RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_DATA_REQUEST, NULL, NULL);
event->format = format;
freerdp_channels_send_event(cb->channels, (RDP_EVENT*) event);
@ -415,7 +416,7 @@ static void xf_cliprdr_process_cb_monitor_ready_event(xfInfo* xfi)
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
xf_cliprdr_send_format_list(xfi);
cb->sync = True;
cb->sync = true;
}
static void xf_cliprdr_process_cb_data_request_event(xfInfo* xfi, RDP_CB_DATA_REQUEST_EVENT* event)
@ -429,13 +430,14 @@ static void xf_cliprdr_process_cb_data_request_event(xfInfo* xfi, RDP_CB_DATA_RE
{
/* CB_FORMAT_RAW */
i = 0;
XChangeProperty(xfi->display, xfi->drawing, cb->property_atom,
XChangeProperty(xfi->display, xfi->drawable, cb->property_atom,
XA_INTEGER, 32, PropModeReplace, (uint8*) &event->format, 1);
}
else
{
i = xf_cliprdr_select_format_by_id(cb, event->format);
}
if (i < 0)
{
DEBUG_X11("unsupported format requested");
@ -445,7 +447,7 @@ static void xf_cliprdr_process_cb_data_request_event(xfInfo* xfi, RDP_CB_DATA_RE
{
cb->request_index = i;
DEBUG_X11("target=%d", (int)cb->format_mappings[i].target_format);
DEBUG_X11("target=%d", (int) cb->format_mappings[i].target_format);
XConvertSelection(xfi->display, cb->clipboard_atom,
cb->format_mappings[i].target_format, cb->property_atom,
@ -462,28 +464,28 @@ static void xf_cliprdr_get_requested_targets(xfInfo* xfi)
Atom atom;
int format;
uint8* data = NULL;
unsigned long len, bytes_left;
unsigned long length, bytes_left;
RDP_CB_FORMAT_LIST_EVENT* event;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
XGetWindowProperty(xfi->display, xfi->drawable, cb->property_atom,
0, 200, 0, XA_ATOM,
&atom, &format, &len, &bytes_left, &data);
&atom, &format, &length, &bytes_left, &data);
DEBUG_X11("type=%d format=%d len=%d bytes_left=%d",
(int) atom, format, (int) len, (int) bytes_left);
DEBUG_X11("type=%d format=%d length=%d bytes_left=%d",
(int) atom, format, (int) length, (int) bytes_left);
if (len > 0)
if (length > 0)
{
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL);
event->formats = (uint32*) xmalloc(sizeof(uint32) * cb->num_format_mappings);
num = 0;
for (i = 0; i < len; i++)
for (i = 0; i < length; i++)
{
atom = ((Atom*)data)[i];
DEBUG_X11("atom %d", (int)atom);
atom = ((Atom*) data)[i];
DEBUG_X11("atom %d", (int) atom);
for (j = 0; j < cb->num_format_mappings; j++)
{
if (cb->format_mappings[j].target_format == atom)
@ -687,7 +689,7 @@ static void xf_cliprdr_process_requested_data(xfInfo* xfi, boolean has_data, uin
xf_cliprdr_send_null_data_response(xfi);
/* Resend the format list, otherwise the server won't request again for the next paste */
xf_cliprdr_send_format_list(xfi);
//xf_cliprdr_send_format_list(xfi);
}
static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
@ -695,21 +697,21 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
Atom type;
int format;
uint8* data = NULL;
boolean has_data = False;
unsigned long len, bytes_left, dummy;
boolean has_data = false;
unsigned long length, bytes_left, dummy;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
if (cb->request_index < 0 ||
cb->format_mappings[cb->request_index].target_format != target)
if ((cb->request_index < 0) ||
(cb->format_mappings[cb->request_index].target_format != target))
{
DEBUG_X11("invalid target");
xf_cliprdr_send_null_data_response(xfi);
return False;
return false;
}
XGetWindowProperty(xfi->display, xfi->drawable,
cb->property_atom, 0, 0, 0, target,
&type, &format, &len, &bytes_left, &data);
&type, &format, &length, &bytes_left, &data);
DEBUG_X11("type=%d format=%d bytes=%d request_index=%d",
(int) type, format, (int) bytes_left, cb->request_index);
@ -726,7 +728,7 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
else if (type == cb->incr_atom)
{
DEBUG_X11("INCR started");
cb->incr_starts = True;
cb->incr_starts = true;
if (cb->incr_data)
{
xfree(cb->incr_data);
@ -734,7 +736,7 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
}
cb->incr_data_length = 0;
/* Data will be followed in PropertyNotify event */
has_data = True;
has_data = true;
}
else
{
@ -747,15 +749,15 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
cb->incr_data_length = 0;
cb->incr_starts = 0;
DEBUG_X11("INCR finished");
has_data = True;
has_data = true;
}
else if (XGetWindowProperty(xfi->display, xfi->drawable,
cb->property_atom, 0, bytes_left, 0, target,
&type, &format, &len, &dummy, &data) == Success)
&type, &format, &length, &dummy, &data) == Success)
{
if (cb->incr_starts)
{
bytes_left = len * format / 8;
bytes_left = length * format / 8;
DEBUG_X11("%d bytes", (int)bytes_left);
cb->incr_data = (uint8*) xrealloc(cb->incr_data, cb->incr_data_length + bytes_left);
memcpy(cb->incr_data + cb->incr_data_length, data, bytes_left);
@ -763,7 +765,7 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
XFree(data);
data = NULL;
}
has_data = True;
has_data = true;
}
else
{
@ -777,7 +779,7 @@ static boolean xf_cliprdr_get_requested_data(xfInfo* xfi, Atom target)
if (data)
XFree(data);
return True;
return true;
}
static void xf_cliprdr_append_target(clipboardContext* cb, Atom target)
@ -1060,7 +1062,7 @@ boolean xf_cliprdr_process_selection_notify(xfInfo* xfi, XEvent* xevent)
xf_cliprdr_get_requested_targets(xfi);
}
return True;
return true;
}
else
{
@ -1078,18 +1080,18 @@ boolean xf_cliprdr_process_selection_request(xfInfo* xfi, XEvent* xevent)
uint32 alt_format;
uint8* data = NULL;
boolean delay_respond;
unsigned long len, bytes_left;
unsigned long length, bytes_left;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
DEBUG_X11("target=%d", (int)xevent->xselectionrequest.target);
DEBUG_X11("target=%d", (int) xevent->xselectionrequest.target);
if (xevent->xselectionrequest.owner != xfi->drawable)
{
DEBUG_X11("not owner");
return False;
return false;
}
delay_respond = False;
delay_respond = false;
respond = xnew(XEvent);
respond->xselection.property = None;
respond->xselection.type = SelectionNotify;
@ -1120,7 +1122,7 @@ boolean xf_cliprdr_process_selection_request(xfInfo* xfi, XEvent* xevent)
{
if (XGetWindowProperty(xfi->display, xevent->xselectionrequest.requestor,
cb->property_atom, 0, 4, 0, XA_INTEGER,
&type, &fmt, &len, &bytes_left, &data) != Success)
&type, &fmt, &length, &bytes_left, &data) != Success)
{
DEBUG_X11("XGetWindowProperty failed");
}
@ -1131,7 +1133,7 @@ boolean xf_cliprdr_process_selection_request(xfInfo* xfi, XEvent* xevent)
}
}
DEBUG_X11("provide format 0x%04x alt_format 0x%04x", format, alt_format);
if (cb->data != 0 && format == cb->data_format && alt_format == cb->data_alt_format)
if ((cb->data != 0) && (format == cb->data_format) && (alt_format == cb->data_alt_format))
{
/* Cached clipboard data available. Send it now */
respond->xselection.property = xevent->xselectionrequest.property;
@ -1157,21 +1159,21 @@ boolean xf_cliprdr_process_selection_request(xfInfo* xfi, XEvent* xevent)
cb->respond = respond;
cb->data_format = format;
cb->data_alt_format = alt_format;
delay_respond = True;
delay_respond = true;
xf_cliprdr_send_data_request(xfi, alt_format);
}
}
}
if (!delay_respond)
if (delay_respond != false)
{
XSendEvent(xfi->display, xevent->xselectionrequest.requestor, 0, 0, respond);
XFlush(xfi->display);
xfree(respond);
}
return True;
return true;
}
boolean xf_cliprdr_process_selection_clear(xfInfo* xfi, XEvent* xevent)
@ -1179,11 +1181,11 @@ boolean xf_cliprdr_process_selection_clear(xfInfo* xfi, XEvent* xevent)
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
if (xf_cliprdr_is_self_owned(xfi))
return False;
return false;
XDeleteProperty(xfi->display, cb->root_window, cb->property_atom);
return True;
return true;
}
boolean xf_cliprdr_process_property_notify(xfInfo* xfi, XEvent* xevent)
@ -1191,7 +1193,7 @@ boolean xf_cliprdr_process_property_notify(xfInfo* xfi, XEvent* xevent)
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
if (xevent->xproperty.atom != cb->property_atom)
return False; /* Not cliprdr-related */
return false; /* Not cliprdr-related */
if (xevent->xproperty.window == cb->root_window)
{
@ -1207,7 +1209,7 @@ boolean xf_cliprdr_process_property_notify(xfInfo* xfi, XEvent* xevent)
cb->format_mappings[cb->request_index].target_format);
}
return True;
return true;
}
void xf_cliprdr_check_owner(xfInfo* xfi)

View File

@ -82,7 +82,7 @@ boolean xf_event_Expose(xfInfo* xfi, XEvent* event, boolean app)
w = event->xexpose.width;
h = event->xexpose.height;
if (app != True)
if (app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc, x, y, w, h, x, y);
}
@ -101,13 +101,13 @@ boolean xf_event_Expose(xfInfo* xfi, XEvent* event, boolean app)
}
}
return True;
return true;
}
boolean xf_event_VisibilityNotify(xfInfo* xfi, XEvent* event, boolean app)
{
xfi->unobscured = event->xvisibility.state == VisibilityUnobscured;
return True;
return true;
}
boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
@ -116,12 +116,12 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
input = xfi->instance->input;
if (app != True)
if (app != true)
{
if (xfi->mouse_motion != True)
if (xfi->mouse_motion != true)
{
if ((event->xmotion.state & (Button1Mask | Button2Mask | Button3Mask)) == 0)
return True;
return true;
}
input->MouseEvent(input, PTR_FLAGS_MOVE, event->xmotion.x, event->xmotion.y);
@ -129,7 +129,7 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
if (xfi->fullscreen)
XSetInputFocus(xfi->display, xfi->window->handle, RevertToPointerRoot, CurrentTime);
}
else if (xfi->mouse_motion == True)
else if (xfi->mouse_motion == true)
{
rdpWindow* window;
int x = event->xmotion.x;
@ -146,7 +146,7 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
}
}
return True;
return true;
}
boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app)
@ -161,7 +161,7 @@ boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app)
x = 0;
y = 0;
flags = 0;
wheel = False;
wheel = false;
switch (event->xbutton.button)
{
@ -184,12 +184,12 @@ boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app)
break;
case 4:
wheel = True;
wheel = true;
flags = PTR_FLAGS_WHEEL | 0x0078;
break;
case 5:
wheel = True;
wheel = true;
flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
break;
@ -226,7 +226,7 @@ boolean xf_event_ButtonPress(xfInfo* xfi, XEvent* event, boolean app)
}
}
return True;
return true;
}
boolean xf_event_ButtonRelease(xfInfo* xfi, XEvent* event, boolean app)
@ -285,7 +285,7 @@ boolean xf_event_ButtonRelease(xfInfo* xfi, XEvent* event, boolean app)
input->MouseEvent(input, flags, x, y);
}
return True;
return true;
}
boolean xf_event_KeyPress(xfInfo* xfi, XEvent* event, boolean app)
@ -298,11 +298,11 @@ boolean xf_event_KeyPress(xfInfo* xfi, XEvent* event, boolean app)
xf_kbd_set_keypress(xfi, event->xkey.keycode, keysym);
if (xfi->fullscreen_toggle && xf_kbd_handle_special_keys(xfi, keysym))
return True;
return true;
xf_kbd_send_key(xfi, True, event->xkey.keycode);
xf_kbd_send_key(xfi, true, event->xkey.keycode);
return True;
return true;
}
boolean xf_event_KeyRelease(xfInfo* xfi, XEvent* event, boolean app)
@ -317,48 +317,48 @@ boolean xf_event_KeyRelease(xfInfo* xfi, XEvent* event, boolean app)
if (next_event.type == KeyPress)
{
if (next_event.xkey.keycode == event->xkey.keycode)
return True;
return true;
}
}
xf_kbd_unset_keypress(xfi, event->xkey.keycode);
xf_kbd_send_key(xfi, False, event->xkey.keycode);
xf_kbd_send_key(xfi, false, event->xkey.keycode);
return True;
return true;
}
boolean xf_event_FocusIn(xfInfo* xfi, XEvent* event, boolean app)
{
if (event->xfocus.mode == NotifyGrab)
return True;
return true;
xfi->focused = True;
xfi->focused = true;
if (xfi->mouse_active && (app != True))
XGrabKeyboard(xfi->display, xfi->window->handle, True, GrabModeAsync, GrabModeAsync, CurrentTime);
if (xfi->mouse_active && (app != true))
XGrabKeyboard(xfi->display, xfi->window->handle, true, GrabModeAsync, GrabModeAsync, CurrentTime);
xf_rail_send_activate(xfi, event->xany.window, True);
xf_rail_send_activate(xfi, event->xany.window, true);
xf_kbd_focus_in(xfi);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
xf_cliprdr_check_owner(xfi);
return True;
return true;
}
boolean xf_event_FocusOut(xfInfo* xfi, XEvent* event, boolean app)
{
if (event->xfocus.mode == NotifyUngrab)
return True;
return true;
xfi->focused = False;
xfi->focused = false;
if (event->xfocus.mode == NotifyWhileGrabbed)
XUngrabKeyboard(xfi->display, CurrentTime);
xf_rail_send_activate(xfi, event->xany.window, False);
xf_rail_send_activate(xfi, event->xany.window, false);
return True;
return true;
}
boolean xf_event_MappingNotify(xfInfo* xfi, XEvent* event, boolean app)
@ -369,7 +369,7 @@ boolean xf_event_MappingNotify(xfInfo* xfi, XEvent* event, boolean app)
xfi->modifier_map = XGetModifierMapping(xfi->display);
}
return True;
return true;
}
boolean xf_event_ClientMessage(xfInfo* xfi, XEvent* event, boolean app)
@ -389,28 +389,28 @@ boolean xf_event_ClientMessage(xfInfo* xfi, XEvent* event, boolean app)
xf_rail_send_client_system_command(xfi, window->windowId, SC_CLOSE);
}
return True;
return true;
}
else
{
return False;
return false;
}
}
return True;
return true;
}
boolean xf_event_EnterNotify(xfInfo* xfi, XEvent* event, boolean app)
{
if (app != True)
if (app != true)
{
xfi->mouse_active = True;
xfi->mouse_active = true;
if (xfi->fullscreen)
XSetInputFocus(xfi->display, xfi->window->handle, RevertToPointerRoot, CurrentTime);
if (xfi->focused)
XGrabKeyboard(xfi->display, xfi->window->handle, True, GrabModeAsync, GrabModeAsync, CurrentTime);
XGrabKeyboard(xfi->display, xfi->window->handle, true, GrabModeAsync, GrabModeAsync, CurrentTime);
} else {
// Keep track of which window has focus so that we can apply pointer updates
xfWindow* xfw;
@ -424,18 +424,18 @@ boolean xf_event_EnterNotify(xfInfo* xfi, XEvent* event, boolean app)
}
}
return True;
return true;
}
boolean xf_event_LeaveNotify(xfInfo* xfi, XEvent* event, boolean app)
{
if (app != True)
if (app != true)
{
xfi->mouse_active = False;
xfi->mouse_active = false;
XUngrabKeyboard(xfi->display, CurrentTime);
}
return True;
return true;
}
boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
@ -470,7 +470,7 @@ boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
event->xconfigure.override_redirect);
}
return True;
return true;
}
boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
@ -478,8 +478,8 @@ boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
rdpWindow* window;
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
if (app != True)
return True;
if (app != true)
return true;
window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
@ -489,67 +489,67 @@ boolean xf_event_MapNotify(xfInfo* xfi, XEvent* event, boolean app)
xf_rail_send_client_system_command(xfi, window->windowId, SC_RESTORE);
}
return True;
return true;
}
boolean xf_event_SelectionNotify(xfInfo* xfi, XEvent* event, boolean app)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xf_cliprdr_process_selection_notify(xfi, event))
return True;
return true;
}
return True;
return true;
}
boolean xf_event_SelectionRequest(xfInfo* xfi, XEvent* event, boolean app)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xf_cliprdr_process_selection_request(xfi, event))
return True;
return true;
}
return True;
return true;
}
boolean xf_event_SelectionClear(xfInfo* xfi, XEvent* event, boolean app)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xf_cliprdr_process_selection_clear(xfi, event))
return True;
return true;
}
return True;
return true;
}
boolean xf_event_PropertyNotify(xfInfo* xfi, XEvent* event, boolean app)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xf_cliprdr_process_property_notify(xfi, event))
return True;
return true;
}
return True;
return true;
}
boolean xf_event_process(freerdp* instance, XEvent* event)
{
boolean app = False;
boolean status = True;
boolean app = false;
boolean status = true;
xfInfo* xfi = ((xfContext*) instance->context)->xfi;
if (xfi->remote_app == True)
if (xfi->remote_app == true)
{
app = True;
app = true;
}
else
{
if (event->xany.window != xfi->window->handle)
app = True;
app = true;
}

View File

@ -56,11 +56,11 @@ boolean xf_set_rop2(xfInfo* xfi, int rop2)
if ((rop2 < 0x01) || (rop2 > 0x10))
{
printf("Unsupported ROP2: %d\n", rop2);
return False;
return false;
}
XSetFunction(xfi->display, xfi->gc, xf_rop2_table[rop2]);
return True;
return true;
}
boolean xf_set_rop3(xfInfo* xfi, int rop3)
@ -189,12 +189,12 @@ boolean xf_set_rop3(xfInfo* xfi, int rop3)
{
printf("Unsupported ROP3: 0x%08X\n", rop3);
XSetFunction(xfi->display, xfi->gc, GXclear);
return False;
return false;
}
XSetFunction(xfi->display, xfi->gc, function);
return True;
return true;
}
Pixmap xf_brush_new(xfInfo* xfi, int width, int height, int bpp, uint8* data)
@ -262,17 +262,17 @@ Pixmap xf_glyph_new(xfInfo* xfi, int width, int height, uint8* data)
return bitmap;
}
void xf_gdi_palette_update(rdpUpdate* update, PALETTE_UPDATE* palette)
void xf_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette)
{
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
xfi->clrconv->palette->count = palette->number;
xfi->clrconv->palette->entries = palette->entries;
}
void xf_gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds)
void xf_gdi_set_bounds(rdpContext* context, rdpBounds* bounds)
{
XRectangle clip;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
if (bounds != NULL)
{
@ -288,9 +288,9 @@ void xf_gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds)
}
}
void xf_gdi_dstblt(rdpUpdate* update, DSTBLT_ORDER* dstblt)
void xf_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt)
{
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop3(xfi, gdi_rop3_code(dstblt->bRop));
@ -301,7 +301,7 @@ void xf_gdi_dstblt(rdpUpdate* update, DSTBLT_ORDER* dstblt)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XFillRectangle(xfi->display, xfi->drawable, xfi->gc,
dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight);
@ -312,13 +312,13 @@ void xf_gdi_dstblt(rdpUpdate* update, DSTBLT_ORDER* dstblt)
XSetFunction(xfi->display, xfi->gc, GXcopy);
}
void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
Pixmap pattern;
rdpBrush* brush;
uint32 foreColor;
uint32 backColor;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
brush = &patblt->brush;
xf_set_rop3(xfi, gdi_rop3_code(patblt->bRop));
@ -329,7 +329,7 @@ void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
if (brush->style == GDI_BS_SOLID)
{
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, patblt->foreColor);
XSetForeground(xfi->display, xfi->gc, foreColor);
XFillRectangle(xfi->display, xfi->drawing, xfi->gc,
patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight);
@ -373,7 +373,7 @@ void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
{
XSetFunction(xfi->display, xfi->gc, GXcopy);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->drawable, xfi->gc, patblt->nLeftRect, patblt->nTopRect,
patblt->nWidth, patblt->nHeight, patblt->nLeftRect, patblt->nTopRect);
@ -385,9 +385,9 @@ void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
XSetFunction(xfi->display, xfi->gc, GXcopy);
}
void xf_gdi_scrblt(rdpUpdate* update, SCRBLT_ORDER* scrblt)
void xf_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt)
{
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop3(xfi, gdi_rop3_code(scrblt->bRop));
@ -396,7 +396,7 @@ void xf_gdi_scrblt(rdpUpdate* update, SCRBLT_ORDER* scrblt)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xfi->unobscured)
{
@ -419,10 +419,10 @@ void xf_gdi_scrblt(rdpUpdate* update, SCRBLT_ORDER* scrblt)
XSetFunction(xfi->display, xfi->gc, GXcopy);
}
void xf_gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
{
uint32 color;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
color = freerdp_color_convert(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
@ -435,7 +435,7 @@ void xf_gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XFillRectangle(xfi->display, xfi->drawable, xfi->gc,
opaque_rect->nLeftRect, opaque_rect->nTopRect, opaque_rect->nWidth, opaque_rect->nHeight);
@ -446,12 +446,12 @@ void xf_gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
}
}
void xf_gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
{
int i;
uint32 color;
DELTA_RECT* rectangle;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
color = freerdp_color_convert(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
@ -469,7 +469,7 @@ void xf_gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XFillRectangle(xfi->display, xfi->drawable, xfi->gc,
rectangle->left, rectangle->top, rectangle->width, rectangle->height);
@ -480,10 +480,10 @@ void xf_gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_
}
}
void xf_gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
{
uint32 color;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, line_to->bRop2);
color = freerdp_color_convert(line_to->penColor, xfi->srcBpp, 32, xfi->clrconv);
@ -496,7 +496,7 @@ void xf_gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
int width, height;
@ -519,7 +519,7 @@ void xf_gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
XSetFunction(xfi->display, xfi->gc, GXcopy);
}
void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
void xf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
{
int i;
int x, y;
@ -529,7 +529,7 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
uint32 color;
XPoint* points;
int width, height;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, polyline->bRop2);
color = freerdp_color_convert(polyline->penColor, xfi->srcBpp, 32, xfi->clrconv);
@ -553,7 +553,7 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
XDrawLines(xfi->display, xfi->drawable, xfi->gc, points, npoints, CoordModePrevious);
x1 = points[0].x;
@ -581,10 +581,10 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
xfree(points);
}
void xf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
void xf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
{
xfBitmap* bitmap;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
xfInfo* xfi = ((xfContext*) context)->xfi;
bitmap = (xfBitmap*) memblt->bitmap;
xf_set_rop3(xfi, gdi_rop3_code(memblt->bRop));
@ -595,7 +595,7 @@ void xf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, bitmap->pixmap, xfi->drawable, xfi->gc,
memblt->nXSrc, memblt->nYSrc, memblt->nWidth, memblt->nHeight,
@ -608,23 +608,24 @@ void xf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
XSetFunction(xfi->display, xfi->gc, GXcopy);
}
void xf_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
{
}
void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
void xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command)
{
int i, tx, ty;
XImage* image;
RFX_MESSAGE* message;
xfInfo* xfi = ((xfContext*) update->context)->xfi;
RFX_CONTEXT* context = (RFX_CONTEXT*) xfi->rfx_context;
NSC_CONTEXT* ncontext = (NSC_CONTEXT*) xfi->nsc_context;
xfInfo* xfi = ((xfContext*) context)->xfi;
RFX_CONTEXT* rfx_context = (RFX_CONTEXT*) xfi->rfx_context;
NSC_CONTEXT* nsc_context = (NSC_CONTEXT*) xfi->nsc_context;
if (surface_bits_command->codecID == CODEC_ID_REMOTEFX)
{
message = rfx_process_message(context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
message = rfx_process_message(rfx_context,
surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@ -652,7 +653,7 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
tx = message->rects[i].x + surface_bits_command->destLeft;
ty = message->rects[i].y + surface_bits_command->destTop;
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->drawable, xfi->gc,
tx, ty, message->rects[i].width, message->rects[i].height, tx, ty);
@ -662,20 +663,20 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
}
XSetClipMask(xfi->display, xfi->gc, None);
rfx_message_free(context, message);
rfx_message_free(rfx_context, message);
}
else if (surface_bits_command->codecID == CODEC_ID_NSCODEC)
{
ncontext->width = surface_bits_command->width;
ncontext->height = surface_bits_command->height;
nsc_process_message(ncontext, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
nsc_context->width = surface_bits_command->width;
nsc_context->height = surface_bits_command->height;
nsc_process_message(nsc_context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
xfi->bmp_codec_nsc = (uint8*) xrealloc(xfi->bmp_codec_nsc,
surface_bits_command->width * surface_bits_command->height * 4);
freerdp_image_flip(ncontext->bmpdata, xfi->bmp_codec_nsc,
freerdp_image_flip(nsc_context->bmpdata, xfi->bmp_codec_nsc,
surface_bits_command->width, surface_bits_command->height, 32);
image = XCreateImage(xfi->display, xfi->visual, 24, ZPixmap, 0,
@ -685,7 +686,7 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
surface_bits_command->destLeft, surface_bits_command->destTop,
surface_bits_command->width, surface_bits_command->height);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc,
surface_bits_command->destLeft, surface_bits_command->destTop,
@ -697,7 +698,7 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
surface_bits_command->width, surface_bits_command->height);
XSetClipMask(xfi->display, xfi->gc, None);
nsc_context_destroy(ncontext);
nsc_context_destroy(nsc_context);
}
else if (surface_bits_command->codecID == CODEC_ID_NONE)
{
@ -717,7 +718,7 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
surface_bits_command->destLeft, surface_bits_command->destTop,
surface_bits_command->width, surface_bits_command->height);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc,
surface_bits_command->destLeft, surface_bits_command->destTop,
@ -738,30 +739,33 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
void xf_gdi_register_update_callbacks(rdpUpdate* update)
{
rdpPrimaryUpdate* primary = update->primary;
update->Palette = xf_gdi_palette_update;
update->SetBounds = xf_gdi_set_bounds;
update->DstBlt = xf_gdi_dstblt;
update->PatBlt = xf_gdi_patblt;
update->ScrBlt = xf_gdi_scrblt;
update->OpaqueRect = xf_gdi_opaque_rect;
update->DrawNineGrid = NULL;
update->MultiDstBlt = NULL;
update->MultiPatBlt = NULL;
update->MultiScrBlt = NULL;
update->MultiOpaqueRect = xf_gdi_multi_opaque_rect;
update->MultiDrawNineGrid = NULL;
update->LineTo = xf_gdi_line_to;
update->Polyline = xf_gdi_polyline;
update->MemBlt = xf_gdi_memblt;
update->Mem3Blt = xf_gdi_mem3blt;
update->SaveBitmap = NULL;
update->GlyphIndex = NULL;
update->FastIndex = NULL;
update->FastGlyph = NULL;
update->PolygonSC = NULL;
update->PolygonCB = NULL;
update->EllipseSC = NULL;
update->EllipseCB = NULL;
primary->DstBlt = xf_gdi_dstblt;
primary->PatBlt = xf_gdi_patblt;
primary->ScrBlt = xf_gdi_scrblt;
primary->OpaqueRect = xf_gdi_opaque_rect;
primary->DrawNineGrid = NULL;
primary->MultiDstBlt = NULL;
primary->MultiPatBlt = NULL;
primary->MultiScrBlt = NULL;
primary->MultiOpaqueRect = xf_gdi_multi_opaque_rect;
primary->MultiDrawNineGrid = NULL;
primary->LineTo = xf_gdi_line_to;
primary->Polyline = xf_gdi_polyline;
primary->MemBlt = xf_gdi_memblt;
primary->Mem3Blt = xf_gdi_mem3blt;
primary->SaveBitmap = NULL;
primary->GlyphIndex = NULL;
primary->FastIndex = NULL;
primary->FastGlyph = NULL;
primary->PolygonSC = NULL;
primary->PolygonCB = NULL;
primary->EllipseSC = NULL;
primary->EllipseCB = NULL;
update->SurfaceBits = xf_gdi_surface_bits;
}

View File

@ -45,7 +45,7 @@ void xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
data = freerdp_image_convert(bitmap->data, NULL,
bitmap->width, bitmap->height, xfi->srcBpp, xfi->bpp, xfi->clrconv);
if (bitmap->ephemeral != True)
if (bitmap->ephemeral != true)
{
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
ZPixmap, 0, (char*) data, bitmap->width, bitmap->height, xfi->scanline_pad, 0);
@ -95,7 +95,7 @@ void xf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
XFree(image);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XCopyArea(xfi->display, xfi->primary, xfi->drawable, xfi->gc,
bitmap->left, bitmap->top, width, height, bitmap->left, bitmap->top);
@ -122,7 +122,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
status = bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp);
if (status != True)
if (status != true)
{
printf("Bitmap Decompression Failed\n");
}
@ -132,7 +132,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
freerdp_image_flip(data, bitmap->data, width, height, bpp);
}
bitmap->compressed = False;
bitmap->compressed = false;
bitmap->length = size;
bitmap->bpp = bpp;
}

View File

@ -89,7 +89,7 @@ void xf_kbd_send_key(xfInfo* xfi, boolean down, uint8 keycode)
input->KeyboardEvent(input, flags, scancode);
if ((scancode == 0x3A) && (down == False)) /* caps lock was released */
if ((scancode == 0x3A) && (down == false)) /* caps lock was released */
{
uint32 syncFlags;
syncFlags = xf_kbd_get_toggle_keys_state(xfi);
@ -104,7 +104,7 @@ int xf_kbd_read_keyboard_state(xfInfo* xfi)
Window wdummy;
uint32 state = 0;
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
XQueryPointer(xfi->display, xfi->window->handle,
&wdummy, &wdummy, &dummy, &dummy, &dummy, &dummy, &state);
@ -120,7 +120,7 @@ boolean xf_kbd_get_key_state(xfInfo* xfi, int state, int keysym)
KeyCode keycode = XKeysymToKeycode(xfi->display, keysym);
if (keycode == NoSymbol)
return False;
return false;
for (modifierpos = 0; modifierpos < 8; modifierpos++)
{
@ -134,7 +134,7 @@ boolean xf_kbd_get_key_state(xfInfo* xfi, int state, int keysym)
}
}
return (state & keysymMask) ? True : False;
return (state & keysymMask) ? true : false;
}
int xf_kbd_get_toggle_keys_state(xfInfo* xfi)
@ -179,10 +179,10 @@ boolean xf_kbd_handle_special_keys(xfInfo* xfi, KeySym keysym)
{
/* Ctrl-Alt-Enter: toggle full screen */
xf_toggle_fullscreen(xfi);
return True;
return true;
}
}
return False;
return false;
}

View File

@ -43,7 +43,7 @@ boolean xf_detect_monitors(xfInfo* xfi, rdpSettings* settings)
vscreen = &xfi->vscreen;
if (xf_GetWorkArea(xfi) != True)
if (xf_GetWorkArea(xfi) != true)
{
xfi->workArea.x = 0;
xfi->workArea.y = 0;
@ -62,8 +62,8 @@ boolean xf_detect_monitors(xfInfo* xfi, rdpSettings* settings)
settings->height = (xfi->workArea.height * settings->percent_screen) / 100;
}
if (settings->fullscreen != True && settings->workarea != True)
return True;
if (settings->fullscreen != true && settings->workarea != true)
return true;
#ifdef WITH_XINERAMA
if (XineramaQueryExtension(xfi->display, &ignored, &ignored2))
@ -87,7 +87,7 @@ boolean xf_detect_monitors(xfInfo* xfi, rdpSettings* settings)
vscreen->monitors[i].area.bottom = screen_info[i].y_org + screen_info[i].height - 1;
if ((screen_info[i].x_org == 0) && (screen_info[i].y_org == 0))
vscreen->monitors[i].primary = True;
vscreen->monitors[i].primary = true;
}
}
@ -115,5 +115,5 @@ boolean xf_detect_monitors(xfInfo* xfi, rdpSettings* settings)
settings->width = vscreen->area.right - vscreen->area.left + 1;
settings->height = vscreen->area.bottom - vscreen->area.top + 1;
return True;
return true;
}

View File

@ -57,7 +57,7 @@ void xf_rail_paint(xfInfo* xfi, rdpRail* rail, uint32 uleft, uint32 utop, uint32
iwidth = iright - ileft + 1;
iheight = ibottom - itop + 1;
intersect = ((iright > ileft) && (ibottom > itop)) ? True : False;
intersect = ((iright > ileft) && (ibottom > itop)) ? true : false;
if (intersect)
{
@ -265,7 +265,7 @@ void xf_process_rail_get_sysparams_event(xfInfo* xfi, rdpChannels* channels, RDP
sysparam->taskbarPos.right = 0;
sysparam->taskbarPos.bottom = 0;
sysparam->dragFullWindows = False;
sysparam->dragFullWindows = false;
xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_SET_SYSPARAMS, sysparam);
}

View File

@ -122,7 +122,7 @@ void xf_tsmf_init(xfInfo* xfi, long xv_port)
{
if (strcmp(attr[i].name, "XV_COLORKEY") == 0)
{
xv->xv_colorkey_atom = XInternAtom(xfi->display, "XV_COLORKEY", False);
xv->xv_colorkey_atom = XInternAtom(xfi->display, "XV_COLORKEY", false);
XvSetPortAttribute(xfi->display, xv->xv_port, xv->xv_colorkey_atom, attr[i].min_value + 1);
break;
}
@ -179,15 +179,15 @@ xf_tsmf_is_format_supported(xfXvContext* xv, uint32 pixfmt)
int i;
if (!xv->xv_pixfmts)
return False;
return false;
for (i = 0; xv->xv_pixfmts[i]; i++)
{
if (xv->xv_pixfmts[i] == pixfmt)
return True;
return true;
}
return False;
return false;
}
static void xf_process_tsmf_video_frame_event(xfInfo* xfi, RDP_VIDEO_FRAME_EVENT* vevent)
@ -240,7 +240,7 @@ static void xf_process_tsmf_video_frame_event(xfInfo* xfi, RDP_VIDEO_FRAME_EVENT
}
shminfo.shmid = xv->xv_shmid;
shminfo.shmaddr = image->data = xv->xv_shmaddr;
shminfo.readOnly = False;
shminfo.readOnly = false;
if (!XShmAttach(xfi->display, &shminfo))
{
@ -323,8 +323,8 @@ static void xf_process_tsmf_video_frame_event(xfInfo* xfi, RDP_VIDEO_FRAME_EVENT
XvShmPutImage(xfi->display, xv->xv_port, xfi->window->handle, xfi->gc, image,
0, 0, image->width, image->height,
vevent->x, vevent->y, vevent->width, vevent->height, False);
XSync(xfi->display, False);
vevent->x, vevent->y, vevent->width, vevent->height, false);
XSync(xfi->display, false);
XShmDetach(xfi->display, &shminfo);
XFree(image);

View File

@ -63,20 +63,20 @@ void xf_SendClientMessage(xfInfo* xfi, xfWindow* window, Atom atom, long msg, lo
xevent.xclient.data.l[3] = d2;
xevent.xclient.data.l[4] = d3;
XSendEvent(xfi->display, window->handle, False, NoEventMask, &xevent);
XSync(xfi->display, False);
XSendEvent(xfi->display, window->handle, false, NoEventMask, &xevent);
XSync(xfi->display, false);
}
void xf_SetWindowFullscreen(xfInfo* xfi, xfWindow* window, boolean fullscreen)
{
if (fullscreen)
{
xf_SetWindowDecorations(xfi, window, False);
xf_SetWindowDecorations(xfi, window, false);
XMoveResizeWindow(xfi->display, window->handle, 0, 0, window->width, window->height);
XMapRaised(xfi->display, window->handle);
window->fullscreen = True;
window->fullscreen = true;
}
}
@ -90,22 +90,22 @@ boolean xf_GetWindowProperty(xfInfo* xfi, Window window, Atom property, int leng
int actual_format;
if (property == None)
return False;
return false;
status = XGetWindowProperty(xfi->display, window,
property, 0, length, False, AnyPropertyType,
property, 0, length, false, AnyPropertyType,
&actual_type, &actual_format, nitems, bytes, prop);
if (status != Success)
return False;
return false;
if (actual_type == None)
{
DEBUG_WARN("Property %lu does not exist", property);
return False;
return false;
}
return True;
return true;
}
boolean xf_GetCurrentDesktop(xfInfo* xfi)
@ -118,14 +118,14 @@ boolean xf_GetCurrentDesktop(xfInfo* xfi)
status = xf_GetWindowProperty(xfi, DefaultRootWindow(xfi->display),
xfi->_NET_CURRENT_DESKTOP, 1, &nitems, &bytes, &prop);
if (status != True) {
return False;
if (status != true) {
return false;
}
xfi->current_desktop = (int) *prop;
xfree(prop);
return True;
return true;
}
boolean xf_GetWorkArea(xfInfo* xfi)
@ -138,18 +138,18 @@ boolean xf_GetWorkArea(xfInfo* xfi)
status = xf_GetCurrentDesktop(xfi);
if (status != True)
return False;
if (status != true)
return false;
status = xf_GetWindowProperty(xfi, DefaultRootWindow(xfi->display),
xfi->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop);
if (status != True)
return False;
if (status != true)
return false;
if ((xfi->current_desktop * 4 + 3) >= nitems) {
xfree(prop);
return False;
return false;
}
plong = (long*) prop;
@ -160,7 +160,7 @@ boolean xf_GetWorkArea(xfInfo* xfi)
xfi->workArea.height = plong[xfi->current_desktop * 4 + 3];
xfree(prop);
return True;
return true;
}
void xf_SetWindowDecorations(xfInfo* xfi, xfWindow* window, boolean show)
@ -219,7 +219,7 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height,
window->width = width;
window->height = height;
window->fullscreen = False;
window->fullscreen = false;
window->decorations = decorations;
window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen),
@ -333,10 +333,10 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
int input_mask;
XClassHint* class_hints;
window->decorations = False;
window->fullscreen = False;
window->decorations = false;
window->fullscreen = false;
window->window = wnd;
window->localMoveSize = False;
window->localMoveSize = false;
window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen),
x, y, window->width, window->height, 0, xfi->depth, InputOutput, xfi->visual,
@ -418,7 +418,7 @@ void xf_SendMoveResizeEvent(xfInfo* xfi, xfWindow* window, int direction, int x_
event.xclient.message_type = xfi->_NET_WM_MOVERESIZE;
event.xclient.serial = 0;
event.xclient.display = xfi->display;
event.xclient.send_event = True;
event.xclient.send_event = true;
event.xclient.format = 32;
event.xclient.data.l[0] = x_root;
event.xclient.data.l[1] = y_root;
@ -427,28 +427,28 @@ void xf_SendMoveResizeEvent(xfInfo* xfi, xfWindow* window, int direction, int x_
event.xclient.data.l[4] = 0;
XUngrabPointer(xfi->display, CurrentTime);
XSendEvent(xfi->display, RootWindowOfScreen(xfi->screen), False, SubstructureNotifyMask, &event);
XSendEvent(xfi->display, RootWindowOfScreen(xfi->screen), false, SubstructureNotifyMask, &event);
}
void xf_StartLocalMoveSize(xfInfo* xfi, xfWindow* window, uint16 moveSizeType, int posX, int posY)
{
window->localMoveSize = True;
window->localMoveSize = true;
}
void xf_StopLocalMoveSize(xfInfo* xfi, xfWindow* window, uint16 moveSizeType, int posX, int posY)
{
window->localMoveSize = False;
window->localMoveSize = false;
}
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height)
{
boolean resize = False;
boolean resize = false;
if ((width * height) < 1)
return;
if ((window->width != width) || (window->height != height))
resize = True;
resize = true;
if (resize)
XMoveResizeWindow(xfi->display, window->handle, x, y, width, height);
@ -505,7 +505,7 @@ void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon)
long* dstp;
uint32* srcp;
if (icon->big != True)
if (icon->big != true)
return;
pixels = icon->entry->width * icon->entry->height;
@ -605,18 +605,18 @@ void xf_UpdateWindowArea(xfInfo* xfi, xfWindow* window, int x, int y, int width,
boolean xf_IsWindowBorder(xfInfo* xfi, xfWindow* xfw, int x, int y)
{
rdpWindow* wnd;
boolean clientArea = False;
boolean windowArea = False;
boolean clientArea = false;
boolean windowArea = false;
wnd = xfw->window;
if (((x > wnd->clientOffsetX) && (x < wnd->clientOffsetX + wnd->clientAreaWidth)) &&
((y > wnd->clientOffsetY) && (y < wnd->clientOffsetY + wnd->clientAreaHeight)))
clientArea = True;
clientArea = true;
if (((x > wnd->windowOffsetX) && (x < wnd->windowOffsetX + wnd->windowWidth)) &&
((y > wnd->windowOffsetY) && (y < wnd->windowOffsetY + wnd->windowHeight)))
windowArea = True;
windowArea = true;
return (windowArea && !(clientArea));
}
@ -626,6 +626,9 @@ void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
if (window == NULL)
return;
if (xfi->window == window)
xfi->window = NULL;
if (window->gc)
XFreeGC(xfi->display, window->gc);

View File

@ -90,28 +90,26 @@ void xf_context_free(freerdp* instance, rdpContext* context)
}
void xf_sw_begin_paint(rdpUpdate* update)
void xf_sw_begin_paint(rdpContext* context)
{
rdpGdi* gdi = update->context->gdi;
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
gdi->primary->hdc->hwnd->ninvalid = 0;
}
void xf_sw_end_paint(rdpUpdate* update)
void xf_sw_end_paint(rdpContext* context)
{
rdpGdi* gdi;
xfInfo* xfi;
sint32 x, y;
uint32 w, h;
xfContext* context;
context = (xfContext*) update->context;
gdi = update->context->gdi;
xfi = context->xfi;
xfi = ((xfContext*) context)->xfi;
gdi = context->gdi;
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xfi->complex_regions != True)
if (xfi->complex_regions != true)
{
if (gdi->primary->hdc->hwnd->invalid->null)
return;
@ -160,21 +158,21 @@ void xf_sw_end_paint(rdpUpdate* update)
w = gdi->primary->hdc->hwnd->invalid->w;
h = gdi->primary->hdc->hwnd->invalid->h;
xf_rail_paint(xfi, update->context->rail, x, y, x + w - 1, y + h - 1);
xf_rail_paint(xfi, context->rail, x, y, x + w - 1, y + h - 1);
}
}
void xf_sw_desktop_resize(rdpUpdate* update)
void xf_sw_desktop_resize(rdpContext* context)
{
xfInfo* xfi;
rdpSettings* settings;
xfi = ((xfContext*) update->context)->xfi;
xfi = ((xfContext*) context)->xfi;
settings = xfi->instance->settings;
if (xfi->fullscreen != True)
if (xfi->fullscreen != true)
{
rdpGdi* gdi = update->context->gdi;
rdpGdi* gdi = context->gdi;
gdi_resize(gdi, xfi->width, xfi->height);
if (xfi->image)
@ -187,21 +185,21 @@ void xf_sw_desktop_resize(rdpUpdate* update)
}
}
void xf_hw_begin_paint(rdpUpdate* update)
void xf_hw_begin_paint(rdpContext* context)
{
xfInfo* xfi;
xfi = ((xfContext*) update->context)->xfi;
xfi = ((xfContext*) context)->xfi;
xfi->hdc->hwnd->invalid->null = 1;
xfi->hdc->hwnd->ninvalid = 0;
}
void xf_hw_end_paint(rdpUpdate* update)
void xf_hw_end_paint(rdpContext* context)
{
xfInfo* xfi;
sint32 x, y;
uint32 w, h;
xfi = ((xfContext*) update->context)->xfi;
xfi = ((xfContext*) context)->xfi;
if (xfi->remote_app)
{
@ -213,20 +211,20 @@ void xf_hw_end_paint(rdpUpdate* update)
w = xfi->hdc->hwnd->invalid->w;
h = xfi->hdc->hwnd->invalid->h;
xf_rail_paint(xfi, update->context->rail, x, y, x + w - 1, y + h - 1);
xf_rail_paint(xfi, context->rail, x, y, x + w - 1, y + h - 1);
}
}
void xf_hw_desktop_resize(rdpUpdate* update)
void xf_hw_desktop_resize(rdpContext* context)
{
xfInfo* xfi;
boolean same;
rdpSettings* settings;
xfi = ((xfContext*) update->context)->xfi;
xfi = ((xfContext*) context)->xfi;
settings = xfi->instance->settings;
if (xfi->fullscreen != True)
if (xfi->fullscreen != true)
{
xfi->width = settings->width;
xfi->height = settings->height;
@ -236,7 +234,7 @@ void xf_hw_desktop_resize(rdpUpdate* update)
if (xfi->primary)
{
same = (xfi->primary == xfi->drawing) ? True : False;
same = (xfi->primary == xfi->drawing) ? true : false;
XFreePixmap(xfi->display, xfi->primary);
@ -256,7 +254,7 @@ boolean xf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int
rfds[*rcount] = (void*)(long)(xfi->xfds);
(*rcount)++;
return True;
return true;
}
boolean xf_check_fds(freerdp* instance, fd_set* set)
@ -269,11 +267,11 @@ boolean xf_check_fds(freerdp* instance, fd_set* set)
memset(&xevent, 0, sizeof(xevent));
XNextEvent(xfi->display, &xevent);
if (xf_event_process(instance, &xevent) != True)
return False;
if (xf_event_process(instance, &xevent) != true)
return false;
}
return True;
return true;
}
void xf_create_window(xfInfo* xfi)
@ -292,7 +290,7 @@ void xf_create_window(xfInfo* xfi)
xfi->attribs.override_redirect = xfi->fullscreen;
xfi->attribs.colormap = xfi->colormap;
if (xfi->remote_app != True)
if (xfi->remote_app != true)
{
if (xfi->fullscreen)
{
@ -336,7 +334,7 @@ void xf_toggle_fullscreen(xfInfo* xfi)
XCopyArea(xfi->display, xfi->primary, contents, xfi->gc, 0, 0, xfi->width, xfi->height, 0, 0);
XDestroyWindow(xfi->display, xfi->window->handle);
xfi->fullscreen = (xfi->fullscreen) ? False : True;
xfi->fullscreen = (xfi->fullscreen) ? false : true;
xf_create_window(xfi);
XCopyArea(xfi->display, contents, xfi->primary, xfi->gc, 0, 0, xfi->width, xfi->height, 0, 0);
@ -384,7 +382,7 @@ boolean xf_get_pixmap_info(xfInfo* xfi)
if (vis == NULL)
{
printf("xf_get_pixmap_info: XGetVisualInfo failed\n");
return False;
return false;
}
for (i = 0; i < vi_count; i++)
@ -401,10 +399,10 @@ boolean xf_get_pixmap_info(xfInfo* xfi)
if ((xfi->visual == NULL) || (xfi->scanline_pad == 0))
{
return False;
return false;
}
return True;
return true;
}
boolean xf_pre_connect(freerdp* instance)
@ -431,30 +429,30 @@ boolean xf_pre_connect(freerdp* instance)
settings = instance->settings;
bitmap_cache = settings->bitmap_cache;
settings->order_support[NEG_DSTBLT_INDEX] = True;
settings->order_support[NEG_PATBLT_INDEX] = True;
settings->order_support[NEG_SCRBLT_INDEX] = True;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = True;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = False;
settings->order_support[NEG_MULTIPATBLT_INDEX] = False;
settings->order_support[NEG_MULTISCRBLT_INDEX] = False;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;
settings->order_support[NEG_SCRBLT_INDEX] = true;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_LINETO_INDEX] = true;
settings->order_support[NEG_POLYLINE_INDEX] = true;
settings->order_support[NEG_MEMBLT_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_INDEX] = False;
settings->order_support[NEG_MEM3BLT_INDEX] = false;
settings->order_support[NEG_MEMBLT_V2_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_V2_INDEX] = False;
settings->order_support[NEG_SAVEBITMAP_INDEX] = False;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_GLYPH_INDEX] = True;
settings->order_support[NEG_POLYGON_SC_INDEX] = False;
settings->order_support[NEG_POLYGON_CB_INDEX] = False;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
settings->order_support[NEG_MEM3BLT_V2_INDEX] = false;
settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_GLYPH_INDEX] = true;
settings->order_support[NEG_POLYGON_SC_INDEX] = false;
settings->order_support[NEG_POLYGON_CB_INDEX] = false;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
freerdp_channels_pre_connect(xfi->_context->channels, instance);
@ -463,27 +461,27 @@ boolean xf_pre_connect(freerdp* instance)
if (xfi->display == NULL)
{
printf("xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
return False;
return false;
}
xfi->_NET_WM_ICON = XInternAtom(xfi->display, "_NET_WM_ICON", False);
xfi->_MOTIF_WM_HINTS = XInternAtom(xfi->display, "_MOTIF_WM_HINTS", False);
xfi->_NET_CURRENT_DESKTOP = XInternAtom(xfi->display, "_NET_CURRENT_DESKTOP", False);
xfi->_NET_WORKAREA = XInternAtom(xfi->display, "_NET_WORKAREA", False);
xfi->_NET_WM_STATE = XInternAtom(xfi->display, "_NET_WM_STATE", False);
xfi->_NET_WM_STATE_FULLSCREEN = XInternAtom(xfi->display, "_NET_WM_STATE_FULLSCREEN", False);
xfi->_NET_WM_WINDOW_TYPE = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE", False);
xfi->_NET_WM_ICON = XInternAtom(xfi->display, "_NET_WM_ICON", false);
xfi->_MOTIF_WM_HINTS = XInternAtom(xfi->display, "_MOTIF_WM_HINTS", false);
xfi->_NET_CURRENT_DESKTOP = XInternAtom(xfi->display, "_NET_CURRENT_DESKTOP", false);
xfi->_NET_WORKAREA = XInternAtom(xfi->display, "_NET_WORKAREA", false);
xfi->_NET_WM_STATE = XInternAtom(xfi->display, "_NET_WM_STATE", false);
xfi->_NET_WM_STATE_FULLSCREEN = XInternAtom(xfi->display, "_NET_WM_STATE_FULLSCREEN", false);
xfi->_NET_WM_WINDOW_TYPE = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE", false);
xfi->_NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_NORMAL", False);
xfi->_NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
xfi->_NET_WM_WINDOW_TYPE_UTILITY = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_UTILITY", False);
xfi->_NET_WM_STATE_SKIP_TASKBAR = XInternAtom(xfi->display, "_NET_WM_STATE_SKIP_TASKBAR", False);
xfi->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfi->display, "_NET_WM_STATE_SKIP_PAGER", False);
xfi->_NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_NORMAL", false);
xfi->_NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_DIALOG", false);
xfi->_NET_WM_WINDOW_TYPE_UTILITY = XInternAtom(xfi->display, "_NET_WM_WINDOW_TYPE_UTILITY", false);
xfi->_NET_WM_STATE_SKIP_TASKBAR = XInternAtom(xfi->display, "_NET_WM_STATE_SKIP_TASKBAR", false);
xfi->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfi->display, "_NET_WM_STATE_SKIP_PAGER", false);
xfi->_NET_WM_MOVERESIZE = XInternAtom(xfi->display, "_NET_WM_MOVERESIZE", False);
xfi->_NET_WM_MOVERESIZE = XInternAtom(xfi->display, "_NET_WM_MOVERESIZE", false);
xfi->WM_PROTOCOLS = XInternAtom(xfi->display, "WM_PROTOCOLS", False);
xfi->WM_DELETE_WINDOW = XInternAtom(xfi->display, "WM_DELETE_WINDOW", False);
xfi->WM_PROTOCOLS = XInternAtom(xfi->display, "WM_PROTOCOLS", false);
xfi->WM_DELETE_WINDOW = XInternAtom(xfi->display, "WM_DELETE_WINDOW", false);
xf_kbd_init(xfi);
@ -502,17 +500,17 @@ boolean xf_pre_connect(freerdp* instance)
xfi->big_endian = (ImageByteOrder(xfi->display) == MSBFirst);
xfi->mouse_motion = settings->mouse_motion;
xfi->complex_regions = True;
xfi->complex_regions = true;
xfi->decorations = settings->decorations;
xfi->remote_app = settings->remote_app;
xfi->fullscreen = settings->fullscreen;
xfi->grab_keyboard = settings->grab_keyboard;
xfi->fullscreen_toggle = True;
xfi->fullscreen_toggle = true;
xfi->sw_gdi = settings->sw_gdi;
xf_detect_monitors(xfi, settings);
return True;
return true;
}
void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx)
@ -559,8 +557,8 @@ boolean xf_post_connect(freerdp* instance)
cache = instance->context->cache;
channels = xfi->_context->channels;
if (xf_get_pixmap_info(xfi) != True)
return False;
if (xf_get_pixmap_info(xfi) != true)
return false;
xf_register_graphics(instance->context->graphics);
@ -661,7 +659,7 @@ boolean xf_post_connect(freerdp* instance)
pointer_cache_register_callbacks(instance->update);
if (xfi->sw_gdi != True)
if (xfi->sw_gdi != true)
{
brush_cache_register_callbacks(instance->update);
bitmap_cache_register_callbacks(instance->update);
@ -677,10 +675,10 @@ boolean xf_post_connect(freerdp* instance)
xf_tsmf_init(xfi, xv_port);
if (xfi->remote_app != True)
if (xfi->remote_app != true)
xf_cliprdr_init(xfi, channels);
return True;
return true;
}
boolean xf_authenticate(freerdp* instance, char** username, char** password, char** domain)
@ -688,9 +686,9 @@ boolean xf_authenticate(freerdp* instance, char** username, char** password, cha
*password = xmalloc(password_size * sizeof(char));
if (freerdp_passphrase_read("Password: ", *password, password_size) == NULL)
return False;
return false;
return True;
return true;
}
boolean xf_verify_certificate(freerdp* instance, char* subject, char* issuer, char* fingerprint)
@ -711,7 +709,7 @@ boolean xf_verify_certificate(freerdp* instance, char* subject, char* issuer, ch
if (answer == 'y' || answer == 'Y')
{
return True;
return true;
}
else if (answer == 'n' || answer == 'N')
{
@ -719,7 +717,7 @@ boolean xf_verify_certificate(freerdp* instance, char* subject, char* issuer, ch
}
}
return False;
return false;
}
int xf_process_client_args(rdpSettings* settings, const char* opt, const char* val, void* user_data)
@ -896,19 +894,19 @@ int xfreerdp_run(freerdp* instance)
rcount = 0;
wcount = 0;
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get FreeRDP file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get channel manager file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
break;
}
if (xf_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (xf_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get xfreerdp file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
@ -945,17 +943,17 @@ int xfreerdp_run(freerdp* instance)
}
}
if (freerdp_check_fds(instance) != True)
if (freerdp_check_fds(instance) != true)
{
printf("Failed to check FreeRDP file descriptor\n");
break;
}
if (xf_check_fds(instance, &rfds_set) != True)
if (xf_check_fds(instance, &rfds_set) != true)
{
printf("Failed to check xfreerdp file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != True)
if (freerdp_channels_check_fds(channels, instance) != true)
{
printf("Failed to check channel manager file descriptor\n");
break;
@ -1045,7 +1043,7 @@ int main(int argc, char* argv[])
instance->context->argc = argc;
instance->context->argv = argv;
instance->settings->sw_gdi = False;
instance->settings->sw_gdi = false;
data = (struct thread_data*) xzalloc(sizeof(struct thread_data));
data->instance = instance;

View File

@ -74,15 +74,15 @@ void tf_context_free(freerdp* instance, rdpContext* context)
}
void tf_begin_paint(rdpUpdate* update)
void tf_begin_paint(rdpContext* context)
{
rdpGdi* gdi = update->context->gdi;
rdpGdi* gdi = context->gdi;
gdi->primary->hdc->hwnd->invalid->null = 1;
}
void tf_end_paint(rdpUpdate* update)
void tf_end_paint(rdpContext* context)
{
rdpGdi* gdi = update->context->gdi;
rdpGdi* gdi = context->gdi;
if (gdi->primary->hdc->hwnd->invalid->null)
return;
@ -150,32 +150,32 @@ boolean tf_pre_connect(freerdp* instance)
settings = instance->settings;
settings->order_support[NEG_DSTBLT_INDEX] = True;
settings->order_support[NEG_PATBLT_INDEX] = True;
settings->order_support[NEG_SCRBLT_INDEX] = True;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = True;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = True;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = True;
settings->order_support[NEG_MULTIPATBLT_INDEX] = True;
settings->order_support[NEG_MULTISCRBLT_INDEX] = True;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = True;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_MEMBLT_INDEX] = True;
settings->order_support[NEG_MEM3BLT_INDEX] = True;
settings->order_support[NEG_SAVEBITMAP_INDEX] = True;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_GLYPH_INDEX] = True;
settings->order_support[NEG_POLYGON_SC_INDEX] = True;
settings->order_support[NEG_POLYGON_CB_INDEX] = True;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = True;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = True;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = true;
settings->order_support[NEG_SCRBLT_INDEX] = true;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = true;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = true;
settings->order_support[NEG_MULTIPATBLT_INDEX] = true;
settings->order_support[NEG_MULTISCRBLT_INDEX] = true;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = true;
settings->order_support[NEG_LINETO_INDEX] = true;
settings->order_support[NEG_POLYLINE_INDEX] = true;
settings->order_support[NEG_MEMBLT_INDEX] = true;
settings->order_support[NEG_MEM3BLT_INDEX] = true;
settings->order_support[NEG_SAVEBITMAP_INDEX] = true;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_GLYPH_INDEX] = true;
settings->order_support[NEG_POLYGON_SC_INDEX] = true;
settings->order_support[NEG_POLYGON_CB_INDEX] = true;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = true;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = true;
freerdp_channels_pre_connect(instance->context->channels, instance);
return True;
return true;
}
boolean tf_post_connect(freerdp* instance)
@ -190,7 +190,7 @@ boolean tf_post_connect(freerdp* instance)
freerdp_channels_post_connect(instance->context->channels, instance);
return True;
return true;
}
int tfreerdp_run(freerdp* instance)
@ -218,12 +218,12 @@ int tfreerdp_run(freerdp* instance)
rcount = 0;
wcount = 0;
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get FreeRDP file descriptor\n");
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != True)
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != true)
{
printf("Failed to get channel manager file descriptor\n");
break;
@ -258,12 +258,12 @@ int tfreerdp_run(freerdp* instance)
}
}
if (freerdp_check_fds(instance) != True)
if (freerdp_check_fds(instance) != true)
{
printf("Failed to check FreeRDP file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != True)
if (freerdp_channels_check_fds(channels, instance) != true)
{
printf("Failed to check channel manager file descriptor\n");
break;

View File

@ -2,7 +2,7 @@
# Find the CUnit libraries
#
# This module defines the following variables:
# CUNIT_FOUND - True if CUNIT_INCLUDE_DIR & CUNIT_LIBRARY are found
# CUNIT_FOUND - true if CUNIT_INCLUDE_DIR & CUNIT_LIBRARY are found
# CUNIT_LIBRARIES - Set when CUNIT_LIBRARY is found
# CUNIT_INCLUDE_DIRS - Set when CUNIT_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the DirectFB libraries
#
# This module defines the following variables:
# DIRECTFB_FOUND - True if DIRECTFB_INCLUDE_DIR & DIRECTFB_LIBRARY are found
# DIRECTFB_FOUND - true if DIRECTFB_INCLUDE_DIR & DIRECTFB_LIBRARY are found
# DIRECTFB_LIBRARIES - Set when DIRECTFB_LIBRARY is found
# DIRECTFB_INCLUDE_DIRS - Set when DIRECTFB_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the X11 libraries
#
# This module defines the following variables:
# X11_FOUND - True if X11_INCLUDE_DIR & X11_LIBRARY are found
# X11_FOUND - true if X11_INCLUDE_DIR & X11_LIBRARY are found
# X11_LIBRARIES - Set when X11_LIBRARY is found
# X11_INCLUDE_DIRS - Set when X11_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the XKBFILE libraries
#
# This module defines the following variables:
# XKBFILE_FOUND - True if XKBFILE_INCLUDE_DIR & XKBFILE_LIBRARY are found
# XKBFILE_FOUND - true if XKBFILE_INCLUDE_DIR & XKBFILE_LIBRARY are found
# XKBFILE_LIBRARIES - Set when XKBFILE_LIBRARY is found
# XKBFILE_INCLUDE_DIRS - Set when XKBFILE_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the Xcursor libraries
#
# This module defines the following variables:
# XCURSOR_FOUND - True if XCURSOR_INCLUDE_DIR & XCURSOR_LIBRARY are found
# XCURSOR_FOUND - true if XCURSOR_INCLUDE_DIR & XCURSOR_LIBRARY are found
# XCURSOR_LIBRARIES - Set when XCURSOR_LIBRARY is found
# XCURSOR_INCLUDE_DIRS - Set when XCURSOR_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the XDAMAGE libraries
#
# This module defines the following variables:
# XDAMAGE_FOUND - True if XDAMAGE_INCLUDE_DIR & XDAMAGE_LIBRARY are found
# XDAMAGE_FOUND - true if XDAMAGE_INCLUDE_DIR & XDAMAGE_LIBRARY are found
# XDAMAGE_LIBRARIES - Set when XDAMAGE_LIBRARY is found
# XDAMAGE_INCLUDE_DIRS - Set when XDAMAGE_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the Xext libraries
#
# This module defines the following variables:
# Xext_FOUND - True if Xext_INCLUDE_DIR & Xext_LIBRARY are found
# Xext_FOUND - true if Xext_INCLUDE_DIR & Xext_LIBRARY are found
# Xext_LIBRARIES - Set when Xext_LIBRARY is found
# Xext_INCLUDE_DIRS - Set when Xext_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the XINERAMA libraries
#
# This module defines the following variables:
# XINERAMA_FOUND - True if XINERAMA_INCLUDE_DIR & XINERAMA_LIBRARY are found
# XINERAMA_FOUND - true if XINERAMA_INCLUDE_DIR & XINERAMA_LIBRARY are found
# XINERAMA_LIBRARIES - Set when XINERAMA_LIBRARY is found
# XINERAMA_INCLUDE_DIRS - Set when XINERAMA_INCLUDE_DIR is found
#

View File

@ -2,7 +2,7 @@
# Find the xmlto docbook xslt frontend
#
# This module defines the following variables:
# XMLTO_FOUND - True if xmlto was found
# XMLTO_FOUND - true if xmlto was found
# XMLTO_EXECUTABLE - Path to xmlto, if xmlto was found
#

View File

@ -2,7 +2,7 @@
# Find the Xv libraries
#
# This module defines the following variables:
# XV_FOUND - True if XV_INCLUDE_DIR & XV_LIBRARY are found
# XV_FOUND - true if XV_INCLUDE_DIR & XV_LIBRARY are found
# XV_LIBRARIES - Set when XV_LIBRARY is found
# XV_INCLUDE_DIRS - Set when XV_INCLUDE_DIR is found
#

View File

@ -9,6 +9,10 @@
#cmakedefine HAVE_NETDB_H
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_LIMITS_H
#cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_STDBOOL_H
#cmakedefine HAVE_INTTYPES_H
/* Found packages */
#cmakedefine CUPS_FOUND

View File

@ -73,7 +73,7 @@ void test_ber_write_universal_tag(void)
STREAM* s;
s = stream_new(sizeof(ber_universal_tag_expected));
ber_write_universal_tag(s, 1, False);
ber_write_universal_tag(s, 1, false);
ASSERT_STREAM(s, (uint8*) ber_universal_tag_expected, sizeof(ber_universal_tag_expected));

View File

@ -1172,7 +1172,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_16x1x8);
decomp_size = sizeof(decompressed_16x1x8);
CU_ASSERT(bitmap_decompress(compressed_16x1x8, t->decompressed_16x1x8,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_16x1x8, decompressed_16x1x8,
decomp_size) == 0);
@ -1182,7 +1182,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_32x32x8);
decomp_size = sizeof(decompressed_32x32x8);
CU_ASSERT(bitmap_decompress(compressed_32x32x8, t->decompressed_32x32x8,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_32x32x8, decompressed_32x32x8,
decomp_size) == 0);
@ -1192,7 +1192,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_16x1x16);
decomp_size = sizeof(decompressed_16x1x16);
CU_ASSERT(bitmap_decompress(compressed_16x1x16, t->decompressed_16x1x16,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_16x1x16, decompressed_16x1x16,
decomp_size) == 0);
@ -1202,7 +1202,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_32x32x16);
decomp_size = sizeof(decompressed_32x32x16);
CU_ASSERT(bitmap_decompress(compressed_32x32x16, t->decompressed_32x32x16,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_32x32x16, decompressed_32x32x16,
decomp_size) == 0);
@ -1212,7 +1212,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_16x1x24);
decomp_size = sizeof(decompressed_16x1x24);
CU_ASSERT(bitmap_decompress(compressed_16x1x24, t->decompressed_16x1x24,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_16x1x24, decompressed_16x1x24,
decomp_size) == 0);
@ -1222,7 +1222,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_32x32x24);
decomp_size = sizeof(decompressed_32x32x24);
CU_ASSERT(bitmap_decompress(compressed_32x32x24, t->decompressed_32x32x24,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_32x32x24, decompressed_32x32x24,
decomp_size) == 0);
@ -1232,7 +1232,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_16x1x32);
decomp_size = sizeof(decompressed_16x1x32);
CU_ASSERT(bitmap_decompress(compressed_16x1x32, t->decompressed_16x1x32,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_16x1x32, decompressed_16x1x32,
decomp_size) == 0);
@ -1242,7 +1242,7 @@ void test_bitmap(void)
comp_size = sizeof(compressed_32x32x32);
decomp_size = sizeof(decompressed_32x32x32);
CU_ASSERT(bitmap_decompress(compressed_32x32x32, t->decompressed_32x32x32,
width, height, comp_size, bpp, bpp) == True);
width, height, comp_size, bpp, bpp) == true);
CU_ASSERT(memcmp(t->decompressed_32x32x32, decompressed_32x32x32,
decomp_size) == 0);

View File

@ -655,7 +655,7 @@ void test_mppc(void)
/* uncompress data */
CU_ASSERT(decompress_rdp_5(&rdp, compressed_rd5, sizeof(compressed_rd5),
PACKET_COMPRESSED, &roff, &rlen) == True);
PACKET_COMPRESSED, &roff, &rlen) == true);
/* get end time */
gettimeofday(&end_time, NULL);

View File

@ -188,7 +188,7 @@ void test_read_draw_nine_grid_order(void)
memset(orderInfo, 0, sizeof(ORDER_INFO));
orderInfo->fieldFlags = 0x1C;
orderInfo->deltaCoordinates = True;
orderInfo->deltaCoordinates = true;
memset(&draw_nine_grid, 0, sizeof(DRAW_NINE_GRID_ORDER));
draw_nine_grid.srcRight = 38;
@ -268,7 +268,7 @@ void test_read_line_to_order(void)
memset(orderInfo, 0, sizeof(ORDER_INFO));
orderInfo->fieldFlags = 0x021E;
orderInfo->deltaCoordinates = True;
orderInfo->deltaCoordinates = true;
memset(&line_to, 0, sizeof(LINE_TO_ORDER));
line_to.nXStart = 826;
@ -410,7 +410,7 @@ void test_read_glyph_index_order(void)
memset(orderInfo, 0, sizeof(ORDER_INFO));
orderInfo->fieldFlags = 0x200100;
orderInfo->deltaCoordinates = True;
orderInfo->deltaCoordinates = true;
memset(&glyph_index, 0, sizeof(GLYPH_INDEX_ORDER));
@ -424,7 +424,7 @@ void test_read_glyph_index_order(void)
memset(orderInfo, 0, sizeof(ORDER_INFO));
orderInfo->fieldFlags = 0x383FE8;
orderInfo->deltaCoordinates = True;
orderInfo->deltaCoordinates = true;
memset(&glyph_index, 0, sizeof(GLYPH_INDEX_ORDER));
@ -567,7 +567,7 @@ void test_read_cache_bitmap_order(void)
memset(&cache_bitmap, 0, sizeof(CACHE_BITMAP_ORDER));
update_read_cache_bitmap_order(s, &cache_bitmap, True, extraFlags);
update_read_cache_bitmap_order(s, &cache_bitmap, true, extraFlags);
CU_ASSERT(cache_bitmap.cacheId == 0);
CU_ASSERT(cache_bitmap.bitmapWidth == 16);
@ -608,7 +608,7 @@ void test_read_cache_bitmap_v2_order(void)
memset(&cache_bitmap_v2, 0, sizeof(CACHE_BITMAP_V2_ORDER));
update_read_cache_bitmap_v2_order(s, &cache_bitmap_v2, True, extraFlags);
update_read_cache_bitmap_v2_order(s, &cache_bitmap_v2, true, extraFlags);
CU_ASSERT(cache_bitmap_v2.cacheId == 1);
CU_ASSERT(cache_bitmap_v2.bitmapBpp == 16);
@ -639,7 +639,7 @@ void test_read_cache_bitmap_v3_order(void)
memset(&cache_bitmap_v3, 0, sizeof(CACHE_BITMAP_V3_ORDER));
update_read_cache_bitmap_v3_order(s, &cache_bitmap_v3, True, extraFlags);
update_read_cache_bitmap_v3_order(s, &cache_bitmap_v3, true, extraFlags);
CU_ASSERT(cache_bitmap_v3.cacheIndex == 32767);
CU_ASSERT(cache_bitmap_v3.key1 == 0xBCEC5035);
@ -739,17 +739,17 @@ uint8 orders_update_2[] =
"\x50\x01\x01\x01\x55\x01\x50\xff\xff\xff\x16\x00\x17\x00\xea\x03"
"\xea\x03\x02\x00\x85\x02\x16\x00\x02\x00\x00\x00\x03\x00\x14\xb2";
void test_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
void test_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
{
opaque_rect_count++;
}
void test_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
void test_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
{
polyline_count++;
}
void test_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
void test_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
patblt_count++;
}
@ -766,9 +766,9 @@ void test_update_recv_orders(void)
polyline_count = 0;
patblt_count = 0;
update->OpaqueRect = test_opaque_rect;
update->Polyline = test_polyline;
update->PatBlt = test_patblt;
update->primary->OpaqueRect = test_opaque_rect;
update->primary->Polyline = test_polyline;
update->primary->PatBlt = test_patblt;
s->p = s->data = orders_update_1;
@ -777,7 +777,7 @@ void test_update_recv_orders(void)
CU_ASSERT(opaque_rect_count == 5);
CU_ASSERT(polyline_count == 2);
update->order_info.orderType = ORDER_TYPE_PATBLT;
update->primary->order_info.orderType = ORDER_TYPE_PATBLT;
s->p = s->data = orders_update_2;
update_recv(update, s);

View File

@ -74,7 +74,7 @@ void test_pcap(void)
packets[2].data = test_packet_3;
packets[2].length = sizeof(test_packet_3);
pcap = pcap_open("/tmp/test.pcap", True);
pcap = pcap_open("/tmp/test.pcap", true);
pcap_add_record(pcap, test_packet_1, sizeof(test_packet_1));
pcap_flush(pcap);
pcap_add_record(pcap, test_packet_2, sizeof(test_packet_2));
@ -82,7 +82,7 @@ void test_pcap(void)
pcap_add_record(pcap, test_packet_3, sizeof(test_packet_3));
pcap_close(pcap);
pcap = pcap_open("/tmp/test.pcap", False);
pcap = pcap_open("/tmp/test.pcap", false);
int i = 0;
while (pcap_has_next_record(pcap))

View File

@ -717,16 +717,16 @@ void test_rail_plugin(void)
param.out_rail_orders.sysparam.taskbarPos.bottom = 0x03c2;
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
param.out_rail_orders.sysparam.mouseButtonSwap = False;
param.out_rail_orders.sysparam.mouseButtonSwap = false;
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
param.out_rail_orders.sysparam.keyboardPref = False;
param.out_rail_orders.sysparam.keyboardPref = false;
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
param.out_rail_orders.sysparam.dragFullWindows = True;
param.out_rail_orders.sysparam.dragFullWindows = true;
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
param.out_rail_orders.sysparam.keyboardCues = False;
param.out_rail_orders.sysparam.keyboardCues = false;
param.out_rail_orders.sysparam.params |= SPI_MASK_SET_WORK_AREA;
param.out_rail_orders.sysparam.workArea.left = 0;
@ -744,7 +744,7 @@ void test_rail_plugin(void)
send_ui_event2plugin(chan_man, RDP_EVENT_TYPE_RAIL_CLIENT_EXEC_REMOTE_APP,
&param.plugin_data);
param.out_rail_orders.activate.enabled = True;
param.out_rail_orders.activate.enabled = true;
param.out_rail_orders.activate.windowId = 0x0007008e;
send_ui_event2plugin(chan_man, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE,
&param.out_rail_orders.activate);
@ -829,18 +829,18 @@ void test_rail_plugin(void)
);
CU_ASSERT(en > 2 &&
ee[ 2].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM &&
ee[ 2].order_info.sysparam.setScreenSaveSecure == False
ee[ 2].order_info.sysparam.setScreenSaveSecure == false
);
CU_ASSERT(en > 3 &&
ee[ 3].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_SYSPARAM &&
ee[ 3].order_info.sysparam.setScreenSaveActive == False
ee[ 3].order_info.sysparam.setScreenSaveActive == false
);
CU_ASSERT(en > 4 &&
ee[ 4].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE &&
ee[ 4].order_info.localmovesize.windowId == 0x0007008e &&
ee[ 4].order_info.localmovesize.isMoveSizeStart == True &&
ee[ 4].order_info.localmovesize.isMoveSizeStart == true &&
ee[ 4].order_info.localmovesize.moveSizeType == RAIL_WMSZ_MOVE &&
ee[ 4].order_info.localmovesize.posX == 0x017e &&
ee[ 4].order_info.localmovesize.posY == 0x000a
@ -849,7 +849,7 @@ void test_rail_plugin(void)
CU_ASSERT(en > 5 &&
ee[ 5].event_type == RDP_EVENT_TYPE_RAIL_CHANNEL_SERVER_LOCALMOVESIZE &&
ee[ 5].order_info.localmovesize.windowId == 0x0007008e &&
ee[ 5].order_info.localmovesize.isMoveSizeStart == False &&
ee[ 5].order_info.localmovesize.isMoveSizeStart == false &&
ee[ 5].order_info.localmovesize.moveSizeType == RAIL_WMSZ_MOVE &&
ee[ 5].order_info.localmovesize.posX == 0x00a6 &&
ee[ 5].order_info.localmovesize.posY == 0x0044

216
include/freerdp/altsec.h Normal file
View File

@ -0,0 +1,216 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Alternate Secondary Drawing Orders Interface API
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __UPDATE_ALTSEC_H
#define __UPDATE_ALTSEC_H
#include <freerdp/types.h>
#define DSDNG_STRETCH 0x00000001
#define DSDNG_TILE 0x00000002
#define DSDNG_PERPIXELALPHA 0x00000004
#define DSDNG_TRANSPARENT 0x00000008
#define DSDNG_MUSTFLIP 0x00000010
#define DSDNG_TRUESIZE 0x00000020
#define FRAME_START 0x00000000
#define FRAME_END 0x00000001
#define STREAM_BITMAP_END 0x01
#define STREAM_BITMAP_COMPRESSED 0x02
#define STREAM_BITMAP_V2 0x04
struct _OFFSCREEN_DELETE_LIST
{
uint32 cIndices;
uint16* indices;
};
typedef struct _OFFSCREEN_DELETE_LIST OFFSCREEN_DELETE_LIST;
struct _CREATE_OFFSCREEN_BITMAP_ORDER
{
uint32 id;
uint32 cx;
uint32 cy;
OFFSCREEN_DELETE_LIST deleteList;
};
typedef struct _CREATE_OFFSCREEN_BITMAP_ORDER CREATE_OFFSCREEN_BITMAP_ORDER;
struct _SWITCH_SURFACE_ORDER
{
uint32 bitmapId;
};
typedef struct _SWITCH_SURFACE_ORDER SWITCH_SURFACE_ORDER;
struct _NINE_GRID_BITMAP_INFO
{
uint32 flFlags;
uint32 ulLeftWidth;
uint32 ulRightWidth;
uint32 ulTopHeight;
uint32 ulBottomHeight;
uint32 crTransparent;
};
typedef struct _NINE_GRID_BITMAP_INFO NINE_GRID_BITMAP_INFO;
struct _CREATE_NINE_GRID_BITMAP_ORDER
{
uint32 bitmapBpp;
uint32 bitmapId;
uint32 cx;
uint32 cy;
NINE_GRID_BITMAP_INFO nineGridInfo;
};
typedef struct _CREATE_NINE_GRID_BITMAP_ORDER CREATE_NINE_GRID_BITMAP_ORDER;
struct _FRAME_MARKER_ORDER
{
uint32 action;
};
typedef struct _FRAME_MARKER_ORDER FRAME_MARKER_ORDER;
struct _STREAM_BITMAP_FIRST_ORDER
{
uint32 bitmapFlags;
uint32 bitmapBpp;
uint32 bitmapType;
uint32 bitmapWidth;
uint32 bitmapHeight;
uint32 bitmapSize;
uint32 bitmapBlockSize;
uint8* bitmapBlock;
};
typedef struct _STREAM_BITMAP_FIRST_ORDER STREAM_BITMAP_FIRST_ORDER;
struct _STREAM_BITMAP_NEXT_ORDER
{
uint32 bitmapFlags;
uint32 bitmapType;
uint32 bitmapBlockSize;
uint8* bitmapBlock;
};
typedef struct _STREAM_BITMAP_NEXT_ORDER STREAM_BITMAP_NEXT_ORDER;
struct _DRAW_GDIPLUS_FIRST_ORDER
{
uint32 cbSize;
uint32 cbTotalSize;
uint32 cbTotalEmfSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_FIRST_ORDER DRAW_GDIPLUS_FIRST_ORDER;
struct _DRAW_GDIPLUS_NEXT_ORDER
{
uint32 cbSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_NEXT_ORDER DRAW_GDIPLUS_NEXT_ORDER;
struct _DRAW_GDIPLUS_END_ORDER
{
uint32 cbSize;
uint32 cbTotalSize;
uint32 cbTotalEmfSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_END_ORDER DRAW_GDIPLUS_END_ORDER;
struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER
{
uint32 flags;
uint32 cacheType;
uint32 cacheIndex;
uint32 cbSize;
uint32 cbTotalSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER DRAW_GDIPLUS_CACHE_FIRST_ORDER;
struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER
{
uint32 flags;
uint32 cacheType;
uint32 cacheIndex;
uint32 cbSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER DRAW_GDIPLUS_CACHE_NEXT_ORDER;
struct _DRAW_GDIPLUS_CACHE_END_ORDER
{
uint32 flags;
uint32 cacheType;
uint32 cacheIndex;
uint32 cbSize;
uint32 cbTotalSize;
uint8* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER;
typedef void (*pCreateOffscreenBitmap)(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap);
typedef void (*pSwitchSurface)(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface);
typedef void (*pCreateNineGridBitmap)(rdpContext* context, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap);
typedef void (*pFrameMarker)(rdpContext* context, FRAME_MARKER_ORDER* frame_marker);
typedef void (*pStreamBitmapFirst)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first);
typedef void (*pStreamBitmapNext)(rdpContext* context, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next);
typedef void (*pDrawGdiPlusFirst)(rdpContext* context, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first);
typedef void (*pDrawGdiPlusNext)(rdpContext* context, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next);
typedef void (*pDrawGdiPlusEnd)(rdpContext* context, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end);
typedef void (*pDrawGdiPlusCacheFirst)(rdpContext* context, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first);
typedef void (*pDrawGdiPlusCacheNext)(rdpContext* context, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next);
typedef void (*pDrawGdiPlusCacheEnd)(rdpContext* context, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end);
struct rdp_altsec_update
{
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */
pSwitchSurface SwitchSurface; /* 17 */
pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */
pFrameMarker FrameMarker; /* 19 */
pStreamBitmapFirst StreamBitmapFirst; /* 20 */
pStreamBitmapNext StreamBitmapNext; /* 21 */
pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */
pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */
pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */
pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */
pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */
pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */
uint32 paddingB[32 - 28]; /* 28 */
/* internal */
CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap;
SWITCH_SURFACE_ORDER switch_surface;
CREATE_NINE_GRID_BITMAP_ORDER create_nine_grid_bitmap;
FRAME_MARKER_ORDER frame_marker;
STREAM_BITMAP_FIRST_ORDER stream_bitmap_first;
STREAM_BITMAP_FIRST_ORDER stream_bitmap_next;
DRAW_GDIPLUS_CACHE_FIRST_ORDER draw_gdiplus_cache_first;
DRAW_GDIPLUS_CACHE_NEXT_ORDER draw_gdiplus_cache_next;
DRAW_GDIPLUS_CACHE_END_ORDER draw_gdiplus_cache_end;
DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first;
DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next;
DRAW_GDIPLUS_END_ORDER draw_gdiplus_end;
};
typedef struct rdp_altsec_update rdpAltSecUpdate;
#endif /* __UPDATE_ALTSEC_H */

View File

@ -39,27 +39,28 @@ struct _BITMAP_V2_CELL
struct rdp_bitmap_cache
{
pMemBlt MemBlt;
pMem3Blt Mem3Blt;
pMemBlt MemBlt; /* 0 */
pMem3Blt Mem3Blt; /* 1 */
pCacheBitmap CacheBitmap; /* 2 */
pCacheBitmapV2 CacheBitmapV2; /* 3 */
pCacheBitmapV3 CacheBitmapV3; /* 4 */
pBitmapUpdate BitmapUpdate; /* 5 */
uint32 paddingA[16 - 6]; /* 6 */
pCacheBitmap CacheBitmap;
pCacheBitmapV2 CacheBitmapV2;
pCacheBitmapV3 CacheBitmapV3;
uint32 maxCells; /* 16 */
BITMAP_V2_CELL* cells; /* 17 */
uint32 paddingB[32 - 18]; /* 18 */
pBitmapUpdate BitmapUpdate;
/* internal */
uint8 maxCells;
rdpBitmap* bitmap;
rdpUpdate* update;
rdpContext* context;
rdpSettings* settings;
BITMAP_V2_CELL* cells;
};
FREERDP_API void bitmap_free(rdpBitmap* bitmap);
FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint8 id, uint16 index);
FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint8 id, uint16 index, rdpBitmap* bitmap);
FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index);
FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index, rdpBitmap* bitmap);
FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update);

View File

@ -33,25 +33,29 @@ typedef struct rdp_brush_cache rdpBrushCache;
struct _BRUSH_ENTRY
{
uint8 bpp;
uint32 bpp;
void* entry;
};
struct rdp_brush_cache
{
pPatBlt PatBlt;
pPatBlt PatBlt; /* 0 */
pCacheBrush CacheBrush; /* 1 */
uint32 paddingA[16 - 2]; /* 2 */
pCacheBrush CacheBrush;
uint32 maxEntries; /* 16 */
uint32 maxMonoEntries; /* 17 */
BRUSH_ENTRY* entries; /* 18 */
BRUSH_ENTRY* monoEntries; /* 19 */
uint32 paddingB[32 - 20]; /* 20 */
/* internal */
rdpSettings* settings;
uint8 maxEntries;
uint8 maxMonoEntries;
BRUSH_ENTRY* entries;
BRUSH_ENTRY* monoEntries;
};
FREERDP_API void* brush_cache_get(rdpBrushCache* brush, uint8 index, uint8* bpp);
FREERDP_API void brush_cache_put(rdpBrushCache* brush, uint8 index, void* entry, uint8 bpp);
FREERDP_API void* brush_cache_get(rdpBrushCache* brush, uint32 index, uint32* bpp);
FREERDP_API void brush_cache_put(rdpBrushCache* brush, uint32 index, void* entry, uint32 bpp);
FREERDP_API void brush_cache_register_callbacks(rdpUpdate* update);

View File

@ -34,14 +34,16 @@
struct rdp_cache
{
rdpSettings* settings;
rdpGlyphCache* glyph; /* 0 */
rdpBrushCache* brush; /* 1 */
rdpPointerCache* pointer; /* 2 */
rdpBitmapCache* bitmap; /* 3 */
rdpOffscreenCache* offscreen; /* 4 */
rdpPaletteCache* palette; /* 5 */
rdpGlyphCache* glyph;
rdpBrushCache* brush;
rdpPointerCache* pointer;
rdpBitmapCache* bitmap;
rdpOffscreenCache* offscreen;
rdpPaletteCache* palette;
/* internal */
rdpSettings* settings;
};
FREERDP_API rdpCache* cache_new(rdpSettings* settings);

View File

@ -34,15 +34,15 @@ typedef struct rdp_glyph_cache rdpGlyphCache;
struct _GLYPH_CACHE
{
uint16 number;
uint16 maxCellSize;
uint32 number;
uint32 maxCellSize;
rdpGlyph** entries;
};
struct _FRAGMENT_CACHE_ENTRY
{
void* fragment;
uint16 size;
uint32 size;
};
struct _FRAGMENT_CACHE
@ -52,17 +52,18 @@ struct _FRAGMENT_CACHE
struct rdp_glyph_cache
{
FRAGMENT_CACHE fragCache;
GLYPH_CACHE glyphCache[10];
rdpContext* context;
rdpSettings* settings;
GLYPH_CACHE glyphCache[10];
FRAGMENT_CACHE fragCache;
};
FREERDP_API rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint8 id, uint16 index);
FREERDP_API void glyph_cache_put(rdpGlyphCache* glyph_cache, uint8 id, uint16 index, rdpGlyph* entry);
FREERDP_API rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint32 id, uint32 index);
FREERDP_API void glyph_cache_put(rdpGlyphCache* glyph_cache, uint32 id, uint32 index, rdpGlyph* entry);
FREERDP_API void* glyph_cache_fragment_get(rdpGlyphCache* glyph, uint8 index, uint8* count);
FREERDP_API void glyph_cache_fragment_put(rdpGlyphCache* glyph, uint8 index, uint8 count, void* entry);
FREERDP_API void* glyph_cache_fragment_get(rdpGlyphCache* glyph, uint32 index, uint32* count);
FREERDP_API void glyph_cache_fragment_put(rdpGlyphCache* glyph, uint32 index, uint32 count, void* entry);
FREERDP_API void glyph_cache_register_callbacks(rdpUpdate* update);

View File

@ -32,17 +32,20 @@ typedef struct rdp_offscreen_cache rdpOffscreenCache;
struct rdp_offscreen_cache
{
uint16 currentSurface;
uint16 maxSize;
uint16 maxEntries;
uint32 maxSize; /* 0 */
uint32 maxEntries; /* 1 */
rdpBitmap** entries; /* 2 */
uint32 currentSurface; /* 3 */
/* internal */
rdpUpdate* update;
rdpSettings* settings;
rdpBitmap** entries;
};
FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint16 index);
FREERDP_API void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, uint16 index, rdpBitmap* bitmap);
FREERDP_API void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint16 index);
FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint32 index);
FREERDP_API void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, uint32 index, rdpBitmap* bitmap);
FREERDP_API void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint32 index);
FREERDP_API void offscreen_cache_register_callbacks(rdpUpdate* update);

View File

@ -38,13 +38,16 @@ struct _PALETTE_TABLE_ENTRY
struct rdp_palette_cache
{
uint8 maxEntries;
uint32 maxEntries; /* 0 */
PALETTE_TABLE_ENTRY* entries; /* 1 */
/* internal */
rdpSettings* settings;
PALETTE_TABLE_ENTRY* entries;
};
FREERDP_API void* palette_cache_get(rdpPaletteCache* palette, uint8 index);
FREERDP_API void palette_cache_put(rdpPaletteCache* palette, uint8 index, void* entry);
FREERDP_API void* palette_cache_get(rdpPaletteCache* palette, uint32 index);
FREERDP_API void palette_cache_put(rdpPaletteCache* palette, uint32 index, void* entry);
FREERDP_API void palette_cache_register_callbacks(rdpUpdate* update);

View File

@ -33,14 +33,17 @@ typedef struct rdp_pointer_cache rdpPointerCache;
struct rdp_pointer_cache
{
uint16 cacheSize;
uint32 cacheSize; /* 0 */
rdpPointer** entries; /* 1 */
/* internal */
rdpUpdate* update;
rdpSettings* settings;
rdpPointer** entries;
};
FREERDP_API rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint16 index);
FREERDP_API void pointer_cache_put(rdpPointerCache* pointer_cache, uint16 index, rdpPointer* pointer);
FREERDP_API rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint32 index);
FREERDP_API void pointer_cache_put(rdpPointerCache* pointer_cache, uint32 index, rdpPointer* pointer);
FREERDP_API void pointer_cache_register_callbacks(rdpUpdate* update);

View File

@ -56,39 +56,47 @@ typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, uint8* data
struct rdp_context
{
freerdp* instance;
freerdp_peer* peer;
freerdp* instance; /* 0 */
freerdp_peer* peer; /* 1 */
uint32 paddingA[16 - 2]; /* 2 */
int argc;
char** argv;
int argc; /* 16 */
char** argv; /* 17 */
uint32 paddingB[32 - 18]; /* 18 */
rdpRdp* rdp;
rdpGdi* gdi;
rdpRail* rail;
rdpCache* cache;
rdpChannels* channels;
rdpGraphics* graphics;
rdpRdp* rdp; /* 32 */
rdpGdi* gdi; /* 33 */
rdpRail* rail; /* 34 */
rdpCache* cache; /* 35 */
rdpChannels* channels; /* 36 */
rdpGraphics* graphics; /* 37 */
uint32 paddingC[64 - 38]; /* 38 */
};
struct rdp_freerdp
{
rdpContext* context;
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
rdpInput* input;
rdpUpdate* update;
rdpSettings* settings;
rdpInput* input; /* 16 */
rdpUpdate* update; /* 17 */
rdpSettings* settings; /* 18 */
uint32 paddingB[32 - 19]; /* 19 */
size_t context_size;
pContextNew ContextNew;
pContextFree ContextFree;
size_t context_size; /* 32 */
pContextNew ContextNew; /* 33 */
pContextFree ContextFree; /* 34 */
uint32 paddingC[48 - 35]; /* 35 */
pPreConnect PreConnect;
pPostConnect PostConnect;
pAuthenticate Authenticate;
pVerifyCertificate VerifyCertificate;
pPreConnect PreConnect; /* 48 */
pPostConnect PostConnect; /* 49 */
pAuthenticate Authenticate; /* 50 */
pVerifyCertificate VerifyCertificate; /* 51 */
uint32 paddingD[64 - 52]; /* 52 */
pSendChannelData SendChannelData;
pReceiveChannelData ReceiveChannelData;
pSendChannelData SendChannelData; /* 64 */
pReceiveChannelData ReceiveChannelData; /* 65 */
uint32 paddingE[80 - 66]; /* 66 */
};
FREERDP_API void freerdp_context_new(freerdp* instance);

View File

@ -40,28 +40,29 @@ typedef void (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, boole
struct rdp_bitmap
{
size_t size;
size_t size; /* 0 */
pBitmap_New New; /* 1 */
pBitmap_Free Free; /* 2 */
pBitmap_Paint Paint; /* 3 */
pBitmap_Decompress Decompress; /* 4 */
pBitmap_SetSurface SetSurface; /* 5 */
uint32 paddingA[16 - 6]; /* 6 */
pBitmap_New New;
pBitmap_Free Free;
pBitmap_Paint Paint;
pBitmap_Decompress Decompress;
pBitmap_SetSurface SetSurface;
uint32 left; /* 16 */
uint32 top; /* 17 */
uint32 right; /* 18 */
uint32 bottom; /* 19 */
uint32 width; /* 20 */
uint32 height; /* 21 */
uint32 bpp; /* 22 */
uint32 flags; /* 23 */
uint32 length; /* 24 */
uint8* data; /* 25 */
uint32 paddingB[32 - 26]; /* 26 */
uint16 left;
uint16 top;
uint16 right;
uint16 bottom;
uint16 width;
uint16 height;
uint16 bpp;
uint16 flags;
uint32 length;
uint8* data;
boolean compressed;
boolean ephemeral;
boolean compressed; /* 32 */
boolean ephemeral; /* 33 */
uint32 paddingC[64 - 34]; /* 34 */
};
FREERDP_API rdpBitmap* Bitmap_Alloc(rdpContext* context);
@ -83,21 +84,22 @@ typedef void (*pPointer_Set)(rdpContext* context, rdpPointer* pointer);
struct rdp_pointer
{
size_t size;
size_t size; /* 0 */
pPointer_New New; /* 1 */
pPointer_Free Free; /* 2 */
pPointer_Set Set; /* 3 */
uint32 paddingA[16 - 4]; /* 4 */
pPointer_New New;
pPointer_Free Free;
pPointer_Set Set;
uint16 xPos;
uint16 yPos;
uint16 width;
uint16 height;
uint16 xorBpp;
uint16 lengthAndMask;
uint16 lengthXorMask;
uint8* xorMaskData;
uint8* andMaskData;
uint32 xPos; /* 16 */
uint32 yPos; /* 17 */
uint32 width; /* 18 */
uint32 height; /* 19 */
uint32 xorBpp; /* 20 */
uint32 lengthAndMask; /* 21 */
uint32 lengthXorMask; /* 22 */
uint8* xorMaskData; /* 23 */
uint8* andMaskData; /* 24 */
uint32 paddingB[32 - 25]; /* 25 */
};
FREERDP_API rdpPointer* Pointer_Alloc(rdpContext* context);
@ -115,20 +117,21 @@ typedef void (*pGlyph_EndDraw)(rdpContext* context, int x, int y, int width, int
struct rdp_glyph
{
size_t size;
size_t size; /* 0 */
pGlyph_New New; /* 1 */
pGlyph_Free Free; /* 2 */
pGlyph_Draw Draw; /* 3 */
pGlyph_BeginDraw BeginDraw; /* 4 */
pGlyph_EndDraw EndDraw; /* 5 */
uint32 paddingA[16 - 6]; /* 6 */
sint16 x;
sint16 y;
uint16 cx;
uint16 cy;
uint16 cb;
uint8* aj;
pGlyph_New New;
pGlyph_Free Free;
pGlyph_Draw Draw;
pGlyph_BeginDraw BeginDraw;
pGlyph_EndDraw EndDraw;
sint32 x; /* 16 */
sint32 y; /* 17 */
uint32 cx; /* 18 */
uint32 cy; /* 19 */
uint32 cb; /* 20 */
uint8* aj; /* 21 */
uint32 paddingB[32 - 22]; /* 22 */
};
FREERDP_API rdpGlyph* Glyph_Alloc(rdpContext* context);
@ -142,10 +145,11 @@ FREERDP_API void Glyph_EndDraw(rdpContext* context, int x, int y, int width, int
struct rdp_graphics
{
rdpContext* context;
rdpBitmap* Bitmap_Prototype;
rdpPointer* Pointer_Prototype;
rdpGlyph* Glyph_Prototype;
rdpContext* context; /* 0 */
rdpBitmap* Bitmap_Prototype; /* 1 */
rdpPointer* Pointer_Prototype; /* 2 */
rdpGlyph* Glyph_Prototype; /* 3 */
uint32 paddingA[16 - 4]; /* 4 */
};
FREERDP_API void graphics_register_bitmap(rdpGraphics* graphics, rdpBitmap* bitmap);

View File

@ -60,15 +60,16 @@ typedef void (*pExtendedMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uin
struct rdp_input
{
rdpContext* context;
rdpContext* context; /* 0 */
void* param1; /* 1 */
uint32 paddingA[16 - 2]; /* 2 */
pSynchronizeEvent SynchronizeEvent;
pKeyboardEvent KeyboardEvent;
pUnicodeKeyboardEvent UnicodeKeyboardEvent;
pMouseEvent MouseEvent;
pExtendedMouseEvent ExtendedMouseEvent;
void* param1;
pSynchronizeEvent SynchronizeEvent; /* 16 */
pKeyboardEvent KeyboardEvent; /* 17 */
pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */
pMouseEvent MouseEvent; /* 19 */
pExtendedMouseEvent ExtendedMouseEvent; /* 20 */
uint32 paddingB[32 - 21]; /* 21 */
};
#endif /* __INPUT_API_H */

102
include/freerdp/pointer.h Normal file
View File

@ -0,0 +1,102 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Pointer Updates Interface API
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __UPDATE_POINTER_H
#define __UPDATE_POINTER_H
#include <freerdp/types.h>
#define PTR_MSG_TYPE_SYSTEM 0x0001
#define PTR_MSG_TYPE_POSITION 0x0003
#define PTR_MSG_TYPE_COLOR 0x0006
#define PTR_MSG_TYPE_CACHED 0x0007
#define PTR_MSG_TYPE_POINTER 0x0008
#define SYSPTR_NULL 0x00000000
#define SYSPTR_DEFAULT 0x00007F00
struct _POINTER_POSITION_UPDATE
{
uint32 xPos;
uint32 yPos;
};
typedef struct _POINTER_POSITION_UPDATE POINTER_POSITION_UPDATE;
struct _POINTER_SYSTEM_UPDATE
{
uint32 type;
};
typedef struct _POINTER_SYSTEM_UPDATE POINTER_SYSTEM_UPDATE;
struct _POINTER_COLOR_UPDATE
{
uint32 cacheIndex;
uint32 xPos;
uint32 yPos;
uint32 width;
uint32 height;
uint32 lengthAndMask;
uint32 lengthXorMask;
uint8* xorMaskData;
uint8* andMaskData;
};
typedef struct _POINTER_COLOR_UPDATE POINTER_COLOR_UPDATE;
struct _POINTER_NEW_UPDATE
{
uint32 xorBpp;
POINTER_COLOR_UPDATE colorPtrAttr;
};
typedef struct _POINTER_NEW_UPDATE POINTER_NEW_UPDATE;
struct _POINTER_CACHED_UPDATE
{
uint32 cacheIndex;
};
typedef struct _POINTER_CACHED_UPDATE POINTER_CACHED_UPDATE;
typedef void (*pPointerPosition)(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position);
typedef void (*pPointerSystem)(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system);
typedef void (*pPointerColor)(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color);
typedef void (*pPointerNew)(rdpContext* context, POINTER_NEW_UPDATE* pointer_new);
typedef void (*pPointerCached)(rdpContext* context, POINTER_CACHED_UPDATE* pointer_cached);
struct rdp_pointer_update
{
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
pPointerPosition PointerPosition; /* 16 */
pPointerSystem PointerSystem; /* 17 */
pPointerColor PointerColor; /* 18 */
pPointerNew PointerNew; /* 19 */
pPointerCached PointerCached; /* 20 */
uint32 paddingB[32 - 21]; /* 21 */
/* internal */
POINTER_POSITION_UPDATE pointer_position;
POINTER_SYSTEM_UPDATE pointer_system;
POINTER_COLOR_UPDATE pointer_color;
POINTER_NEW_UPDATE pointer_new;
POINTER_CACHED_UPDATE pointer_cached;
};
typedef struct rdp_pointer_update rdpPointerUpdate;
#endif /* __UPDATE_POINTER_H */

494
include/freerdp/primary.h Normal file
View File

@ -0,0 +1,494 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Primary Drawing Orders Interface API
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __UPDATE_PRIMARY_H
#define __UPDATE_PRIMARY_H
#include <freerdp/types.h>
struct rdp_bounds
{
sint32 left;
sint32 top;
sint32 right;
sint32 bottom;
};
typedef struct rdp_bounds rdpBounds;
struct rdp_brush
{
uint32 x;
uint32 y;
uint32 bpp;
uint32 style;
uint32 hatch;
uint32 index;
uint8* data;
uint8 p8x8[8];
};
typedef struct rdp_brush rdpBrush;
struct _ORDER_INFO
{
uint32 orderType;
uint32 fieldFlags;
rdpBounds bounds;
sint32 deltaBoundLeft;
sint32 deltaBoundTop;
sint32 deltaBoundRight;
sint32 deltaBoundBottom;
boolean deltaCoordinates;
};
typedef struct _ORDER_INFO ORDER_INFO;
struct _DSTBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
};
typedef struct _DSTBLT_ORDER DSTBLT_ORDER;
struct _PATBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
uint32 backColor;
uint32 foreColor;
rdpBrush brush;
};
typedef struct _PATBLT_ORDER PATBLT_ORDER;
struct _SCRBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
sint32 nXSrc;
sint32 nYSrc;
};
typedef struct _SCRBLT_ORDER SCRBLT_ORDER;
struct _OPAQUE_RECT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 color;
};
typedef struct _OPAQUE_RECT_ORDER OPAQUE_RECT_ORDER;
struct _DRAW_NINE_GRID_ORDER
{
sint32 srcLeft;
sint32 srcTop;
sint32 srcRight;
sint32 srcBottom;
uint32 bitmapId;
};
typedef struct _DRAW_NINE_GRID_ORDER DRAW_NINE_GRID_ORDER;
struct _DELTA_RECT
{
sint32 left;
sint32 top;
sint32 width;
sint32 height;
};
typedef struct _DELTA_RECT DELTA_RECT;
struct _MULTI_DSTBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
uint32 numRectangles;
uint32 cbData;
DELTA_RECT rectangles[45];
};
typedef struct _MULTI_DSTBLT_ORDER MULTI_DSTBLT_ORDER;
struct _MULTI_PATBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
uint32 backColor;
uint32 foreColor;
rdpBrush brush;
uint32 numRectangles;
uint32 cbData;
DELTA_RECT rectangles[45];
};
typedef struct _MULTI_PATBLT_ORDER MULTI_PATBLT_ORDER;
struct _MULTI_SCRBLT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
sint32 nXSrc;
sint32 nYSrc;
uint32 numRectangles;
uint32 cbData;
DELTA_RECT rectangles[45];
};
typedef struct _MULTI_SCRBLT_ORDER MULTI_SCRBLT_ORDER;
struct _MULTI_OPAQUE_RECT_ORDER
{
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 color;
uint32 numRectangles;
uint32 cbData;
DELTA_RECT rectangles[45];
};
typedef struct _MULTI_OPAQUE_RECT_ORDER MULTI_OPAQUE_RECT_ORDER;
struct _MULTI_DRAW_NINE_GRID_ORDER
{
sint32 srcLeft;
sint32 srcTop;
sint32 srcRight;
sint32 srcBottom;
uint32 bitmapId;
uint32 nDeltaEntries;
uint32 cbData;
uint8* codeDeltaList;
};
typedef struct _MULTI_DRAW_NINE_GRID_ORDER MULTI_DRAW_NINE_GRID_ORDER;
struct _LINE_TO_ORDER
{
uint32 backMode;
sint32 nXStart;
sint32 nYStart;
sint32 nXEnd;
sint32 nYEnd;
uint32 backColor;
uint32 bRop2;
uint32 penStyle;
uint32 penWidth;
uint32 penColor;
};
typedef struct _LINE_TO_ORDER LINE_TO_ORDER;
struct _DELTA_POINT
{
sint32 x;
sint32 y;
};
typedef struct _DELTA_POINT DELTA_POINT;
struct _POLYLINE_ORDER
{
sint32 xStart;
sint32 yStart;
uint32 bRop2;
uint32 penColor;
uint32 numPoints;
uint32 cbData;
DELTA_POINT* points;
};
typedef struct _POLYLINE_ORDER POLYLINE_ORDER;
struct _MEMBLT_ORDER
{
uint32 cacheId;
uint32 colorIndex;
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
sint32 nXSrc;
sint32 nYSrc;
uint32 cacheIndex;
rdpBitmap* bitmap;
};
typedef struct _MEMBLT_ORDER MEMBLT_ORDER;
struct _MEM3BLT_ORDER
{
uint32 cacheId;
uint32 colorIndex;
sint32 nLeftRect;
sint32 nTopRect;
sint32 nWidth;
sint32 nHeight;
uint32 bRop;
sint32 nXSrc;
sint32 nYSrc;
uint32 backColor;
uint32 foreColor;
rdpBrush brush;
uint32 cacheIndex;
rdpBitmap* bitmap;
};
typedef struct _MEM3BLT_ORDER MEM3BLT_ORDER;
struct _SAVE_BITMAP_ORDER
{
uint32 savedBitmapPosition;
sint32 nLeftRect;
sint32 nTopRect;
sint32 nRightRect;
sint32 nBottomRect;
uint32 operation;
};
typedef struct _SAVE_BITMAP_ORDER SAVE_BITMAP_ORDER;
struct _GLYPH_FRAGMENT_INDEX
{
uint32 index;
uint32 delta;
};
typedef struct _GLYPH_FRAGMENT_INDEX GLYPH_FRAGMENT_INDEX;
struct _GLYPH_FRAGMENT
{
uint32 operation;
uint32 index;
uint32 size;
uint32 nindices;
GLYPH_FRAGMENT_INDEX* indices;
};
typedef struct _GLYPH_FRAGMENT GLYPH_FRAGMENT;
struct _GLYPH_INDEX_ORDER
{
uint32 cacheId;
uint32 flAccel;
uint32 ulCharInc;
uint32 fOpRedundant;
uint32 backColor;
uint32 foreColor;
sint32 bkLeft;
sint32 bkTop;
sint32 bkRight;
sint32 bkBottom;
sint32 opLeft;
sint32 opTop;
sint32 opRight;
sint32 opBottom;
rdpBrush brush;
sint32 x;
sint32 y;
uint32 cbData;
uint8* data;
};
typedef struct _GLYPH_INDEX_ORDER GLYPH_INDEX_ORDER;
struct _FAST_INDEX_ORDER
{
uint32 cacheId;
uint32 flAccel;
uint32 ulCharInc;
uint32 backColor;
uint32 foreColor;
sint32 bkLeft;
sint32 bkTop;
sint32 bkRight;
sint32 bkBottom;
sint32 opLeft;
sint32 opTop;
sint32 opRight;
sint32 opBottom;
boolean opaqueRect;
sint32 x;
sint32 y;
uint32 cbData;
uint8* data;
};
typedef struct _FAST_INDEX_ORDER FAST_INDEX_ORDER;
struct _FAST_GLYPH_ORDER
{
uint32 cacheId;
uint32 flAccel;
uint32 ulCharInc;
uint32 backColor;
uint32 foreColor;
sint32 bkLeft;
sint32 bkTop;
sint32 bkRight;
sint32 bkBottom;
sint32 opLeft;
sint32 opTop;
sint32 opRight;
sint32 opBottom;
sint32 x;
sint32 y;
uint32 cbData;
uint8* data;
};
typedef struct _FAST_GLYPH_ORDER FAST_GLYPH_ORDER;
struct _POLYGON_SC_ORDER
{
sint32 xStart;
sint32 yStart;
uint32 bRop2;
uint32 fillMode;
uint32 brushColor;
uint32 nDeltaEntries;
uint32 cbData;
uint8* codeDeltaList;
};
typedef struct _POLYGON_SC_ORDER POLYGON_SC_ORDER;
struct _POLYGON_CB_ORDER
{
sint32 xStart;
sint32 yStart;
uint32 bRop2;
uint32 fillMode;
uint32 backColor;
uint32 foreColor;
rdpBrush brush;
uint32 nDeltaEntries;
uint32 cbData;
uint8* codeDeltaList;
};
typedef struct _POLYGON_CB_ORDER POLYGON_CB_ORDER;
struct _ELLIPSE_SC_ORDER
{
sint32 leftRect;
sint32 topRect;
sint32 rightRect;
sint32 bottomRect;
uint32 bRop2;
uint32 fillMode;
uint32 color;
};
typedef struct _ELLIPSE_SC_ORDER ELLIPSE_SC_ORDER;
struct _ELLIPSE_CB_ORDER
{
sint32 leftRect;
sint32 topRect;
sint32 rightRect;
sint32 bottomRect;
uint32 bRop2;
uint32 fillMode;
uint32 backColor;
uint32 foreColor;
rdpBrush brush;
};
typedef struct _ELLIPSE_CB_ORDER ELLIPSE_CB_ORDER;
typedef void (*pDstBlt)(rdpContext* context, DSTBLT_ORDER* dstblt);
typedef void (*pPatBlt)(rdpContext* context, PATBLT_ORDER* patblt);
typedef void (*pScrBlt)(rdpContext* context, SCRBLT_ORDER* scrblt);
typedef void (*pOpaqueRect)(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect);
typedef void (*pDrawNineGrid)(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid);
typedef void (*pMultiDstBlt)(rdpContext* context, MULTI_DSTBLT_ORDER* multi_dstblt);
typedef void (*pMultiPatBlt)(rdpContext* context, MULTI_PATBLT_ORDER* multi_patblt);
typedef void (*pMultiScrBlt)(rdpContext* context, MULTI_SCRBLT_ORDER* multi_scrblt);
typedef void (*pMultiOpaqueRect)(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect);
typedef void (*pMultiDrawNineGrid)(rdpContext* context, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid);
typedef void (*pLineTo)(rdpContext* context, LINE_TO_ORDER* line_to);
typedef void (*pPolyline)(rdpContext* context, POLYLINE_ORDER* polyline);
typedef void (*pMemBlt)(rdpContext* context, MEMBLT_ORDER* memblt);
typedef void (*pMem3Blt)(rdpContext* context, MEM3BLT_ORDER* memblt);
typedef void (*pSaveBitmap)(rdpContext* context, SAVE_BITMAP_ORDER* save_bitmap);
typedef void (*pGlyphIndex)(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index);
typedef void (*pFastIndex)(rdpContext* context, FAST_INDEX_ORDER* fast_index);
typedef void (*pFastGlyph)(rdpContext* context, FAST_GLYPH_ORDER* fast_glyph);
typedef void (*pPolygonSC)(rdpContext* context, POLYGON_SC_ORDER* polygon_sc);
typedef void (*pPolygonCB)(rdpContext* context, POLYGON_CB_ORDER* polygon_cb);
typedef void (*pEllipseSC)(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc);
typedef void (*pEllipseCB)(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb);
struct rdp_primary_update
{
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
pDstBlt DstBlt; /* 16 */
pPatBlt PatBlt; /* 17 */
pScrBlt ScrBlt; /* 18 */
pOpaqueRect OpaqueRect; /* 19 */
pDrawNineGrid DrawNineGrid; /* 20 */
pMultiDstBlt MultiDstBlt; /* 21 */
pMultiPatBlt MultiPatBlt; /* 22 */
pMultiScrBlt MultiScrBlt; /* 23 */
pMultiOpaqueRect MultiOpaqueRect; /* 24 */
pMultiDrawNineGrid MultiDrawNineGrid; /* 25 */
pLineTo LineTo; /* 26 */
pPolyline Polyline; /* 27 */
pMemBlt MemBlt; /* 28 */
pMem3Blt Mem3Blt; /* 29 */
pSaveBitmap SaveBitmap; /* 30 */
pGlyphIndex GlyphIndex; /* 31 */
pFastIndex FastIndex; /* 32 */
pFastGlyph FastGlyph; /* 33 */
pPolygonSC PolygonSC; /* 34 */
pPolygonCB PolygonCB; /* 35 */
pEllipseSC EllipseSC; /* 36 */
pEllipseCB EllipseCB; /* 37 */
uint32 paddingB[48 - 38]; /* 38 */
/* internal */
ORDER_INFO order_info;
DSTBLT_ORDER dstblt;
PATBLT_ORDER patblt;
SCRBLT_ORDER scrblt;
OPAQUE_RECT_ORDER opaque_rect;
DRAW_NINE_GRID_ORDER draw_nine_grid;
MULTI_DSTBLT_ORDER multi_dstblt;
MULTI_PATBLT_ORDER multi_patblt;
MULTI_SCRBLT_ORDER multi_scrblt;
MULTI_OPAQUE_RECT_ORDER multi_opaque_rect;
MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid;
LINE_TO_ORDER line_to;
POLYLINE_ORDER polyline;
MEMBLT_ORDER memblt;
MEM3BLT_ORDER mem3blt;
SAVE_BITMAP_ORDER save_bitmap;
GLYPH_INDEX_ORDER glyph_index;
FAST_INDEX_ORDER fast_index;
FAST_GLYPH_ORDER fast_glyph;
POLYGON_SC_ORDER polygon_sc;
POLYGON_CB_ORDER polygon_cb;
ELLIPSE_SC_ORDER ellipse_sc;
ELLIPSE_CB_ORDER ellipse_cb;
};
typedef struct rdp_primary_update rdpPrimaryUpdate;
#endif /* __UPDATE_PRIMARY_H */

218
include/freerdp/secondary.h Normal file
View File

@ -0,0 +1,218 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Secondary Drawing Orders Interface API
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __UPDATE_SECONDARY_H
#define __UPDATE_SECONDARY_H
#include <freerdp/types.h>
#define GLYPH_FRAGMENT_NOP 0x00
#define GLYPH_FRAGMENT_USE 0xFE
#define GLYPH_FRAGMENT_ADD 0xFF
#define CBR2_HEIGHT_SAME_AS_WIDTH 0x01
#define CBR2_PERSISTENT_KEY_PRESENT 0x02
#define CBR2_NO_BITMAP_COMPRESSION_HDR 0x08
#define CBR2_DO_NOT_CACHE 0x10
#define SCREEN_BITMAP_SURFACE 0xFFFF
#define BITMAP_CACHE_WAITING_LIST_INDEX 0x7FFF
#define CACHED_BRUSH 0x80
#define BMF_1BPP 0x1
#define BMF_8BPP 0x3
#define BMF_16BPP 0x4
#define BMF_24BPP 0x5
#define BMF_32BPP 0x6
#ifndef _WIN32
#define BS_SOLID 0x00
#define BS_NULL 0x01
#define BS_HATCHED 0x02
#define BS_PATTERN 0x03
#endif
#define HS_HORIZONTAL 0x00
#define HS_VERTICAL 0x01
#define HS_FDIAGONAL 0x02
#define HS_BDIAGONAL 0x03
#define HS_CROSS 0x04
#define HS_DIAGCROSS 0x05
#define SO_FLAG_DEFAULT_PLACEMENT 0x01
#define SO_HORIZONTAL 0x02
#define SO_VERTICAL 0x04
#define SO_REVERSED 0x08
#define SO_ZERO_BEARINGS 0x10
#define SO_CHAR_INC_EQUAL_BM_BASE 0x20
#define SO_MAXEXT_EQUAL_BM_SIDE 0x40
struct _CACHE_BITMAP_ORDER
{
uint32 cacheId;
uint32 bitmapBpp;
uint32 bitmapWidth;
uint32 bitmapHeight;
uint32 bitmapLength;
uint32 cacheIndex;
uint8 bitmapComprHdr[8];
uint8* bitmapDataStream;
};
typedef struct _CACHE_BITMAP_ORDER CACHE_BITMAP_ORDER;
struct _CACHE_BITMAP_V2_ORDER
{
uint32 cacheId;
uint32 flags;
uint32 key1;
uint32 key2;
uint32 bitmapBpp;
uint32 bitmapWidth;
uint32 bitmapHeight;
uint32 bitmapLength;
uint32 cacheIndex;
boolean compressed;
uint8 bitmapComprHdr[8];
uint8* bitmapDataStream;
};
typedef struct _CACHE_BITMAP_V2_ORDER CACHE_BITMAP_V2_ORDER;
struct _BITMAP_DATA_EX
{
uint32 bpp;
uint32 codecID;
uint32 width;
uint32 height;
uint32 length;
uint8* data;
};
typedef struct _BITMAP_DATA_EX BITMAP_DATA_EX;
struct _CACHE_BITMAP_V3_ORDER
{
uint32 cacheId;
uint32 bpp;
uint32 flags;
uint32 cacheIndex;
uint32 key1;
uint32 key2;
BITMAP_DATA_EX bitmapData;
};
typedef struct _CACHE_BITMAP_V3_ORDER CACHE_BITMAP_V3_ORDER;
struct _CACHE_COLOR_TABLE_ORDER
{
uint32 cacheIndex;
uint32 numberColors;
uint32* colorTable;
};
typedef struct _CACHE_COLOR_TABLE_ORDER CACHE_COLOR_TABLE_ORDER;
struct _GLYPH_DATA
{
uint32 cacheIndex;
sint32 x;
sint32 y;
uint32 cx;
uint32 cy;
uint32 cb;
uint8* aj;
};
typedef struct _GLYPH_DATA GLYPH_DATA;
struct _CACHE_GLYPH_ORDER
{
uint32 cacheId;
uint32 cGlyphs;
GLYPH_DATA* glyphData[255];
uint8* unicodeCharacters;
};
typedef struct _CACHE_GLYPH_ORDER CACHE_GLYPH_ORDER;
struct _GLYPH_DATA_V2
{
uint32 cacheIndex;
sint32 x;
sint32 y;
uint32 cx;
uint32 cy;
uint32 cb;
uint8* aj;
};
typedef struct _GLYPH_DATA_V2 GLYPH_DATA_V2;
struct _CACHE_GLYPH_V2_ORDER
{
uint32 cacheId;
uint32 flags;
uint32 cGlyphs;
GLYPH_DATA_V2* glyphData[255];
uint8* unicodeCharacters;
};
typedef struct _CACHE_GLYPH_V2_ORDER CACHE_GLYPH_V2_ORDER;
struct _CACHE_BRUSH_ORDER
{
uint32 index;
uint32 bpp;
uint32 cx;
uint32 cy;
uint32 style;
uint32 length;
uint8* data;
};
typedef struct _CACHE_BRUSH_ORDER CACHE_BRUSH_ORDER;
typedef void (*pCacheBitmap)(rdpContext* context, CACHE_BITMAP_ORDER* cache_bitmap_order);
typedef void (*pCacheBitmapV2)(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order);
typedef void (*pCacheBitmapV3)(rdpContext* context, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order);
typedef void (*pCacheColorTable)(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cache_color_table_order);
typedef void (*pCacheGlyph)(rdpContext* context, CACHE_GLYPH_ORDER* cache_glyph_order);
typedef void (*pCacheGlyphV2)(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order);
typedef void (*pCacheBrush)(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush_order);
struct rdp_secondary_update
{
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
pCacheBitmap CacheBitmap; /* 16 */
pCacheBitmapV2 CacheBitmapV2; /* 17 */
pCacheBitmapV3 CacheBitmapV3; /* 18 */
pCacheColorTable CacheColorTable; /* 19 */
pCacheGlyph CacheGlyph; /* 20 */
pCacheGlyphV2 CacheGlyphV2; /* 21 */
pCacheBrush CacheBrush; /* 22 */
uint32 paddingE[32 - 23]; /* 23 */
/* internal */
boolean glyph_v2;
CACHE_BITMAP_ORDER cache_bitmap_order;
CACHE_BITMAP_V2_ORDER cache_bitmap_v2_order;
CACHE_BITMAP_V3_ORDER cache_bitmap_v3_order;
CACHE_COLOR_TABLE_ORDER cache_color_table_order;
CACHE_GLYPH_ORDER cache_glyph_order;
CACHE_GLYPH_V2_ORDER cache_glyph_v2_order;
CACHE_BRUSH_ORDER cache_brush_order;
};
typedef struct rdp_secondary_update rdpSecondaryUpdate;
#endif /* __UPDATE_SECONDARY_H */

View File

@ -140,14 +140,14 @@ struct rdp_channel
int options; /* ui sets */
int channel_id; /* core sets */
boolean joined; /* client has joined the channel */
void * handle; /* just for ui */
void* handle; /* just for ui */
};
typedef struct rdp_channel rdpChannel;
struct rdp_ext_set
{
char name[256]; /* plugin name or path */
void * data; /* plugin data */
void* data; /* plugin data */
};
struct _BITMAP_CACHE_CELL_INFO
@ -182,152 +182,173 @@ struct rdp_monitor
struct rdp_settings
{
void* instance;
void* instance; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
uint16 width;
uint16 height;
uint16 percent_screen;
boolean sw_gdi;
boolean workarea;
boolean fullscreen;
boolean grab_keyboard;
boolean decorations;
uint32 rdp_version;
uint16 color_depth;
uint32 kbd_layout;
uint32 kbd_type;
uint32 kbd_subtype;
uint32 kbd_fn_keys;
uint32 client_build;
uint32 requested_protocols;
uint32 selected_protocol;
uint32 encryption_method;
uint32 encryption_level;
boolean authentication;
/* Core Protocol Parameters */
uint32 width; /* 16 */
uint32 height; /* 17 */
uint32 rdp_version; /* 18 */
uint32 color_depth; /* 19 */
uint32 kbd_layout; /* 20 */
uint32 kbd_type; /* 21 */
uint32 kbd_subtype; /* 22 */
uint32 kbd_fn_keys; /* 23 */
uint32 client_build; /* 24 */
uint32 requested_protocols; /* 25 */
uint32 selected_protocol; /* 26 */
uint32 encryption_method; /* 27 */
uint32 encryption_level; /* 28 */
boolean authentication; /* 29 */
uint32 paddingB[48 - 30]; /* 30 */
char* home_path;
boolean server_mode;
/* Connection Settings */
uint32 port; /* 48 */
boolean ipv6; /* 49 */
char* hostname; /* 50 */
char* username; /* 51 */
char* password; /* 52 */
char* domain; /* 53 */
char* shell; /* 54 */
char* directory; /* 55 */
char* ip_address; /* 56 */
char* client_dir; /* 57 */
boolean autologon; /* 58 */
boolean compression; /* 59 */
uint32 performance_flags; /* 60 */
uint32 paddingC[80 - 61]; /* 61 */
rdpBlob server_random;
rdpBlob server_certificate;
struct rdp_certificate* server_cert;
/* User Interface Parameters */
boolean sw_gdi; /* 80 */
boolean workarea; /* 81 */
boolean fullscreen; /* 82 */
boolean grab_keyboard; /* 83 */
boolean decorations; /* 84 */
uint32 percent_screen; /* 85 */
boolean mouse_motion; /* 86 */
uint32 paddingD[112 - 87]; /* 87 */
boolean console_audio;
boolean console_session;
uint32 redirected_session_id;
/* Internal Parameters */
char* home_path; /* 112 */
uint32 share_id; /* 113 */
uint32 pdu_source; /* 114 */
UNICONV* uniconv; /* 115 */
boolean server_mode; /* 116 */
uint32 paddingE[144 - 117]; /* 117 */
int num_channels;
rdpChannel channels[16];
/* Security */
boolean encryption; /* 144 */
boolean tls_security; /* 145 */
boolean nla_security; /* 146 */
boolean rdp_security; /* 147 */
uint32 paddingF[160 - 148]; /* 148 */
int num_monitors;
struct rdp_monitor monitors[16];
/* Session */
boolean console_audio; /* 160 */
boolean console_session; /* 161 */
uint32 redirected_session_id; /* 162 */
uint32 paddingG[176 - 163]; /* 163 */
struct rdp_ext_set extensions[16];
UNICONV* uniconv;
char client_hostname[32];
char client_product_id[32];
uint16 port;
char* hostname;
char* username;
char* password;
char* domain;
char* shell;
char* directory;
uint32 performance_flags;
char* cert_file;
char* privatekey_file;
boolean autologon;
boolean ignore_certificate;
boolean compression;
boolean ipv6;
char* ip_address;
char* client_dir;
TIME_ZONE_INFO client_time_zone;
/* Output Control */
boolean refresh_rect; /* 176 */
boolean suppress_output; /* 177 */
boolean desktop_resize; /* 178 */
uint32 paddingH[192 - 179]; /* 179 */
boolean auto_reconnection;
ARC_CS_PRIVATE_PACKET client_auto_reconnect_cookie;
ARC_SC_PRIVATE_PACKET server_auto_reconnect_cookie;
boolean encryption;
boolean tls_security;
boolean nla_security;
boolean rdp_security;
uint32 share_id;
uint16 pdu_source;
boolean refresh_rect;
boolean suppress_output;
boolean desktop_resize;
boolean frame_marker;
boolean bitmap_cache_v3;
uint8 received_caps[32];
uint8 order_support[32];
/* Time Zone */
TIME_ZONE_INFO client_time_zone;
/* Capabilities */
uint32 vc_chunk_size;
boolean sound_beeps;
boolean color_pointer;
boolean smooth_fonts;
uint16 pointer_cache_size;
boolean glyph_cache;
boolean frame_marker;
boolean fastpath_input;
boolean fastpath_output;
boolean offscreen_bitmap_cache;
uint16 offscreen_bitmap_cache_size;
uint16 offscreen_bitmap_cache_entries;
boolean bitmap_cache;
boolean persistent_bitmap_cache;
uint8 bitmapCacheV2NumCells;
BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[6];
uint16 glyphSupportLevel;
GLYPH_CACHE_DEFINITION glyphCache[10];
GLYPH_CACHE_DEFINITION fragCache;
uint32 vc_chunk_size;
boolean draw_nine_grid;
uint16 draw_nine_grid_cache_size;
uint16 draw_nine_grid_cache_entries;
boolean draw_gdi_plus;
boolean draw_gdi_plus_cache;
boolean large_pointer;
uint8 received_caps[32];
uint8 order_support[32];
boolean surface_commands;
uint32 multifrag_max_request_size;
boolean desktop_composition;
/* Certificate */
char* cert_file;
char* privatekey_file;
char client_hostname[32];
char client_product_id[32];
rdpBlob server_random;
rdpBlob server_certificate;
boolean ignore_certificate;
struct rdp_certificate* server_cert;
/* Codecs */
boolean rfx_codec;
boolean ns_codec;
uint8 rfx_codec_id;
uint8 ns_codec_id;
uint32 rfx_codec_id;
uint32 ns_codec_id;
boolean frame_acknowledge;
/* Recording */
boolean dump_rfx;
boolean play_rfx;
char* dump_rfx_file;
char* play_rfx_file;
/* RemoteApp */
boolean remote_app;
uint8 num_icon_caches;
uint16 num_icon_cache_entries;
uint32 num_icon_caches;
uint32 num_icon_cache_entries;
boolean rail_langbar_supported;
boolean mouse_motion;
/* Pointer */
boolean large_pointer;
boolean color_pointer;
uint32 pointer_cache_size;
/* Bitmap Cache */
boolean bitmap_cache;
boolean bitmap_cache_v3;
boolean persistent_bitmap_cache;
uint32 bitmapCacheV2NumCells;
BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[6];
/* Offscreen Bitmap Cache */
boolean offscreen_bitmap_cache;
uint32 offscreen_bitmap_cache_size;
uint32 offscreen_bitmap_cache_entries;
/* Glyph Cache */
boolean glyph_cache;
uint32 glyphSupportLevel;
GLYPH_CACHE_DEFINITION glyphCache[10];
GLYPH_CACHE_DEFINITION fragCache;
/* Draw Nine Grid */
boolean draw_nine_grid;
uint32 draw_nine_grid_cache_size;
uint32 draw_nine_grid_cache_entries;
/* Draw GDI+ */
boolean draw_gdi_plus;
boolean draw_gdi_plus_cache;
/* Desktop Composition */
boolean desktop_composition;
/* Channels */
int num_channels;
rdpChannel channels[16];
/* Monitors */
int num_monitors;
struct rdp_monitor monitors[16];
/* Extensions */
int num_extensions;
struct rdp_ext_set extensions[16];
};
typedef struct rdp_settings rdpSettings;

View File

@ -27,6 +27,28 @@
/* Base Types */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
typedef uint8_t uint8;
typedef int8_t sint8;
typedef uint16_t uint16;
typedef int16_t sint16;
typedef uint32_t uint32;
typedef int32_t sint32;
typedef uint64_t uint64;
typedef int64_t sint64;
#else
typedef unsigned char uint8;
typedef signed char sint8;
typedef unsigned short uint16;
@ -41,20 +63,47 @@ typedef unsigned long long uint64;
typedef signed long long sint64;
#endif
#ifndef True
#define True (1)
#endif
#endif /* HAVE_INTTYPES_H */
#ifndef False
#define False (0)
#endif
#ifdef HAVE_STDBOOL_H
#ifndef _WIN32
#include <stdbool.h>
typedef int boolean;
#else
#ifndef __cplusplus
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
#define true 1
#define false 0
#ifdef _WIN32
#define boolean BOOLEAN
#else
typedef int boolean;
#endif
#endif /* __bool_true_false_are_defined */
#else
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
typedef int boolean;
#endif /* __cplusplus */
#endif /* HAVE_STDBOOL_H */
#ifndef MIN
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif

File diff suppressed because it is too large Load Diff

261
include/freerdp/window.h Normal file
View File

@ -0,0 +1,261 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* Window Alternate Secondary Drawing Orders Interface API
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __UPDATE_WINDOW_H
#define __UPDATE_WINDOW_H
#include <freerdp/types.h>
/* Window Order Header Flags */
#define WINDOW_ORDER_TYPE_WINDOW 0x01000000
#define WINDOW_ORDER_TYPE_NOTIFY 0x02000000
#define WINDOW_ORDER_TYPE_DESKTOP 0x04000000
#define WINDOW_ORDER_STATE_NEW 0x10000000
#define WINDOW_ORDER_STATE_DELETED 0x20000000
#define WINDOW_ORDER_FIELD_OWNER 0x00000002
#define WINDOW_ORDER_FIELD_STYLE 0x00000008
#define WINDOW_ORDER_FIELD_SHOW 0x00000010
#define WINDOW_ORDER_FIELD_TITLE 0x00000004
#define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000
#define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000
#define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000
#define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000
#define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800
#define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000
#define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400
#define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100
#define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000
#define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200
#define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000
#define WINDOW_ORDER_ICON 0x40000000
#define WINDOW_ORDER_CACHED_ICON 0x80000000
#define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008
#define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001
#define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002
#define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001
#define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004
#define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008
#define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010
#define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020
/* Window Show States */
#define WINDOW_HIDE 0x00
#define WINDOW_SHOW_MINIMIZED 0x02
#define WINDOW_SHOW_MAXIMIZED 0x03
#define WINDOW_SHOW 0x05
/* Window Styles */
#ifndef _WIN32
#define WS_BORDER 0x00800000
#define WS_CAPTION 0x00C00000
#define WS_CHILD 0x40000000
#define WS_CLIPCHILDREN 0x02000000
#define WS_CLIPSIBLINGS 0x04000000
#define WS_DISABLED 0x08000000
#define WS_DLGFRAME 0x00400000
#define WS_GROUP 0x00020000
#define WS_HSCROLL 0x00100000
#define WS_ICONIC 0x20000000
#define WS_MAXIMIZE 0x01000000
#define WS_MAXIMIZEBOX 0x00010000
#define WS_MINIMIZE 0x20000000
#define WS_MINIMIZEBOX 0x00020000
#define WS_OVERLAPPED 0x00000000
#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
#define WS_POPUP 0x80000000
#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
#define WS_SIZEBOX 0x00040000
#define WS_SYSMENU 0x00080000
#define WS_TABSTOP 0x00010000
#define WS_THICKFRAME 0x00040000
#define WS_VISIBLE 0x10000000
#define WS_VSCROLL 0x00200000
#endif
/* Extended Window Styles */
#ifndef _WIN32
#define WS_EX_ACCEPTFILES 0x00000010
#define WS_EX_APPWINDOW 0x00040000
#define WS_EX_CLIENTEDGE 0x00000200
#define WS_EX_COMPOSITED 0x02000000
#define WS_EX_CONTEXTHELP 0x00000400
#define WS_EX_CONTROLPARENT 0x00010000
#define WS_EX_DLGMODALFRAME 0x00000001
#define WS_EX_LAYERED 0x00080000
#define WS_EX_LAYOUTRTL 0x00400000
#define WS_EX_LEFT 0x00000000
#define WS_EX_LEFTSCROLLBAR 0x00004000
#define WS_EX_LTRREADING 0x00000000
#define WS_EX_MDICHILD 0x00000040
#define WS_EX_NOACTIVATE 0x08000000
#define WS_EX_NOINHERITLAYOUT 0x00100000
#define WS_EX_NOPARENTNOTIFY 0x00000004
#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
#define WS_EX_RIGHT 0x00001000
#define WS_EX_RIGHTSCROLLBAR 0x00000000
#define WS_EX_RTLREADING 0x00002000
#define WS_EX_STATICEDGE 0x00020000
#define WS_EX_TOOLWINDOW 0x00000080
#define WS_EX_TOPMOST 0x00000008
#define WS_EX_TRANSPARENT 0x00000020
#define WS_EX_WINDOWEDGE 0x00000100
#endif
struct _WINDOW_ORDER_INFO
{
uint32 windowId;
uint32 fieldFlags;
uint32 notifyIconId;
};
typedef struct _WINDOW_ORDER_INFO WINDOW_ORDER_INFO;
struct _ICON_INFO
{
uint32 cacheEntry;
uint32 cacheId;
uint32 bpp;
uint32 width;
uint32 height;
uint32 cbColorTable;
uint32 cbBitsMask;
uint32 cbBitsColor;
uint8* bitsMask;
uint8* colorTable;
uint8* bitsColor;
};
typedef struct _ICON_INFO ICON_INFO;
struct _CACHED_ICON_INFO
{
uint32 cacheEntry;
uint32 cacheId;
};
typedef struct _CACHED_ICON_INFO CACHED_ICON_INFO;
struct _NOTIFY_ICON_INFOTIP
{
uint32 timeout;
uint32 flags;
UNICODE_STRING text;
UNICODE_STRING title;
};
typedef struct _NOTIFY_ICON_INFOTIP NOTIFY_ICON_INFOTIP;
struct _WINDOW_STATE_ORDER
{
uint32 ownerWindowId;
uint32 style;
uint32 extendedStyle;
uint32 showState;
UNICODE_STRING titleInfo;
uint32 clientOffsetX;
uint32 clientOffsetY;
uint32 clientAreaWidth;
uint32 clientAreaHeight;
uint32 RPContent;
uint32 rootParentHandle;
uint32 windowOffsetX;
uint32 windowOffsetY;
uint32 windowClientDeltaX;
uint32 windowClientDeltaY;
uint32 windowWidth;
uint32 windowHeight;
uint32 numWindowRects;
RECTANGLE_16* windowRects;
uint32 visibleOffsetX;
uint32 visibleOffsetY;
uint32 numVisibilityRects;
RECTANGLE_16* visibilityRects;
};
typedef struct _WINDOW_STATE_ORDER WINDOW_STATE_ORDER;
struct _WINDOW_ICON_ORDER
{
ICON_INFO* iconInfo;
};
typedef struct _WINDOW_ICON_ORDER WINDOW_ICON_ORDER;
struct _WINDOW_CACHED_ICON_ORDER
{
CACHED_ICON_INFO cachedIcon;
};
typedef struct _WINDOW_CACHED_ICON_ORDER WINDOW_CACHED_ICON_ORDER;
struct _NOTIFY_ICON_STATE_ORDER
{
uint32 version;
UNICODE_STRING toolTip;
NOTIFY_ICON_INFOTIP infoTip;
uint32 state;
ICON_INFO icon;
CACHED_ICON_INFO cachedIcon;
};
typedef struct _NOTIFY_ICON_STATE_ORDER NOTIFY_ICON_STATE_ORDER;
struct _MONITORED_DESKTOP_ORDER
{
uint32 activeWindowId;
uint32 numWindowIds;
uint32* windowIds;
};
typedef struct _MONITORED_DESKTOP_ORDER MONITORED_DESKTOP_ORDER;
typedef void (*pWindowCreate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
typedef void (*pWindowUpdate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
typedef void (*pWindowIcon)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* window_icon);
typedef void (*pWindowCachedIcon)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* window_cached_icon);
typedef void (*pWindowDelete)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
typedef void (*pNotifyIconCreate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
typedef void (*pNotifyIconUpdate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
typedef void (*pNotifyIconDelete)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
typedef void (*pMonitoredDesktop)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitored_desktop);
typedef void (*pNonMonitoredDesktop)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
struct rdp_window_update
{
rdpContext* context; /* 0 */
uint32 paddingA[16 - 1]; /* 1 */
pWindowCreate WindowCreate; /* 16 */
pWindowUpdate WindowUpdate; /* 17 */
pWindowIcon WindowIcon; /* 18 */
pWindowCachedIcon WindowCachedIcon; /* 19 */
pWindowDelete WindowDelete; /* 20 */
pNotifyIconCreate NotifyIconCreate; /* 21 */
pNotifyIconUpdate NotifyIconUpdate; /* 22 */
pNotifyIconDelete NotifyIconDelete; /* 23 */
pMonitoredDesktop MonitoredDesktop; /* 24 */
pNonMonitoredDesktop NonMonitoredDesktop; /* 25 */
uint32 paddingB[32 - 26]; /* 26 */
/* internal */
WINDOW_ORDER_INFO orderInfo;
WINDOW_STATE_ORDER window_state;
WINDOW_ICON_ORDER window_icon;
WINDOW_CACHED_ICON_ORDER window_cached_icon;
NOTIFY_ICON_STATE_ORDER notify_icon_state;
MONITORED_DESKTOP_ORDER monitored_desktop;
};
typedef struct rdp_window_update rdpWindowUpdate;
#endif /* __UPDATE_WINDOW_H */

View File

@ -23,10 +23,10 @@
#include <freerdp/cache/bitmap.h>
void update_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
{
rdpBitmap* bitmap;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
if (memblt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
@ -34,13 +34,13 @@ void update_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
bitmap = bitmap_cache_get(cache->bitmap, (uint8) memblt->cacheId, memblt->cacheIndex);
memblt->bitmap = bitmap;
IFCALL(cache->bitmap->MemBlt, update, memblt);
IFCALL(cache->bitmap->MemBlt, context, memblt);
}
void update_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
{
rdpBitmap* bitmap;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
if (mem3blt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
@ -48,51 +48,51 @@ void update_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex);
mem3blt->bitmap = bitmap;
IFCALL(cache->bitmap->Mem3Blt, update, mem3blt);
IFCALL(cache->bitmap->Mem3Blt, context, mem3blt);
}
void update_gdi_cache_bitmap(rdpUpdate* update, CACHE_BITMAP_ORDER* cache_bitmap)
void update_gdi_cache_bitmap(rdpContext* context, CACHE_BITMAP_ORDER* cache_bitmap)
{
printf("Warning: CacheBitmapV1 Unimplemented\n");
}
void update_gdi_cache_bitmap_v2(rdpUpdate* update, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2)
void update_gdi_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2)
{
rdpBitmap* bitmap;
rdpBitmap* prevBitmap;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
bitmap = Bitmap_Alloc(update->context);
bitmap = Bitmap_Alloc(context);
Bitmap_SetDimensions(update->context, bitmap, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight);
Bitmap_SetDimensions(context, bitmap, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight);
bitmap->Decompress(update->context, bitmap,
bitmap->Decompress(context, bitmap,
cache_bitmap_v2->bitmapDataStream, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight,
cache_bitmap_v2->bitmapBpp, cache_bitmap_v2->bitmapLength, cache_bitmap_v2->compressed);
bitmap->New(update->context, bitmap);
bitmap->New(context, bitmap);
prevBitmap = bitmap_cache_get(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex);
if (prevBitmap != NULL)
Bitmap_Free(update->context, prevBitmap);
Bitmap_Free(context, prevBitmap);
bitmap_cache_put(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex, bitmap);
}
void update_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap_update)
void update_gdi_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmap_update)
{
int i;
rdpBitmap* bitmap;
BITMAP_DATA* bitmap_data;
rdpCache* cache = update->context->cache;
int reused = 1;
boolean reused = true;
rdpCache* cache = context->cache;
if (cache->bitmap->bitmap == NULL)
{
cache->bitmap->bitmap = Bitmap_Alloc(update->context);
cache->bitmap->bitmap->ephemeral = True;
reused = 0;
cache->bitmap->bitmap = Bitmap_Alloc(context);
cache->bitmap->bitmap->ephemeral = true;
reused = false;
}
bitmap = cache->bitmap->bitmap;
@ -105,28 +105,28 @@ void update_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap_update)
bitmap->length = bitmap_data->bitmapLength;
bitmap->compressed = bitmap_data->compressed;
Bitmap_SetRectangle(update->context, bitmap,
Bitmap_SetRectangle(context, bitmap,
bitmap_data->destLeft, bitmap_data->destTop,
bitmap_data->destRight, bitmap_data->destBottom);
Bitmap_SetDimensions(update->context, bitmap, bitmap_data->width, bitmap_data->height);
Bitmap_SetDimensions(context, bitmap, bitmap_data->width, bitmap_data->height);
bitmap->Decompress(update->context, bitmap,
bitmap->Decompress(context, bitmap,
bitmap_data->bitmapDataStream, bitmap_data->width, bitmap_data->height,
bitmap_data->bitsPerPixel, bitmap_data->bitmapLength, bitmap_data->compressed);
if (reused)
bitmap->Free(update->context, bitmap);
bitmap->Free(context, bitmap);
else
reused = 1;
reused = true;
bitmap->New(update->context, bitmap);
bitmap->New(context, bitmap);
bitmap->Paint(update->context, bitmap);
bitmap->Paint(context, bitmap);
}
}
rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint8 id, uint16 index)
rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index)
{
rdpBitmap* bitmap;
@ -150,7 +150,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint8 id, uint16 index
return bitmap;
}
void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint8 id, uint16 index, rdpBitmap* bitmap)
void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index, rdpBitmap* bitmap)
{
if (id > bitmap_cache->maxCells)
{
@ -174,13 +174,15 @@ void bitmap_cache_register_callbacks(rdpUpdate* update)
{
rdpCache* cache = update->context->cache;
cache->bitmap->MemBlt = update->MemBlt;
cache->bitmap->Mem3Blt = update->Mem3Blt;
cache->bitmap->MemBlt = update->primary->MemBlt;
cache->bitmap->Mem3Blt = update->primary->Mem3Blt;
update->primary->MemBlt = update_gdi_memblt;
update->primary->Mem3Blt = update_gdi_mem3blt;
update->secondary->CacheBitmap = update_gdi_cache_bitmap;
update->secondary->CacheBitmapV2 = update_gdi_cache_bitmap_v2;
update->MemBlt = update_gdi_memblt;
update->Mem3Blt = update_gdi_mem3blt;
update->CacheBitmap = update_gdi_cache_bitmap;
update->CacheBitmapV2 = update_gdi_cache_bitmap_v2;
update->BitmapUpdate = update_gdi_bitmap_update;
}
@ -199,18 +201,18 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
bitmap_cache->maxCells = 5;
settings->bitmap_cache = False;
settings->bitmap_cache = false;
settings->bitmapCacheV2NumCells = 5;
settings->bitmapCacheV2CellInfo[0].numEntries = 600;
settings->bitmapCacheV2CellInfo[0].persistent = False;
settings->bitmapCacheV2CellInfo[0].persistent = false;
settings->bitmapCacheV2CellInfo[1].numEntries = 600;
settings->bitmapCacheV2CellInfo[1].persistent = False;
settings->bitmapCacheV2CellInfo[1].persistent = false;
settings->bitmapCacheV2CellInfo[2].numEntries = 2048;
settings->bitmapCacheV2CellInfo[2].persistent = False;
settings->bitmapCacheV2CellInfo[2].persistent = false;
settings->bitmapCacheV2CellInfo[3].numEntries = 4096;
settings->bitmapCacheV2CellInfo[3].persistent = False;
settings->bitmapCacheV2CellInfo[3].persistent = false;
settings->bitmapCacheV2CellInfo[4].numEntries = 2048;
settings->bitmapCacheV2CellInfo[4].persistent = False;
settings->bitmapCacheV2CellInfo[4].persistent = false;
bitmap_cache->cells = (BITMAP_V2_CELL*) xzalloc(sizeof(BITMAP_V2_CELL) * bitmap_cache->maxCells);

View File

@ -24,10 +24,10 @@
#include <freerdp/cache/brush.h>
void update_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
void update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
rdpBrush* brush = &patblt->brush;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
if (brush->style & CACHED_BRUSH)
{
@ -35,16 +35,16 @@ void update_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
brush->style = 0x03;
}
IFCALL(cache->brush->PatBlt, update, patblt);
IFCALL(cache->brush->PatBlt, context, patblt);
}
void update_gdi_cache_brush(rdpUpdate* update, CACHE_BRUSH_ORDER* cache_brush)
void update_gdi_cache_brush(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush)
{
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
brush_cache_put(cache->brush, cache_brush->index, cache_brush->data, cache_brush->bpp);
}
void* brush_cache_get(rdpBrushCache* brush, uint8 index, uint8* bpp)
void* brush_cache_get(rdpBrushCache* brush, uint32 index, uint32* bpp)
{
void* entry;
@ -80,7 +80,7 @@ void* brush_cache_get(rdpBrushCache* brush, uint8 index, uint8* bpp)
return entry;
}
void brush_cache_put(rdpBrushCache* brush, uint8 index, void* entry, uint8 bpp)
void brush_cache_put(rdpBrushCache* brush, uint32 index, void* entry, uint32 bpp)
{
if (bpp == 1)
{
@ -110,10 +110,10 @@ void brush_cache_register_callbacks(rdpUpdate* update)
{
rdpCache* cache = update->context->cache;
cache->brush->PatBlt = update->PatBlt;
cache->brush->PatBlt = update->primary->PatBlt;
update->PatBlt = update_gdi_patblt;
update->CacheBrush = update_gdi_cache_brush;
update->primary->PatBlt = update_gdi_patblt;
update->secondary->CacheBrush = update_gdi_cache_brush;
}
rdpBrushCache* brush_cache_new(rdpSettings* settings)

View File

@ -23,17 +23,17 @@
#include <freerdp/cache/glyph.h>
void update_process_glyph(rdpUpdate* update, uint8* data, int* index,
int* x, int* y, uint8 cacheId, uint8 ulCharInc, uint8 flAccel)
void update_process_glyph(rdpContext* context, uint8* data, int* index,
int* x, int* y, uint32 cacheId, uint32 ulCharInc, uint32 flAccel)
{
int offset;
rdpGlyph* glyph;
uint8 cacheIndex;
uint32 cacheIndex;
rdpGraphics* graphics;
rdpGlyphCache* glyph_cache;
graphics = update->context->graphics;
glyph_cache = update->context->cache->glyph;
graphics = context->graphics;
glyph_cache = context->cache->glyph;
cacheIndex = data[(*index)++];
@ -58,32 +58,32 @@ void update_process_glyph(rdpUpdate* update, uint8* data, int* index,
if (glyph != NULL)
{
Glyph_Draw(update->context, glyph, glyph->x + *x, glyph->y + *y);
Glyph_Draw(context, glyph, glyph->x + *x, glyph->y + *y);
if (flAccel & SO_CHAR_INC_EQUAL_BM_BASE)
*x += glyph->cx;
}
}
void update_process_glyph_fragments(rdpUpdate* update, uint8* data, uint8 length,
uint8 cacheId, uint8 ulCharInc, uint8 flAccel, uint32 bgcolor, uint32 fgcolor, int x, int y,
void update_process_glyph_fragments(rdpContext* context, uint8* data, uint32 length,
uint32 cacheId, uint32 ulCharInc, uint32 flAccel, uint32 bgcolor, uint32 fgcolor, int x, int y,
int bkX, int bkY, int bkWidth, int bkHeight, int opX, int opY, int opWidth, int opHeight)
{
int n;
uint8 id;
uint8 size;
uint32 id;
uint32 size;
int index = 0;
uint8* fragments;
rdpGraphics* graphics;
rdpGlyphCache* glyph_cache;
graphics = update->context->graphics;
glyph_cache = update->context->cache->glyph;
graphics = context->graphics;
glyph_cache = context->cache->glyph;
if (opWidth > 1)
Glyph_BeginDraw(update->context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
Glyph_BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
else
Glyph_BeginDraw(update->context, 0, 0, 0, 0, bgcolor, fgcolor);
Glyph_BeginDraw(context, 0, 0, 0, 0, bgcolor, fgcolor);
while (index < length)
{
@ -115,7 +115,7 @@ void update_process_glyph_fragments(rdpUpdate* update, uint8* data, uint8 length
for (n = 0; n < size; n++)
{
update_process_glyph(update, fragments, &n, &x, &y, cacheId, ulCharInc, flAccel);
update_process_glyph(context, fragments, &n, &x, &y, cacheId, ulCharInc, flAccel);
}
}
@ -154,32 +154,32 @@ void update_process_glyph_fragments(rdpUpdate* update, uint8* data, uint8 length
default:
printf("GLYPH_FRAGMENT_NOP\n");
update_process_glyph(update, data, &index, &x, &y, cacheId, ulCharInc, flAccel);
update_process_glyph(context, data, &index, &x, &y, cacheId, ulCharInc, flAccel);
index++;
break;
}
}
if (opWidth > 1)
Glyph_EndDraw(update->context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
Glyph_EndDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
else
Glyph_EndDraw(update->context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor);
Glyph_EndDraw(context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor);
}
void update_gdi_glyph_index(rdpUpdate* update, GLYPH_INDEX_ORDER* glyph_index)
void update_gdi_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index)
{
}
void update_gdi_fast_index(rdpUpdate* update, FAST_INDEX_ORDER* fast_index)
void update_gdi_fast_index(rdpContext* context, FAST_INDEX_ORDER* fast_index)
{
rdpGlyphCache* glyph_cache;
glyph_cache = update->context->cache->glyph;
glyph_cache = context->cache->glyph;
fast_index->x = fast_index->bkLeft;
update_process_glyph_fragments(update, fast_index->data, fast_index->cbData,
update_process_glyph_fragments(context, fast_index->data, fast_index->cbData,
fast_index->cacheId, fast_index->ulCharInc, fast_index->flAccel,
fast_index->backColor, fast_index->foreColor, fast_index->x, fast_index->y,
fast_index->bkLeft, fast_index->bkTop,
@ -188,18 +188,18 @@ void update_gdi_fast_index(rdpUpdate* update, FAST_INDEX_ORDER* fast_index)
fast_index->opRight - fast_index->opLeft, fast_index->opBottom - fast_index->opTop);
}
void update_gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
void update_gdi_cache_glyph(rdpContext* context, CACHE_GLYPH_ORDER* cache_glyph)
{
int i;
rdpGlyph* glyph;
GLYPH_DATA* glyph_data;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
for (i = 0; i < cache_glyph->cGlyphs; i++)
{
glyph_data = cache_glyph->glyphData[i];
glyph = Glyph_Alloc(update->context);
glyph = Glyph_Alloc(context);
glyph->x = glyph_data->x;
glyph->y = glyph_data->y;
@ -207,18 +207,18 @@ void update_gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
glyph->cy = glyph_data->cy;
glyph->aj = glyph_data->aj;
glyph->cb = glyph_data->cb;
Glyph_New(update->context, glyph);
Glyph_New(context, glyph);
glyph_cache_put(cache->glyph, cache_glyph->cacheId, glyph_data->cacheIndex, glyph);
}
}
void update_gdi_cache_glyph_v2(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
void update_gdi_cache_glyph_v2(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
{
}
rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint8 id, uint16 index)
rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint32 id, uint32 index)
{
rdpGlyph* glyph;
@ -244,7 +244,7 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint8 id, uint16 index)
return glyph;
}
void glyph_cache_put(rdpGlyphCache* glyph_cache, uint8 id, uint16 index, rdpGlyph* glyph)
void glyph_cache_put(rdpGlyphCache* glyph_cache, uint32 id, uint32 index, rdpGlyph* glyph)
{
rdpGlyph* prevGlyph;
@ -272,7 +272,7 @@ void glyph_cache_put(rdpGlyphCache* glyph_cache, uint8 id, uint16 index, rdpGlyp
glyph_cache->glyphCache[id].entries[index] = glyph;
}
void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, uint8 index, uint8* size)
void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, uint32 index, uint32* size)
{
void* fragment;
@ -287,7 +287,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, uint8 index, uint8* s
return fragment;
}
void glyph_cache_fragment_put(rdpGlyphCache* glyph_cache, uint8 index, uint8 size, void* fragment)
void glyph_cache_fragment_put(rdpGlyphCache* glyph_cache, uint32 index, uint32 size, void* fragment)
{
void* prevFragment;
@ -304,10 +304,10 @@ void glyph_cache_fragment_put(rdpGlyphCache* glyph_cache, uint8 index, uint8 siz
void glyph_cache_register_callbacks(rdpUpdate* update)
{
update->GlyphIndex = update_gdi_glyph_index;
update->FastIndex = update_gdi_fast_index;
update->CacheGlyph = update_gdi_cache_glyph;
update->CacheGlyphV2 = update_gdi_cache_glyph_v2;
update->primary->GlyphIndex = update_gdi_glyph_index;
update->primary->FastIndex = update_gdi_fast_index;
update->secondary->CacheGlyph = update_gdi_cache_glyph;
update->secondary->CacheGlyphV2 = update_gdi_cache_glyph_v2;
}
rdpGlyphCache* glyph_cache_new(rdpSettings* settings)

View File

@ -22,25 +22,25 @@
#include <freerdp/cache/offscreen.h>
void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
int i;
uint16 index;
rdpBitmap* bitmap;
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
bitmap = Bitmap_Alloc(update->context);
bitmap = Bitmap_Alloc(context);
bitmap->width = create_offscreen_bitmap->cx;
bitmap->height = create_offscreen_bitmap->cy;
bitmap->New(update->context, bitmap);
bitmap->New(context, bitmap);
offscreen_cache_delete(cache->offscreen, create_offscreen_bitmap->id);
offscreen_cache_put(cache->offscreen, create_offscreen_bitmap->id, bitmap);
if(cache->offscreen->currentSurface == create_offscreen_bitmap->id)
Bitmap_SetSurface(update->context, bitmap, False);
Bitmap_SetSurface(context, bitmap, false);
for (i = 0; i < create_offscreen_bitmap->deleteList.cIndices; i++)
{
@ -49,25 +49,25 @@ void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITM
}
}
void update_gdi_switch_surface(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface)
void update_gdi_switch_surface(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface)
{
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
if (switch_surface->bitmapId == SCREEN_BITMAP_SURFACE)
{
Bitmap_SetSurface(update->context, NULL, True);
Bitmap_SetSurface(context, NULL, true);
}
else
{
rdpBitmap* bitmap;
bitmap = offscreen_cache_get(cache->offscreen, switch_surface->bitmapId);
Bitmap_SetSurface(update->context, bitmap, False);
Bitmap_SetSurface(context, bitmap, false);
}
cache->offscreen->currentSurface = switch_surface->bitmapId;
}
rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint16 index)
rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint32 index)
{
rdpBitmap* bitmap;
@ -88,7 +88,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint16 index)
return bitmap;
}
void offscreen_cache_put(rdpOffscreenCache* offscreen, uint16 index, rdpBitmap* bitmap)
void offscreen_cache_put(rdpOffscreenCache* offscreen, uint32 index, rdpBitmap* bitmap)
{
if (index > offscreen->maxEntries)
{
@ -100,7 +100,7 @@ void offscreen_cache_put(rdpOffscreenCache* offscreen, uint16 index, rdpBitmap*
offscreen->entries[index] = bitmap;
}
void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint16 index)
void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint32 index)
{
rdpBitmap* prevBitmap;
@ -120,8 +120,8 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint16 index)
void offscreen_cache_register_callbacks(rdpUpdate* update)
{
update->CreateOffscreenBitmap = update_gdi_create_offscreen_bitmap;
update->SwitchSurface = update_gdi_switch_surface;
update->altsec->CreateOffscreenBitmap = update_gdi_create_offscreen_bitmap;
update->altsec->SwitchSurface = update_gdi_switch_surface;
}
rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings)

View File

@ -22,13 +22,13 @@
#include <freerdp/cache/palette.h>
void update_gdi_cache_color_table(rdpUpdate* update, CACHE_COLOR_TABLE_ORDER* cache_color_table)
void update_gdi_cache_color_table(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cache_color_table)
{
rdpCache* cache = update->context->cache;
rdpCache* cache = context->cache;
palette_cache_put(cache->palette, cache_color_table->cacheIndex, (void*) cache_color_table->colorTable);
}
void* palette_cache_get(rdpPaletteCache* palette_cache, uint8 index)
void* palette_cache_get(rdpPaletteCache* palette_cache, uint32 index)
{
void* entry;
@ -49,7 +49,7 @@ void* palette_cache_get(rdpPaletteCache* palette_cache, uint8 index)
return entry;
}
void palette_cache_put(rdpPaletteCache* palette_cache, uint8 index, void* entry)
void palette_cache_put(rdpPaletteCache* palette_cache, uint32 index, void* entry)
{
if (index > palette_cache->maxEntries)
{
@ -62,7 +62,7 @@ void palette_cache_put(rdpPaletteCache* palette_cache, uint8 index, void* entry)
void palette_cache_register_callbacks(rdpUpdate* update)
{
update->CacheColorTable = update_gdi_cache_color_table;
update->secondary->CacheColorTable = update_gdi_cache_color_table;
}
rdpPaletteCache* palette_cache_new(rdpSettings* settings)

View File

@ -22,27 +22,27 @@
#include <freerdp/cache/pointer.h>
void update_pointer_position(rdpUpdate* update, POINTER_POSITION_UPDATE* pointer_position)
void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position)
{
}
void update_pointer_system(rdpUpdate* update, POINTER_SYSTEM_UPDATE* pointer_system)
void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system)
{
}
void update_pointer_color(rdpUpdate* update, POINTER_COLOR_UPDATE* pointer_color)
void update_pointer_color(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color)
{
}
void update_pointer_new(rdpUpdate* update, POINTER_NEW_UPDATE* pointer_new)
void update_pointer_new(rdpContext* context, POINTER_NEW_UPDATE* pointer_new)
{
rdpPointer* pointer;
rdpCache* cache = (rdpCache*) update->context->cache;
rdpCache* cache = context->cache;
pointer = Pointer_Alloc(update->context);
pointer = Pointer_Alloc(context);
if (pointer != NULL)
{
@ -56,22 +56,22 @@ void update_pointer_new(rdpUpdate* update, POINTER_NEW_UPDATE* pointer_new)
pointer->xorMaskData = pointer_new->colorPtrAttr.xorMaskData;
pointer->andMaskData = pointer_new->colorPtrAttr.andMaskData;
pointer->New(update->context, pointer);
pointer->New(context, pointer);
pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer);
Pointer_Set(update->context, pointer);
Pointer_Set(context, pointer);
}
}
void update_pointer_cached(rdpUpdate* update, POINTER_CACHED_UPDATE* pointer_cached)
void update_pointer_cached(rdpContext* context, POINTER_CACHED_UPDATE* pointer_cached)
{
rdpPointer* pointer;
rdpCache* cache = (rdpCache*) update->context->cache;
rdpCache* cache = context->cache;
pointer = pointer_cache_get(cache->pointer, pointer_cached->cacheIndex);
Pointer_Set(update->context, pointer);
Pointer_Set(context, pointer);
}
rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint16 index)
rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint32 index)
{
rdpPointer* pointer;
@ -86,7 +86,7 @@ rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint16 index)
return pointer;
}
void pointer_cache_put(rdpPointerCache* pointer_cache, uint16 index, rdpPointer* pointer)
void pointer_cache_put(rdpPointerCache* pointer_cache, uint32 index, rdpPointer* pointer)
{
if (index >= pointer_cache->cacheSize)
{
@ -99,11 +99,13 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, uint16 index, rdpPointer*
void pointer_cache_register_callbacks(rdpUpdate* update)
{
update->PointerPosition = update_pointer_position;
update->PointerSystem = update_pointer_system;
update->PointerColor = update_pointer_color;
update->PointerNew = update_pointer_new;
update->PointerCached = update_pointer_cached;
rdpPointerUpdate* pointer = update->pointer;
pointer->PointerPosition = update_pointer_position;
pointer->PointerSystem = update_pointer_system;
pointer->PointerColor = update_pointer_color;
pointer->PointerNew = update_pointer_new;
pointer->PointerCached = update_pointer_cached;
}
rdpPointerCache* pointer_cache_new(rdpSettings* settings)

View File

@ -859,7 +859,7 @@ boolean freerdp_channels_get_fds(rdpChannels* chan_man, freerdp* instance, void*
int* read_count, void** write_fds, int* write_count)
{
wait_obj_get_fds(chan_man->signal, read_fds, read_count);
return True;
return true;
}
/**
@ -873,7 +873,7 @@ boolean freerdp_channels_check_fds(rdpChannels * chan_man, freerdp* instance)
freerdp_channels_process_sync(chan_man, instance);
}
return True;
return true;
}
RDP_EVENT* freerdp_channels_pop_event(rdpChannels* chan_man)

View File

@ -372,7 +372,7 @@ static boolean bitmap_decompress4(uint8* srcData, uint8* dstData, int width, int
code = IN_UINT8_MV(srcData);
RLE = code & 0x10;
if (RLE == 0)
return False;
return false;
total_pro = 1;
NA = code & 0x20;
if (NA == 0)
@ -389,7 +389,7 @@ static boolean bitmap_decompress4(uint8* srcData, uint8* dstData, int width, int
srcData += bytes_pro;
bytes_pro = process_plane(srcData, width, height, dstData + 0, size - total_pro);
total_pro += bytes_pro;
return (size == total_pro) ? True : False;
return (size == total_pro) ? true : false;
}
/**
@ -426,7 +426,7 @@ boolean bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height,
else if (srcBpp == 32 && dstBpp == 32)
{
if (!bitmap_decompress4(srcData, dstData, width, height, size))
return False;
return false;
}
else if (srcBpp == 15 && dstBpp == 15)
{
@ -451,8 +451,8 @@ boolean bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height,
}
else
{
return False;
return false;
}
return True;
return true;
}

View File

@ -260,8 +260,8 @@ void RLEDECOMPRESS(uint8* pbSrcBuffer, uint32 cbSrcBuffer, uint8* pbDestBuffer,
PIXEL temp;
PIXEL fgPel = WHITE_PIXEL;
boolean fInsertFgPel = False;
boolean fFirstLine = True;
boolean fInsertFgPel = false;
boolean fFirstLine = true;
uint8 bitmask;
PIXEL pixelA, pixelB;
@ -280,8 +280,8 @@ void RLEDECOMPRESS(uint8* pbSrcBuffer, uint32 cbSrcBuffer, uint8* pbDestBuffer,
{
if ((uint32)(pbDest - pbDestBuffer) >= rowDelta)
{
fFirstLine = False;
fInsertFgPel = False;
fFirstLine = false;
fInsertFgPel = false;
}
}
@ -344,13 +344,13 @@ void RLEDECOMPRESS(uint8* pbSrcBuffer, uint32 cbSrcBuffer, uint8* pbDestBuffer,
}
}
/* A follow-on background run order will need a foreground pel inserted. */
fInsertFgPel = True;
fInsertFgPel = true;
continue;
}
/* For any of the other run-types a follow-on background run
order does not need a foreground pel inserted. */
fInsertFgPel = False;
fInsertFgPel = false;
switch (code)
{

View File

@ -212,7 +212,7 @@ void rfx_context_set_pixel_format(RFX_CONTEXT* context, RFX_PIXEL_FORMAT pixel_f
void rfx_context_reset(RFX_CONTEXT* context)
{
context->header_processed = False;
context->header_processed = false;
context->frame_idx = 0;
}
@ -681,7 +681,7 @@ void rfx_compose_message_header(RFX_CONTEXT* context, STREAM* s)
rfx_compose_message_codec_versions(context, s);
rfx_compose_message_channels(context, s);
context->header_processed = True;
context->header_processed = true;
}
static void rfx_compose_message_frame_begin(RFX_CONTEXT* context, STREAM* s)

View File

@ -113,7 +113,7 @@ rfx_quantization_decode_NEON(sint16 * buffer, const uint32 * quantization_values
rfx_quantization_decode_block_NEON(buffer + 3584, 256, quantization_values[6]); /* HH2 */
rfx_quantization_decode_block_NEON(buffer + 3840, 64, quantization_values[2]); /* HL3 */
rfx_quantization_decode_block_NEON(buffer + 3904, 64, quantization_values[1]); /* LH3 */
rfx_quantization_decode_block_NEON(buffer + 3868, 64, quantization_values[3]); /* HH3 */
rfx_quantization_decode_block_NEON(buffer + 3968, 64, quantization_values[3]); /* HH3 */
rfx_quantization_decode_block_NEON(buffer + 4032, 64, quantization_values[0]); /* LL3 */
}

View File

@ -288,7 +288,7 @@ static void rfx_quantization_encode_sse2(sint16* buffer, const uint32* quantizat
rfx_quantization_encode_block_sse2(buffer + 3584, 256, quantization_values[6] - 6); /* HH2 */
rfx_quantization_encode_block_sse2(buffer + 3840, 64, quantization_values[2] - 6); /* HL3 */
rfx_quantization_encode_block_sse2(buffer + 3904, 64, quantization_values[1] - 6); /* LH3 */
rfx_quantization_encode_block_sse2(buffer + 3868, 64, quantization_values[3] - 6); /* HH3 */
rfx_quantization_encode_block_sse2(buffer + 3968, 64, quantization_values[3] - 6); /* HH3 */
rfx_quantization_encode_block_sse2(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */
rfx_quantization_encode_block_sse2(buffer, 4096, 5);

View File

@ -36,7 +36,7 @@ void rdp_write_synchronize_pdu(STREAM* s, rdpSettings* settings)
boolean rdp_recv_server_synchronize_pdu(rdpRdp* rdp, STREAM* s)
{
return True;
return true;
}
boolean rdp_send_server_synchronize_pdu(rdpRdp* rdp)
@ -49,7 +49,7 @@ boolean rdp_send_server_synchronize_pdu(rdpRdp* rdp)
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SYNCHRONIZE, rdp->mcs->user_id);
return True;
return true;
}
boolean rdp_recv_client_synchronize_pdu(STREAM* s)
@ -57,14 +57,14 @@ boolean rdp_recv_client_synchronize_pdu(STREAM* s)
uint16 messageType;
if (stream_get_left(s) < 4)
return False;
return false;
stream_read_uint16(s, messageType); /* messageType (2 bytes) */
if (messageType != SYNCMSGTYPE_SYNC)
return False;
return false;
/* targetUser (2 bytes) */
return True;
return true;
}
boolean rdp_send_client_synchronize_pdu(rdpRdp* rdp)
@ -81,13 +81,13 @@ boolean rdp_send_client_synchronize_pdu(rdpRdp* rdp)
boolean rdp_recv_control_pdu(STREAM* s, uint16* action)
{
if (stream_get_left(s) < 8)
return False;
return false;
stream_read_uint16(s, *action); /* action (2 bytes) */
stream_seek_uint16(s); /* grantId (2 bytes) */
stream_seek_uint32(s); /* controlId (4 bytes) */
return True;
return true;
}
void rdp_write_client_control_pdu(STREAM* s, uint16 action)
@ -103,7 +103,7 @@ boolean rdp_recv_server_control_pdu(rdpRdp* rdp, STREAM* s)
rdp_recv_control_pdu(s, &action);
return True;
return true;
}
boolean rdp_send_server_control_cooperate_pdu(rdpRdp* rdp)
@ -118,7 +118,7 @@ boolean rdp_send_server_control_cooperate_pdu(rdpRdp* rdp)
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id);
return True;
return true;
}
boolean rdp_send_server_control_granted_pdu(rdpRdp* rdp)
@ -133,7 +133,7 @@ boolean rdp_send_server_control_granted_pdu(rdpRdp* rdp)
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id);
return True;
return true;
}
boolean rdp_send_client_control_pdu(rdpRdp* rdp, uint16 action)
@ -186,9 +186,9 @@ boolean rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp)
boolean rdp_recv_client_font_list_pdu(STREAM* s)
{
if (stream_get_left(s) < 8)
return False;
return false;
return True;
return true;
}
void rdp_write_client_font_list_pdu(STREAM* s, uint16 flags)
@ -212,7 +212,7 @@ boolean rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags)
boolean rdp_recv_server_font_map_pdu(rdpRdp* rdp, STREAM* s)
{
return True;
return true;
}
boolean rdp_send_server_font_map_pdu(rdpRdp* rdp)
@ -242,10 +242,10 @@ boolean rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s)
while (rdp->state != CONNECTION_STATE_ACTIVE)
{
if (rdp_check_fds(rdp) < 0)
return False;
return false;
}
return True;
return true;
}
boolean rdp_send_deactivate_all(rdpRdp* rdp)
@ -266,22 +266,22 @@ boolean rdp_server_accept_client_control_pdu(rdpRdp* rdp, STREAM* s)
uint16 action;
if (!rdp_recv_control_pdu(s, &action))
return False;
return false;
if (action == CTRLACTION_REQUEST_CONTROL)
{
if (!rdp_send_server_control_granted_pdu(rdp))
return False;
return false;
}
return True;
return true;
}
boolean rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, STREAM* s)
{
if (!rdp_recv_client_font_list_pdu(s))
return False;
return false;
if (!rdp_send_server_font_map_pdu(rdp))
return False;
return false;
return True;
return true;
}

View File

@ -91,16 +91,16 @@ boolean ber_read_universal_tag(STREAM* s, uint8 tag, boolean pc)
stream_read_uint8(s, byte);
if (byte != (BER_CLASS_UNIV | BER_PC(pc) | (BER_TAG_MASK & tag)))
return False;
return false;
return True;
return true;
}
/**
* Write BER Universal tag.
* @param s stream
* @param tag BER universally-defined tag
* @param pc primitive (False) or constructed (True)
* @param pc primitive (false) or constructed (true)
*/
void ber_write_universal_tag(STREAM* s, uint8 tag, boolean pc)
@ -124,12 +124,12 @@ boolean ber_read_application_tag(STREAM* s, uint8 tag, int* length)
stream_read_uint8(s, byte);
if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | BER_TAG_MASK))
return False;
return false;
stream_read_uint8(s, byte);
if (byte != tag)
return False;
return false;
ber_read_length(s, length);
}
@ -138,12 +138,12 @@ boolean ber_read_application_tag(STREAM* s, uint8 tag, int* length)
stream_read_uint8(s, byte);
if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | (BER_TAG_MASK & tag)))
return False;
return false;
ber_read_length(s, length);
}
return True;
return true;
}
/**
@ -177,12 +177,12 @@ boolean ber_read_contextual_tag(STREAM* s, uint8 tag, int* length, boolean pc)
if (byte != ((BER_CLASS_CTXT | BER_PC(pc)) | (BER_TAG_MASK & tag)))
{
stream_rewind(s, 1);
return False;
return false;
}
ber_read_length(s, length);
return True;
return true;
}
int ber_write_contextual_tag(STREAM* s, uint8 tag, int length, boolean pc)
@ -203,11 +203,11 @@ boolean ber_read_sequence_tag(STREAM* s, int* length)
stream_read_uint8(s, byte);
if (byte != ((BER_CLASS_UNIV | BER_CONSTRUCT) | (BER_TAG_SEQUENCE_OF)))
return False;
return false;
ber_read_length(s, length);
return True;
return true;
}
/**
@ -236,43 +236,43 @@ boolean ber_read_enumerated(STREAM* s, uint8* enumerated, uint8 count)
{
int length;
ber_read_universal_tag(s, BER_TAG_ENUMERATED, False);
ber_read_universal_tag(s, BER_TAG_ENUMERATED, false);
ber_read_length(s, &length);
if (length == 1)
stream_read_uint8(s, *enumerated);
else
return False;
return false;
/* check that enumerated value falls within expected range */
if (*enumerated + 1 > count)
return False;
return false;
return True;
return true;
}
void ber_write_enumerated(STREAM* s, uint8 enumerated, uint8 count)
{
ber_write_universal_tag(s, BER_TAG_ENUMERATED, False);
ber_write_universal_tag(s, BER_TAG_ENUMERATED, false);
ber_write_length(s, 1);
stream_write_uint8(s, enumerated);
}
boolean ber_read_bit_string(STREAM* s, int* length, uint8* padding)
{
ber_read_universal_tag(s, BER_TAG_BIT_STRING, False);
ber_read_universal_tag(s, BER_TAG_BIT_STRING, false);
ber_read_length(s, length);
stream_read_uint8(s, *padding);
return True;
return true;
}
boolean ber_read_octet_string(STREAM* s, int* length)
{
ber_read_universal_tag(s, BER_TAG_OCTET_STRING, False);
ber_read_universal_tag(s, BER_TAG_OCTET_STRING, false);
ber_read_length(s, length);
return True;
return true;
}
/**
@ -284,14 +284,14 @@ boolean ber_read_octet_string(STREAM* s, int* length)
void ber_write_octet_string(STREAM* s, uint8* oct_str, int length)
{
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, False);
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, false);
ber_write_length(s, length);
stream_write(s, oct_str, length);
}
int ber_write_octet_string_tag(STREAM* s, int length)
{
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, False);
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, false);
ber_write_length(s, length);
return 1 + _ber_skip_length(length);
}
@ -312,14 +312,14 @@ boolean ber_read_boolean(STREAM* s, boolean* value)
int length;
uint8 v;
if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, False))
return False;
if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, false))
return false;
ber_read_length(s, &length);
if (length != 1)
return False;
return false;
stream_read_uint8(s, v);
*value = (v ? True : False);
return True;
*value = (v ? true : false);
return true;
}
/**
@ -330,22 +330,22 @@ boolean ber_read_boolean(STREAM* s, boolean* value)
void ber_write_boolean(STREAM* s, boolean value)
{
ber_write_universal_tag(s, BER_TAG_BOOLEAN, False);
ber_write_universal_tag(s, BER_TAG_BOOLEAN, false);
ber_write_length(s, 1);
stream_write_uint8(s, (value == True) ? 0xFF : 0);
stream_write_uint8(s, (value == true) ? 0xFF : 0);
}
boolean ber_read_integer(STREAM* s, uint32* value)
{
int length;
ber_read_universal_tag(s, BER_TAG_INTEGER, False);
ber_read_universal_tag(s, BER_TAG_INTEGER, false);
ber_read_length(s, &length);
if (value == NULL)
{
stream_seek(s, length);
return True;
return true;
}
if (length == 1)
@ -362,9 +362,9 @@ boolean ber_read_integer(STREAM* s, uint32* value)
else if (length == 4)
stream_read_uint32_be(s, *value);
else
return False;
return false;
return True;
return true;
}
/**
@ -375,7 +375,7 @@ boolean ber_read_integer(STREAM* s, uint32* value)
int ber_write_integer(STREAM* s, uint32 value)
{
ber_write_universal_tag(s, BER_TAG_INTEGER, False);
ber_write_universal_tag(s, BER_TAG_INTEGER, false);
if (value <= 0xFF)
{
@ -419,7 +419,7 @@ int ber_skip_integer(uint32 value)
boolean ber_read_integer_length(STREAM* s, int* length)
{
ber_read_universal_tag(s, BER_TAG_INTEGER, False);
ber_read_universal_tag(s, BER_TAG_INTEGER, false);
ber_read_length(s, length);
return True;
return true;
}

View File

@ -117,11 +117,11 @@ void rdp_read_general_capability_set(STREAM* s, uint16 length, rdpSettings* sett
stream_read_uint8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */
stream_read_uint8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */
if (refreshRectSupport == False)
settings->refresh_rect = False;
if (refreshRectSupport == false)
settings->refresh_rect = false;
if (suppressOutputSupport == False)
settings->suppress_output = False;
if (suppressOutputSupport == false)
settings->suppress_output = false;
}
/**
@ -149,8 +149,8 @@ void rdp_write_general_capability_set(STREAM* s, rdpSettings* settings)
if (settings->server_mode)
{
/* not yet supported server-side */
settings->refresh_rect = False;
settings->suppress_output = False;
settings->refresh_rect = false;
settings->suppress_output = false;
}
stream_write_uint16(s, 0); /* osMajorType (2 bytes) */
@ -203,8 +203,8 @@ void rdp_read_bitmap_capability_set(STREAM* s, uint16 length, rdpSettings* setti
settings->color_depth = preferredBitsPerPixel;
}
if (desktopResizeFlag == False)
settings->desktop_resize = False;
if (desktopResizeFlag == false)
settings->desktop_resize = false;
if (!settings->server_mode && settings->desktop_resize)
{
@ -290,8 +290,8 @@ void rdp_read_order_capability_set(STREAM* s, uint16 length, rdpSettings* settin
for (i = 0; i < 32; i++)
{
if (orderSupport[i] == False)
settings->order_support[i] = False;
if (orderSupport[i] == false)
settings->order_support[i] = false;
}
}
@ -494,8 +494,8 @@ void rdp_read_pointer_capability_set(STREAM* s, uint16 length, rdpSettings* sett
stream_read_uint16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */
stream_read_uint16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */
if (colorPointerFlag == False)
settings->color_pointer = False;
if (colorPointerFlag == false)
settings->color_pointer = false;
}
/**
@ -512,7 +512,7 @@ void rdp_write_pointer_capability_set(STREAM* s, rdpSettings* settings)
header = rdp_capability_set_start(s);
colorPointerFlag = (settings->color_pointer) ? True : False;
colorPointerFlag = (settings->color_pointer) ? true : false;
stream_write_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
stream_write_uint16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */
@ -603,7 +603,7 @@ void rdp_read_sound_capability_set(STREAM* s, uint16 length, rdpSettings* settin
stream_read_uint16(s, soundFlags); /* soundFlags (2 bytes) */
stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
settings->sound_beeps = (soundFlags & SOUND_BEEPS_FLAG) ? True : False;
settings->sound_beeps = (soundFlags & SOUND_BEEPS_FLAG) ? true : false;
}
/**
@ -662,7 +662,7 @@ void rdp_read_input_capability_set(STREAM* s, uint16 length, rdpSettings* settin
if (!settings->server_mode &&
(inputFlags & INPUT_FLAG_FASTPATH_INPUT) == 0 && (inputFlags & INPUT_FLAG_FASTPATH_INPUT2) == 0)
{
settings->fastpath_input = False;
settings->fastpath_input = false;
}
}
@ -851,8 +851,8 @@ void rdp_read_offscreen_bitmap_cache_capability_set(STREAM* s, uint16 length, rd
stream_read_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
stream_read_uint16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
if (offscreenSupportLevel & True)
settings->offscreen_bitmap_cache = True;
if (offscreenSupportLevel & true)
settings->offscreen_bitmap_cache = true;
}
/**
@ -870,7 +870,7 @@ void rdp_write_offscreen_bitmap_cache_capability_set(STREAM* s, rdpSettings* set
header = rdp_capability_set_start(s);
if (settings->offscreen_bitmap_cache)
offscreenSupportLevel = True;
offscreenSupportLevel = true;
stream_read_uint32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */
stream_write_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
@ -895,7 +895,7 @@ void rdp_read_bitmap_cache_host_support_capability_set(STREAM* s, uint16 length,
stream_seek_uint16(s); /* pad2 (2 bytes) */
if (cacheVersion & BITMAP_CACHE_V2)
settings->persistent_bitmap_cache = True;
settings->persistent_bitmap_cache = true;
}
/**
@ -1002,7 +1002,7 @@ void rdp_read_virtual_channel_capability_set(STREAM* s, uint16 length, rdpSettin
else
VCChunkSize = 1600;
if (settings->server_mode != True)
if (settings->server_mode != true)
settings->vc_chunk_size = VCChunkSize;
}
@ -1042,7 +1042,7 @@ void rdp_read_draw_nine_grid_cache_capability_set(STREAM* s, uint16 length, rdpS
if ((drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED) ||
(drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED_V2))
settings->draw_nine_grid = True;
settings->draw_nine_grid = true;
}
/**
@ -1112,10 +1112,10 @@ void rdp_read_draw_gdiplus_cache_capability_set(STREAM* s, uint16 length, rdpSet
stream_seek(s, 6); /* GdipImageCacheProperties (6 bytes) */
if (drawGDIPlusSupportLevel & DRAW_GDIPLUS_SUPPORTED)
settings->draw_gdi_plus = True;
settings->draw_gdi_plus = true;
if (drawGdiplusCacheLevel & DRAW_GDIPLUS_CACHE_LEVEL_ONE)
settings->draw_gdi_plus_cache = True;
settings->draw_gdi_plus_cache = true;
}
/**
@ -1161,10 +1161,10 @@ void rdp_read_remote_programs_capability_set(STREAM* s, uint16 length, rdpSettin
if ((railSupportLevel & RAIL_LEVEL_SUPPORTED) == 0)
{
if (settings->remote_app == True)
if (settings->remote_app == true)
{
/* RemoteApp Failure! */
settings->remote_app = False;
settings->remote_app = false;
}
}
}
@ -1338,7 +1338,7 @@ void rdp_read_surface_commands_capability_set(STREAM* s, uint16 length, rdpSetti
stream_seek_uint32(s); /* cmdFlags (4 bytes) */
stream_seek_uint32(s); /* reserved (4 bytes) */
settings->surface_commands = True;
settings->surface_commands = true;
}
/**
@ -1381,8 +1381,8 @@ void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings
if (settings->server_mode)
{
settings->rfx_codec = False;
settings->ns_codec = False;
settings->rfx_codec = false;
settings->ns_codec = false;
}
while (bitmapCodecCount > 0)
@ -1391,13 +1391,13 @@ void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings
{
stream_seek(s, 16); /* codecGUID (16 bytes) */
stream_read_uint8(s, settings->rfx_codec_id);
settings->rfx_codec = True;
settings->rfx_codec = true;
}
else if (settings->server_mode && strncmp((char*)stream_get_tail(s),CODEC_GUID_NSCODEC, 16) == 0)
{
stream_seek(s, 16); /*codec GUID (16 bytes) */
stream_read_uint8(s, settings->ns_codec_id);
settings->ns_codec = True;
settings->ns_codec = true;
}
else
{
@ -1592,13 +1592,13 @@ boolean rdp_read_capability_sets(STREAM* s, rdpSettings* settings, uint16 number
rdp_read_capability_set_header(s, &length, &type);
//printf("%s Capability Set (0x%02X), length:%d\n", CAPSET_TYPE_STRINGS[type], type, length);
settings->received_caps[type] = True;
settings->received_caps[type] = true;
em = bm + length;
if (stream_get_left(s) < length - 4)
{
printf("error processing stream\n");
return False;
return false;
}
switch (type)
@ -1730,7 +1730,7 @@ boolean rdp_read_capability_sets(STREAM* s, rdpSettings* settings, uint16 number
numberCapabilities--;
}
return True;
return true;
}
boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
@ -1739,13 +1739,14 @@ boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
uint16 channelId;
uint16 pduType;
uint16 pduLength;
uint16 pduSource;
uint16 numberCapabilities;
uint16 lengthSourceDescriptor;
uint16 lengthCombinedCapabilities;
uint32 securityHeader;
if (!rdp_read_header(rdp, s, &length, &channelId))
return False;
return false;
if (rdp->settings->encryption)
{
@ -1753,14 +1754,14 @@ boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
if (securityHeader & SEC_SECURE_CHECKSUM)
{
printf("Error: TODO\n");
return False;
return false;
}
if (securityHeader & SEC_ENCRYPT)
{
if (!rdp_decrypt(rdp, s, length - 4))
{
printf("rdp_decrypt failed\n");
return False;
return false;
}
}
}
@ -1768,19 +1769,21 @@ boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
if (channelId != MCS_GLOBAL_CHANNEL_ID)
{
printf("channelId bad\n");
return False;
return false;
}
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &rdp->settings->pdu_source))
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
{
printf("rdp_read_share_control_header failed\n");
return False;
return false;
}
rdp->settings->pdu_source = pduSource;
if (pduType != PDU_TYPE_DEMAND_ACTIVE)
{
printf("pduType bad\n");
return False;
return false;
}
stream_read_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
@ -1794,12 +1797,12 @@ boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities))
{
printf("rdp_read_capability_sets failed\n");
return False;
return false;
}
rdp->update->glyph_v2 = (rdp->settings->glyphSupportLevel > GLYPH_SUPPORT_FULL) ? True : False;
rdp->update->secondary->glyph_v2 = (rdp->settings->glyphSupportLevel > GLYPH_SUPPORT_FULL) ? true : false;
return True;
return true;
}
void rdp_write_demand_active(STREAM* s, rdpSettings* settings)
@ -1861,7 +1864,7 @@ boolean rdp_send_demand_active(rdpRdp* rdp)
rdp_send_pdu(rdp, s, PDU_TYPE_DEMAND_ACTIVE, rdp->mcs->user_id);
return True;
return true;
}
boolean rdp_recv_confirm_active(rdpRdp* rdp, STREAM* s)
@ -1870,19 +1873,23 @@ boolean rdp_recv_confirm_active(rdpRdp* rdp, STREAM* s)
uint16 channelId;
uint16 pduType;
uint16 pduLength;
uint16 pduSource;
uint16 lengthSourceDescriptor;
uint16 lengthCombinedCapabilities;
uint16 numberCapabilities;
if (!rdp_read_header(rdp, s, &length, &channelId))
return False;
return false;
if (channelId != MCS_GLOBAL_CHANNEL_ID)
return False;
return false;
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
return false;
rdp->settings->pdu_source = pduSource;
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &rdp->settings->pdu_source))
return False;
if (pduType != PDU_TYPE_CONFIRM_ACTIVE)
return False;
return false;
stream_seek_uint32(s); /* shareId (4 bytes) */
stream_seek_uint16(s); /* originatorId (2 bytes) */
@ -1893,9 +1900,9 @@ boolean rdp_recv_confirm_active(rdpRdp* rdp, STREAM* s)
stream_seek(s, 2); /* pad2Octets (2 bytes) */
if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities))
return False;
return false;
return True;
return true;
}
void rdp_write_confirm_active(STREAM* s, rdpSettings* settings)

View File

@ -130,7 +130,7 @@ void certificate_read_x509_certificate(rdpCertBlob* cert, rdpCertInfo* info)
ber_read_sequence_tag(s, &length); /* TBSCertificate (SEQUENCE) */
/* Explicit Contextual Tag [0] */
ber_read_contextual_tag(s, 0, &length, True);
ber_read_contextual_tag(s, 0, &length, true);
ber_read_integer(s, &version); /* version (INTEGER) */
version++;
@ -242,7 +242,7 @@ static boolean certificate_process_server_public_key(rdpCertificate* certificate
if (memcmp(magic, "RSA1", 4) != 0)
{
printf("gcc_process_server_public_key: magic error\n");
return False;
return false;
}
stream_seek(s, 4);
@ -256,13 +256,13 @@ static boolean certificate_process_server_public_key(rdpCertificate* certificate
memcpy(certificate->cert_info.modulus.data, s->p, modlen);
stream_seek(s, keylen);
return True;
return true;
}
static boolean certificate_process_server_public_signature(rdpCertificate* certificate, STREAM* s, uint32 length)
{
stream_seek(s, length);
return True;
return true;
}
/**
@ -285,34 +285,34 @@ boolean certificate_read_server_proprietary_certificate(rdpCertificate* certific
if (!(dwSigAlgId == 1 && dwKeyAlgId == 1))
{
printf("certificate_read_server_proprietary_certificate: parse error 1\n");
return False;
return false;
}
stream_read_uint16(s, wPublicKeyBlobType);
if (wPublicKeyBlobType != BB_RSA_KEY_BLOB)
{
printf("certificate_read_server_proprietary_certificate: parse error 2\n");
return False;
return false;
}
stream_read_uint16(s, wPublicKeyBlobLen);
if (!certificate_process_server_public_key(certificate, s, wPublicKeyBlobLen))
{
printf("certificate_read_server_proprietary_certificate: parse error 3\n");
return False;
return false;
}
stream_read_uint16(s, wSignatureBlobType);
if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB)
{
printf("certificate_read_server_proprietary_certificate: parse error 4\n");
return False;
return false;
}
stream_read_uint16(s, wSignatureBlobLen);
if (!certificate_process_server_public_signature(certificate, s, wSignatureBlobLen))
{
printf("certificate_read_server_proprietary_certificate: parse error 5\n");
return False;
return false;
}
return True;
return true;
}
/**
@ -358,7 +358,7 @@ boolean certificate_read_server_x509_certificate_chain(rdpCertificate* certifica
}
}
return True;
return true;
}
/**
@ -379,7 +379,7 @@ boolean certificate_read_server_certificate(rdpCertificate* certificate, uint8*
if (length < 1)
{
printf("null server certificate\n");
return False;
return false;
}
stream_read_uint32(s, dwVersion); /* dwVersion (4 bytes) */
@ -400,7 +400,7 @@ boolean certificate_read_server_certificate(rdpCertificate* certificate, uint8*
}
xfree(s);
return True;
return true;
}
/**

View File

@ -48,7 +48,7 @@ boolean freerdp_channel_send(freerdp* instance, uint16 channel_id, uint8* data,
if (channel == NULL)
{
printf("freerdp_channel_send: unknown channel_id %d\n", channel_id);
return False;
return false;
}
flags = CHANNEL_FLAG_FIRST;
@ -83,7 +83,7 @@ boolean freerdp_channel_send(freerdp* instance, uint16 channel_id, uint8* data,
flags = 0;
}
return True;
return true;
}
void freerdp_channel_process(freerdp* instance, STREAM* s, uint16 channel_id)

View File

@ -70,13 +70,13 @@ boolean rdp_client_connect(rdpRdp* rdp)
nego_enable_nla(rdp->nego, rdp->settings->nla_security);
nego_enable_tls(rdp->nego, rdp->settings->tls_security);
if (nego_connect(rdp->nego) != True)
if (nego_connect(rdp->nego) != true)
{
printf("Error: protocol security negotiation failure\n");
return False;
return false;
}
status = False;
status = false;
if (rdp->nego->selected_protocol & PROTOCOL_NLA)
status = transport_connect_nla(rdp->transport);
else if (rdp->nego->selected_protocol & PROTOCOL_TLS)
@ -84,25 +84,25 @@ boolean rdp_client_connect(rdpRdp* rdp)
else if (rdp->nego->selected_protocol == PROTOCOL_RDP) /* 0 */
status = transport_connect_rdp(rdp->transport);
if (status != True)
return False;
if (status != true)
return false;
rdp_set_blocking_mode(rdp, False);
rdp_set_blocking_mode(rdp, false);
rdp->state = CONNECTION_STATE_NEGO;
if (mcs_send_connect_initial(rdp->mcs) != True)
if (mcs_send_connect_initial(rdp->mcs) != true)
{
printf("Error: unable to send MCS Connect Initial\n");
return False;
return false;
}
while (rdp->state != CONNECTION_STATE_ACTIVE)
{
if (rdp_check_fds(rdp) < 0)
return False;
return false;
}
return True;
return true;
}
boolean rdp_client_disconnect(rdpRdp* rdp)
@ -156,10 +156,10 @@ static boolean rdp_establish_keys(rdpRdp* rdp)
uint32 length;
STREAM* s;
if (rdp->settings->encryption == False)
if (rdp->settings->encryption == false)
{
/* no RDP encryption */
return True;
return true;
}
/* encrypt client random */
@ -189,16 +189,16 @@ static boolean rdp_establish_keys(rdpRdp* rdp)
stream_seek(s, length);
if (transport_write(rdp->mcs->transport, s) < 0)
{
return False;
return false;
}
/* now calculate encrypt / decrypt and update keys */
if (!security_establish_keys(client_random, rdp))
{
return False;
return false;
}
rdp->do_crypt = True;
rdp->do_crypt = true;
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
{
@ -207,13 +207,13 @@ static boolean rdp_establish_keys(rdpRdp* rdp)
rdp->fips_decrypt = crypto_des3_decrypt_init(rdp->fips_decrypt_key, fips_ivec);
rdp->fips_hmac = crypto_hmac_new();
return True;
return true;
}
rdp->rc4_decrypt_key = crypto_rc4_init(rdp->decrypt_key, rdp->rc4_key_len);
rdp->rc4_encrypt_key = crypto_rc4_init(rdp->encrypt_key, rdp->rc4_key_len);
return True;
return true;
}
boolean rdp_client_connect_mcs_connect_response(rdpRdp* rdp, STREAM* s)
@ -221,61 +221,61 @@ boolean rdp_client_connect_mcs_connect_response(rdpRdp* rdp, STREAM* s)
if (!mcs_recv_connect_response(rdp->mcs, s))
{
printf("rdp_client_connect_mcs_connect_response: mcs_recv_connect_response failed\n");
return False;
return false;
}
if (!mcs_send_erect_domain_request(rdp->mcs))
return False;
return false;
if (!mcs_send_attach_user_request(rdp->mcs))
return False;
return false;
rdp->state = CONNECTION_STATE_MCS_ATTACH_USER;
return True;
return true;
}
boolean rdp_client_connect_mcs_attach_user_confirm(rdpRdp* rdp, STREAM* s)
{
if (!mcs_recv_attach_user_confirm(rdp->mcs, s))
return False;
return false;
if (!mcs_send_channel_join_request(rdp->mcs, rdp->mcs->user_id))
return False;
return false;
rdp->state = CONNECTION_STATE_MCS_CHANNEL_JOIN;
return True;
return true;
}
boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
{
int i;
uint16 channel_id;
boolean all_joined = True;
boolean all_joined = true;
if (!mcs_recv_channel_join_confirm(rdp->mcs, s, &channel_id))
return False;
return false;
if (!rdp->mcs->user_channel_joined)
{
if (channel_id != rdp->mcs->user_id)
return False;
rdp->mcs->user_channel_joined = True;
return false;
rdp->mcs->user_channel_joined = true;
if (!mcs_send_channel_join_request(rdp->mcs, MCS_GLOBAL_CHANNEL_ID))
return False;
return false;
}
else if (!rdp->mcs->global_channel_joined)
{
if (channel_id != MCS_GLOBAL_CHANNEL_ID)
return False;
rdp->mcs->global_channel_joined = True;
return false;
rdp->mcs->global_channel_joined = true;
if (rdp->settings->num_channels > 0)
{
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[0].channel_id))
return False;
return false;
all_joined = False;
all_joined = false;
}
}
else
@ -286,41 +286,41 @@ boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
continue;
if (rdp->settings->channels[i].channel_id != channel_id)
return False;
return false;
rdp->settings->channels[i].joined = True;
rdp->settings->channels[i].joined = true;
break;
}
if (i + 1 < rdp->settings->num_channels)
{
if (!mcs_send_channel_join_request(rdp->mcs, rdp->settings->channels[i + 1].channel_id))
return False;
return false;
all_joined = False;
all_joined = false;
}
}
if (rdp->mcs->user_channel_joined && rdp->mcs->global_channel_joined && all_joined)
{
if (!rdp_establish_keys(rdp))
return False;
return false;
if (!rdp_send_client_info(rdp))
return False;
return false;
rdp->state = CONNECTION_STATE_LICENSE;
}
return True;
return true;
}
boolean rdp_client_connect_license(rdpRdp* rdp, STREAM* s)
{
if (!license_recv(rdp->license, s))
return False;
return false;
if (rdp->license->state == LICENSE_STATE_ABORTED)
{
printf("license connection sequence aborted.\n");
return False;
return false;
}
if (rdp->license->state == LICENSE_STATE_COMPLETED)
@ -328,7 +328,7 @@ boolean rdp_client_connect_license(rdpRdp* rdp, STREAM* s)
rdp->state = CONNECTION_STATE_CAPABILITY;
}
return True;
return true;
}
boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
@ -347,14 +347,14 @@ boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
stream_set_mark(s, mark);
stream_seek(s, RDP_PACKET_HEADER_LENGTH);
if (rdp_recv_out_of_sequence_pdu(rdp, s) != True)
return False;
if (rdp_recv_out_of_sequence_pdu(rdp, s) != true)
return false;
return True;
return true;
}
if (!rdp_send_confirm_active(rdp))
return False;
return false;
/**
* The server may request a different desktop size during Deactivation-Reactivation sequence.
@ -362,7 +362,7 @@ boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
*/
if (width != rdp->settings->width || height != rdp->settings->height)
{
IFCALL(rdp->update->DesktopResize, rdp->update);
IFCALL(rdp->update->DesktopResize, rdp->update->context);
}
/**
@ -372,34 +372,34 @@ boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
*/
if (!rdp_send_client_synchronize_pdu(rdp))
return False;
return false;
if (!rdp_send_client_control_pdu(rdp, CTRLACTION_COOPERATE))
return False;
return false;
if (!rdp_send_client_control_pdu(rdp, CTRLACTION_REQUEST_CONTROL))
return False;
return false;
if (!rdp_send_client_persistent_key_list_pdu(rdp))
return False;
return false;
if (!rdp_send_client_font_list_pdu(rdp, FONTLIST_FIRST | FONTLIST_LAST))
return False;
return false;
rdp->state = CONNECTION_STATE_ACTIVE;
update_reset_state(rdp->update);
return True;
return true;
}
boolean rdp_server_accept_nego(rdpRdp* rdp, STREAM* s)
{
boolean ret;
transport_set_blocking_mode(rdp->transport, True);
transport_set_blocking_mode(rdp->transport, true);
if (!nego_read_request(rdp->nego, s))
return False;
return false;
if (rdp->nego->requested_protocols == PROTOCOL_RDP)
{
printf("Standard RDP encryption is not supported.\n");
return False;
return false;
}
printf("Requested protocols:");
@ -428,9 +428,9 @@ boolean rdp_server_accept_nego(rdpRdp* rdp, STREAM* s)
printf("\n");
if (!nego_send_negotiation_response(rdp->nego))
return False;
return false;
ret = False;
ret = false;
if (rdp->nego->selected_protocol & PROTOCOL_NLA)
ret = transport_accept_nla(rdp->transport);
else if (rdp->nego->selected_protocol & PROTOCOL_TLS)
@ -439,13 +439,13 @@ boolean rdp_server_accept_nego(rdpRdp* rdp, STREAM* s)
ret = transport_accept_rdp(rdp->transport);
if (!ret)
return False;
return false;
transport_set_blocking_mode(rdp->transport, False);
transport_set_blocking_mode(rdp->transport, false);
rdp->state = CONNECTION_STATE_NEGO;
return True;
return true;
}
boolean rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, STREAM* s)
@ -453,7 +453,7 @@ boolean rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, STREAM* s)
int i;
if (!mcs_recv_connect_initial(rdp->mcs, s))
return False;
return false;
printf("Accepted client: %s\n", rdp->settings->client_hostname);
printf("Accepted channels:");
@ -464,82 +464,82 @@ boolean rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, STREAM* s)
printf("\n");
if (!mcs_send_connect_response(rdp->mcs))
return False;
return false;
rdp->state = CONNECTION_STATE_MCS_CONNECT;
return True;
return true;
}
boolean rdp_server_accept_mcs_erect_domain_request(rdpRdp* rdp, STREAM* s)
{
if (!mcs_recv_erect_domain_request(rdp->mcs, s))
return False;
return false;
rdp->state = CONNECTION_STATE_MCS_ERECT_DOMAIN;
return True;
return true;
}
boolean rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, STREAM* s)
{
if (!mcs_recv_attach_user_request(rdp->mcs, s))
return False;
return false;
if (!mcs_send_attach_user_confirm(rdp->mcs))
return False;
return false;
rdp->state = CONNECTION_STATE_MCS_ATTACH_USER;
return True;
return true;
}
boolean rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, STREAM* s)
{
int i;
uint16 channel_id;
boolean all_joined = True;
boolean all_joined = true;
if (!mcs_recv_channel_join_request(rdp->mcs, s, &channel_id))
return False;
return false;
if (!mcs_send_channel_join_confirm(rdp->mcs, channel_id))
return False;
return false;
if (channel_id == rdp->mcs->user_id)
rdp->mcs->user_channel_joined = True;
rdp->mcs->user_channel_joined = true;
else if (channel_id == MCS_GLOBAL_CHANNEL_ID)
rdp->mcs->global_channel_joined = True;
rdp->mcs->global_channel_joined = true;
for (i = 0; i < rdp->settings->num_channels; i++)
{
if (rdp->settings->channels[i].channel_id == channel_id)
rdp->settings->channels[i].joined = True;
rdp->settings->channels[i].joined = true;
if (!rdp->settings->channels[i].joined)
all_joined = False;
all_joined = false;
}
if (rdp->mcs->user_channel_joined && rdp->mcs->global_channel_joined && all_joined)
rdp->state = CONNECTION_STATE_MCS_CHANNEL_JOIN;
return True;
return true;
}
boolean rdp_server_accept_client_info(rdpRdp* rdp, STREAM* s)
{
if (!rdp_recv_client_info(rdp, s))
return False;
return false;
if (!license_send_valid_client_error_packet(rdp->license))
return False;
return false;
rdp->state = CONNECTION_STATE_LICENSE;
if (!rdp_send_demand_active(rdp))
return False;
return false;
return True;
return true;
}
boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s)
@ -549,30 +549,30 @@ boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s)
* the Deactivate All PDU. We need to ignore those noises here.
*/
if (!rdp_recv_confirm_active(rdp, s))
return True;
return true;
rdp->state = CONNECTION_STATE_ACTIVE;
update_reset_state(rdp->update);
if (!rdp_send_server_synchronize_pdu(rdp))
return False;
return false;
if (!rdp_send_server_control_cooperate_pdu(rdp))
return False;
return false;
return True;
return true;
}
boolean rdp_server_reactivate(rdpRdp* rdp)
{
if (!rdp_send_deactivate_all(rdp))
return False;
return false;
rdp->state = CONNECTION_STATE_LICENSE;
if (!rdp_send_demand_active(rdp))
return False;
return false;
return True;
return true;
}

View File

@ -349,15 +349,15 @@ void credssp_write_ts_password_creds(rdpCredssp* credssp, STREAM* s)
ber_write_sequence_tag(s, length);
/* [0] domainName (OCTET STRING) */
ber_write_contextual_tag(s, 0, credssp->ntlmssp->domain.length + 2, True);
ber_write_contextual_tag(s, 0, credssp->ntlmssp->domain.length + 2, true);
ber_write_octet_string(s, credssp->ntlmssp->domain.data, credssp->ntlmssp->domain.length);
/* [1] userName (OCTET STRING) */
ber_write_contextual_tag(s, 1, credssp->ntlmssp->username.length + 2, True);
ber_write_contextual_tag(s, 1, credssp->ntlmssp->username.length + 2, true);
ber_write_octet_string(s, credssp->ntlmssp->username.data, credssp->ntlmssp->username.length);
/* [2] password (OCTET STRING) */
ber_write_contextual_tag(s, 2, credssp->ntlmssp->password.length + 2, True);
ber_write_contextual_tag(s, 2, credssp->ntlmssp->password.length + 2, true);
ber_write_octet_string(s, credssp->ntlmssp->password.data, credssp->ntlmssp->password.length);
}
@ -394,12 +394,12 @@ void credssp_write_ts_credentials(rdpCredssp* credssp, STREAM* s)
length -= ber_write_sequence_tag(s, length);
/* [0] credType (INTEGER) */
length -= ber_write_contextual_tag(s, 0, 3, True);
length -= ber_write_contextual_tag(s, 0, 3, true);
length -= ber_write_integer(s, 1);
/* [1] credentials (OCTET STRING) */
length -= 1;
length -= ber_write_contextual_tag(s, 1, length, True);
length -= ber_write_contextual_tag(s, 1, length, true);
length -= ber_write_octet_string_tag(s, ts_password_creds_length);
credssp_write_ts_password_creds(credssp, s);
@ -491,17 +491,17 @@ void credssp_send(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rd
/* TSRequest */
length = ber_get_content_length(ts_request_length);
ber_write_sequence_tag(s, length); /* SEQUENCE */
ber_write_contextual_tag(s, 0, 3, True); /* [0] version */
ber_write_contextual_tag(s, 0, 3, true); /* [0] version */
ber_write_integer(s, 2); /* INTEGER */
/* [1] negoTokens (NegoData) */
if (nego_tokens_length > 0)
{
length = ber_get_content_length(nego_tokens_length);
length -= ber_write_contextual_tag(s, 1, length, True); /* NegoData */
length -= ber_write_contextual_tag(s, 1, length, true); /* NegoData */
length -= ber_write_sequence_tag(s, length); /* SEQUENCE OF NegoDataItem */
length -= ber_write_sequence_tag(s, length); /* NegoDataItem */
length -= ber_write_contextual_tag(s, 0, length, True); /* [0] negoToken */
length -= ber_write_contextual_tag(s, 0, length, true); /* [0] negoToken */
ber_write_octet_string(s, negoToken->data, length); /* OCTET STRING */
}
@ -509,7 +509,7 @@ void credssp_send(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rd
if (auth_info_length > 0)
{
length = ber_get_content_length(auth_info_length);
length -= ber_write_contextual_tag(s, 2, length, True);
length -= ber_write_contextual_tag(s, 2, length, true);
ber_write_octet_string(s, authInfo->data, authInfo->length);
}
@ -517,7 +517,7 @@ void credssp_send(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rd
if (pub_key_auth_length > 0)
{
length = ber_get_content_length(pub_key_auth_length);
length -= ber_write_contextual_tag(s, 3, length, True);
length -= ber_write_contextual_tag(s, 3, length, true);
ber_write_octet_string(s, pubKeyAuth->data, length);
}
@ -548,22 +548,22 @@ int credssp_recv(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdp
/* TSRequest */
ber_read_sequence_tag(s, &length);
ber_read_contextual_tag(s, 0, &length, True);
ber_read_contextual_tag(s, 0, &length, true);
ber_read_integer(s, &version);
/* [1] negoTokens (NegoData) */
if (ber_read_contextual_tag(s, 1, &length, True) != False)
if (ber_read_contextual_tag(s, 1, &length, true) != false)
{
ber_read_sequence_tag(s, &length); /* SEQUENCE OF NegoDataItem */
ber_read_sequence_tag(s, &length); /* NegoDataItem */
ber_read_contextual_tag(s, 0, &length, True); /* [0] negoToken */
ber_read_contextual_tag(s, 0, &length, true); /* [0] negoToken */
ber_read_octet_string(s, &length); /* OCTET STRING */
freerdp_blob_alloc(negoToken, length);
stream_read(s, negoToken->data, length);
}
/* [2] authInfo (OCTET STRING) */
if (ber_read_contextual_tag(s, 2, &length, True) != False)
if (ber_read_contextual_tag(s, 2, &length, true) != false)
{
ber_read_octet_string(s, &length); /* OCTET STRING */
freerdp_blob_alloc(authInfo, length);
@ -571,7 +571,7 @@ int credssp_recv(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdp
}
/* [3] pubKeyAuth (OCTET STRING) */
if (ber_read_contextual_tag(s, 3, &length, True) != False)
if (ber_read_contextual_tag(s, 3, &length, true) != false)
{
ber_read_octet_string(s, &length); /* OCTET STRING */
freerdp_blob_alloc(pubKeyAuth, length);

View File

@ -154,14 +154,14 @@ void crypto_cert_free(CryptoCert cert)
boolean crypto_cert_verify(CryptoCert server_cert, CryptoCert cacert)
{
return True; /* FIXME: do the actual verification */
return true; /* FIXME: do the actual verification */
}
boolean crypto_cert_get_public_key(CryptoCert cert, rdpBlob* public_key)
{
uint8* p;
int length;
boolean status = True;
boolean status = true;
EVP_PKEY* pkey = NULL;
pkey = X509_get_pubkey(cert->px509);
@ -169,7 +169,7 @@ boolean crypto_cert_get_public_key(CryptoCert cert, rdpBlob* public_key)
if (!pkey)
{
printf("crypto_cert_get_public_key: X509_get_pubkey() failed\n");
status = False;
status = false;
goto exit;
}
@ -178,7 +178,7 @@ boolean crypto_cert_get_public_key(CryptoCert cert, rdpBlob* public_key)
if (length < 1)
{
printf("crypto_cert_get_public_key: i2d_PublicKey() failed\n");
status = False;
status = false;
goto exit;
}
@ -311,7 +311,7 @@ boolean x509_verify_cert(CryptoCert cert, rdpSettings* settings)
{
char* cert_loc;
X509_STORE_CTX* csc;
boolean status = False;
boolean status = false;
X509_STORE* cert_ctx = NULL;
X509_LOOKUP* lookup = NULL;
X509* xcert = cert->px509;
@ -352,7 +352,7 @@ boolean x509_verify_cert(CryptoCert cert, rdpSettings* settings)
goto end;
if (X509_verify_cert(csc) == 1)
status = True;
status = true;
X509_STORE_CTX_free(csc);
X509_STORE_free(cert_ctx);

View File

@ -141,8 +141,9 @@ static void fastpath_recv_orders(rdpFastPath* fastpath, STREAM* s)
static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
{
rdpUpdate* update = fastpath->rdp->update;
uint16 updateType;
rdpUpdate* update = fastpath->rdp->update;
rdpContext* context = update->context;
stream_read_uint16(s, updateType); /* updateType (2 bytes) */
@ -150,12 +151,12 @@ static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
{
case UPDATE_TYPE_BITMAP:
update_read_bitmap(update, s, &update->bitmap_update);
IFCALL(update->BitmapUpdate, update, &update->bitmap_update);
IFCALL(update->BitmapUpdate, context, &update->bitmap_update);
break;
case UPDATE_TYPE_PALETTE:
update_read_palette(update, s, &update->palette_update);
IFCALL(update->Palette, update, &update->palette_update);
IFCALL(update->Palette, context, &update->palette_update);
break;
}
}
@ -163,6 +164,8 @@ static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
static void fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uint32 size, STREAM* s)
{
rdpUpdate* update = fastpath->rdp->update;
rdpContext* context = fastpath->rdp->update->context;
rdpPointerUpdate* pointer = update->pointer;
switch (updateCode)
{
@ -176,41 +179,41 @@ static void fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uint32
break;
case FASTPATH_UPDATETYPE_SYNCHRONIZE:
IFCALL(fastpath->rdp->update->Synchronize, fastpath->rdp->update);
IFCALL(update->Synchronize, context);
break;
case FASTPATH_UPDATETYPE_SURFCMDS:
update_recv_surfcmds(fastpath->rdp->update, size, s);
update_recv_surfcmds(update, size, s);
break;
case FASTPATH_UPDATETYPE_PTR_NULL:
update->pointer_system.type = SYSPTR_NULL;
IFCALL(update->PointerSystem, update, &update->pointer_system);
pointer->pointer_system.type = SYSPTR_NULL;
IFCALL(pointer->PointerSystem, context, &pointer->pointer_system);
break;
case FASTPATH_UPDATETYPE_PTR_DEFAULT:
update->pointer_system.type = SYSPTR_DEFAULT;
IFCALL(update->PointerSystem, update, &update->pointer_system);
update->pointer->pointer_system.type = SYSPTR_DEFAULT;
IFCALL(pointer->PointerSystem, context, &pointer->pointer_system);
break;
case FASTPATH_UPDATETYPE_PTR_POSITION:
update_read_pointer_position(s, &update->pointer_position);
IFCALL(update->PointerPosition, update, &update->pointer_position);
update_read_pointer_position(s, &pointer->pointer_position);
IFCALL(pointer->PointerPosition, context, &pointer->pointer_position);
break;
case FASTPATH_UPDATETYPE_COLOR:
update_read_pointer_color(s, &update->pointer_color);
IFCALL(update->PointerColor, update, &update->pointer_color);
update_read_pointer_color(s, &pointer->pointer_color);
IFCALL(pointer->PointerColor, context, &pointer->pointer_color);
break;
case FASTPATH_UPDATETYPE_CACHED:
update_read_pointer_cached(s, &update->pointer_cached);
IFCALL(update->PointerCached, update, &update->pointer_cached);
update_read_pointer_cached(s, &pointer->pointer_cached);
IFCALL(pointer->PointerCached, context, &pointer->pointer_cached);
break;
case FASTPATH_UPDATETYPE_POINTER:
update_read_pointer_new(s, &update->pointer_new);
IFCALL(update->PointerNew, update, &update->pointer_new);
update_read_pointer_new(s, &pointer->pointer_new);
IFCALL(pointer->PointerNew, context, &pointer->pointer_new);
break;
default:
@ -299,16 +302,16 @@ boolean fastpath_recv_updates(rdpFastPath* fastpath, STREAM* s)
{
rdpUpdate* update = fastpath->rdp->update;
IFCALL(update->BeginPaint, update);
IFCALL(update->BeginPaint, update->context);
while (stream_get_left(s) > 3)
{
fastpath_recv_update_data(fastpath, s);
}
IFCALL(update->EndPaint, update);
IFCALL(update->EndPaint, update->context);
return True;
return true;
}
static boolean fastpath_read_input_event_header(STREAM* s, uint8* eventFlags, uint8* eventCode)
@ -316,14 +319,14 @@ static boolean fastpath_read_input_event_header(STREAM* s, uint8* eventFlags, ui
uint8 eventHeader;
if (stream_get_left(s) < 1)
return False;
return false;
stream_read_uint8(s, eventHeader); /* eventHeader (1 byte) */
*eventFlags = (eventHeader & 0x1F);
*eventCode = (eventHeader >> 5);
return True;
return true;
}
static boolean fastpath_recv_input_event_scancode(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
@ -332,7 +335,7 @@ static boolean fastpath_recv_input_event_scancode(rdpFastPath* fastpath, STREAM*
uint16 code;
if (stream_get_left(s) < 1)
return False;
return false;
stream_read_uint8(s, code); /* keyCode (1 byte) */
@ -347,7 +350,7 @@ static boolean fastpath_recv_input_event_scancode(rdpFastPath* fastpath, STREAM*
IFCALL(fastpath->rdp->input->KeyboardEvent, fastpath->rdp->input, flags, code);
return True;
return true;
}
static boolean fastpath_recv_input_event_mouse(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
@ -357,7 +360,7 @@ static boolean fastpath_recv_input_event_mouse(rdpFastPath* fastpath, STREAM* s,
uint16 yPos;
if (stream_get_left(s) < 6)
return False;
return false;
stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
stream_read_uint16(s, xPos); /* xPos (2 bytes) */
@ -365,7 +368,7 @@ static boolean fastpath_recv_input_event_mouse(rdpFastPath* fastpath, STREAM* s,
IFCALL(fastpath->rdp->input->MouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
return True;
return true;
}
static boolean fastpath_recv_input_event_mousex(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
@ -375,7 +378,7 @@ static boolean fastpath_recv_input_event_mousex(rdpFastPath* fastpath, STREAM* s
uint16 yPos;
if (stream_get_left(s) < 6)
return False;
return false;
stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
stream_read_uint16(s, xPos); /* xPos (2 bytes) */
@ -383,14 +386,14 @@ static boolean fastpath_recv_input_event_mousex(rdpFastPath* fastpath, STREAM* s
IFCALL(fastpath->rdp->input->ExtendedMouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
return True;
return true;
}
static boolean fastpath_recv_input_event_sync(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
{
IFCALL(fastpath->rdp->input->SynchronizeEvent, fastpath->rdp->input, eventFlags);
return True;
return true;
}
static boolean fastpath_recv_input_event_unicode(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
@ -398,13 +401,13 @@ static boolean fastpath_recv_input_event_unicode(rdpFastPath* fastpath, STREAM*
uint16 unicodeCode;
if (stream_get_left(s) < 2)
return False;
return false;
stream_read_uint16(s, unicodeCode); /* unicodeCode (2 bytes) */
IFCALL(fastpath->rdp->input->UnicodeKeyboardEvent, fastpath->rdp->input, unicodeCode);
return True;
return true;
}
static boolean fastpath_recv_input_event(rdpFastPath* fastpath, STREAM* s)
@ -413,33 +416,33 @@ static boolean fastpath_recv_input_event(rdpFastPath* fastpath, STREAM* s)
uint8 eventCode;
if (!fastpath_read_input_event_header(s, &eventFlags, &eventCode))
return False;
return false;
switch (eventCode)
{
case FASTPATH_INPUT_EVENT_SCANCODE:
if (!fastpath_recv_input_event_scancode(fastpath, s, eventFlags))
return False;
return false;
break;
case FASTPATH_INPUT_EVENT_MOUSE:
if (!fastpath_recv_input_event_mouse(fastpath, s, eventFlags))
return False;
return false;
break;
case FASTPATH_INPUT_EVENT_MOUSEX:
if (!fastpath_recv_input_event_mousex(fastpath, s, eventFlags))
return False;
return false;
break;
case FASTPATH_INPUT_EVENT_SYNC:
if (!fastpath_recv_input_event_sync(fastpath, s, eventFlags))
return False;
return false;
break;
case FASTPATH_INPUT_EVENT_UNICODE:
if (!fastpath_recv_input_event_unicode(fastpath, s, eventFlags))
return False;
return false;
break;
default:
@ -447,7 +450,7 @@ static boolean fastpath_recv_input_event(rdpFastPath* fastpath, STREAM* s)
break;
}
return True;
return true;
}
boolean fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s)
@ -462,7 +465,7 @@ boolean fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s)
*/
if (stream_get_left(s) < 1)
return False;
return false;
stream_read_uint8(s, fastpath->numberEvents); /* eventHeader (1 byte) */
}
@ -470,10 +473,10 @@ boolean fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s)
for (i = 0; i < fastpath->numberEvents; i++)
{
if (!fastpath_recv_input_event(fastpath, s))
return False;
return false;
}
return True;
return true;
}
STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, uint8 eventFlags, uint8 eventCode)
@ -494,7 +497,7 @@ boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s)
if (length > 127)
{
printf("Maximum FastPath PDU length is 127\n");
return False;
return false;
}
stream_set_pos(s, 0);
@ -503,9 +506,9 @@ boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s)
stream_set_pos(s, length);
if (transport_write(fastpath->rdp->transport, s) < 0)
return False;
return false;
return True;
return true;
}
STREAM* fastpath_update_pdu_init(rdpFastPath* fastpath)
@ -525,7 +528,7 @@ boolean fastpath_send_update_pdu(rdpFastPath* fastpath, STREAM* s)
if (length > FASTPATH_MAX_PACKET_SIZE)
{
printf("Maximum FastPath Update PDU length is %d (actual:%d)\n", FASTPATH_MAX_PACKET_SIZE, length);
return False;
return false;
}
stream_set_pos(s, 0);
@ -535,9 +538,9 @@ boolean fastpath_send_update_pdu(rdpFastPath* fastpath, STREAM* s)
stream_set_pos(s, length);
if (transport_write(fastpath->rdp->transport, s) < 0)
return False;
return false;
return True;
return true;
}
boolean fastpath_send_fragmented_update_pdu(rdpFastPath* fastpath, STREAM* s)
@ -572,7 +575,7 @@ boolean fastpath_send_fragmented_update_pdu(rdpFastPath* fastpath, STREAM* s)
fastpath_send_update_pdu(fastpath, update);
}
return True;
return true;
}
boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId)
@ -586,9 +589,9 @@ boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAc
update_write_surfcmd_frame_marker(s, frameAction, frameId);
if (transport_write(fastpath->rdp->transport, s) < 0)
return False;
return false;
return True;
return true;
}
boolean fastpath_send_surfcmd_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* cmd)
@ -639,10 +642,10 @@ boolean fastpath_send_surfcmd_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_C
bitmapDataLength -= fragment_size;
if (!fastpath_send_update_pdu(fastpath, s))
return False;
return false;
}
return True;
return true;
}
rdpFastPath* fastpath_new(rdpRdp* rdp)

View File

@ -45,9 +45,9 @@ boolean freerdp_connect(freerdp* instance)
{
if (instance->settings->dump_rfx)
{
instance->update->pcap_rfx = pcap_open(instance->settings->dump_rfx_file, True);
instance->update->pcap_rfx = pcap_open(instance->settings->dump_rfx_file, true);
if (instance->update->pcap_rfx)
instance->update->dump_rfx = True;
instance->update->dump_rfx = true;
}
extension_post_connect(rdp->extension);
@ -61,9 +61,9 @@ boolean freerdp_connect(freerdp* instance)
pcap_record record;
s = stream_new(1024);
instance->update->pcap_rfx = pcap_open(instance->settings->play_rfx_file, False);
instance->update->pcap_rfx = pcap_open(instance->settings->play_rfx_file, false);
if (instance->update->pcap_rfx)
instance->update->play_rfx = True;
instance->update->play_rfx = true;
update = instance->update;
while (instance->update->play_rfx && pcap_has_next_record(update->pcap_rfx))
@ -77,13 +77,13 @@ boolean freerdp_connect(freerdp* instance)
pcap_get_next_record_content(update->pcap_rfx, &record);
stream_set_pos(s, 0);
update->BeginPaint(update);
update->BeginPaint(update->context);
update_recv_surfcmds(update, s->size, s);
update->EndPaint(update);
update->EndPaint(update->context);
}
xfree(s->data);
return True;
return true;
}
}
@ -97,7 +97,7 @@ boolean freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds
rdp = instance->context->rdp;
transport_get_fds(rdp->transport, rfds, rcount);
return True;
return true;
}
boolean freerdp_check_fds(freerdp* instance)
@ -110,9 +110,9 @@ boolean freerdp_check_fds(freerdp* instance)
status = rdp_check_fds(rdp);
if (status < 0)
return False;
return false;
return True;
return true;
}
static int freerdp_send_channel_data(freerdp* instance, int channel_id, uint8* data, int size)
@ -127,7 +127,7 @@ boolean freerdp_disconnect(freerdp* instance)
rdp = instance->context->rdp;
transport_disconnect(rdp->transport);
return True;
return true;
}
void freerdp_context_new(freerdp* instance)
@ -145,6 +145,11 @@ void freerdp_context_new(freerdp* instance)
instance->context->rdp = rdp;
instance->update->context = instance->context;
instance->update->pointer->context = instance->context;
instance->update->primary->context = instance->context;
instance->update->secondary->context = instance->context;
instance->update->altsec->context = instance->context;
instance->input->context = instance->context;
input_register_client_callbacks(rdp->input);

Some files were not shown because too many files have changed in this diff Show More