freerdp: merge with master

This commit is contained in:
Marc-André Moreau 2013-03-28 21:20:36 -04:00
commit d187becc28
136 changed files with 1282 additions and 1269 deletions

View File

@ -373,7 +373,7 @@ static void* audin_server_thread_func(void* arg)
break;
default:
printf("audin_server_thread_func: unknown MessageId %d\n", MessageId);
fprintf(stderr, "audin_server_thread_func: unknown MessageId %d\n", MessageId);
break;
}
}

View File

@ -972,7 +972,7 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, v
if (channels->num_libs_data + 1 >= CHANNEL_MAX_COUNT)
{
printf("error: too many channels\n");
fprintf(stderr, "error: too many channels\n");
return 1;
}
@ -1006,7 +1006,7 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, v
if (!status)
{
printf("error: channel export function call failed\n");
fprintf(stderr, "error: channel export function call failed\n");
return 1;
}

View File

@ -87,18 +87,18 @@ static void cliprdr_process_connect(rdpSvcPlugin* plugin)
void cliprdr_print_general_capability_flags(UINT32 flags)
{
printf("generalFlags (0x%08X) {\n", flags);
fprintf(stderr, "generalFlags (0x%08X) {\n", flags);
if (flags & CB_USE_LONG_FORMAT_NAMES)
printf("\tCB_USE_LONG_FORMAT_NAMES\n");
fprintf(stderr, "\tCB_USE_LONG_FORMAT_NAMES\n");
if (flags & CB_STREAM_FILECLIP_ENABLED)
printf("\tCB_STREAM_FILECLIP_ENABLED\n");
fprintf(stderr, "\tCB_STREAM_FILECLIP_ENABLED\n");
if (flags & CB_FILECLIP_NO_FILE_PATHS)
printf("\tCB_FILECLIP_NO_FILE_PATHS\n");
fprintf(stderr, "\tCB_FILECLIP_NO_FILE_PATHS\n");
if (flags & CB_CAN_LOCK_CLIPDATA)
printf("\tCB_CAN_LOCK_CLIPDATA\n");
fprintf(stderr, "\tCB_CAN_LOCK_CLIPDATA\n");
printf("}\n");
fprintf(stderr, "}\n");
}
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s)

View File

@ -233,7 +233,7 @@ int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args)
DVCMAN_ENTRY_POINTS entryPoints;
PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL;
printf("Loading Dynamic Virtual Channel %s\n", args->argv[0]);
fprintf(stderr, "Loading Dynamic Virtual Channel %s\n", args->argv[0]);
pDVCPluginEntry = (PDVC_PLUGIN_ENTRY) freerdp_load_channel_addin_entry(args->argv[0],
NULL, NULL, FREERDP_ADDIN_CHANNEL_DYNAMIC);

View File

@ -501,7 +501,7 @@ BOOL rail_order_recv(rdpRailOrder* rail_order, wStream* s)
return rail_recv_langbar_info_order(rail_order, s);
default:
printf("Unknown RAIL PDU order reveived.");
fprintf(stderr, "Unknown RAIL PDU order reveived.");
break;
}
return TRUE;

View File

@ -99,7 +99,7 @@ BOOL devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device)
if (!ServiceName)
return FALSE;
printf("Loading device service %s (static)\n", ServiceName);
fprintf(stderr, "Loading device service %s (static)\n", ServiceName);
entry = (PDEVICE_SERVICE_ENTRY) freerdp_load_channel_addin_entry(ServiceName, NULL, "DeviceServiceEntry", 0);
if (entry == NULL)

View File

@ -199,7 +199,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
count++;
printf("registered device #%d: %s (type=%d id=%d)\n",
fprintf(stderr, "registered device #%d: %s (type=%d id=%d)\n",
count, device->name, device->type, device->id);
}
}

View File

@ -68,7 +68,7 @@ struct rdpsnd_alsa_plugin
#define SND_PCM_CHECK(_func, _status) \
if (_status < 0) \
{ \
printf("%s: %d\n", _func, _status); \
fprintf(stderr, "%s: %d\n", _func, _status); \
return -1; \
}
@ -106,7 +106,7 @@ int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa)
if (alsa->buffer_size > buffer_size_max)
{
printf("Warning: requested sound buffer size %d, got %d instead\n",
fprintf(stderr, "Warning: requested sound buffer size %d, got %d instead\n",
(int) alsa->buffer_size, (int) buffer_size_max);
alsa->buffer_size = buffer_size_max;
}
@ -596,7 +596,7 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
}
else if (status < 0)
{
printf("status: %d\n", status);
fprintf(stderr, "status: %d\n", status);
snd_pcm_close(alsa->pcm_handle);
alsa->pcm_handle = NULL;
rdpsnd_alsa_open((rdpsndDevicePlugin*) alsa, NULL, alsa->latency);
@ -617,7 +617,7 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
wave->wLatency = (UINT16) (wave->wLocalTimeB - wave->wLocalTimeA);
wave->wTimeStampB = wave->wTimeStampA + wave->wLatency;
//printf("wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
//fprintf(stderr, "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
device->WaveConfirm(device, wave);
}

View File

@ -110,7 +110,7 @@ static void rdpsnd_audio_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format,
&aq_plugin_p->aq_ref
);
if (rv != 0) {
printf("rdpsnd_audio_open: AudioQueueNewOutput() failed with error %d\n", rv);
fprintf(stderr, "rdpsnd_audio_open: AudioQueueNewOutput() failed with error %d\n", rv);
aq_plugin_p->is_open = 1;
return;
}
@ -205,7 +205,7 @@ static void aq_playback_cb(void* user_data, AudioQueueRef aq_ref, AudioQueueBuff
int freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
{
printf("freerdp_rdpsnd_client_subsystem_entry()\n\n");
fprintf(stderr, "freerdp_rdpsnd_client_subsystem_entry()\n\n");
ADDIN_ARGV* args;
rdpsndAudioQPlugin* aqPlugin;

View File

@ -178,13 +178,13 @@ void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd)
}
#if 0
printf("Server ");
fprintf(stderr, "Server ");
rdpsnd_print_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats);
printf("\n");
fprintf(stderr, "\n");
printf("Client ");
fprintf(stderr, "Client ");
rdpsnd_print_audio_formats(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats);
printf("\n");
fprintf(stderr, "\n");
#endif
}
@ -484,7 +484,7 @@ static void rdpsnd_recv_pdu(rdpSvcPlugin* plugin, wStream* s)
stream_seek_BYTE(s); /* bPad */
stream_read_UINT16(s, BodySize);
//printf("msgType %d BodySize %d\n", msgType, BodySize);
//fprintf(stderr, "msgType %d BodySize %d\n", msgType, BodySize);
switch (msgType)
{

View File

@ -123,7 +123,7 @@ static void rdpsnd_server_recv_quality_mode(rdpsnd_server* rdpsnd, wStream* s)
stream_read_UINT16(s, quality);
stream_seek_UINT16(s); // reserved
printf("Client requested sound quality: %#0X\n", quality);
fprintf(stderr, "Client requested sound quality: %#0X\n", quality);
}
static BOOL rdpsnd_server_recv_formats(rdpsnd_server* rdpsnd, wStream* s)
@ -174,7 +174,7 @@ static BOOL rdpsnd_server_recv_formats(rdpsnd_server* rdpsnd, wStream* s)
if (num_known_format == 0)
{
printf("Client doesnt support any known formats!\n");
fprintf(stderr, "Client doesnt support any known formats!\n");
return FALSE;
}
@ -251,7 +251,7 @@ static void* rdpsnd_server_thread_func(void* arg)
}
break;
default:
printf("UNKOWN MESSAGE TYPE!! (%#0X)\n\n", msgType);
fprintf(stderr, "UNKOWN MESSAGE TYPE!! (%#0X)\n\n", msgType);
break;
}
}
@ -293,7 +293,7 @@ static void rdpsnd_server_select_format(rdpsnd_server_context* context, int clie
if (client_format_index < 0 || client_format_index >= context->num_client_formats)
{
printf("rdpsnd_server_select_format: index %d is not correct.\n", client_format_index);
fprintf(stderr, "rdpsnd_server_select_format: index %d is not correct.\n", client_format_index);
return;
}
@ -305,7 +305,7 @@ static void rdpsnd_server_select_format(rdpsnd_server_context* context, int clie
if (format->nSamplesPerSec == 0)
{
printf("Invalid Client Sound Format!!\n\n");
fprintf(stderr, "Invalid Client Sound Format!!\n\n");
return;
}

View File

@ -53,11 +53,11 @@ static void sample_process_receive(rdpSvcPlugin* plugin, wStream* data_in)
wStream* data_out;
samplePlugin* sample = (samplePlugin*) plugin;
printf("sample_process_receive:\n");
fprintf(stderr, "sample_process_receive:\n");
if (!sample)
{
printf("sample_process_receive: sample is nil\n");
fprintf(stderr, "sample_process_receive: sample is nil\n");
return;
}
@ -65,7 +65,7 @@ static void sample_process_receive(rdpSvcPlugin* plugin, wStream* data_in)
/* here we just send the same data back */
bytes = stream_get_size(data_in);
printf("sample_process_receive: got bytes %d\n", bytes);
fprintf(stderr, "sample_process_receive: got bytes %d\n", bytes);
if (bytes > 0)
{
@ -75,7 +75,7 @@ static void sample_process_receive(rdpSvcPlugin* plugin, wStream* data_in)
we do not free it */
bytes = stream_get_length(data_in);
printf("sample_process_receive: sending bytes %d\n", bytes);
fprintf(stderr, "sample_process_receive: sending bytes %d\n", bytes);
svc_plugin_send(plugin, data_out);
}
@ -88,7 +88,7 @@ static void sample_process_connect(rdpSvcPlugin* plugin)
samplePlugin* sample = (samplePlugin*) plugin;
DEBUG_SVC("connecting");
printf("sample_process_connect:\n");
fprintf(stderr, "sample_process_connect:\n");
if (!sample)
return;
@ -96,7 +96,7 @@ static void sample_process_connect(rdpSvcPlugin* plugin)
static void sample_process_event(rdpSvcPlugin* plugin, wMessage* event)
{
printf("sample_process_event:\n");
fprintf(stderr, "sample_process_event:\n");
/* events coming from main freerdp window to plugin */
/* send them back with svc_plugin_send_event */
@ -108,7 +108,7 @@ static void sample_process_terminate(rdpSvcPlugin* plugin)
{
samplePlugin* sample = (samplePlugin*) plugin;
printf("sample_process_terminate:\n");
fprintf(stderr, "sample_process_terminate:\n");
if (!sample)
return;

View File

@ -26,7 +26,7 @@ int main()
if (!ret)
{
long err = GetLastError();
printf("error 0x%8.8x\n", err);
fprintf(stderr, "error 0x%8.8x\n", err);
return 1;
}
@ -34,12 +34,12 @@ int main()
if (!ret)
{
long err = GetLastError();
printf("error 0x%8.8x\n", err);
fprintf(stderr, "error 0x%8.8x\n", err);
return 1;
}
if (written != DSIZE)
{
printf("error read %d\n", written);
fprintf(stderr, "error read %d\n", written);
return 1;
}
@ -49,11 +49,11 @@ int main()
}
else
{
printf("error data no match\n");
fprintf(stderr, "error data no match\n");
return 1;
}
printf("Success!\n");
fprintf(stderr, "Success!\n");
Sleep(2000);
return 0;

View File

@ -216,7 +216,7 @@ static void wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, UINT32 le
if (stream_get_length(channel->receive_data) + length > channel->dvc_total_length)
{
channel->dvc_total_length = 0;
printf("wts_read_drdynvc_data: incorrect fragment data, discarded.\n");
fprintf(stderr, "wts_read_drdynvc_data: incorrect fragment data, discarded.\n");
return;
}
@ -300,7 +300,7 @@ static void wts_read_drdynvc_pdu(rdpPeerChannel* channel)
break;
default:
printf("wts_read_drdynvc_pdu: Cmd %d not recognized.\n", Cmd);
fprintf(stderr, "wts_read_drdynvc_pdu: Cmd %d not recognized.\n", Cmd);
break;
}
}
@ -311,7 +311,7 @@ static void wts_read_drdynvc_pdu(rdpPeerChannel* channel)
}
else
{
printf("wts_read_drdynvc_pdu: received Cmd %d but channel is not ready.\n", Cmd);
fprintf(stderr, "wts_read_drdynvc_pdu: received Cmd %d but channel is not ready.\n", Cmd);
}
}
@ -373,7 +373,7 @@ static void WTSProcessChannelData(rdpPeerChannel* channel, int channelId, BYTE*
{
if (stream_get_length(channel->receive_data) != total_size)
{
printf("WTSProcessChannelData: read error\n");
fprintf(stderr, "WTSProcessChannelData: read error\n");
}
if (channel == channel->vcm->drdynvc_channel)
{

View File

@ -73,7 +73,7 @@ static void smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
break;
default:
printf("MajorFunction 0x%X unexpected for smartcards.", irp->MajorFunction);
fprintf(stderr, "MajorFunction 0x%X unexpected for smartcards.", irp->MajorFunction);
DEBUG_WARN("Smartcard MajorFunction 0x%X not supported.", irp->MajorFunction);
irp->IoStatus = STATUS_NOT_SUPPORTED;
irp->Complete(irp);

View File

@ -749,10 +749,10 @@ static UINT32 handle_State(IRP* irp)
(unsigned) hCard, (int) atrLen, (unsigned) state, (unsigned) protocol);
#ifdef WITH_DEBUG_SCARD
printf(" ATR: ");
fprintf(stderr, " ATR: ");
for (i = 0; i < atrLen; i++)
printf("%02x%c", pbAtr[i], (i == atrLen - 1) ? ' ' : ':');
printf("\n");
fprintf(stderr, "%02x%c", pbAtr[i], (i == atrLen - 1) ? ' ' : ':');
fprintf(stderr, "\n");
#endif
state = smartcard_map_state(state);
@ -822,10 +822,10 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
DEBUG_SCARD(" Reader: \"%s\"", readerName ? readerName : "NULL");
#ifdef WITH_DEBUG_SCARD
printf(" ATR: ");
fprintf(stderr, " ATR: ");
for (i = 0; i < atrLen; i++)
printf("%02x%c", pbAtr[i], (i == atrLen - 1) ? ' ' : ':');
printf("\n");
fprintf(stderr, "%02x%c", pbAtr[i], (i == atrLen - 1) ? ' ' : ':');
fprintf(stderr, "\n");
#endif
state = smartcard_map_state(state);
@ -1180,7 +1180,7 @@ static UINT32 handle_AccessStartedEvent(IRP* irp)
void scard_error(SMARTCARD_DEVICE* scard, IRP* irp, UINT32 ntstatus)
{
/* [MS-RDPESC] 3.1.4.4 */
printf("scard processing error %x\n", ntstatus);
fprintf(stderr, "scard processing error %x\n", ntstatus);
stream_set_pos(irp->output, 0); /* CHECKME */
irp->IoStatus = ntstatus;
@ -1515,7 +1515,7 @@ void smartcard_device_control(SMARTCARD_DEVICE* scard, IRP* irp)
default:
result = 0xc0000001;
printf("scard unknown ioctl 0x%x\n", ioctl_code);
fprintf(stderr, "scard unknown ioctl 0x%x\n", ioctl_code);
break;
}

View File

@ -536,7 +536,7 @@ ITSMFDecoder* freerdp_tsmf_client_decoder_subsystem_entry(void)
initialized = TRUE;
}
printf("TSMFDecoderEntry FFMPEG\n");
fprintf(stderr, "TSMFDecoderEntry FFMPEG\n");
decoder = (TSMFFFmpegDecoder*) malloc(sizeof(TSMFFFmpegDecoder));
ZeroMemory(decoder, sizeof(TSMFFFmpegDecoder));

View File

@ -265,21 +265,21 @@ static void tsmf_print_guid(const BYTE* guid)
int i;
for (i = 3; i >= 0; i--)
printf("%02X", guid[i]);
printf("-");
fprintf(stderr, "%02X", guid[i]);
fprintf(stderr, "-");
for (i = 5; i >= 4; i--)
printf("%02X", guid[i]);
printf("-");
fprintf(stderr, "%02X", guid[i]);
fprintf(stderr, "-");
for (i = 7; i >= 6; i--)
printf("%02X", guid[i]);
printf("-");
fprintf(stderr, "%02X", guid[i]);
fprintf(stderr, "-");
for (i = 8; i < 16; i++)
{
printf("%02X", guid[i]);
fprintf(stderr, "%02X", guid[i]);
if (i == 9)
printf("-");
fprintf(stderr, "-");
}
printf("\n");
fprintf(stderr, "\n");
#endif
}

View File

@ -237,7 +237,7 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da
{
case IOCTL_INTERNAL_USB_SUBMIT_URB: /** 0x00220003 */
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_SUBMIT_URB"));
printf(" Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked\n");
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked\n");
break;
case IOCTL_INTERNAL_USB_RESET_PORT: /** 0x00220007 */
@ -269,12 +269,12 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da
case IOCTL_INTERNAL_USB_CYCLE_PORT: /** 0x0022001F */
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_CYCLE_PORT"));
printf(" Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked\n");
fprintf(stderr, " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked\n");
break;
case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: /** 0x00220027 */
LLOGLN(urbdrc_debug, ("ioctl: IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION"));
printf(" Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
break;
default:
@ -447,7 +447,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat
if (transferDir == 0)
{
printf("urb_select_configuration: not support transfer out\n");
fprintf(stderr, "urb_select_configuration: not support transfer out\n");
return -1;
}
@ -539,7 +539,7 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U
if (transferDir == 0)
{
printf("urb_select_interface: not support transfer out\n");
fprintf(stderr, "urb_select_interface: not support transfer out\n");
return -1;
}
@ -1296,7 +1296,7 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback,
switch (transferDir)
{
case USBD_TRANSFER_DIRECTION_OUT:
printf("Function urb_os_feature_descriptor_request: OUT Unchecked\n");
fprintf(stderr, "Function urb_os_feature_descriptor_request: OUT Unchecked\n");
memcpy(buffer, data + offset, OutputBufferSize);
break;
case USBD_TRANSFER_DIRECTION_IN:
@ -1699,7 +1699,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
switch (transferDir)
{
case USBD_TRANSFER_DIRECTION_OUT:
printf("Function urb_control_feature_request: OUT Unchecked\n");
fprintf(stderr, "Function urb_control_feature_request: OUT Unchecked\n");
memcpy(buffer, data + offset, OutputBufferSize);
bmRequestType |= 0x00;
break;
@ -1717,7 +1717,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
bmRequest = 0x01; /* REQUEST_CLEAR_FEATURE */
break;
default:
printf("urb_control_feature_request: Error Command %x\n", command);
fprintf(stderr, "urb_control_feature_request: Error Command %x\n", command);
return -1;
}

View File

@ -201,7 +201,7 @@ static void func_iso_callback(struct libusb_transfer *transfer)
}
else
{
//printf("actual length %d \n", act_len);
//fprintf(stderr, "actual length %d \n", act_len);
//exit(EXIT_FAILURE);
}
}
@ -362,7 +362,7 @@ static int func_config_release_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle
if (ret < 0)
{
printf("config_release_all_interface: error num %d\n", ret);
fprintf(stderr, "config_release_all_interface: error num %d\n", ret);
return -1;
}
}
@ -380,7 +380,7 @@ static int func_claim_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle, int Num
if (ret < 0)
{
printf("claim_all_interface: error num %d\n", ret);
fprintf(stderr, "claim_all_interface: error num %d\n", ret);
return -1;
}
}
@ -394,28 +394,28 @@ static void* print_transfer_status(enum libusb_transfer_status status)
switch (status)
{
case LIBUSB_TRANSFER_COMPLETED:
//printf("Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
//fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
break;
case LIBUSB_TRANSFER_ERROR:
printf("Transfer Status: LIBUSB_TRANSFER_ERROR\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_ERROR\n");
break;
case LIBUSB_TRANSFER_TIMED_OUT:
printf("Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
break;
case LIBUSB_TRANSFER_CANCELLED:
printf("Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
break;
case LIBUSB_TRANSFER_STALL:
printf("Transfer Status: LIBUSB_TRANSFER_STALL\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_STALL\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
printf("Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
break;
case LIBUSB_TRANSFER_OVERFLOW:
printf("Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
break;
default:
printf("Transfer Status: Get unknow error num %d (0x%x)\n",
fprintf(stderr, "Transfer Status: Get unknow error num %d (0x%x)\n",
status, status);
}
return 0;
@ -426,28 +426,28 @@ static void print_status(enum libusb_transfer_status status)
switch (status)
{
case LIBUSB_TRANSFER_COMPLETED:
printf("Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
break;
case LIBUSB_TRANSFER_ERROR:
printf("Transfer status: LIBUSB_TRANSFER_ERROR\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_ERROR\n");
break;
case LIBUSB_TRANSFER_TIMED_OUT:
printf("Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
break;
case LIBUSB_TRANSFER_CANCELLED:
printf("Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
break;
case LIBUSB_TRANSFER_STALL:
printf("Transfer status: LIBUSB_TRANSFER_STALL\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_STALL\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
printf("Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
break;
case LIBUSB_TRANSFER_OVERFLOW:
printf("Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
break;
default:
printf("Transfer status: unknow status %d(0x%x)\n", status, status);
fprintf(stderr, "Transfer status: unknow status %d(0x%x)\n", status, status);
break;
}
}
@ -484,7 +484,7 @@ static LIBUSB_DEVICE_DESCRIPTOR* udev_new_descript(LIBUSB_DEVICE* libusb_dev)
if (ret < 0)
{
printf("libusb_get_device_descriptor: ERROR!!\n");
fprintf(stderr, "libusb_get_device_descriptor: ERROR!!\n");
return NULL;
}
@ -653,7 +653,7 @@ static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BY
if (error < 0)
{
printf("%s: Set interface altsetting get error num %d\n",
fprintf(stderr, "%s: Set interface altsetting get error num %d\n",
__func__, error);
}
}
@ -680,7 +680,7 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id
LibusbConfig = pdev->LibusbConfig;
if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces)
{
printf("Select Configuration: Libusb NumberInterfaces(%d) is different "
fprintf(stderr, "Select Configuration: Libusb NumberInterfaces(%d) is different "
"with MsConfig NumberInterfaces(%d)\n",
LibusbConfig->bNumInterfaces, MsConfig->NumInterfaces);
}
@ -826,7 +826,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
ret = libusb_set_configuration(libusb_handle, bConfigurationValue);
if (ret < 0){
printf("libusb_set_configuration: ERROR number %d!!\n", ret);
fprintf(stderr, "libusb_set_configuration: ERROR number %d!!\n", ret);
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
return -1;
}
@ -834,7 +834,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
{
ret = libusb_get_active_config_descriptor (libusb_dev, LibusbConfig);
if (ret < 0){
printf("libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
fprintf(stderr, "libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
return -1;
}
@ -884,7 +884,7 @@ static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId,
*UsbdStatus = 0;
/*
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
printf("request_queue_unregister_request: not fount request 0x%x\n", RequestId);
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
*/
return error;
}
@ -979,12 +979,12 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
ms_string_desc,
0x12,
Timeout);
//printf("Get ms string: result number %d", error);
//fprintf(stderr, "Get ms string: result number %d", error);
if (error > 0)
{
BYTE bMS_Vendorcode;
data_read_BYTE(ms_string_desc + 16, bMS_Vendorcode);
//printf("bMS_Vendorcode:0x%x", bMS_Vendorcode);
//fprintf(stderr, "bMS_Vendorcode:0x%x", bMS_Vendorcode);
/** get os descriptor */
error = libusb_control_transfer(pdev->libusb_handle,
LIBUSB_ENDPOINT_IN |LIBUSB_REQUEST_TYPE_VENDOR | Recipient,
@ -1003,7 +1003,7 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
*UsbdStatus = USBD_STATUS_SUCCESS;
/*
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
printf("request_queue_unregister_request: not fount request 0x%x\n", RequestId);
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
*/
return error;
}
@ -1262,7 +1262,7 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 E
if (iso_transfer == NULL)
{
printf("Error: libusb_alloc_transfer.\n");
fprintf(stderr, "Error: libusb_alloc_transfer.\n");
status = -1;
}
@ -1367,7 +1367,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request
if (!ep_desc)
{
printf("func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
fprintf(stderr, "func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
return -1;
}
transfer_type = (ep_desc->bmAttributes) & 0x3;
@ -1493,7 +1493,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request
if (request)
{
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
printf("request_queue_unregister_request: not fount request 0x%x\n", RequestId);
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
}
libusb_free_transfer(transfer);
@ -1698,7 +1698,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (status < 0)
{
printf("USB init: Error to get HUB handle!!\n");
fprintf(stderr, "USB init: Error to get HUB handle!!\n");
pdev->hub_handle = NULL;
}
@ -1706,7 +1706,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (!pdev->devDescriptor)
{
printf("USB init: Error to get device descriptor!!\n");
fprintf(stderr, "USB init: Error to get device descriptor!!\n");
zfree(pdev);
return NULL;
}
@ -1717,7 +1717,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (status < 0)
{
printf("libusb_get_descriptor: ERROR!!ret:%d\n", status);
fprintf(stderr, "libusb_get_descriptor: ERROR!!ret:%d\n", status);
zfree(pdev);
return NULL;
}
@ -1746,7 +1746,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
case CLASS_CONTENT_SECURITY:
//case CLASS_WIRELESS_CONTROLLER:
//case CLASS_ELSE_DEVICE:
printf(" Device is not supported!!\n");
fprintf(stderr, " Device is not supported!!\n");
zfree(pdev);
return NULL;
default:
@ -1812,7 +1812,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
ssize_t total_device;
int i, status, num = 0;
printf("VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
fprintf(stderr, "VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
array = (UDEVICE**) malloc(16 * sizeof(UDEVICE*));
@ -1833,7 +1833,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
if (status < 0)
{
printf("libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
fprintf(stderr, "libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
zfree(descriptor);
zfree(array[num]);
continue;
@ -1870,7 +1870,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
if (pDev->libusb_dev == NULL)
{
printf("libusb_device_new: ERROR!!\n");
fprintf(stderr, "libusb_device_new: ERROR!!\n");
zfree(pDev);
return NULL;
}
@ -1879,7 +1879,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
if (status < 0)
{
printf("libusb_open: (by addr) ERROR!!\n");
fprintf(stderr, "libusb_open: (by addr) ERROR!!\n");
zfree(pDev);
return NULL;
}

View File

@ -206,7 +206,7 @@ static int udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_n
}
else
{
printf("udevman_register_udevice: function error!!");
fprintf(stderr, "udevman_register_udevice: function error!!");
return 0;
}

View File

@ -100,7 +100,7 @@ TRANSFER_REQUEST* request_queue_get_request_by_endpoint(REQUEST_QUEUE* queue, BY
}
}
pthread_mutex_unlock(&queue->request_loading);
printf("request_queue_get_request_by_id: ERROR!!\n");
fprintf(stderr, "request_queue_get_request_by_id: ERROR!!\n");
return NULL;
}

View File

@ -156,16 +156,16 @@ static void searchman_list_show(USB_SEARCHMAN* self)
int num = 0;
USB_SEARCHDEV* usb;
printf("=========== Usb Search List ========= \n");
fprintf(stderr, "=========== Usb Search List ========= \n");
self->rewind(self);
while (self->has_next(self))
{
usb = self->get_next(self);
printf(" USB %d: \n", num++);
printf(" idVendor: 0x%04X \n", usb->idVendor);
printf(" idProduct: 0x%04X \n", usb->idProduct);
fprintf(stderr, " USB %d: \n", num++);
fprintf(stderr, " idVendor: 0x%04X \n", usb->idVendor);
fprintf(stderr, " idProduct: 0x%04X \n", usb->idProduct);
}
printf("================= END =============== \n");
fprintf(stderr, "================= END =============== \n");
}
void searchman_free(USB_SEARCHMAN* self)
@ -202,7 +202,7 @@ USB_SEARCHMAN* searchman_new(void * urbdrc, UINT32 UsbDevice)
if (ret != 0)
{
printf("searchman mutex initialization: searchman->mutex failed");
fprintf(stderr, "searchman mutex initialization: searchman->mutex failed");
exit(EXIT_FAILURE);
}

View File

@ -464,7 +464,7 @@ static void* urbdrc_search_usb_device(void* arg)
if (!udev)
{
printf("Can't create udev\n");
fprintf(stderr, "Can't create udev\n");
return 0;
}
@ -648,7 +648,7 @@ static void* urbdrc_search_usb_device(void* arg)
}
else
{
printf("No Device from receive_device(). An error occured.\n");
fprintf(stderr, "No Device from receive_device(). An error occured.\n");
}
}
}
@ -830,7 +830,7 @@ static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
transfer_data = (TRANSFER_DATA*) malloc(sizeof(TRANSFER_DATA));
if (transfer_data == NULL)
printf("transfer_data is NULL!!");
fprintf(stderr, "transfer_data is NULL!!");
transfer_data->callback = callback;
transfer_data->urbdrc = urbdrc;

View File

@ -291,7 +291,7 @@ static void df_process_channel_event(rdpChannels* channels, freerdp* instance)
break;
default:
printf("df_process_channel_event: unknown event type %d\n", GetMessageType(event->id));
fprintf(stderr, "df_process_channel_event: unknown event type %d\n", event->event_type);
break;
}
@ -338,17 +338,17 @@ int dfreerdp_run(freerdp* instance)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get channel manager file descriptor\n");
fprintf(stderr, "Failed to get channel manager file descriptor\n");
break;
}
if (df_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get dfreerdp file descriptor\n");
fprintf(stderr, "Failed to get dfreerdp file descriptor\n");
break;
}
@ -377,24 +377,24 @@ int dfreerdp_run(freerdp* instance)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
printf("dfreerdp_run: select failed\n");
fprintf(stderr, "dfreerdp_run: select failed\n");
break;
}
}
if (freerdp_check_fds(instance) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
break;
}
if (df_check_fds(instance, &rfds_set) != TRUE)
{
printf("Failed to check dfreerdp file descriptor\n");
fprintf(stderr, "Failed to check dfreerdp file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != TRUE)
{
printf("Failed to check channel manager file descriptor\n");
fprintf(stderr, "Failed to check channel manager file descriptor\n");
break;
}
df_process_channel_event(channels, instance);

View File

@ -175,7 +175,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
w = ps.rcPaint.right - ps.rcPaint.left + 1;
h = ps.rcPaint.bottom - ps.rcPaint.top + 1;
//printf("WM_PAINT: x:%d y:%d w:%d h:%d\n", x, y, w, h);
//fprintf(stderr, "WM_PAINT: x:%d y:%d w:%d h:%d\n", x, y, w, h);
BitBlt(hdc, x, y, w, h, wfi->primary->hdc, x - wfi->offset_x, y - wfi->offset_y, SRCCOPY);

View File

@ -62,7 +62,7 @@ BOOL wf_set_rop2(HDC hdc, int rop2)
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
printf("Unsupported ROP2: %d\n", rop2);
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
@ -537,7 +537,7 @@ void wf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits
}
else
{
printf("Unsupported codecID %d\n", surface_bits_command->codecID);
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
}
if (tile_bitmap != NULL)

View File

@ -161,7 +161,7 @@ void wf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (status != TRUE)
{
printf("Bitmap Decompression Failed\n");
fprintf(stderr, "Bitmap Decompression Failed\n");
}
}
else

View File

@ -84,7 +84,7 @@ int wf_create_console(void)
return 1;
freopen("CONOUT$", "w", stdout);
printf("Debug console created.\n");
fprintf(stderr, "Debug console created.\n");
return 0;
}
@ -222,7 +222,7 @@ BOOL wf_pre_connect(freerdp* instance)
{
file = freerdp_client_rdp_file_new();
printf("Using connection file: %s\n", settings->ConnectionFile);
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
freerdp_client_parse_rdp_file(file, settings->ConnectionFile);
freerdp_client_populate_settings_from_rdp_file(file, settings);
@ -291,7 +291,7 @@ BOOL wf_pre_connect(freerdp* instance)
if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) ||
(settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096))
{
printf("wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
fprintf(stderr, "wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
return 1;
}
@ -445,7 +445,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
if (status != NO_ERROR)
{
printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
fprintf(stderr, "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
return FALSE;
}
@ -454,7 +454,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
status = CredUIParseUserNameA(UserName, User, sizeof(User), Domain, sizeof(Domain));
//printf("User: %s Domain: %s Password: %s\n", User, Domain, Password);
//fprintf(stderr, "User: %s Domain: %s Password: %s\n", User, Domain, Password);
*username = _strdup(User);
@ -554,17 +554,17 @@ DWORD WINAPI wf_thread(LPVOID lpParam)
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
break;
}
if (wf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get wfreerdp file descriptor\n");
fprintf(stderr, "Failed to get wfreerdp file descriptor\n");
break;
}
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get channel manager file descriptor\n");
fprintf(stderr, "Failed to get channel manager file descriptor\n");
break;
}
@ -582,20 +582,20 @@ DWORD WINAPI wf_thread(LPVOID lpParam)
/* exit if nothing to do */
if (fds_count == 0)
{
printf("wfreerdp_run: fds_count is zero\n");
fprintf(stderr, "wfreerdp_run: fds_count is zero\n");
break;
}
/* do the wait */
if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED)
{
printf("wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
fprintf(stderr, "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
break;
}
if (freerdp_check_fds(instance) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
break;
}
if (freerdp_shall_disconnect(instance))
@ -604,12 +604,12 @@ DWORD WINAPI wf_thread(LPVOID lpParam)
}
if (wf_check_fds(instance) != TRUE)
{
printf("Failed to check wfreerdp file descriptor\n");
fprintf(stderr, "Failed to check wfreerdp file descriptor\n");
break;
}
if (freerdp_channels_check_fds(channels, instance) != TRUE)
{
printf("Failed to check channel manager file descriptor\n");
fprintf(stderr, "Failed to check channel manager file descriptor\n");
break;
}
wf_process_channel_event(channels, instance);
@ -659,7 +659,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
{
if (status == -1)
{
printf("keyboard thread error getting message\n");
fprintf(stderr, "keyboard thread error getting message\n");
break;
}
else
@ -673,7 +673,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
}
else
{
printf("failed to install keyboard hook\n");
fprintf(stderr, "failed to install keyboard hook\n");
}
return (DWORD) NULL;

View File

@ -68,7 +68,7 @@ BOOL xf_set_rop2(xfInfo* xfi, int rop2)
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
printf("Unsupported ROP2: %d\n", rop2);
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
@ -204,7 +204,7 @@ BOOL xf_set_rop3(xfInfo* xfi, int rop3)
if (function < 0)
{
printf("Unsupported ROP3: 0x%08X\n", rop3);
fprintf(stderr, "Unsupported ROP3: 0x%08X\n", rop3);
XSetFunction(xfi->display, xfi->gc, GXclear);
return FALSE;
}
@ -395,7 +395,7 @@ void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
else
{
printf("unimplemented brush style:%d\n", brush->style);
fprintf(stderr, "unimplemented brush style:%d\n", brush->style);
}
if (xfi->drawing == xfi->primary)
@ -491,7 +491,7 @@ void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult
void xf_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
{
printf("DrawNineGrid\n");
fprintf(stderr, "DrawNineGrid\n");
}
void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
@ -670,7 +670,7 @@ void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
else
{
printf("Mem3Blt unimplemented brush style:%d\n", brush->style);
fprintf(stderr, "Mem3Blt unimplemented brush style:%d\n", brush->style);
}
XCopyArea(xfi->display, bitmap->pixmap, xfi->drawing, xfi->gc,
@ -728,7 +728,7 @@ void xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
break;
default:
printf("PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
fprintf(stderr, "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
break;
}
@ -790,7 +790,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
break;
default:
printf("PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
fprintf(stderr, "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
break;
}
@ -848,7 +848,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
}
else
{
printf("PolygonCB unimplemented brush style:%d\n", brush->style);
fprintf(stderr, "PolygonCB unimplemented brush style:%d\n", brush->style);
}
XSetFunction(xfi->display, xfi->gc, GXcopy);
@ -859,12 +859,12 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
void xf_gdi_ellipse_sc(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc)
{
printf("EllipseSC\n");
fprintf(stderr, "EllipseSC\n");
}
void xf_gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
{
printf("EllipseCB\n");
fprintf(stderr, "EllipseCB\n");
}
void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
@ -1042,12 +1042,12 @@ void xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits
}
else
{
printf("Invalid bitmap size - data is %d bytes for %dx%d\n update", surface_bits_command->bitmapDataLength, surface_bits_command->width, surface_bits_command->height);
fprintf(stderr, "Invalid bitmap size - data is %d bytes for %dx%d\n update", surface_bits_command->bitmapDataLength, surface_bits_command->width, surface_bits_command->height);
}
}
else
{
printf("Unsupported codecID %d\n", surface_bits_command->codecID);
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
}
xf_unlock_x11(xfi, FALSE);

View File

@ -144,7 +144,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
switch (codec_id)
{
case RDP_CODEC_ID_NSCODEC:
printf("xf_Bitmap_Decompress: nsc not done\n");
fprintf(stderr, "xf_Bitmap_Decompress: nsc not done\n");
break;
case RDP_CODEC_ID_REMOTEFX:
@ -153,7 +153,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (msg == NULL)
{
printf("xf_Bitmap_Decompress: rfx Decompression Failed\n");
fprintf(stderr, "xf_Bitmap_Decompress: rfx Decompression Failed\n");
}
else
{
@ -176,7 +176,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
case RDP_CODEC_ID_JPEG:
if (!jpeg_decompress(data, bitmap->data, width, height, length, bpp))
{
printf("xf_Bitmap_Decompress: jpeg Decompression Failed\n");
fprintf(stderr, "xf_Bitmap_Decompress: jpeg Decompression Failed\n");
}
break;
@ -187,7 +187,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (status == FALSE)
{
printf("xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
fprintf(stderr, "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
}
}
else

View File

@ -97,7 +97,7 @@ void xf_kbd_send_key(xfInfo* xfi, BOOL down, BYTE keycode)
if (rdp_scancode == RDP_SCANCODE_UNKNOWN)
{
printf("Unknown key with X keycode 0x%02x\n", keycode);
fprintf(stderr, "Unknown key with X keycode 0x%02x\n", keycode);
}
else if (rdp_scancode == RDP_SCANCODE_PAUSE &&
!xf_kbd_key_pressed(xfi, XK_Control_L) && !xf_kbd_key_pressed(xfi, XK_Control_R))

View File

@ -487,7 +487,7 @@ void xf_process_rail_exec_result_event(xfInfo* xfi, rdpChannels* channels, wMess
if (exec_result->execResult != RAIL_EXEC_S_OK)
{
printf("RAIL exec error: execResult=%s NtError=0x%X\n",
fprintf(stderr, "RAIL exec error: execResult=%s NtError=0x%X\n",
error_code_names[exec_result->execResult], exec_result->rawResult);
xfi->disconnect = True;
}
@ -650,7 +650,7 @@ void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChannels* channels, wMessa
RAIL_GET_APPID_RESP_ORDER* appid_resp =
(RAIL_GET_APPID_RESP_ORDER*) event->wParam;
printf("Server Application ID Response PDU: windowId=0x%X "
fprintf(stderr, "Server Application ID Response PDU: windowId=0x%X "
"applicationId=(length=%d dump)\n",
appid_resp->windowId, appid_resp->applicationId.length);
@ -662,7 +662,7 @@ void xf_process_rail_langbarinfo_event(xfInfo* xfi, rdpChannels* channels, wMess
RAIL_LANGBAR_INFO_ORDER* langbar =
(RAIL_LANGBAR_INFO_ORDER*) event->wParam;
printf("Language Bar Information PDU: languageBarStatus=0x%X\n",
fprintf(stderr, "Language Bar Information PDU: languageBarStatus=0x%X\n",
langbar->languageBarStatus);
}

View File

@ -140,7 +140,7 @@ void xf_tsmf_init(xfInfo* xfi, long xv_port)
XFree(attr);
#ifdef WITH_DEBUG_XV
printf("xf_tsmf_init: pixel format ");
fprintf(stderr, "xf_tsmf_init: pixel format ");
#endif
fo = XvListImageFormats(xfi->display, xv->xv_port, &ret);
if (ret > 0)
@ -152,7 +152,7 @@ void xf_tsmf_init(xfInfo* xfi, long xv_port)
{
xv->xv_pixfmts[i] = fo[i].id;
#ifdef WITH_DEBUG_XV
printf("%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1],
fprintf(stderr, "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1],
((char*)(xv->xv_pixfmts + i))[2], ((char*)(xv->xv_pixfmts + i))[3]);
#endif
}
@ -160,7 +160,7 @@ void xf_tsmf_init(xfInfo* xfi, long xv_port)
}
XFree(fo);
#ifdef WITH_DEBUG_XV
printf("\n");
fprintf(stderr, "\n");
#endif
}

View File

@ -485,7 +485,7 @@ BOOL xf_get_pixmap_info(xfInfo* xfi)
if (pfs == NULL)
{
printf("xf_get_pixmap_info: XListPixmapFormats failed\n");
fprintf(stderr, "xf_get_pixmap_info: XListPixmapFormats failed\n");
return 1;
}
@ -508,7 +508,7 @@ BOOL xf_get_pixmap_info(xfInfo* xfi)
if (XGetWindowAttributes(xfi->display, RootWindowOfScreen(xfi->screen), &window_attributes) == 0)
{
printf("xf_get_pixmap_info: XGetWindowAttributes failed\n");
fprintf(stderr, "xf_get_pixmap_info: XGetWindowAttributes failed\n");
return FALSE;
}
@ -516,7 +516,7 @@ BOOL xf_get_pixmap_info(xfInfo* xfi)
if (vis == NULL)
{
printf("xf_get_pixmap_info: XGetVisualInfo failed\n");
fprintf(stderr, "xf_get_pixmap_info: XGetVisualInfo failed\n");
return FALSE;
}
@ -563,7 +563,7 @@ int xf_error_handler(Display* d, XErrorEvent* ev)
int do_abort = TRUE;
XGetErrorText(d, ev->error_code, buf, sizeof(buf));
printf("%s", buf);
fprintf(stderr, "%s", buf);
if (do_abort)
abort();
@ -628,7 +628,7 @@ BOOL xf_pre_connect(freerdp* instance)
{
file = freerdp_client_rdp_file_new();
printf("Using connection file: %s\n", settings->ConnectionFile);
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
freerdp_client_parse_rdp_file(file, settings->ConnectionFile);
freerdp_client_populate_settings_from_rdp_file(file, settings);
@ -694,7 +694,7 @@ BOOL xf_pre_connect(freerdp* instance)
{
if (!XInitThreads())
{
printf("warning: XInitThreads() failure\n");
fprintf(stderr, "warning: XInitThreads() failure\n");
xfi->UseXThreads = FALSE;
}
}
@ -703,14 +703,14 @@ BOOL xf_pre_connect(freerdp* instance)
if (xfi->display == NULL)
{
printf("xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
printf("Please check that the $DISPLAY environment variable is properly set.\n");
fprintf(stderr, "xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
fprintf(stderr, "Please check that the $DISPLAY environment variable is properly set.\n");
return FALSE;
}
if (xfi->debug)
{
printf("Enabling X11 debug mode.\n");
fprintf(stderr, "Enabling X11 debug mode.\n");
XSynchronize(xfi->display, TRUE);
_def_error_handler = XSetErrorHandler(_xf_error_handler);
}
@ -1272,7 +1272,7 @@ int xfreerdp_run(freerdp* instance)
{
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get FreeRDP file descriptor\n");
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
break;
}
@ -1282,7 +1282,7 @@ int xfreerdp_run(freerdp* instance)
{
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get channel manager file descriptor\n");
fprintf(stderr, "Failed to get channel manager file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
break;
}
@ -1292,7 +1292,7 @@ int xfreerdp_run(freerdp* instance)
{
if (xf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
printf("Failed to get xfreerdp file descriptor\n");
fprintf(stderr, "Failed to get xfreerdp file descriptor\n");
ret = XF_EXIT_CONN_FAILED;
break;
}
@ -1336,7 +1336,7 @@ int xfreerdp_run(freerdp* instance)
if (!((errno == EAGAIN) || (errno == EWOULDBLOCK) ||
(errno == EINPROGRESS) || (errno == EINTR))) /* signal occurred */
{
printf("xfreerdp_run: select failed\n");
fprintf(stderr, "xfreerdp_run: select failed\n");
break;
}
}
@ -1345,7 +1345,7 @@ int xfreerdp_run(freerdp* instance)
{
if (freerdp_check_fds(instance) != TRUE)
{
printf("Failed to check FreeRDP file descriptor\n");
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
break;
}
}
@ -1354,7 +1354,7 @@ int xfreerdp_run(freerdp* instance)
{
if (freerdp_channels_check_fds(channels, instance) != TRUE)
{
printf("Failed to check channel manager file descriptor\n");
fprintf(stderr, "Failed to check channel manager file descriptor\n");
break;
}
@ -1365,7 +1365,7 @@ int xfreerdp_run(freerdp* instance)
{
if (xf_process_x_events(instance) != TRUE)
{
printf("Closed from X11\n");
fprintf(stderr, "Closed from X11\n");
break;
}
}
@ -1375,7 +1375,7 @@ int xfreerdp_run(freerdp* instance)
{
if (!freerdp_message_queue_process_pending_messages(instance, FREERDP_INPUT_MESSAGE_QUEUE))
{
printf("User Disconnect\n");
fprintf(stderr, "User Disconnect\n");
xfi->disconnect = TRUE;
break;
}

View File

@ -61,3 +61,16 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()
if(IOS AND MONOLITHIC_BUILD AND (NOT BUILD_SHARED_LIBS))
# generate combined library
foreach(af ${${MODULE_PREFIX}_LIBS})
get_target_property(LOC ${af} LOCATION)
if ((NOT (${LOC} MATCHES ".*libfreerdp.a$")) AND (NOT (${LOC} MATCHES ".*libwinpr.a$")))
set(ALIST ${ALIST} ${LOC})
endif()
endforeach()
get_target_property(LOC ${MODULE_NAME} LOCATION)
set(ALIST ${ALIST} ${LOC})
message(${ALIST})
add_custom_command(TARGET ${MODULE_NAME} POST_BUILD COMMAND libtool -static -o libfreerdp-client-combined.a ${ALIST})
endif()

View File

@ -933,7 +933,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
if (compatibility)
{
printf("WARNING: Using deprecated command-line interface!\n");
fprintf(stderr, "WARNING: Using deprecated command-line interface!\n");
return freerdp_client_parse_old_command_line_arguments(argc, argv, settings);
}
else
@ -990,7 +990,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
if (!settings->ConnectionFile && !(arg->Flags & COMMAND_LINE_VALUE_PRESENT))
{
printf("error: server hostname was not specified with /v:<server>[:port]\n");
fprintf(stderr, "error: server hostname was not specified with /v:<server>[:port]\n");
return COMMAND_LINE_ERROR_MISSING_ARGUMENT;
}
@ -1114,7 +1114,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
if (!id)
{
printf("Could not identify keyboard layout: %s\n", arg->Value);
fprintf(stderr, "Could not identify keyboard layout: %s\n", arg->Value);
}
}
@ -1413,7 +1413,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
}
else
{
printf("unknown protocol security: %s\n", arg->Value);
fprintf(stderr, "unknown protocol security: %s\n", arg->Value);
}
}
CommandLineSwitchCase(arg, "sec-rdp")
@ -1592,7 +1592,7 @@ int freerdp_client_load_static_channel_addin(rdpChannels* channels, rdpSettings*
{
if (freerdp_channels_client_load(channels, settings, entry, data) == 0)
{
printf("loading channel %s\n", name);
fprintf(stderr, "loading channel %s\n", name);
return 0;
}
}

View File

@ -121,7 +121,7 @@ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
if (strcmp(args->argv[0], "cliprdr") == 0)
{
settings->RedirectClipboard = TRUE;
printf("--plugin cliprdr -> +clipboard\n");
fprintf(stderr, "--plugin cliprdr -> +clipboard\n");
}
else if (strcmp(args->argv[0], "rdpdr") == 0)
{
@ -401,37 +401,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "0")
{
settings->ConsoleSession = TRUE;
printf("-0 -> /admin\n");
fprintf(stderr, "-0 -> /admin\n");
}
CommandLineSwitchCase(arg, "a")
{
settings->ColorDepth = atoi(arg->Value);
printf("-a %s -> /bpp:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-a %s -> /bpp:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "c")
{
settings->ShellWorkingDirectory = _strdup(arg->Value);
printf("-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "D")
{
settings->Decorations = FALSE;
printf("-D -> -decorations\n");
fprintf(stderr, "-D -> -decorations\n");
}
CommandLineSwitchCase(arg, "T")
{
settings->WindowTitle = _strdup(arg->Value);
printf("-T %s -> /title:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-T %s -> /title:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "d")
{
settings->Domain = _strdup(arg->Value);
printf("-d %s -> /d:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-d %s -> /d:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "f")
{
settings->Fullscreen = TRUE;
printf("-f -> /f\n");
fprintf(stderr, "-f -> /f\n");
}
CommandLineSwitchCase(arg, "g")
{
@ -448,18 +448,18 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
free(str);
printf("-g %s -> /size:%s or /w:%d /h:%d\n", arg->Value, arg->Value,
fprintf(stderr, "-g %s -> /size:%s or /w:%d /h:%d\n", arg->Value, arg->Value,
settings->DesktopWidth, settings->DesktopHeight);
}
CommandLineSwitchCase(arg, "k")
{
sscanf(arg->Value, "%X", &(settings->KeyboardLayout));
printf("-k %s -> /kbd:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-k %s -> /kbd:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "K")
{
settings->GrabKeyboard = FALSE;
printf("-K -> -grab-keyboard\n");
fprintf(stderr, "-K -> -grab-keyboard\n");
}
CommandLineSwitchCase(arg, "n")
{
@ -468,27 +468,27 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "o")
{
settings->RemoteConsoleAudio = TRUE;
printf("-o -> /audio-mode:1\n");
fprintf(stderr, "-o -> /audio-mode:1\n");
}
CommandLineSwitchCase(arg, "p")
{
settings->Password = _strdup(arg->Value);
printf("-p %s -> /p:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-p %s -> /p:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "s")
{
settings->AlternateShell = _strdup(arg->Value);
printf("-s %s -> /shell:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-s %s -> /shell:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "t")
{
settings->ServerPort = atoi(arg->Value);
printf("-t %s -> /port:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-t %s -> /port:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "u")
{
settings->Username = _strdup(arg->Value);
printf("-u %s -> /u:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-u %s -> /u:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "x")
{
@ -515,31 +515,31 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
settings->PerformanceFlags = type;
}
printf("-x %s -> /network ", arg->Value);
fprintf(stderr, "-x %s -> /network ", arg->Value);
if (type == CONNECTION_TYPE_MODEM)
printf("modem");
fprintf(stderr, "modem");
else if (CONNECTION_TYPE_BROADBAND_HIGH)
printf("broadband");
fprintf(stderr, "broadband");
else if (CONNECTION_TYPE_LAN)
printf("lan");
fprintf(stderr, "lan");
printf("\n");
fprintf(stderr, "\n");
}
CommandLineSwitchCase(arg, "X")
{
settings->ParentWindowId = strtol(arg->Value, NULL, 0);
printf("-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
fprintf(stderr, "-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "z")
{
settings->CompressionEnabled = TRUE;
printf("-z -> /compression\n");
fprintf(stderr, "-z -> /compression\n");
}
CommandLineSwitchCase(arg, "app")
{
settings->RemoteApplicationMode = TRUE;
printf("--app -> /app + program name or alias\n");
fprintf(stderr, "--app -> /app + program name or alias\n");
}
CommandLineSwitchCase(arg, "ext")
{
@ -548,7 +548,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "no-auth")
{
settings->Authentication = FALSE;
printf("--no-auth -> -authentication\n");
fprintf(stderr, "--no-auth -> -authentication\n");
}
CommandLineSwitchCase(arg, "authonly")
{
@ -562,12 +562,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
{
settings->FastPathInput = FALSE;
settings->FastPathOutput = FALSE;
printf("--no-fastpath -> -fast-path\n");
fprintf(stderr, "--no-fastpath -> -fast-path\n");
}
CommandLineSwitchCase(arg, "no-motion")
{
settings->MouseMotion = FALSE;
printf("--no-motion -> -mouse-motion\n");
fprintf(stderr, "--no-motion -> -mouse-motion\n");
}
CommandLineSwitchCase(arg, "gdi")
{
@ -576,26 +576,26 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
else if (strcmp(arg->Value, "hw") == 0)
settings->SoftwareGdi = FALSE;
printf("--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
fprintf(stderr, "--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "no-osb")
{
settings->OffscreenSupportLevel = FALSE;
printf("--no-osb -> -offscreen-cache\n");
fprintf(stderr, "--no-osb -> -offscreen-cache\n");
}
CommandLineSwitchCase(arg, "no-bmp-cache")
{
settings->BitmapCacheEnabled = FALSE;
printf("--no-bmp-cache -> -bitmap-cache\n");
fprintf(stderr, "--no-bmp-cache -> -bitmap-cache\n");
}
CommandLineSwitchCase(arg, "plugin")
{
printf("--plugin -> /a, /vc, /dvc and channel-specific options\n");
fprintf(stderr, "--plugin -> /a, /vc, /dvc and channel-specific options\n");
}
CommandLineSwitchCase(arg, "rfx")
{
settings->RemoteFxCodec = TRUE;
printf("--rfx -> /rfx\n");
fprintf(stderr, "--rfx -> /rfx\n");
}
CommandLineSwitchCase(arg, "rfx-mode")
{
@ -604,37 +604,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
else if (arg->Value[0] == 'i')
settings->RemoteFxCodecMode = 0x02;
printf("--rfx-mode -> /rfx-mode\n");
fprintf(stderr, "--rfx-mode -> /rfx-mode\n");
}
CommandLineSwitchCase(arg, "nsc")
{
settings->NSCodec = TRUE;
printf("--nsc -> /nsc\n");
fprintf(stderr, "--nsc -> /nsc\n");
}
CommandLineSwitchCase(arg, "disable-wallpaper")
{
settings->DisableWallpaper = TRUE;
printf("--disable-wallpaper -> -wallpaper\n");
fprintf(stderr, "--disable-wallpaper -> -wallpaper\n");
}
CommandLineSwitchCase(arg, "composition")
{
settings->AllowDesktopComposition = TRUE;
printf("--composition -> +composition\n");
fprintf(stderr, "--composition -> +composition\n");
}
CommandLineSwitchCase(arg, "disable-full-window-drag")
{
settings->DisableFullWindowDrag = TRUE;
printf("--disable-full-window-drag -> -window-drag\n");
fprintf(stderr, "--disable-full-window-drag -> -window-drag\n");
}
CommandLineSwitchCase(arg, "disable-menu-animations")
{
settings->DisableMenuAnims = TRUE;
printf("--disable-menu-animations -> -menu-anims\n");
fprintf(stderr, "--disable-menu-animations -> -menu-anims\n");
}
CommandLineSwitchCase(arg, "disable-theming")
{
settings->DisableThemes = TRUE;
printf("--disable-theming -> -themes\n");
fprintf(stderr, "--disable-theming -> -themes\n");
}
CommandLineSwitchCase(arg, "ntlm")
{
@ -643,7 +643,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "ignore-certificate")
{
settings->IgnoreCertificate = TRUE;
printf("--ignore-certificate -> /cert-ignore\n");
fprintf(stderr, "--ignore-certificate -> /cert-ignore\n");
}
CommandLineSwitchCase(arg, "sec")
{
@ -669,22 +669,22 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
settings->NlaSecurity = TRUE;
}
printf("--sec %s -> /sec:%s\n", arg->Value, arg->Value);
fprintf(stderr, "--sec %s -> /sec:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "no-rdp")
{
settings->RdpSecurity = FALSE;
printf("--no-rdp -> -sec-rdp\n");
fprintf(stderr, "--no-rdp -> -sec-rdp\n");
}
CommandLineSwitchCase(arg, "no-tls")
{
settings->TlsSecurity = FALSE;
printf("--no-tls -> -sec-tls\n");
fprintf(stderr, "--no-tls -> -sec-tls\n");
}
CommandLineSwitchCase(arg, "no-nla")
{
settings->NlaSecurity = FALSE;
printf("--no-nla -> -sec-nla\n");
fprintf(stderr, "--no-nla -> -sec-nla\n");
}
CommandLineSwitchCase(arg, "secure-checksum")
{
@ -699,12 +699,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
}
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
printf("%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
fprintf(stderr, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
if (settings->ServerPort != 3389)
printf(" /port:%d", settings->ServerPort);
fprintf(stderr, " /port:%d", settings->ServerPort);
printf("\n");
fprintf(stderr, "\n");
return 1;
}

View File

@ -52,7 +52,7 @@ static WCHAR CR_LF_STR_W[] = { '\r', '\n', '\0' };
BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, char* name, int value)
{
#ifdef DEBUG_CLIENT_FILE
printf("%s:i:%d\n", name, value);
fprintf(stderr, "%s:i:%d\n", name, value);
#endif
if (_stricmp(name, "use multimon") == 0)
@ -222,7 +222,7 @@ void freerdp_client_parse_rdp_file_integer_ascii(rdpFile* file, char* name, char
BOOL freerdp_client_rdp_file_set_string(rdpFile* file, char* name, char* value)
{
#ifdef DEBUG_CLIENT_FILE
printf("%s:s:%s\n", name, value);
fprintf(stderr, "%s:s:%s\n", name, value);
#endif
if (_stricmp(name, "username") == 0)

View File

@ -118,6 +118,7 @@
C495F01816B937F90041304E /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01616B937F90041304E /* libssl.a */; };
C495F01A16B938210041304E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01916B938210041304E /* Security.framework */; };
C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01D16B938CA0041304E /* SystemConfiguration.framework */; };
C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */; };
C4C31C6F16BAD1890087BB12 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */; };
/* End PBXBuildFile section */
@ -280,6 +281,7 @@
C495F01616B937F90041304E /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = @FREERDP_IOS_EXTERNAL_SSL_PATH@/lib/libssl.a; sourceTree = "<group>"; };
C495F01916B938210041304E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
C495F01D16B938CA0041304E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfreerdp-client-combined.a"; path = "../common/libfreerdp-client-combined.a"; sourceTree = "<group>"; };
C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
@ -297,6 +299,7 @@
C495EE3816B8372D0041304E /* CoreGraphics.framework in Frameworks */,
C495F01A16B938210041304E /* Security.framework in Frameworks */,
C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */,
C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -323,6 +326,7 @@
C495EE3216B8372D0041304E /* Frameworks */ = {
isa = PBXGroup;
children = (
C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */,
C495EFAA16B912C40041304E /* libfreerdp.a */,
C495EFAD16B913980041304E /* libwinpr.a */,
C495F01516B937F80041304E /* libcrypto.a */,
@ -744,9 +748,7 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
);
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;

View File

@ -23,7 +23,7 @@
#include <stdio.h>
#define DEBUG_NULL(fmt, ...) do { } while (0)
#define DEBUG_PRINT(_dbg_str, fmt, ...) printf(_dbg_str fmt "\n" , __FUNCTION__, __LINE__, ## __VA_ARGS__)
#define DEBUG_PRINT(_dbg_str, fmt, ...) fprintf(stderr, _dbg_str fmt "\n" , __FUNCTION__, __LINE__, ## __VA_ARGS__)
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%d): ", fmt, ## __VA_ARGS__)
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%d): ", fmt, ## __VA_ARGS__)

View File

@ -211,7 +211,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 inde
if (id > bitmap_cache->maxCells)
{
printf("get invalid bitmap cell id: %d\n", id);
fprintf(stderr, "get invalid bitmap cell id: %d\n", id);
return NULL;
}
@ -221,7 +221,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 inde
}
else if (index > bitmap_cache->cells[id].number)
{
printf("get invalid bitmap index %d in cell id: %d\n", index, id);
fprintf(stderr, "get invalid bitmap index %d in cell id: %d\n", index, id);
return NULL;
}
@ -234,7 +234,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, rdp
{
if (id > bitmap_cache->maxCells)
{
printf("put invalid bitmap cell id: %d\n", id);
fprintf(stderr, "put invalid bitmap cell id: %d\n", id);
return;
}
@ -244,7 +244,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, rdp
}
else if (index > bitmap_cache->cells[id].number)
{
printf("put invalid bitmap index %d in cell id: %d\n", index, id);
fprintf(stderr, "put invalid bitmap index %d in cell id: %d\n", index, id);
return;
}

View File

@ -95,7 +95,7 @@ void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp)
{
if (index >= brush->maxMonoEntries)
{
printf("invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -106,7 +106,7 @@ void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp)
{
if (index >= brush->maxEntries)
{
printf("invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -116,7 +116,7 @@ void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp)
if (entry == NULL)
{
printf("invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
fprintf(stderr, "invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -131,7 +131,7 @@ void brush_cache_put(rdpBrushCache* brush, UINT32 index, void* entry, UINT32 bpp
{
if (index >= brush->maxMonoEntries)
{
printf("invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
return;
}
@ -147,7 +147,7 @@ void brush_cache_put(rdpBrushCache* brush, UINT32 index, void* entry, UINT32 bpp
{
if (index >= brush->maxEntries)
{
printf("invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
return;
}

View File

@ -362,13 +362,13 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index)
if (id > 9)
{
printf("invalid glyph cache id: %d\n", id);
fprintf(stderr, "invalid glyph cache id: %d\n", id);
return NULL;
}
if (index > glyph_cache->glyphCache[id].number)
{
printf("invalid glyph cache index: %d in cache id: %d\n", index, id);
fprintf(stderr, "invalid glyph cache index: %d in cache id: %d\n", index, id);
return NULL;
}
@ -376,7 +376,7 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index)
if (glyph == NULL)
{
printf("invalid glyph at cache index: %d in cache id: %d\n", index, id);
fprintf(stderr, "invalid glyph at cache index: %d in cache id: %d\n", index, id);
}
return glyph;
@ -388,13 +388,13 @@ void glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, rdpGly
if (id > 9)
{
printf("invalid glyph cache id: %d\n", id);
fprintf(stderr, "invalid glyph cache id: %d\n", id);
return;
}
if (index > glyph_cache->glyphCache[id].number)
{
printf("invalid glyph cache index: %d in cache id: %d\n", index, id);
fprintf(stderr, "invalid glyph cache index: %d in cache id: %d\n", index, id);
return;
}
@ -419,7 +419,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyph_cache, UINT32 index, UINT32*
if (fragment == NULL)
{
printf("invalid glyph fragment at index:%d\n", index);
fprintf(stderr, "invalid glyph fragment at index:%d\n", index);
}
return fragment;

View File

@ -60,7 +60,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
if (index >= nine_grid->maxEntries)
{
printf("invalid NineGrid index: 0x%04X\n", index);
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
return NULL;
}
@ -68,7 +68,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
if (entry == NULL)
{
printf("invalid NineGrid at index: 0x%04X\n", index);
fprintf(stderr, "invalid NineGrid at index: 0x%04X\n", index);
return NULL;
}
@ -81,7 +81,7 @@ void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry)
if (index >= nine_grid->maxEntries)
{
printf("invalid NineGrid index: 0x%04X\n", index);
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
return;
}

View File

@ -80,7 +80,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, UINT32 index)
if (index >= offscreen_cache->maxEntries)
{
printf("invalid offscreen bitmap index: 0x%04X\n", index);
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
return NULL;
}
@ -88,7 +88,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, UINT32 index)
if (bitmap == NULL)
{
printf("invalid offscreen bitmap at index: 0x%04X\n", index);
fprintf(stderr, "invalid offscreen bitmap at index: 0x%04X\n", index);
return NULL;
}
@ -99,7 +99,7 @@ void offscreen_cache_put(rdpOffscreenCache* offscreen, UINT32 index, rdpBitmap*
{
if (index >= offscreen->maxEntries)
{
printf("invalid offscreen bitmap index: 0x%04X\n", index);
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
return;
}
@ -113,7 +113,7 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreen, UINT32 index)
if (index >= offscreen->maxEntries)
{
printf("invalid offscreen bitmap index (delete): 0x%04X\n", index);
fprintf(stderr, "invalid offscreen bitmap index (delete): 0x%04X\n", index);
return;
}

View File

@ -44,7 +44,7 @@ void* palette_cache_get(rdpPaletteCache* palette_cache, UINT32 index)
if (index >= palette_cache->maxEntries)
{
printf("invalid color table index: 0x%04X\n", index);
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
return NULL;
}
@ -52,7 +52,7 @@ void* palette_cache_get(rdpPaletteCache* palette_cache, UINT32 index)
if (entry == NULL)
{
printf("invalid color table at index: 0x%04X\n", index);
fprintf(stderr, "invalid color table at index: 0x%04X\n", index);
return NULL;
}
@ -63,7 +63,7 @@ void palette_cache_put(rdpPaletteCache* palette_cache, UINT32 index, void* entry
{
if (index >= palette_cache->maxEntries)
{
printf("invalid color table index: 0x%04X\n", index);
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
return;
}

View File

@ -47,7 +47,7 @@ void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_s
break;
default:
printf("Unknown system pointer type (0x%08X)\n", pointer_system->type);
fprintf(stderr, "Unknown system pointer type (0x%08X)\n", pointer_system->type);
break;
}
}
@ -131,7 +131,7 @@ rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index)
if (index >= pointer_cache->cacheSize)
{
printf("invalid pointer index:%d\n", index);
fprintf(stderr, "invalid pointer index:%d\n", index);
return NULL;
}
@ -146,7 +146,7 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer*
if (index >= pointer_cache->cacheSize)
{
printf("invalid pointer index:%d\n", index);
fprintf(stderr, "invalid pointer index:%d\n", index);
return;
}

View File

@ -81,7 +81,7 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag)
void rdpsnd_print_audio_format(AUDIO_FORMAT* format)
{
printf("%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d "
fprintf(stderr, "%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d "
"nBlockAlign: %d wBitsPerSample: %d cbSize: %d\n",
rdpsnd_get_audio_tag_string(format->wFormatTag), format->wFormatTag,
format->nChannels, format->nSamplesPerSec, format->nAvgBytesPerSec,
@ -95,17 +95,17 @@ void rdpsnd_print_audio_formats(AUDIO_FORMAT* formats, UINT16 count)
if (formats)
{
printf("AUDIO_FORMATS (%d) =\n{\n", count);
fprintf(stderr, "AUDIO_FORMATS (%d) =\n{\n", count);
for (index = 0; index < (int) count; index++)
{
format = &formats[index];
printf("\t");
fprintf(stderr, "\t");
rdpsnd_print_audio_format(format);
}
printf("}\n");
fprintf(stderr, "}\n");
}
}

View File

@ -151,7 +151,7 @@ int decompress_rdp(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, UIN
break;
default:
printf("mppc.c: invalid RDP compression code 0x%2.2x\n", type);
fprintf(stderr, "mppc.c: invalid RDP compression code 0x%2.2x\n", type);
return FALSE;
}
}
@ -184,11 +184,11 @@ int decompress_rdp_4(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, U
int tmp;
UINT32 i32;
printf("decompress_rdp_4:\n");
fprintf(stderr, "decompress_rdp_4:\n");
if ((dec == NULL) || (dec->history_buf == NULL))
{
printf("decompress_rdp_4: null\n");
fprintf(stderr, "decompress_rdp_4: null\n");
return FALSE;
}
@ -616,7 +616,7 @@ int decompress_rdp_5(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, U
if ((dec == NULL) || (dec->history_buf == NULL))
{
printf("decompress_rdp_5: null\n");
fprintf(stderr, "decompress_rdp_5: null\n");
return FALSE;
}
@ -1082,7 +1082,7 @@ int decompress_rdp_6(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, U
if ((dec == NULL) || (dec->history_buf == NULL))
{
printf("decompress_rdp_6: null\n");
fprintf(stderr, "decompress_rdp_6: null\n");
return FALSE;
}
@ -1417,7 +1417,7 @@ struct rdp_mppc_dec* mppc_dec_new(void)
ptr = (struct rdp_mppc_dec*) malloc(sizeof(struct rdp_mppc_dec));
if (!ptr)
{
printf("mppc_new(): system out of memory\n");
fprintf(stderr, "mppc_new(): system out of memory\n");
return NULL;
}
@ -1429,7 +1429,7 @@ struct rdp_mppc_dec* mppc_dec_new(void)
if (!ptr->history_buf)
{
printf("mppc_new(): system out of memory\n");
fprintf(stderr, "mppc_new(): system out of memory\n");
free(ptr);
return NULL;
}

View File

@ -254,7 +254,7 @@ BOOL rdp_print_general_capability_set(wStream* s, UINT16 length)
if (length < 24)
return FALSE;
printf("GeneralCapabilitySet (length %d):\n", length);
fprintf(stderr, "GeneralCapabilitySet (length %d):\n", length);
stream_read_UINT16(s, osMajorType); /* osMajorType (2 bytes) */
stream_read_UINT16(s, osMinorType); /* osMinorType (2 bytes) */
@ -268,17 +268,17 @@ BOOL rdp_print_general_capability_set(wStream* s, UINT16 length)
stream_read_BYTE(s, refreshRectSupport); /* refreshRectSupport (1 byte) */
stream_read_BYTE(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */
printf("\tosMajorType: 0x%04X\n", osMajorType);
printf("\tosMinorType: 0x%04X\n", osMinorType);
printf("\tprotocolVersion: 0x%04X\n", protocolVersion);
printf("\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
printf("\tgeneralCompressionTypes: 0x%04X\n", generalCompressionTypes);
printf("\textraFlags: 0x%04X\n", extraFlags);
printf("\tupdateCapabilityFlag: 0x%04X\n", updateCapabilityFlag);
printf("\tremoteUnshareFlag: 0x%04X\n", remoteUnshareFlag);
printf("\tgeneralCompressionLevel: 0x%04X\n", generalCompressionLevel);
printf("\trefreshRectSupport: 0x%02X\n", refreshRectSupport);
printf("\tsuppressOutputSupport: 0x%02X\n", suppressOutputSupport);
fprintf(stderr, "\tosMajorType: 0x%04X\n", osMajorType);
fprintf(stderr, "\tosMinorType: 0x%04X\n", osMinorType);
fprintf(stderr, "\tprotocolVersion: 0x%04X\n", protocolVersion);
fprintf(stderr, "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
fprintf(stderr, "\tgeneralCompressionTypes: 0x%04X\n", generalCompressionTypes);
fprintf(stderr, "\textraFlags: 0x%04X\n", extraFlags);
fprintf(stderr, "\tupdateCapabilityFlag: 0x%04X\n", updateCapabilityFlag);
fprintf(stderr, "\tremoteUnshareFlag: 0x%04X\n", remoteUnshareFlag);
fprintf(stderr, "\tgeneralCompressionLevel: 0x%04X\n", generalCompressionLevel);
fprintf(stderr, "\trefreshRectSupport: 0x%02X\n", refreshRectSupport);
fprintf(stderr, "\tsuppressOutputSupport: 0x%02X\n", suppressOutputSupport);
return TRUE;
}
@ -394,7 +394,7 @@ BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length)
UINT16 multipleRectangleSupport;
UINT16 pad2OctetsB;
printf("BitmapCapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCapabilitySet (length %d):\n", length);
if (length < 28)
return FALSE;
@ -413,19 +413,19 @@ BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, multipleRectangleSupport); /* multipleRectangleSupport (2 bytes) */
stream_read_UINT16(s, pad2OctetsB); /* pad2OctetsB (2 bytes) */
printf("\tpreferredBitsPerPixel: 0x%04X\n", preferredBitsPerPixel);
printf("\treceive1BitPerPixel: 0x%04X\n", receive1BitPerPixel);
printf("\treceive4BitsPerPixel: 0x%04X\n", receive4BitsPerPixel);
printf("\treceive8BitsPerPixel: 0x%04X\n", receive8BitsPerPixel);
printf("\tdesktopWidth: 0x%04X\n", desktopWidth);
printf("\tdesktopHeight: 0x%04X\n", desktopHeight);
printf("\tpad2Octets: 0x%04X\n", pad2Octets);
printf("\tdesktopResizeFlag: 0x%04X\n", desktopResizeFlag);
printf("\tbitmapCompressionFlag: 0x%04X\n", bitmapCompressionFlag);
printf("\thighColorFlags: 0x%02X\n", highColorFlags);
printf("\tdrawingFlags: 0x%02X\n", drawingFlags);
printf("\tmultipleRectangleSupport: 0x%04X\n", multipleRectangleSupport);
printf("\tpad2OctetsB: 0x%04X\n", pad2OctetsB);
fprintf(stderr, "\tpreferredBitsPerPixel: 0x%04X\n", preferredBitsPerPixel);
fprintf(stderr, "\treceive1BitPerPixel: 0x%04X\n", receive1BitPerPixel);
fprintf(stderr, "\treceive4BitsPerPixel: 0x%04X\n", receive4BitsPerPixel);
fprintf(stderr, "\treceive8BitsPerPixel: 0x%04X\n", receive8BitsPerPixel);
fprintf(stderr, "\tdesktopWidth: 0x%04X\n", desktopWidth);
fprintf(stderr, "\tdesktopHeight: 0x%04X\n", desktopHeight);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
fprintf(stderr, "\tdesktopResizeFlag: 0x%04X\n", desktopResizeFlag);
fprintf(stderr, "\tbitmapCompressionFlag: 0x%04X\n", bitmapCompressionFlag);
fprintf(stderr, "\thighColorFlags: 0x%02X\n", highColorFlags);
fprintf(stderr, "\tdrawingFlags: 0x%02X\n", drawingFlags);
fprintf(stderr, "\tmultipleRectangleSupport: 0x%04X\n", multipleRectangleSupport);
fprintf(stderr, "\tpad2OctetsB: 0x%04X\n", pad2OctetsB);
return TRUE;
}
@ -550,7 +550,7 @@ BOOL rdp_print_order_capability_set(wStream* s, UINT16 length)
UINT16 textANSICodePage;
UINT16 pad2OctetsE;
printf("OrderCapabilitySet (length %d):\n", length);
fprintf(stderr, "OrderCapabilitySet (length %d):\n", length);
if (length < 88)
return FALSE;
@ -573,56 +573,56 @@ BOOL rdp_print_order_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */
stream_read_UINT16(s, pad2OctetsE); /* pad2OctetsE (2 bytes) */
printf("\tpad4OctetsA: 0x%08X\n", pad4OctetsA);
printf("\tdesktopSaveXGranularity: 0x%04X\n", desktopSaveXGranularity);
printf("\tdesktopSaveYGranularity: 0x%04X\n", desktopSaveYGranularity);
printf("\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
printf("\tmaximumOrderLevel: 0x%04X\n", maximumOrderLevel);
printf("\tnumberFonts: 0x%04X\n", numberFonts);
printf("\torderFlags: 0x%04X\n", orderFlags);
fprintf(stderr, "\tpad4OctetsA: 0x%08X\n", pad4OctetsA);
fprintf(stderr, "\tdesktopSaveXGranularity: 0x%04X\n", desktopSaveXGranularity);
fprintf(stderr, "\tdesktopSaveYGranularity: 0x%04X\n", desktopSaveYGranularity);
fprintf(stderr, "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
fprintf(stderr, "\tmaximumOrderLevel: 0x%04X\n", maximumOrderLevel);
fprintf(stderr, "\tnumberFonts: 0x%04X\n", numberFonts);
fprintf(stderr, "\torderFlags: 0x%04X\n", orderFlags);
printf("\torderSupport:\n");
printf("\t\tDSTBLT: %d\n", orderSupport[NEG_DSTBLT_INDEX]);
printf("\t\tPATBLT: %d\n", orderSupport[NEG_PATBLT_INDEX]);
printf("\t\tSCRBLT: %d\n", orderSupport[NEG_SCRBLT_INDEX]);
printf("\t\tMEMBLT: %d\n", orderSupport[NEG_MEMBLT_INDEX]);
printf("\t\tMEM3BLT: %d\n", orderSupport[NEG_MEM3BLT_INDEX]);
printf("\t\tATEXTOUT: %d\n", orderSupport[NEG_ATEXTOUT_INDEX]);
printf("\t\tAEXTTEXTOUT: %d\n", orderSupport[NEG_AEXTTEXTOUT_INDEX]);
printf("\t\tDRAWNINEGRID: %d\n", orderSupport[NEG_DRAWNINEGRID_INDEX]);
printf("\t\tLINETO: %d\n", orderSupport[NEG_LINETO_INDEX]);
printf("\t\tMULTI_DRAWNINEGRID: %d\n", orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]);
printf("\t\tOPAQUE_RECT: %d\n", orderSupport[NEG_OPAQUE_RECT_INDEX]);
printf("\t\tSAVEBITMAP: %d\n", orderSupport[NEG_SAVEBITMAP_INDEX]);
printf("\t\tWTEXTOUT: %d\n", orderSupport[NEG_WTEXTOUT_INDEX]);
printf("\t\tMEMBLT_V2: %d\n", orderSupport[NEG_MEMBLT_V2_INDEX]);
printf("\t\tMEM3BLT_V2: %d\n", orderSupport[NEG_MEM3BLT_V2_INDEX]);
printf("\t\tMULTIDSTBLT: %d\n", orderSupport[NEG_MULTIDSTBLT_INDEX]);
printf("\t\tMULTIPATBLT: %d\n", orderSupport[NEG_MULTIPATBLT_INDEX]);
printf("\t\tMULTISCRBLT: %d\n", orderSupport[NEG_MULTISCRBLT_INDEX]);
printf("\t\tMULTIOPAQUERECT: %d\n", orderSupport[NEG_MULTIOPAQUERECT_INDEX]);
printf("\t\tFAST_INDEX: %d\n", orderSupport[NEG_FAST_INDEX_INDEX]);
printf("\t\tPOLYGON_SC: %d\n", orderSupport[NEG_POLYGON_SC_INDEX]);
printf("\t\tPOLYGON_CB: %d\n", orderSupport[NEG_POLYGON_CB_INDEX]);
printf("\t\tPOLYLINE: %d\n", orderSupport[NEG_POLYLINE_INDEX]);
printf("\t\tUNUSED23: %d\n", orderSupport[NEG_UNUSED23_INDEX]);
printf("\t\tFAST_GLYPH: %d\n", orderSupport[NEG_FAST_GLYPH_INDEX]);
printf("\t\tELLIPSE_SC: %d\n", orderSupport[NEG_ELLIPSE_SC_INDEX]);
printf("\t\tELLIPSE_CB: %d\n", orderSupport[NEG_ELLIPSE_CB_INDEX]);
printf("\t\tGLYPH_INDEX: %d\n", orderSupport[NEG_GLYPH_INDEX_INDEX]);
printf("\t\tGLYPH_WEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]);
printf("\t\tGLYPH_WLONGTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]);
printf("\t\tGLYPH_WLONGEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX]);
printf("\t\tUNUSED31: %d\n", orderSupport[NEG_UNUSED31_INDEX]);
fprintf(stderr, "\torderSupport:\n");
fprintf(stderr, "\t\tDSTBLT: %d\n", orderSupport[NEG_DSTBLT_INDEX]);
fprintf(stderr, "\t\tPATBLT: %d\n", orderSupport[NEG_PATBLT_INDEX]);
fprintf(stderr, "\t\tSCRBLT: %d\n", orderSupport[NEG_SCRBLT_INDEX]);
fprintf(stderr, "\t\tMEMBLT: %d\n", orderSupport[NEG_MEMBLT_INDEX]);
fprintf(stderr, "\t\tMEM3BLT: %d\n", orderSupport[NEG_MEM3BLT_INDEX]);
fprintf(stderr, "\t\tATEXTOUT: %d\n", orderSupport[NEG_ATEXTOUT_INDEX]);
fprintf(stderr, "\t\tAEXTTEXTOUT: %d\n", orderSupport[NEG_AEXTTEXTOUT_INDEX]);
fprintf(stderr, "\t\tDRAWNINEGRID: %d\n", orderSupport[NEG_DRAWNINEGRID_INDEX]);
fprintf(stderr, "\t\tLINETO: %d\n", orderSupport[NEG_LINETO_INDEX]);
fprintf(stderr, "\t\tMULTI_DRAWNINEGRID: %d\n", orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]);
fprintf(stderr, "\t\tOPAQUE_RECT: %d\n", orderSupport[NEG_OPAQUE_RECT_INDEX]);
fprintf(stderr, "\t\tSAVEBITMAP: %d\n", orderSupport[NEG_SAVEBITMAP_INDEX]);
fprintf(stderr, "\t\tWTEXTOUT: %d\n", orderSupport[NEG_WTEXTOUT_INDEX]);
fprintf(stderr, "\t\tMEMBLT_V2: %d\n", orderSupport[NEG_MEMBLT_V2_INDEX]);
fprintf(stderr, "\t\tMEM3BLT_V2: %d\n", orderSupport[NEG_MEM3BLT_V2_INDEX]);
fprintf(stderr, "\t\tMULTIDSTBLT: %d\n", orderSupport[NEG_MULTIDSTBLT_INDEX]);
fprintf(stderr, "\t\tMULTIPATBLT: %d\n", orderSupport[NEG_MULTIPATBLT_INDEX]);
fprintf(stderr, "\t\tMULTISCRBLT: %d\n", orderSupport[NEG_MULTISCRBLT_INDEX]);
fprintf(stderr, "\t\tMULTIOPAQUERECT: %d\n", orderSupport[NEG_MULTIOPAQUERECT_INDEX]);
fprintf(stderr, "\t\tFAST_INDEX: %d\n", orderSupport[NEG_FAST_INDEX_INDEX]);
fprintf(stderr, "\t\tPOLYGON_SC: %d\n", orderSupport[NEG_POLYGON_SC_INDEX]);
fprintf(stderr, "\t\tPOLYGON_CB: %d\n", orderSupport[NEG_POLYGON_CB_INDEX]);
fprintf(stderr, "\t\tPOLYLINE: %d\n", orderSupport[NEG_POLYLINE_INDEX]);
fprintf(stderr, "\t\tUNUSED23: %d\n", orderSupport[NEG_UNUSED23_INDEX]);
fprintf(stderr, "\t\tFAST_GLYPH: %d\n", orderSupport[NEG_FAST_GLYPH_INDEX]);
fprintf(stderr, "\t\tELLIPSE_SC: %d\n", orderSupport[NEG_ELLIPSE_SC_INDEX]);
fprintf(stderr, "\t\tELLIPSE_CB: %d\n", orderSupport[NEG_ELLIPSE_CB_INDEX]);
fprintf(stderr, "\t\tGLYPH_INDEX: %d\n", orderSupport[NEG_GLYPH_INDEX_INDEX]);
fprintf(stderr, "\t\tGLYPH_WEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]);
fprintf(stderr, "\t\tGLYPH_WLONGTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]);
fprintf(stderr, "\t\tGLYPH_WLONGEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX]);
fprintf(stderr, "\t\tUNUSED31: %d\n", orderSupport[NEG_UNUSED31_INDEX]);
printf("\ttextFlags: 0x%04X\n", textFlags);
printf("\torderSupportExFlags: 0x%04X\n", orderSupportExFlags);
printf("\tpad4OctetsB: 0x%08X\n", pad4OctetsB);
printf("\tdesktopSaveSize: 0x%08X\n", desktopSaveSize);
printf("\tpad2OctetsC: 0x%04X\n", pad2OctetsC);
printf("\tpad2OctetsD: 0x%04X\n", pad2OctetsD);
printf("\ttextANSICodePage: 0x%04X\n", textANSICodePage);
printf("\tpad2OctetsE: 0x%04X\n", pad2OctetsE);
fprintf(stderr, "\ttextFlags: 0x%04X\n", textFlags);
fprintf(stderr, "\torderSupportExFlags: 0x%04X\n", orderSupportExFlags);
fprintf(stderr, "\tpad4OctetsB: 0x%08X\n", pad4OctetsB);
fprintf(stderr, "\tdesktopSaveSize: 0x%08X\n", desktopSaveSize);
fprintf(stderr, "\tpad2OctetsC: 0x%04X\n", pad2OctetsC);
fprintf(stderr, "\tpad2OctetsD: 0x%04X\n", pad2OctetsD);
fprintf(stderr, "\ttextANSICodePage: 0x%04X\n", textANSICodePage);
fprintf(stderr, "\tpad2OctetsE: 0x%04X\n", pad2OctetsE);
return TRUE;
}
@ -706,7 +706,7 @@ BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length)
UINT16 Cache2Entries;
UINT16 Cache2MaximumCellSize;
printf("BitmapCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCacheCapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -724,18 +724,18 @@ BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, Cache2Entries); /* Cache2Entries (2 bytes) */
stream_read_UINT16(s, Cache2MaximumCellSize); /* Cache2MaximumCellSize (2 bytes) */
printf("\tpad1: 0x%08X\n", pad1);
printf("\tpad2: 0x%08X\n", pad2);
printf("\tpad3: 0x%08X\n", pad3);
printf("\tpad4: 0x%08X\n", pad4);
printf("\tpad5: 0x%08X\n", pad5);
printf("\tpad6: 0x%08X\n", pad6);
printf("\tCache0Entries: 0x%04X\n", Cache0Entries);
printf("\tCache0MaximumCellSize: 0x%04X\n", Cache0MaximumCellSize);
printf("\tCache1Entries: 0x%04X\n", Cache1Entries);
printf("\tCache1MaximumCellSize: 0x%04X\n", Cache1MaximumCellSize);
printf("\tCache2Entries: 0x%04X\n", Cache2Entries);
printf("\tCache2MaximumCellSize: 0x%04X\n", Cache2MaximumCellSize);
fprintf(stderr, "\tpad1: 0x%08X\n", pad1);
fprintf(stderr, "\tpad2: 0x%08X\n", pad2);
fprintf(stderr, "\tpad3: 0x%08X\n", pad3);
fprintf(stderr, "\tpad4: 0x%08X\n", pad4);
fprintf(stderr, "\tpad5: 0x%08X\n", pad5);
fprintf(stderr, "\tpad6: 0x%08X\n", pad6);
fprintf(stderr, "\tCache0Entries: 0x%04X\n", Cache0Entries);
fprintf(stderr, "\tCache0MaximumCellSize: 0x%04X\n", Cache0MaximumCellSize);
fprintf(stderr, "\tCache1Entries: 0x%04X\n", Cache1Entries);
fprintf(stderr, "\tCache1MaximumCellSize: 0x%04X\n", Cache1MaximumCellSize);
fprintf(stderr, "\tCache2Entries: 0x%04X\n", Cache2Entries);
fprintf(stderr, "\tCache2MaximumCellSize: 0x%04X\n", Cache2MaximumCellSize);
return TRUE;
}
@ -789,7 +789,7 @@ BOOL rdp_print_control_capability_set(wStream* s, UINT16 length)
UINT16 controlInterest;
UINT16 detachInterest;
printf("ControlCapabilitySet (length %d):\n", length);
fprintf(stderr, "ControlCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -799,10 +799,10 @@ BOOL rdp_print_control_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, controlInterest); /* controlInterest (2 bytes) */
stream_read_UINT16(s, detachInterest); /* detachInterest (2 bytes) */
printf("\tcontrolFlags: 0x%04X\n", controlFlags);
printf("\tremoteDetachFlag: 0x%04X\n", remoteDetachFlag);
printf("\tcontrolInterest: 0x%04X\n", controlInterest);
printf("\tdetachInterest: 0x%04X\n", detachInterest);
fprintf(stderr, "\tcontrolFlags: 0x%04X\n", controlFlags);
fprintf(stderr, "\tremoteDetachFlag: 0x%04X\n", remoteDetachFlag);
fprintf(stderr, "\tcontrolInterest: 0x%04X\n", controlInterest);
fprintf(stderr, "\tdetachInterest: 0x%04X\n", detachInterest);
return TRUE;
}
@ -856,7 +856,7 @@ BOOL rdp_print_window_activation_capability_set(wStream* s, UINT16 length)
UINT16 helpExtendedKeyFlag;
UINT16 windowManagerKeyFlag;
printf("WindowActivationCapabilitySet (length %d):\n", length);
fprintf(stderr, "WindowActivationCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -866,10 +866,10 @@ BOOL rdp_print_window_activation_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, helpExtendedKeyFlag); /* helpExtendedKeyFlag (2 bytes) */
stream_read_UINT16(s, windowManagerKeyFlag); /* windowManagerKeyFlag (2 bytes) */
printf("\thelpKeyFlag: 0x%04X\n", helpKeyFlag);
printf("\thelpKeyIndexFlag: 0x%04X\n", helpKeyIndexFlag);
printf("\thelpExtendedKeyFlag: 0x%04X\n", helpExtendedKeyFlag);
printf("\twindowManagerKeyFlag: 0x%04X\n", windowManagerKeyFlag);
fprintf(stderr, "\thelpKeyFlag: 0x%04X\n", helpKeyFlag);
fprintf(stderr, "\thelpKeyIndexFlag: 0x%04X\n", helpKeyIndexFlag);
fprintf(stderr, "\thelpExtendedKeyFlag: 0x%04X\n", helpExtendedKeyFlag);
fprintf(stderr, "\twindowManagerKeyFlag: 0x%04X\n", windowManagerKeyFlag);
return TRUE;
}
@ -941,15 +941,15 @@ BOOL rdp_print_pointer_capability_set(wStream* s, UINT16 length)
if (length < 10)
return FALSE;
printf("PointerCapabilitySet (length %d):\n", length);
fprintf(stderr, "PointerCapabilitySet (length %d):\n", length);
stream_read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
stream_read_UINT16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */
stream_read_UINT16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */
printf("\tcolorPointerFlag: 0x%04X\n", colorPointerFlag);
printf("\tcolorPointerCacheSize: 0x%04X\n", colorPointerCacheSize);
printf("\tpointerCacheSize: 0x%04X\n", pointerCacheSize);
fprintf(stderr, "\tcolorPointerFlag: 0x%04X\n", colorPointerFlag);
fprintf(stderr, "\tcolorPointerCacheSize: 0x%04X\n", colorPointerCacheSize);
fprintf(stderr, "\tpointerCacheSize: 0x%04X\n", pointerCacheSize);
return TRUE;
}
@ -1000,7 +1000,7 @@ BOOL rdp_print_share_capability_set(wStream* s, UINT16 length)
UINT16 nodeId;
UINT16 pad2Octets;
printf("ShareCapabilitySet (length %d):\n", length);
fprintf(stderr, "ShareCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1008,8 +1008,8 @@ BOOL rdp_print_share_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, nodeId); /* nodeId (2 bytes) */
stream_read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */
printf("\tnodeId: 0x%04X\n", nodeId);
printf("\tpad2Octets: 0x%04X\n", pad2Octets);
fprintf(stderr, "\tnodeId: 0x%04X\n", nodeId);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1057,7 +1057,7 @@ BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length)
UINT16 colorTableCacheSize;
UINT16 pad2Octets;
printf("ColorCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "ColorCacheCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1065,8 +1065,8 @@ BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, colorTableCacheSize); /* colorTableCacheSize (2 bytes) */
stream_read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */
printf("\tcolorTableCacheSize: 0x%04X\n", colorTableCacheSize);
printf("\tpad2Octets: 0x%04X\n", pad2Octets);
fprintf(stderr, "\tcolorTableCacheSize: 0x%04X\n", colorTableCacheSize);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1121,7 +1121,7 @@ BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length)
UINT16 soundFlags;
UINT16 pad2OctetsA;
printf("SoundCapabilitySet (length %d):\n", length);
fprintf(stderr, "SoundCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1129,8 +1129,8 @@ BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */
stream_read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */
printf("\tsoundFlags: 0x%04X\n", soundFlags);
printf("\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
fprintf(stderr, "\tsoundFlags: 0x%04X\n", soundFlags);
fprintf(stderr, "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
return TRUE;
}
@ -1231,7 +1231,7 @@ BOOL rdp_print_input_capability_set(wStream* s, UINT16 length)
UINT32 keyboardSubType;
UINT32 keyboardFunctionKey;
printf("InputCapabilitySet (length %d)\n", length);
fprintf(stderr, "InputCapabilitySet (length %d)\n", length);
if (length < 88)
return FALSE;
@ -1244,12 +1244,12 @@ BOOL rdp_print_input_capability_set(wStream* s, UINT16 length)
stream_read_UINT32(s, keyboardFunctionKey); /* keyboardFunctionKeys (4 bytes) */
stream_seek(s, 64); /* imeFileName (64 bytes) */
printf("\tinputFlags: 0x%04X\n", inputFlags);
printf("\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
printf("\tkeyboardLayout: 0x%08X\n", keyboardLayout);
printf("\tkeyboardType: 0x%08X\n", keyboardType);
printf("\tkeyboardSubType: 0x%08X\n", keyboardSubType);
printf("\tkeyboardFunctionKey: 0x%08X\n", keyboardFunctionKey);
fprintf(stderr, "\tinputFlags: 0x%04X\n", inputFlags);
fprintf(stderr, "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
fprintf(stderr, "\tkeyboardLayout: 0x%08X\n", keyboardLayout);
fprintf(stderr, "\tkeyboardType: 0x%08X\n", keyboardType);
fprintf(stderr, "\tkeyboardSubType: 0x%08X\n", keyboardSubType);
fprintf(stderr, "\tkeyboardFunctionKey: 0x%08X\n", keyboardFunctionKey);
return TRUE;
}
@ -1297,7 +1297,7 @@ BOOL rdp_print_font_capability_set(wStream* s, UINT16 length)
UINT16 fontSupportFlags = 0;
UINT16 pad2Octets = 0;
printf("FontCapabilitySet (length %d):\n", length);
fprintf(stderr, "FontCapabilitySet (length %d):\n", length);
if (length > 4)
stream_read_UINT16(s, fontSupportFlags); /* fontSupportFlags (2 bytes) */
@ -1305,8 +1305,8 @@ BOOL rdp_print_font_capability_set(wStream* s, UINT16 length)
if (length > 6)
stream_read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */
printf("\tfontSupportFlags: 0x%04X\n", fontSupportFlags);
printf("\tpad2Octets: 0x%04X\n", pad2Octets);
fprintf(stderr, "\tfontSupportFlags: 0x%04X\n", fontSupportFlags);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1351,14 +1351,14 @@ BOOL rdp_print_brush_capability_set(wStream* s, UINT16 length)
{
UINT32 brushSupportLevel;
printf("BrushCapabilitySet (length %d):\n", length);
fprintf(stderr, "BrushCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
stream_read_UINT32(s, brushSupportLevel); /* brushSupportLevel (4 bytes) */
printf("\tbrushSupportLevel: 0x%08X\n", brushSupportLevel);
fprintf(stderr, "\tbrushSupportLevel: 0x%08X\n", brushSupportLevel);
return TRUE;
}
@ -1450,7 +1450,7 @@ BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length)
UINT16 glyphSupportLevel;
UINT16 pad2Octets;
printf("GlyphCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "GlyphCacheCapabilitySet (length %d):\n", length);
if (length < 52)
return FALSE;
@ -1471,19 +1471,19 @@ BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */
stream_read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */
printf("\tglyphCache0: Entries: %d MaximumCellSize: %d\n", glyphCache[0].cacheEntries, glyphCache[0].cacheMaximumCellSize);
printf("\tglyphCache1: Entries: %d MaximumCellSize: %d\n", glyphCache[1].cacheEntries, glyphCache[1].cacheMaximumCellSize);
printf("\tglyphCache2: Entries: %d MaximumCellSize: %d\n", glyphCache[2].cacheEntries, glyphCache[2].cacheMaximumCellSize);
printf("\tglyphCache3: Entries: %d MaximumCellSize: %d\n", glyphCache[3].cacheEntries, glyphCache[3].cacheMaximumCellSize);
printf("\tglyphCache4: Entries: %d MaximumCellSize: %d\n", glyphCache[4].cacheEntries, glyphCache[4].cacheMaximumCellSize);
printf("\tglyphCache5: Entries: %d MaximumCellSize: %d\n", glyphCache[5].cacheEntries, glyphCache[5].cacheMaximumCellSize);
printf("\tglyphCache6: Entries: %d MaximumCellSize: %d\n", glyphCache[6].cacheEntries, glyphCache[6].cacheMaximumCellSize);
printf("\tglyphCache7: Entries: %d MaximumCellSize: %d\n", glyphCache[7].cacheEntries, glyphCache[7].cacheMaximumCellSize);
printf("\tglyphCache8: Entries: %d MaximumCellSize: %d\n", glyphCache[8].cacheEntries, glyphCache[8].cacheMaximumCellSize);
printf("\tglyphCache9: Entries: %d MaximumCellSize: %d\n", glyphCache[9].cacheEntries, glyphCache[9].cacheMaximumCellSize);
printf("\tfragCache: Entries: %d MaximumCellSize: %d\n", fragCache.cacheEntries, fragCache.cacheMaximumCellSize);
printf("\tglyphSupportLevel: 0x%04X\n", glyphSupportLevel);
printf("\tpad2Octets: 0x%04X\n", pad2Octets);
fprintf(stderr, "\tglyphCache0: Entries: %d MaximumCellSize: %d\n", glyphCache[0].cacheEntries, glyphCache[0].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache1: Entries: %d MaximumCellSize: %d\n", glyphCache[1].cacheEntries, glyphCache[1].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache2: Entries: %d MaximumCellSize: %d\n", glyphCache[2].cacheEntries, glyphCache[2].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache3: Entries: %d MaximumCellSize: %d\n", glyphCache[3].cacheEntries, glyphCache[3].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache4: Entries: %d MaximumCellSize: %d\n", glyphCache[4].cacheEntries, glyphCache[4].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache5: Entries: %d MaximumCellSize: %d\n", glyphCache[5].cacheEntries, glyphCache[5].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache6: Entries: %d MaximumCellSize: %d\n", glyphCache[6].cacheEntries, glyphCache[6].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache7: Entries: %d MaximumCellSize: %d\n", glyphCache[7].cacheEntries, glyphCache[7].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache8: Entries: %d MaximumCellSize: %d\n", glyphCache[8].cacheEntries, glyphCache[8].cacheMaximumCellSize);
fprintf(stderr, "\tglyphCache9: Entries: %d MaximumCellSize: %d\n", glyphCache[9].cacheEntries, glyphCache[9].cacheMaximumCellSize);
fprintf(stderr, "\tfragCache: Entries: %d MaximumCellSize: %d\n", fragCache.cacheEntries, fragCache.cacheMaximumCellSize);
fprintf(stderr, "\tglyphSupportLevel: 0x%04X\n", glyphSupportLevel);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1543,7 +1543,7 @@ BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, UINT16 length)
UINT16 offscreenCacheSize;
UINT16 offscreenCacheEntries;
printf("OffscreenBitmapCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "OffscreenBitmapCacheCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -1552,9 +1552,9 @@ BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, UINT16 length)
stream_read_UINT16(s, offscreenCacheSize); /* offscreenCacheSize (2 bytes) */
stream_read_UINT16(s, offscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */
printf("\toffscreenSupportLevel: 0x%08X\n", offscreenSupportLevel);
printf("\toffscreenCacheSize: 0x%04X\n", offscreenCacheSize);
printf("\toffscreenCacheEntries: 0x%04X\n", offscreenCacheEntries);
fprintf(stderr, "\toffscreenSupportLevel: 0x%08X\n", offscreenSupportLevel);
fprintf(stderr, "\toffscreenCacheSize: 0x%04X\n", offscreenCacheSize);
fprintf(stderr, "\toffscreenCacheEntries: 0x%04X\n", offscreenCacheEntries);
return TRUE;
}
@ -1610,7 +1610,7 @@ BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, UINT16 lengt
BYTE pad1;
UINT16 pad2;
printf("BitmapCacheHostSupportCapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCacheHostSupportCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1619,9 +1619,9 @@ BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, UINT16 lengt
stream_read_BYTE(s, pad1); /* pad1 (1 byte) */
stream_read_UINT16(s, pad2); /* pad2 (2 bytes) */
printf("\tcacheVersion: 0x%02X\n", cacheVersion);
printf("\tpad1: 0x%02X\n", pad1);
printf("\tpad2: 0x%04X\n", pad2);
fprintf(stderr, "\tcacheVersion: 0x%02X\n", cacheVersion);
fprintf(stderr, "\tpad1: 0x%02X\n", pad1);
fprintf(stderr, "\tpad2: 0x%04X\n", pad2);
return TRUE;
}
@ -1719,7 +1719,7 @@ BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length)
BYTE numCellCaches;
BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[5];
printf("BitmapCacheV2CapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCacheV2CapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -1734,14 +1734,14 @@ BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length)
rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */
stream_seek(s, 12); /* pad3 (12 bytes) */
printf("\tcacheFlags: 0x%04X\n", cacheFlags);
printf("\tpad2: 0x%02X\n", pad2);
printf("\tnumCellCaches: 0x%02X\n", numCellCaches);
printf("\tbitmapCache0CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[0].numEntries, bitmapCacheV2CellInfo[0].persistent);
printf("\tbitmapCache1CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[1].numEntries, bitmapCacheV2CellInfo[1].persistent);
printf("\tbitmapCache2CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[2].numEntries, bitmapCacheV2CellInfo[2].persistent);
printf("\tbitmapCache3CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[3].numEntries, bitmapCacheV2CellInfo[3].persistent);
printf("\tbitmapCache4CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[4].numEntries, bitmapCacheV2CellInfo[4].persistent);
fprintf(stderr, "\tcacheFlags: 0x%04X\n", cacheFlags);
fprintf(stderr, "\tpad2: 0x%02X\n", pad2);
fprintf(stderr, "\tnumCellCaches: 0x%02X\n", numCellCaches);
fprintf(stderr, "\tbitmapCache0CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[0].numEntries, bitmapCacheV2CellInfo[0].persistent);
fprintf(stderr, "\tbitmapCache1CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[1].numEntries, bitmapCacheV2CellInfo[1].persistent);
fprintf(stderr, "\tbitmapCache2CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[2].numEntries, bitmapCacheV2CellInfo[2].persistent);
fprintf(stderr, "\tbitmapCache3CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[3].numEntries, bitmapCacheV2CellInfo[3].persistent);
fprintf(stderr, "\tbitmapCache4CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[4].numEntries, bitmapCacheV2CellInfo[4].persistent);
return TRUE;
}
@ -1802,7 +1802,7 @@ BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length)
UINT32 flags;
UINT32 VCChunkSize;
printf("VirtualChannelCapabilitySet (length %d):\n", length);
fprintf(stderr, "VirtualChannelCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1814,8 +1814,8 @@ BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length)
else
VCChunkSize = 1600;
printf("\tflags: 0x%08X\n", flags);
printf("\tVCChunkSize: 0x%08X\n", VCChunkSize);
fprintf(stderr, "\tflags: 0x%08X\n", flags);
fprintf(stderr, "\tVCChunkSize: 0x%08X\n", VCChunkSize);
return TRUE;
}
@ -1899,7 +1899,7 @@ BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length)
UINT16 DrawNineGridCacheSize;
UINT16 DrawNineGridCacheEntries;
printf("DrawNineGridCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "DrawNineGridCacheCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -1977,7 +1977,7 @@ BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, UINT16 length)
UINT32 GdipVersion;
UINT32 drawGdiplusCacheLevel;
printf("DrawGdiPlusCacheCapabilitySet (length %d):\n", length);
fprintf(stderr, "DrawGdiPlusCacheCapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -2048,14 +2048,14 @@ BOOL rdp_print_remote_programs_capability_set(wStream* s, UINT16 length)
{
UINT32 railSupportLevel;
printf("RemoteProgramsCapabilitySet (length %d):\n", length);
fprintf(stderr, "RemoteProgramsCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
stream_read_UINT32(s, railSupportLevel); /* railSupportLevel (4 bytes) */
printf("\trailSupportLevel: 0x%08X\n", railSupportLevel);
fprintf(stderr, "\trailSupportLevel: 0x%08X\n", railSupportLevel);
return TRUE;
}
@ -2109,7 +2109,7 @@ BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length)
BYTE numIconCaches;
UINT16 numIconCacheEntries;
printf("WindowListCapabilitySet (length %d):\n", length);
fprintf(stderr, "WindowListCapabilitySet (length %d):\n", length);
if (length < 11)
return FALSE;
@ -2118,9 +2118,9 @@ BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length)
stream_read_BYTE(s, numIconCaches); /* numIconCaches (1 byte) */
stream_read_UINT16(s, numIconCacheEntries); /* numIconCacheEntries (2 bytes) */
printf("\twndSupportLevel: 0x%08X\n", wndSupportLevel);
printf("\tnumIconCaches: 0x%02X\n", numIconCaches);
printf("\tnumIconCacheEntries: 0x%04X\n", numIconCacheEntries);
fprintf(stderr, "\twndSupportLevel: 0x%08X\n", wndSupportLevel);
fprintf(stderr, "\tnumIconCaches: 0x%02X\n", numIconCaches);
fprintf(stderr, "\tnumIconCacheEntries: 0x%04X\n", numIconCacheEntries);
return TRUE;
}
@ -2168,14 +2168,14 @@ BOOL rdp_print_desktop_composition_capability_set(wStream* s, UINT16 length)
{
UINT16 compDeskSupportLevel;
printf("DesktopCompositionCapabilitySet (length %d):\n", length);
fprintf(stderr, "DesktopCompositionCapabilitySet (length %d):\n", length);
if (length < 6)
return FALSE;
stream_read_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */
printf("\tcompDeskSupportLevel: 0x%04X\n", compDeskSupportLevel);
fprintf(stderr, "\tcompDeskSupportLevel: 0x%04X\n", compDeskSupportLevel);
return TRUE;
}
@ -2223,14 +2223,14 @@ BOOL rdp_print_multifragment_update_capability_set(wStream* s, UINT16 length)
{
UINT32 maxRequestSize;
printf("MultifragmentUpdateCapabilitySet (length %d):\n", length);
fprintf(stderr, "MultifragmentUpdateCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
stream_read_UINT32(s, maxRequestSize); /* maxRequestSize (4 bytes) */
printf("\tmaxRequestSize: 0x%04X\n", maxRequestSize);
fprintf(stderr, "\tmaxRequestSize: 0x%04X\n", maxRequestSize);
return TRUE;
}
@ -2278,14 +2278,14 @@ BOOL rdp_print_large_pointer_capability_set(wStream* s, UINT16 length)
{
UINT16 largePointerSupportFlags;
printf("LargePointerCapabilitySet (length %d):\n", length);
fprintf(stderr, "LargePointerCapabilitySet (length %d):\n", length);
if (length < 6)
return FALSE;
stream_read_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */
printf("\tlargePointerSupportFlags: 0x%04X\n", largePointerSupportFlags);
fprintf(stderr, "\tlargePointerSupportFlags: 0x%04X\n", largePointerSupportFlags);
return TRUE;
}
@ -2340,7 +2340,7 @@ BOOL rdp_print_surface_commands_capability_set(wStream* s, UINT16 length)
UINT32 cmdFlags;
UINT32 reserved;
printf("SurfaceCommandsCapabilitySet (length %d):\n", length);
fprintf(stderr, "SurfaceCommandsCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -2348,8 +2348,8 @@ BOOL rdp_print_surface_commands_capability_set(wStream* s, UINT16 length)
stream_read_UINT32(s, cmdFlags); /* cmdFlags (4 bytes) */
stream_read_UINT32(s, reserved); /* reserved (4 bytes) */
printf("\tcmdFlags: 0x%08X\n", cmdFlags);
printf("\treserved: 0x%08X\n", reserved);
fprintf(stderr, "\tcmdFlags: 0x%08X\n", cmdFlags);
fprintf(stderr, "\treserved: 0x%08X\n", reserved);
return TRUE;
}
@ -2399,7 +2399,7 @@ void rdp_write_bitmap_codec_guid(wStream* s, GUID* guid)
void rdp_print_bitmap_codec_guid(GUID* guid)
{
printf("%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
fprintf(stderr, "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
@ -2700,7 +2700,7 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
UINT16 codecPropertiesLength;
UINT16 remainingLength;
printf("BitmapCodecsCapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCodecsCapabilitySet (length %d):\n", length);
if (length < 5)
return FALSE;
@ -2708,7 +2708,7 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
stream_read_BYTE(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */
remainingLength = length - 5;
printf("\tbitmapCodecCount: %d\n", bitmapCodecCount);
fprintf(stderr, "\tbitmapCodecCount: %d\n", bitmapCodecCount);
while (bitmapCodecCount > 0)
{
@ -2718,14 +2718,14 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
rdp_read_bitmap_codec_guid(s, &codecGuid); /* codecGuid (16 bytes) */
stream_read_BYTE(s, codecId); /* codecId (1 byte) */
printf("\tcodecGuid: 0x");
fprintf(stderr, "\tcodecGuid: 0x");
rdp_print_bitmap_codec_guid(&codecGuid);
printf(" (%s)\n", rdp_get_bitmap_codec_guid_name(&codecGuid));
fprintf(stderr, " (%s)\n", rdp_get_bitmap_codec_guid_name(&codecGuid));
printf("\tcodecId: %d\n", codecId);
fprintf(stderr, "\tcodecId: %d\n", codecId);
stream_read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */
printf("\tcodecPropertiesLength: %d\n", codecPropertiesLength);
fprintf(stderr, "\tcodecPropertiesLength: %d\n", codecPropertiesLength);
remainingLength -= 19;
@ -2787,14 +2787,14 @@ BOOL rdp_print_frame_acknowledge_capability_set(wStream* s, UINT16 length)
{
UINT32 frameAcknowledge;
printf("FrameAcknowledgeCapabilitySet (length %d):\n", length);
fprintf(stderr, "FrameAcknowledgeCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
stream_read_UINT32(s, frameAcknowledge); /* frameAcknowledge (4 bytes) */
printf("\tframeAcknowledge: 0x%08X\n", frameAcknowledge);
fprintf(stderr, "\tframeAcknowledge: 0x%08X\n", frameAcknowledge);
return TRUE;
}
@ -2824,14 +2824,14 @@ BOOL rdp_print_bitmap_cache_v3_codec_id_capability_set(wStream* s, UINT16 length
{
BYTE bitmapCacheV3CodecId;
printf("BitmapCacheV3CodecIdCapabilitySet (length %d):\n", length);
fprintf(stderr, "BitmapCacheV3CodecIdCapabilitySet (length %d):\n", length);
if (length < 5)
return FALSE;
stream_read_BYTE(s, bitmapCacheV3CodecId); /* bitmapCacheV3CodecId (1 byte) */
printf("\tbitmapCacheV3CodecId: 0x%02X\n", bitmapCacheV3CodecId);
fprintf(stderr, "\tbitmapCacheV3CodecId: 0x%02X\n", bitmapCacheV3CodecId);
return TRUE;
}
@ -2848,13 +2848,13 @@ BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOOL recei
rdp_read_capability_set_header(s, &length, &type);
printf("%s ", receiving ? "Receiving" : "Sending");
fprintf(stderr, "%s ", receiving ? "Receiving" : "Sending");
em = bm + length;
if (stream_get_left(s) < length - 4)
{
printf("error processing stream\n");
fprintf(stderr, "error processing stream\n");
return FALSE;
}
@ -3006,13 +3006,13 @@ BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOOL recei
break;
default:
printf("unknown capability type %d\n", type);
fprintf(stderr, "unknown capability type %d\n", type);
break;
}
if (s->pointer != em)
{
printf("incorrect offset, type:0x%02X actual:%d expected:%d\n",
fprintf(stderr, "incorrect offset, type:0x%02X actual:%d expected:%d\n",
type, (int) (s->pointer - bm), (int) (em - bm));
}
@ -3045,7 +3045,7 @@ BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCa
if (stream_get_left(s) < length - 4)
{
printf("error processing stream\n");
fprintf(stderr, "error processing stream\n");
return FALSE;
}
@ -3197,13 +3197,13 @@ BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCa
break;
default:
printf("unknown capability type %d\n", type);
fprintf(stderr, "unknown capability type %d\n", type);
break;
}
if (s->pointer != em)
{
printf("incorrect offset, type:0x%02X actual:%d expected:%d\n",
fprintf(stderr, "incorrect offset, type:0x%02X actual:%d expected:%d\n",
type, (int) (s->pointer - bm), (int) (em - bm));
}
@ -3249,7 +3249,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return FALSE;
}
}
@ -3257,13 +3257,13 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
if (channelId != MCS_GLOBAL_CHANNEL_ID)
{
printf("expected MCS_GLOBAL_CHANNEL_ID %04x, got %04x\n", MCS_GLOBAL_CHANNEL_ID, channelId);
fprintf(stderr, "expected MCS_GLOBAL_CHANNEL_ID %04x, got %04x\n", MCS_GLOBAL_CHANNEL_ID, channelId);
return FALSE;
}
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
{
printf("rdp_read_share_control_header failed\n");
fprintf(stderr, "rdp_read_share_control_header failed\n");
return FALSE;
}
@ -3271,7 +3271,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
if (pduType != PDU_TYPE_DEMAND_ACTIVE)
{
printf("expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04x\n", PDU_TYPE_DEMAND_ACTIVE, pduType);
fprintf(stderr, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04x\n", PDU_TYPE_DEMAND_ACTIVE, pduType);
return FALSE;
}
@ -3291,7 +3291,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
/* capabilitySets */
if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities))
{
printf("rdp_read_capability_sets failed\n");
fprintf(stderr, "rdp_read_capability_sets failed\n");
return FALSE;
}
@ -3397,7 +3397,7 @@ BOOL rdp_recv_confirm_active(rdpRdp* rdp, wStream* s)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return FALSE;
}
}

View File

@ -270,7 +270,7 @@ error2:
free(info->Modulus);
info->Modulus = 0;
error1:
printf("error reading when reading certificate: part=%s error=%d\n", certificate_read_errors[error], error);
fprintf(stderr, "error reading when reading certificate: part=%s error=%d\n", certificate_read_errors[error], error);
stream_detach(s);
stream_free(s);
return FALSE;
@ -331,7 +331,7 @@ static BOOL certificate_process_server_public_key(rdpCertificate* certificate, w
if (memcmp(magic, "RSA1", 4) != 0)
{
printf("gcc_process_server_public_key: magic error\n");
fprintf(stderr, "gcc_process_server_public_key: magic error\n");
return FALSE;
}
@ -374,7 +374,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
if (sum != 0)
{
printf("certificate_process_server_public_signature: invalid signature\n");
fprintf(stderr, "certificate_process_server_public_signature: invalid signature\n");
//return FALSE;
}
@ -385,7 +385,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
/* Verify signature. */
if (memcmp(md5hash, sig, sizeof(md5hash)) != 0)
{
printf("certificate_process_server_public_signature: invalid signature\n");
fprintf(stderr, "certificate_process_server_public_signature: invalid signature\n");
//return FALSE;
}
@ -401,7 +401,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
if (sig[16] != 0x00 || sum != 0xFF * (62 - 17) || sig[62] != 0x01)
{
printf("certificate_process_server_public_signature: invalid signature\n");
fprintf(stderr, "certificate_process_server_public_signature: invalid signature\n");
//return FALSE;
}
@ -435,7 +435,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (!(dwSigAlgId == SIGNATURE_ALG_RSA && dwKeyAlgId == KEY_EXCHANGE_ALG_RSA))
{
printf("certificate_read_server_proprietary_certificate: parse error 1\n");
fprintf(stderr, "certificate_read_server_proprietary_certificate: parse error 1\n");
return FALSE;
}
@ -443,7 +443,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (wPublicKeyBlobType != BB_RSA_KEY_BLOB)
{
printf("certificate_read_server_proprietary_certificate: parse error 2\n");
fprintf(stderr, "certificate_read_server_proprietary_certificate: parse error 2\n");
return FALSE;
}
@ -453,7 +453,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (!certificate_process_server_public_key(certificate, s, wPublicKeyBlobLen))
{
printf("certificate_read_server_proprietary_certificate: parse error 3\n");
fprintf(stderr, "certificate_read_server_proprietary_certificate: parse error 3\n");
return FALSE;
}
@ -465,7 +465,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB)
{
printf("certificate_read_server_proprietary_certificate: parse error 4\n");
fprintf(stderr, "certificate_read_server_proprietary_certificate: parse error 4\n");
return FALSE;
}
@ -475,13 +475,13 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (wSignatureBlobLen != 72)
{
printf("certificate_process_server_public_signature: invalid signature length (got %d, expected %d)\n", wSignatureBlobLen, 64);
fprintf(stderr, "certificate_process_server_public_signature: invalid signature length (got %d, expected %d)\n", wSignatureBlobLen, 64);
return FALSE;
}
if (!certificate_process_server_public_signature(certificate, sigdata, sigdatalen, s, wSignatureBlobLen))
{
printf("certificate_read_server_proprietary_certificate: parse error 5\n");
fprintf(stderr, "certificate_read_server_proprietary_certificate: parse error 5\n");
return FALSE;
}
@ -532,7 +532,7 @@ BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate,
if (cert_info.Modulus)
free(cert_info.Modulus);
if (!ret) {
printf("failed to read License Server, content follows:\n");
fprintf(stderr, "failed to read License Server, content follows:\n");
winpr_HexDump(certificate->x509_cert_chain->array[i].data, certificate->x509_cert_chain->array[i].length);
return FALSE;
}
@ -587,7 +587,7 @@ int certificate_read_server_certificate(rdpCertificate* certificate, BYTE* serve
break;
default:
printf("invalid certificate chain version:%d\n", dwVersion & CERT_CHAIN_VERSION_MASK);
fprintf(stderr, "invalid certificate chain version:%d\n", dwVersion & CERT_CHAIN_VERSION_MASK);
status = -1;
break;
}
@ -613,7 +613,7 @@ rdpRsaKey* key_new(const char* keyfile)
if (fp == NULL)
{
printf("unable to load RSA key from %s: %s.", keyfile, strerror(errno));
fprintf(stderr, "unable to load RSA key from %s: %s.", keyfile, strerror(errno));
free(key) ;
return NULL;
}
@ -634,7 +634,7 @@ rdpRsaKey* key_new(const char* keyfile)
{
case 0:
RSA_free(rsa);
printf("invalid RSA key in %s", keyfile);
fprintf(stderr, "invalid RSA key in %s", keyfile);
free(key) ;
return NULL;
@ -643,7 +643,7 @@ rdpRsaKey* key_new(const char* keyfile)
break;
default:
ERR_print_errors_fp(stdout);
ERR_print_errors_fp(stderr);
RSA_free(rsa);
free(key) ;
return NULL;
@ -652,7 +652,7 @@ rdpRsaKey* key_new(const char* keyfile)
if (BN_num_bytes(rsa->e) > 4)
{
RSA_free(rsa);
printf("RSA public exponent too large in %s", keyfile);
fprintf(stderr, "RSA public exponent too large in %s", keyfile);
free(key) ;
return NULL;
}

View File

@ -52,7 +52,7 @@ BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channel_id, BYTE* data, int size)
if (!channel)
{
printf("freerdp_channel_send: unknown channel_id %d\n", channel_id);
fprintf(stderr, "freerdp_channel_send: unknown channel_id %d\n", channel_id);
return FALSE;
}

View File

@ -137,7 +137,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
if (!nego_connect(rdp->nego))
{
printf("Error: protocol security negotiation or connection failure\n");
fprintf(stderr, "Error: protocol security negotiation or connection failure\n");
return FALSE;
}
@ -158,7 +158,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
{
connectErrorCode = MCSCONNECTINITIALERROR;
}
printf("Error: unable to send MCS Connect Initial\n");
fprintf(stderr, "Error: unable to send MCS Connect Initial\n");
return FALSE;
}
@ -333,7 +333,7 @@ static BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s)
if (!rdp_read_header(rdp, s, &length, &channel_id))
{
printf("rdp_server_establish_keys: invalid RDP header\n");
fprintf(stderr, "rdp_server_establish_keys: invalid RDP header\n");
return FALSE;
}
@ -342,7 +342,7 @@ static BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s)
if ((sec_flags & SEC_EXCHANGE_PKT) == 0)
{
printf("rdp_server_establish_keys: missing SEC_EXCHANGE_PKT in security header\n");
fprintf(stderr, "rdp_server_establish_keys: missing SEC_EXCHANGE_PKT in security header\n");
return FALSE;
}
@ -356,7 +356,7 @@ static BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s)
if (rand_len != key_len + 8)
{
printf("rdp_server_establish_keys: invalid encrypted client random length\n");
fprintf(stderr, "rdp_server_establish_keys: invalid encrypted client random length\n");
return FALSE;
}
@ -398,7 +398,7 @@ BOOL rdp_client_connect_mcs_connect_response(rdpRdp* rdp, wStream* s)
{
if (!mcs_recv_connect_response(rdp->mcs, s))
{
printf("rdp_client_connect_mcs_connect_response: mcs_recv_connect_response failed\n");
fprintf(stderr, "rdp_client_connect_mcs_connect_response: mcs_recv_connect_response failed\n");
return FALSE;
}
@ -504,7 +504,7 @@ BOOL rdp_client_connect_license(rdpRdp* rdp, wStream* s)
if (rdp->license->state == LICENSE_STATE_ABORTED)
{
printf("license connection sequence aborted.\n");
fprintf(stderr, "license connection sequence aborted.\n");
return FALSE;
}
@ -595,12 +595,12 @@ BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s)
rdp->nego->selected_protocol = 0;
printf("Client Security: NLA:%d TLS:%d RDP:%d\n",
fprintf(stderr, "Client Security: NLA:%d TLS:%d RDP:%d\n",
(rdp->nego->requested_protocols & PROTOCOL_NLA) ? 1 : 0,
(rdp->nego->requested_protocols & PROTOCOL_TLS) ? 1 : 0,
(rdp->nego->requested_protocols == PROTOCOL_RDP) ? 1: 0);
printf("Server Security: NLA:%d TLS:%d RDP:%d\n",
fprintf(stderr, "Server Security: NLA:%d TLS:%d RDP:%d\n",
settings->NlaSecurity, settings->TlsSecurity, settings->RdpSecurity);
if ((settings->NlaSecurity) && (rdp->nego->requested_protocols & PROTOCOL_NLA))
@ -617,10 +617,10 @@ BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s)
}
else
{
printf("Protocol security negotiation failure\n");
fprintf(stderr, "Protocol security negotiation failure\n");
}
printf("Negotiated Security: NLA:%d TLS:%d RDP:%d\n",
fprintf(stderr, "Negotiated Security: NLA:%d TLS:%d RDP:%d\n",
(rdp->nego->selected_protocol & PROTOCOL_NLA) ? 1 : 0,
(rdp->nego->selected_protocol & PROTOCOL_TLS) ? 1 : 0,
(rdp->nego->selected_protocol == PROTOCOL_RDP) ? 1: 0);
@ -653,14 +653,14 @@ BOOL rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, wStream* s)
if (!mcs_recv_connect_initial(rdp->mcs, s))
return FALSE;
printf("Accepted client: %s\n", rdp->settings->ClientHostname);
printf("Accepted channels:");
fprintf(stderr, "Accepted client: %s\n", rdp->settings->ClientHostname);
fprintf(stderr, "Accepted channels:");
for (i = 0; i < rdp->settings->ChannelCount; i++)
{
printf(" %s", rdp->settings->ChannelDefArray[i].Name);
fprintf(stderr, " %s", rdp->settings->ChannelDefArray[i].Name);
}
printf("\n");
fprintf(stderr, "\n");
if (!mcs_send_connect_response(rdp->mcs))
return FALSE;

View File

@ -453,13 +453,13 @@ void rdp_print_errinfo(UINT32 code)
{
if (code == errInfo->code)
{
printf("%s (0x%08X):\n%s\n", errInfo->name, code, errInfo->info);
fprintf(stderr, "%s (0x%08X):\n%s\n", errInfo->name, code, errInfo->info);
return;
}
errInfo++;
}
printf("ERRINFO_UNKNOWN 0x%08X: Unknown error.\n", code);
fprintf(stderr, "ERRINFO_UNKNOWN 0x%08X: Unknown error.\n", code);
}

View File

@ -59,7 +59,7 @@ static UINT32 FREERDP_CC extension_register_plugin(rdpExtPlugin* plugin)
if (ext->num_plugins >= FREERDP_EXT_MAX_COUNT)
{
printf("extension_register_extension: maximum number of plugins reached.\n");
fprintf(stderr, "extension_register_extension: maximum number of plugins reached.\n");
return 1;
}
@ -73,7 +73,7 @@ static UINT32 FREERDP_CC extension_register_pre_connect_hook(rdpExtPlugin* plugi
if (ext->num_pre_connect_hooks >= FREERDP_EXT_MAX_COUNT)
{
printf("extension_register_pre_connect_hook: maximum plugin reached.\n");
fprintf(stderr, "extension_register_pre_connect_hook: maximum plugin reached.\n");
return 1;
}
@ -89,7 +89,7 @@ static UINT32 FREERDP_CC extension_register_post_connect_hook(rdpExtPlugin* plug
if (ext->num_post_connect_hooks >= FREERDP_EXT_MAX_COUNT)
{
printf("extension_register_post_connect_hook: maximum plugin reached.\n");
fprintf(stderr, "extension_register_post_connect_hook: maximum plugin reached.\n");
return 1;
}
@ -124,11 +124,11 @@ static int extension_load_plugins(rdpExtension* extension)
sprintf_s(path, sizeof(path), "%s", settings->extensions[i].name);
han = DLOPEN(path);
printf("extension_load_plugins: %s\n", path);
fprintf(stderr, "extension_load_plugins: %s\n", path);
if (han == NULL)
{
printf("extension_load_plugins: failed to load %s\n", path);
fprintf(stderr, "extension_load_plugins: failed to load %s\n", path);
continue;
}
@ -136,7 +136,7 @@ static int extension_load_plugins(rdpExtension* extension)
if (entry == NULL)
{
DLCLOSE(han);
printf("extension_load_plugins: failed to find export function in %s\n", path);
fprintf(stderr, "extension_load_plugins: failed to find export function in %s\n", path);
continue;
}
@ -144,7 +144,7 @@ static int extension_load_plugins(rdpExtension* extension)
if (entry(&entryPoints) != 0)
{
DLCLOSE(han);
printf("extension_load_plugins: %s entry returns error.\n", path);
fprintf(stderr, "extension_load_plugins: %s entry returns error.\n", path);
continue;
}
}

View File

@ -225,7 +225,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s
case FASTPATH_UPDATETYPE_SYNCHRONIZE:
if (!fastpath_recv_update_synchronize(fastpath, s))
printf("fastpath_recv_update_synchronize failure but we continue\n");
fprintf(stderr, "fastpath_recv_update_synchronize failure but we continue\n");
else
IFCALL(update->Synchronize, context);
break;
@ -322,7 +322,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
}
else
{
printf("decompress_rdp() failed\n");
fprintf(stderr, "decompress_rdp() failed\n");
stream_seek(s, size);
}
}
@ -342,7 +342,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
stream_copy(fastpath->updateData, comp_stream, size);
if (stream_get_length(fastpath->updateData) > rdp->settings->MultifragMaxRequestSize)
{
printf("fastpath PDU is bigger than MultifragMaxRequestSize\n");
fprintf(stderr, "fastpath PDU is bigger than MultifragMaxRequestSize\n");
return -1;
}
@ -527,7 +527,7 @@ static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, wStream* s)
break;
default:
printf("Unknown eventCode %d\n", eventCode);
fprintf(stderr, "Unknown eventCode %d\n", eventCode);
break;
}
@ -606,7 +606,7 @@ BOOL fastpath_send_input_pdu(rdpFastPath* fastpath, wStream* s)
length = stream_get_length(s);
if (length >= (2 << 14))
{
printf("Maximum FastPath PDU length is 32767\n");
fprintf(stderr, "Maximum FastPath PDU length is 32767\n");
return FALSE;
}
@ -722,7 +722,7 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s
}
}
else
printf("fastpath_send_update_pdu: mppc_encode failed\n");
fprintf(stderr, "fastpath_send_update_pdu: mppc_encode failed\n");
}
totalLength -= dlen;

View File

@ -107,7 +107,7 @@ BOOL freerdp_connect(freerdp* instance)
if (status != TRUE)
{
printf("freerdp_post_connect failed\n");
fprintf(stderr, "freerdp_post_connect failed\n");
if (!connectErrorCode)
{

View File

@ -386,9 +386,9 @@ void http_response_print(HttpResponse* http_response)
for (i = 0; i < http_response->count; i++)
{
printf("%s\n", http_response->lines[i]);
fprintf(stderr, "%s\n", http_response->lines[i]);
}
printf("\n");
fprintf(stderr, "\n");
}
HttpResponse* http_response_recv(rdpTls* tls)
@ -441,7 +441,7 @@ HttpResponse* http_response_recv(rdpTls* tls)
}
else
{
printf("http_response_recv: invalid response:\n");
fprintf(stderr, "http_response_recv: invalid response:\n");
winpr_HexDump(buffer, status);
http_response_free(http_response);
return NULL;

View File

@ -71,7 +71,7 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, char* user, char* domain, char*
if (status != SEC_E_OK)
{
printf("QuerySecurityPackageInfo status: 0x%08X\n", status);
fprintf(stderr, "QuerySecurityPackageInfo status: 0x%08X\n", status);
return FALSE;
}
@ -82,7 +82,7 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, char* user, char* domain, char*
if (status != SEC_E_OK)
{
printf("AcquireCredentialsHandle status: 0x%08X\n", status);
fprintf(stderr, "AcquireCredentialsHandle status: 0x%08X\n", status);
return FALSE;
}
@ -242,7 +242,7 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm)
if (ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, &ntlm->ContextSizes) != SEC_E_OK)
{
printf("QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
fprintf(stderr, "QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
return FALSE;
}

View File

@ -87,45 +87,45 @@ const RPC_SECURITY_PROVIDER_INFO RPC_SECURITY_PROVIDER_INFO_TABLE[] =
void rpc_pdu_header_print(rpcconn_hdr_t* header)
{
printf("rpc_vers: %d\n", header->common.rpc_vers);
printf("rpc_vers_minor: %d\n", header->common.rpc_vers_minor);
fprintf(stderr, "rpc_vers: %d\n", header->common.rpc_vers);
fprintf(stderr, "rpc_vers_minor: %d\n", header->common.rpc_vers_minor);
if (header->common.ptype > PTYPE_RTS)
printf("ptype: %s (%d)\n", "PTYPE_UNKNOWN", header->common.ptype);
fprintf(stderr, "ptype: %s (%d)\n", "PTYPE_UNKNOWN", header->common.ptype);
else
printf("ptype: %s (%d)\n", PTYPE_STRINGS[header->common.ptype], header->common.ptype);
fprintf(stderr, "ptype: %s (%d)\n", PTYPE_STRINGS[header->common.ptype], header->common.ptype);
printf("pfc_flags (0x%02X) = {", header->common.pfc_flags);
fprintf(stderr, "pfc_flags (0x%02X) = {", header->common.pfc_flags);
if (header->common.pfc_flags & PFC_FIRST_FRAG)
printf(" PFC_FIRST_FRAG");
fprintf(stderr, " PFC_FIRST_FRAG");
if (header->common.pfc_flags & PFC_LAST_FRAG)
printf(" PFC_LAST_FRAG");
fprintf(stderr, " PFC_LAST_FRAG");
if (header->common.pfc_flags & PFC_PENDING_CANCEL)
printf(" PFC_PENDING_CANCEL");
fprintf(stderr, " PFC_PENDING_CANCEL");
if (header->common.pfc_flags & PFC_RESERVED_1)
printf(" PFC_RESERVED_1");
fprintf(stderr, " PFC_RESERVED_1");
if (header->common.pfc_flags & PFC_CONC_MPX)
printf(" PFC_CONC_MPX");
fprintf(stderr, " PFC_CONC_MPX");
if (header->common.pfc_flags & PFC_DID_NOT_EXECUTE)
printf(" PFC_DID_NOT_EXECUTE");
fprintf(stderr, " PFC_DID_NOT_EXECUTE");
if (header->common.pfc_flags & PFC_OBJECT_UUID)
printf(" PFC_OBJECT_UUID");
printf(" }\n");
fprintf(stderr, " PFC_OBJECT_UUID");
fprintf(stderr, " }\n");
printf("packed_drep[4]: %02X %02X %02X %02X\n",
fprintf(stderr, "packed_drep[4]: %02X %02X %02X %02X\n",
header->common.packed_drep[0], header->common.packed_drep[1],
header->common.packed_drep[2], header->common.packed_drep[3]);
printf("frag_length: %d\n", header->common.frag_length);
printf("auth_length: %d\n", header->common.auth_length);
printf("call_id: %d\n", header->common.call_id);
fprintf(stderr, "frag_length: %d\n", header->common.frag_length);
fprintf(stderr, "auth_length: %d\n", header->common.auth_length);
fprintf(stderr, "call_id: %d\n", header->common.call_id);
if (header->common.ptype == PTYPE_RESPONSE)
{
printf("alloc_hint: %d\n", header->response.alloc_hint);
printf("p_cont_id: %d\n", header->response.p_cont_id);
printf("cancel_count: %d\n", header->response.cancel_count);
printf("reserved: %d\n", header->response.reserved);
fprintf(stderr, "alloc_hint: %d\n", header->response.alloc_hint);
fprintf(stderr, "p_cont_id: %d\n", header->response.p_cont_id);
fprintf(stderr, "cancel_count: %d\n", header->response.cancel_count);
fprintf(stderr, "reserved: %d\n", header->response.reserved);
}
}
@ -285,7 +285,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l
auth_pad_length = sec_trailer->auth_pad_length;
#if 0
printf("sec_trailer: type: %d level: %d pad_length: %d reserved: %d context_id: %d\n",
fprintf(stderr, "sec_trailer: type: %d level: %d pad_length: %d reserved: %d context_id: %d\n",
sec_trailer->auth_type,
sec_trailer->auth_level,
sec_trailer->auth_pad_length,
@ -301,7 +301,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l
if ((frag_length - (sec_trailer_offset + 8)) != auth_length)
{
printf("invalid auth_length: actual: %d, expected: %d\n", auth_length,
fprintf(stderr, "invalid auth_length: actual: %d, expected: %d\n", auth_length,
(frag_length - (sec_trailer_offset + 8)));
}
@ -335,10 +335,10 @@ int rpc_in_write(rdpRpc* rpc, BYTE* data, int length)
int status;
#ifdef WITH_DEBUG_TSG
printf("Sending PDU (length: %d)\n", length);
fprintf(stderr, "Sending PDU (length: %d)\n", length);
rpc_pdu_header_print((rpcconn_hdr_t*) data);
winpr_HexDump(data, length);
printf("\n");
fprintf(stderr, "\n");
#endif
status = tls_write_all(rpc->TlsIn, data, length);
@ -362,7 +362,7 @@ int rpc_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum)
if (ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, &ntlm->ContextSizes) != SEC_E_OK)
{
printf("QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
fprintf(stderr, "QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
return -1;
}
@ -432,7 +432,7 @@ int rpc_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum)
if (encrypt_status != SEC_E_OK)
{
printf("EncryptMessage status: 0x%08X\n", encrypt_status);
fprintf(stderr, "EncryptMessage status: 0x%08X\n", encrypt_status);
return -1;
}
@ -453,7 +453,7 @@ BOOL rpc_connect(rdpRpc* rpc)
if (!rts_connect(rpc))
{
printf("rts_connect error!\n");
fprintf(stderr, "rts_connect error!\n");
return FALSE;
}
@ -461,7 +461,7 @@ BOOL rpc_connect(rdpRpc* rpc)
if (rpc_secure_bind(rpc) != 0)
{
printf("rpc_secure_bind error!\n");
fprintf(stderr, "rpc_secure_bind error!\n");
return FALSE;
}

View File

@ -346,7 +346,7 @@ int rpc_secure_bind(rdpRpc* rpc)
if (status <= 0)
{
printf("rpc_secure_bind: error sending bind pdu!\n");
fprintf(stderr, "rpc_secure_bind: error sending bind pdu!\n");
return -1;
}
@ -358,13 +358,13 @@ int rpc_secure_bind(rdpRpc* rpc)
if (!pdu)
{
printf("rpc_secure_bind: error receiving bind ack pdu!\n");
fprintf(stderr, "rpc_secure_bind: error receiving bind ack pdu!\n");
return -1;
}
if (rpc_recv_bind_ack_pdu(rpc, Stream_Buffer(pdu->s), Stream_Length(pdu->s)) <= 0)
{
printf("rpc_secure_bind: error receiving bind ack pdu!\n");
fprintf(stderr, "rpc_secure_bind: error receiving bind ack pdu!\n");
return -1;
}
@ -372,7 +372,7 @@ int rpc_secure_bind(rdpRpc* rpc)
if (rpc_send_rpc_auth_3_pdu(rpc) <= 0)
{
printf("rpc_secure_bind: error sending rpc_auth_3 pdu!\n");
fprintf(stderr, "rpc_secure_bind: error sending rpc_auth_3 pdu!\n");
return -1;
}
@ -380,7 +380,7 @@ int rpc_secure_bind(rdpRpc* rpc)
}
else
{
printf("rpc_secure_bind: invalid state: %d\n", rpc->State);
fprintf(stderr, "rpc_secure_bind: invalid state: %d\n", rpc->State);
return -1;
}
}

View File

@ -120,14 +120,14 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
{
if (rpc->VirtualConnection->State >= VIRTUAL_CONNECTION_STATE_OPENED)
{
//printf("Receiving Out-of-Sequence RTS PDU\n");
//fprintf(stderr, "Receiving Out-of-Sequence RTS PDU\n");
rts_recv_out_of_sequence_pdu(rpc, buffer, header->common.frag_length);
rpc_client_fragment_pool_return(rpc, fragment);
}
else
{
printf("warning: unhandled RTS PDU\n");
fprintf(stderr, "warning: unhandled RTS PDU\n");
}
return 0;
@ -140,7 +140,7 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
if (header->common.ptype != PTYPE_RESPONSE)
{
printf("Unexpected RPC PDU type: %d\n", header->common.ptype);
fprintf(stderr, "Unexpected RPC PDU type: %d\n", header->common.ptype);
return -1;
}
@ -149,13 +149,13 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
if (!rpc_get_stub_data_info(rpc, buffer, &StubOffset, &StubLength))
{
printf("rpc_recv_pdu_fragment: expected stub\n");
fprintf(stderr, "rpc_recv_pdu_fragment: expected stub\n");
return -1;
}
if (StubLength == 4)
{
//printf("Ignoring TsProxySendToServer Response\n");
//fprintf(stderr, "Ignoring TsProxySendToServer Response\n");
rpc_client_fragment_pool_return(rpc, fragment);
return 0;
}
@ -169,7 +169,7 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
if (rpc->StubCallId != header->common.call_id)
{
printf("invalid call_id: actual: %d, expected: %d, frag_count: %d\n",
fprintf(stderr, "invalid call_id: actual: %d, expected: %d, frag_count: %d\n",
rpc->StubCallId, header->common.call_id, rpc->StubFragCount);
}
@ -180,7 +180,7 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
if (rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow < (rpc->ReceiveWindow / 2))
{
//printf("Sending Flow Control Ack PDU\n");
//fprintf(stderr, "Sending Flow Control Ack PDU\n");
rts_send_flow_control_ack_pdu(rpc);
}
@ -228,7 +228,7 @@ int rpc_client_on_read_event(rdpRpc* rpc)
if (status < 0)
{
printf("rpc_client_frag_read: error reading header\n");
fprintf(stderr, "rpc_client_frag_read: error reading header\n");
return -1;
}
@ -241,7 +241,7 @@ int rpc_client_on_read_event(rdpRpc* rpc)
if (header->frag_length > rpc->max_recv_frag)
{
printf("rpc_client_frag_read: invalid fragment size: %d (max: %d)\n",
fprintf(stderr, "rpc_client_frag_read: invalid fragment size: %d (max: %d)\n",
header->frag_length, rpc->max_recv_frag);
winpr_HexDump(Stream_Buffer(rpc->client->RecvFrag), Stream_Position(rpc->client->RecvFrag));
return -1;
@ -254,7 +254,7 @@ int rpc_client_on_read_event(rdpRpc* rpc)
if (status < 0)
{
printf("rpc_client_frag_read: error reading fragment body\n");
fprintf(stderr, "rpc_client_frag_read: error reading fragment body\n");
return -1;
}
@ -414,9 +414,9 @@ RPC_PDU* rpc_recv_dequeue_pdu(rdpRpc* rpc)
#ifdef WITH_DEBUG_TSG
if (pdu)
{
printf("Receiving PDU (length: %d, CallId: %d)\n", pdu->s->length, pdu->CallId);
fprintf(stderr, "Receiving PDU (length: %d, CallId: %d)\n", pdu->s->length, pdu->CallId);
winpr_HexDump(pdu->s->buffer, pdu->s->length);
printf("\n");
fprintf(stderr, "\n");
}
#endif

View File

@ -315,7 +315,7 @@ int rpc_recv_fault_pdu(rpcconn_hdr_t* header)
int index;
UINT32 code;
printf("RPC Fault PDU:\n");
fprintf(stderr, "RPC Fault PDU:\n");
code = rpc_map_status_code_to_win32_error_code(header->fault.status);
@ -323,7 +323,7 @@ int rpc_recv_fault_pdu(rpcconn_hdr_t* header)
{
if (RPC_FAULT_CODES[index].code == code)
{
printf("status: %s (0x%08X)\n", RPC_FAULT_CODES[index].name, code);
fprintf(stderr, "status: %s (0x%08X)\n", RPC_FAULT_CODES[index].name, code);
return 0;
}
}
@ -332,12 +332,12 @@ int rpc_recv_fault_pdu(rpcconn_hdr_t* header)
{
if (RPC_TSG_FAULT_CODES[index].code == code)
{
printf("status: %s (0x%08X)\n", RPC_TSG_FAULT_CODES[index].name, code);
fprintf(stderr, "status: %s (0x%08X)\n", RPC_TSG_FAULT_CODES[index].name, code);
return 0;
}
}
printf("status: %s (0x%08X)\n", "UNKNOWN", code);
fprintf(stderr, "status: %s (0x%08X)\n", "UNKNOWN", code);
return 0;
}

View File

@ -92,25 +92,25 @@ BOOL rts_connect(rdpRpc* rpc)
if (!rpc_ntlm_http_out_connect(rpc))
{
printf("rpc_out_connect_http error!\n");
fprintf(stderr, "rpc_out_connect_http error!\n");
return FALSE;
}
if (rts_send_CONN_A1_pdu(rpc) != 0)
{
printf("rpc_send_CONN_A1_pdu error!\n");
fprintf(stderr, "rpc_send_CONN_A1_pdu error!\n");
return FALSE;
}
if (!rpc_ntlm_http_in_connect(rpc))
{
printf("rpc_in_connect_http error!\n");
fprintf(stderr, "rpc_in_connect_http error!\n");
return FALSE;
}
if (rts_send_CONN_B1_pdu(rpc) != 0)
{
printf("rpc_send_CONN_B1_pdu error!\n");
fprintf(stderr, "rpc_send_CONN_B1_pdu error!\n");
return FALSE;
}
@ -149,7 +149,7 @@ BOOL rts_connect(rdpRpc* rpc)
if (http_response->StatusCode != 200)
{
printf("rts_connect error! Status Code: %d\n", http_response->StatusCode);
fprintf(stderr, "rts_connect error! Status Code: %d\n", http_response->StatusCode);
http_response_print(http_response);
http_response_free(http_response);
return FALSE;
@ -188,7 +188,7 @@ BOOL rts_connect(rdpRpc* rpc)
if (!rts_match_pdu_signature(rpc, &RTS_PDU_CONN_A3_SIGNATURE, rts))
{
printf("Unexpected RTS PDU: Expected CONN/A3\n");
fprintf(stderr, "Unexpected RTS PDU: Expected CONN/A3\n");
return FALSE;
}
@ -229,7 +229,7 @@ BOOL rts_connect(rdpRpc* rpc)
if (!rts_match_pdu_signature(rpc, &RTS_PDU_CONN_C2_SIGNATURE, rts))
{
printf("Unexpected RTS PDU: Expected CONN/C2\n");
fprintf(stderr, "Unexpected RTS PDU: Expected CONN/C2\n");
return FALSE;
}
@ -842,9 +842,9 @@ int rts_recv_flow_control_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
&BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4;
#if 0
printf("BytesReceived: %d AvailableWindow: %d\n",
fprintf(stderr, "BytesReceived: %d AvailableWindow: %d\n",
BytesReceived, AvailableWindow);
printf("ChannelCookie: " RPC_UUID_FORMAT_STRING "\n", RPC_UUID_FORMAT_ARGUMENTS(ChannelCookie));
fprintf(stderr, "ChannelCookie: " RPC_UUID_FORMAT_STRING "\n", RPC_UUID_FORMAT_ARGUMENTS(ChannelCookie));
#endif
rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow =
@ -883,9 +883,9 @@ int rts_recv_flow_control_ack_with_destination_pdu(rdpRpc* rpc, BYTE* buffer, UI
&BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4;
#if 0
printf("Destination: %d BytesReceived: %d AvailableWindow: %d\n",
fprintf(stderr, "Destination: %d BytesReceived: %d AvailableWindow: %d\n",
Destination, BytesReceived, AvailableWindow);
printf("ChannelCookie: " RPC_UUID_FORMAT_STRING "\n", RPC_UUID_FORMAT_ARGUMENTS(ChannelCookie));
fprintf(stderr, "ChannelCookie: " RPC_UUID_FORMAT_STRING "\n", RPC_UUID_FORMAT_ARGUMENTS(ChannelCookie));
#endif
rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow =
@ -986,7 +986,7 @@ int rts_command_length(rdpRpc* rpc, UINT32 CommandType, BYTE* buffer, UINT32 len
break;
default:
printf("Error: Unknown RTS Command Type: 0x%x\n", CommandType);
fprintf(stderr, "Error: Unknown RTS Command Type: 0x%x\n", CommandType);
return -1;
break;
}
@ -1019,7 +1019,7 @@ int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
}
else
{
printf("Unimplemented signature id: 0x%08X\n", SignatureId);
fprintf(stderr, "Unimplemented signature id: 0x%08X\n", SignatureId);
rts_print_pdu_signature(rpc, &signature);
}

View File

@ -320,13 +320,13 @@ int rts_print_pdu_signature(rdpRpc* rpc, RtsPduSignature* signature)
UINT32 SignatureId;
RTS_PDU_SIGNATURE_ENTRY* entry;
printf("RTS PDU Signature: Flags: 0x%04X NumberOfCommands: %d\n",
fprintf(stderr, "RTS PDU Signature: Flags: 0x%04X NumberOfCommands: %d\n",
signature->Flags, signature->NumberOfCommands);
SignatureId = rts_identify_pdu_signature(rpc, signature, &entry);
if (SignatureId)
printf("Identified %s RTS PDU\n", entry->PduName);
fprintf(stderr, "Identified %s RTS PDU\n", entry->PduName);
return 0;
}

View File

@ -129,7 +129,7 @@ DWORD TsProxySendToServer(handle_t IDL_handle, byte pRpcMessage[], UINT32 count,
if (status <= 0)
{
printf("rpc_write failed!\n");
fprintf(stderr, "rpc_write failed!\n");
return -1;
}
@ -293,7 +293,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT)
{
printf("Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT\n",
fprintf(stderr, "Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT\n",
versionCaps->tsgHeader.ComponentId);
return FALSE;
}
@ -319,7 +319,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if ((SwitchValue != TSG_CAPABILITY_TYPE_NAP) || (tsgCaps->capabilityType != TSG_CAPABILITY_TYPE_NAP))
{
printf("Unexpected CapabilityType: 0x%08X, Expected TSG_CAPABILITY_TYPE_NAP\n",
fprintf(stderr, "Unexpected CapabilityType: 0x%08X, Expected TSG_CAPABILITY_TYPE_NAP\n",
tsgCaps->capabilityType);
return FALSE;
}
@ -336,9 +336,9 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
offset += 20;
#ifdef WITH_DEBUG_TSG
printf("TSG TunnelContext:\n");
fprintf(stderr, "TSG TunnelContext:\n");
winpr_HexDump((void*) &tsg->TunnelContext, 20);
printf("\n");
fprintf(stderr, "\n");
#endif
free(tsgCaps);
@ -394,7 +394,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT)
{
printf("Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT\n",
fprintf(stderr, "Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT\n",
versionCaps->tsgHeader.ComponentId);
return FALSE;
}
@ -421,9 +421,9 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
offset += 20;
#ifdef WITH_DEBUG_TSG
printf("TSG TunnelContext:\n");
fprintf(stderr, "TSG TunnelContext:\n");
winpr_HexDump((void*) &tsg->TunnelContext, 20);
printf("\n");
fprintf(stderr, "\n");
#endif
free(versionCaps);
@ -431,7 +431,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
}
else
{
printf("Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_CAPS_RESPONSE "
fprintf(stderr, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_CAPS_RESPONSE "
"or TSG_PACKET_TYPE_QUARENC_RESPONSE\n", packet->packetId);
return FALSE;
}
@ -460,7 +460,7 @@ BOOL TsProxyCreateTunnel(rdpTsg* tsg, PTSG_PACKET tsgPacket, PTSG_PACKET* tsgPac
if (!TsProxyCreateTunnelWriteRequest(tsg))
{
printf("TsProxyCreateTunnel: error writing request\n");
fprintf(stderr, "TsProxyCreateTunnel: error writing request\n");
return FALSE;
}
@ -562,7 +562,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if ((packet->packetId != TSG_PACKET_TYPE_RESPONSE) || (SwitchValue != TSG_PACKET_TYPE_RESPONSE))
{
printf("Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_RESPONSE\n", packet->packetId);
fprintf(stderr, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_RESPONSE\n", packet->packetId);
return FALSE;
}
@ -575,7 +575,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if (packetResponse->flags != TSG_PACKET_TYPE_QUARREQUEST)
{
printf("Unexpected Packet Response Flags: 0x%08X, Expected TSG_PACKET_TYPE_QUARREQUEST\n",
fprintf(stderr, "Unexpected Packet Response Flags: 0x%08X, Expected TSG_PACKET_TYPE_QUARREQUEST\n",
packetResponse->flags);
return FALSE;
}
@ -599,7 +599,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if (SizeValue != packetResponse->responseDataLen)
{
printf("Unexpected size value: %d, expected: %d\n", SizeValue, packetResponse->responseDataLen);
fprintf(stderr, "Unexpected size value: %d, expected: %d\n", SizeValue, packetResponse->responseDataLen);
return FALSE;
}
@ -630,7 +630,7 @@ BOOL TsProxyAuthorizeTunnel(rdpTsg* tsg, PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunn
if (!TsProxyAuthorizeTunnelWriteRequest(tsg, tunnelContext))
{
printf("TsProxyAuthorizeTunnel: error writing request\n");
fprintf(stderr, "TsProxyAuthorizeTunnel: error writing request\n");
return FALSE;
}
@ -709,7 +709,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
if ((packet->packetId != TSG_PACKET_TYPE_MESSAGE_PACKET) || (SwitchValue != TSG_PACKET_TYPE_MESSAGE_PACKET))
{
printf("Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_MESSAGE_PACKET\n", packet->packetId);
fprintf(stderr, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_MESSAGE_PACKET\n", packet->packetId);
return FALSE;
}
@ -742,7 +742,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
ActualCount = *((UINT32*) &buffer[offset + 56]); /* ActualCount */
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) &buffer[offset + 60], ActualCount, &messageText, 0, NULL, NULL);
printf("Consent Message: %s\n", messageText);
fprintf(stderr, "Consent Message: %s\n", messageText);
free(messageText);
break;
@ -763,7 +763,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
ActualCount = *((UINT32*) &buffer[offset + 56]); /* ActualCount */
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) &buffer[offset + 60], ActualCount, &messageText, 0, NULL, NULL);
printf("Service Message: %s\n", messageText);
fprintf(stderr, "Service Message: %s\n", messageText);
free(messageText);
break;
@ -777,7 +777,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
break;
default:
printf("TsProxyMakeTunnelCallReadResponse: unexpected message type: %d\n", SwitchValue);
fprintf(stderr, "TsProxyMakeTunnelCallReadResponse: unexpected message type: %d\n", SwitchValue);
return FALSE;
break;
}
@ -803,7 +803,7 @@ BOOL TsProxyMakeTunnelCall(rdpTsg* tsg, PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunne
if (!TsProxyMakeTunnelCallWriteRequest(tsg, tunnelContext, procId))
{
printf("TsProxyMakeTunnelCall: error writing request\n");
fprintf(stderr, "TsProxyMakeTunnelCall: error writing request\n");
return FALSE;
}
@ -822,9 +822,9 @@ BOOL TsProxyCreateChannelWriteRequest(rdpTsg* tsg, PTUNNEL_CONTEXT_HANDLE_NOSERI
count = _wcslen(tsg->Hostname) + 1;
#ifdef WITH_DEBUG_TSG
printf("ResourceName:\n");
fprintf(stderr, "ResourceName:\n");
winpr_HexDump((BYTE*) tsg->Hostname, (count - 1) * 2);
printf("\n");
fprintf(stderr, "\n");
#endif
length = 60 + (count * 2);
@ -888,9 +888,9 @@ BOOL TsProxyCreateChannelReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
CopyMemory(tsg->ChannelContext.ContextUuid, &buffer[offset + 4], 16); /* ContextUuid (16 bytes) */
#ifdef WITH_DEBUG_TSG
printf("ChannelContext:\n");
fprintf(stderr, "ChannelContext:\n");
winpr_HexDump((void*) &tsg->ChannelContext, 20);
printf("\n");
fprintf(stderr, "\n");
#endif
rpc_client_receive_pool_return(rpc, pdu);
@ -916,7 +916,7 @@ BOOL TsProxyCreateChannel(rdpTsg* tsg, PTUNNEL_CONTEXT_HANDLE_NOSERIALIZE tunnel
if (!TsProxyCreateChannelWriteRequest(tsg, tunnelContext))
{
printf("TsProxyCreateChannel: error writing request\n");
fprintf(stderr, "TsProxyCreateChannel: error writing request\n");
return FALSE;
}
@ -986,13 +986,13 @@ HRESULT TsProxyCloseChannel(rdpTsg* tsg, PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE* co
if (!TsProxyCloseChannelWriteRequest(tsg, context))
{
printf("TsProxyCloseChannel: error writing request\n");
fprintf(stderr, "TsProxyCloseChannel: error writing request\n");
return FALSE;
}
if (!TsProxyCloseChannelReadResponse(tsg, pdu))
{
printf("TsProxyCloseChannel: error reading response\n");
fprintf(stderr, "TsProxyCloseChannel: error reading response\n");
return FALSE;
}
@ -1062,13 +1062,13 @@ HRESULT TsProxyCloseTunnel(rdpTsg* tsg, PTUNNEL_CONTEXT_HANDLE_SERIALIZE* contex
if (!TsProxyCloseTunnelWriteRequest(tsg, context))
{
printf("TsProxyCloseTunnel: error writing request\n");
fprintf(stderr, "TsProxyCloseTunnel: error writing request\n");
return FALSE;
}
if (!TsProxyCloseTunnelReadResponse(tsg, pdu))
{
printf("TsProxyCloseTunnel: error reading response\n");
fprintf(stderr, "TsProxyCloseTunnel: error reading response\n");
return FALSE;
}
@ -1123,7 +1123,7 @@ BOOL TsProxySetupReceivePipe(handle_t IDL_handle, BYTE* pRpcMessage)
if (!TsProxySetupReceivePipeWriteRequest(tsg))
{
printf("TsProxySetupReceivePipe: error writing request\n");
fprintf(stderr, "TsProxySetupReceivePipe: error writing request\n");
return FALSE;
}
@ -1143,7 +1143,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
if (!rpc_connect(rpc))
{
printf("rpc_connect failed!\n");
fprintf(stderr, "rpc_connect failed!\n");
return FALSE;
}
@ -1206,7 +1206,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
if (!TsProxyCreateTunnelReadResponse(tsg, pdu))
{
printf("TsProxyCreateTunnel: error reading response\n");
fprintf(stderr, "TsProxyCreateTunnel: error reading response\n");
return FALSE;
}
@ -1252,7 +1252,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
if (!TsProxyAuthorizeTunnelReadResponse(tsg, pdu))
{
printf("TsProxyAuthorizeTunnel: error reading response\n");
fprintf(stderr, "TsProxyAuthorizeTunnel: error reading response\n");
return FALSE;
}
@ -1296,7 +1296,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
{
if (!TsProxyMakeTunnelCallReadResponse(tsg, pdu))
{
printf("TsProxyMakeTunnelCall: error reading response\n");
fprintf(stderr, "TsProxyMakeTunnelCall: error reading response\n");
return FALSE;
}
@ -1305,7 +1305,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
if (!TsProxyCreateChannelReadResponse(tsg, pdu))
{
printf("TsProxyCreateChannel: error reading response\n");
fprintf(stderr, "TsProxyCreateChannel: error reading response\n");
return FALSE;
}
@ -1334,7 +1334,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
if (!TsProxySetupReceivePipeReadResponse(tsg, pdu))
{
printf("TsProxySetupReceivePipe: error reading response\n");
fprintf(stderr, "TsProxySetupReceivePipe: error reading response\n");
return FALSE;
}
#endif
@ -1342,7 +1342,7 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
rpc->client->SynchronousSend = TRUE;
rpc->client->SynchronousReceive = TRUE;
printf("TS Gateway Connection Success\n");
fprintf(stderr, "TS Gateway Connection Success\n");
return TRUE;
}

View File

@ -264,7 +264,7 @@ BOOL gcc_read_conference_create_response(wStream* s, rdpSettings* settings)
per_read_length(s, &length);
if (!gcc_read_server_data_blocks(s, settings, length))
{
printf("gcc_read_conference_create_response: gcc_read_server_data_blocks failed\n");
fprintf(stderr, "gcc_read_conference_create_response: gcc_read_server_data_blocks failed\n");
return FALSE;
}
@ -375,16 +375,16 @@ void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings)
{
if (settings->UseMultimon)
{
printf("WARNING: true multi monitor support was not advertised by server!\n");
fprintf(stderr, "WARNING: true multi monitor support was not advertised by server!\n");
if (settings->ForceMultimon)
{
printf("Sending multi monitor information anyway (may break connectivity!)\n");
fprintf(stderr, "Sending multi monitor information anyway (may break connectivity!)\n");
gcc_write_client_monitor_data(s, settings);
}
else
{
printf("Use /multimon:force to force sending multi monitor information\n");
fprintf(stderr, "Use /multimon:force to force sending multi monitor information\n");
}
}
}
@ -403,7 +403,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
if (!gcc_read_user_data_header(s, &type, &blockLength))
{
printf("gcc_read_server_data_blocks: gcc_read_user_data_header failed\n");
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_user_data_header failed\n");
return FALSE;
}
@ -412,7 +412,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
case SC_CORE:
if (!gcc_read_server_core_data(s, settings))
{
printf("gcc_read_server_data_blocks: gcc_read_server_core_data failed\n");
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_core_data failed\n");
return FALSE;
}
break;
@ -420,7 +420,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
case SC_SECURITY:
if (!gcc_read_server_security_data(s, settings))
{
printf("gcc_read_server_data_blocks: gcc_read_server_security_data failed\n");
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_security_data failed\n");
return FALSE;
}
break;
@ -428,13 +428,13 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
case SC_NET:
if (!gcc_read_server_network_data(s, settings))
{
printf("gcc_read_server_data_blocks: gcc_read_server_network_data failed\n");
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_network_data failed\n");
return FALSE;
}
break;
default:
printf("gcc_read_server_data_blocks: ignoring type=%hu\n", type);
fprintf(stderr, "gcc_read_server_data_blocks: ignoring type=%hu\n", type);
break;
}
offset += blockLength;
@ -1127,7 +1127,7 @@ BOOL gcc_read_server_network_data(wStream* s, rdpSettings* settings)
if (channelCount != settings->ChannelCount)
{
printf("requested %d channels, got %d instead\n",
fprintf(stderr, "requested %d channels, got %d instead\n",
settings->ChannelCount, channelCount);
}
@ -1221,7 +1221,7 @@ void gcc_write_client_cluster_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_client_monitor_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
{
printf("CS_MONITOR\n");
fprintf(stderr, "CS_MONITOR\n");
return TRUE;
}

View File

@ -449,14 +449,14 @@ BOOL rdp_recv_client_info(rdpRdp* rdp, wStream* s)
{
if (securityFlags & SEC_REDIRECTION_PKT)
{
printf("Error: SEC_REDIRECTION_PKT unsupported\n");
fprintf(stderr, "Error: SEC_REDIRECTION_PKT unsupported\n");
return FALSE;
}
if (securityFlags & SEC_ENCRYPT)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return FALSE;
}
}
@ -584,7 +584,7 @@ BOOL rdp_recv_save_session_info(rdpRdp* rdp, wStream* s)
return FALSE;
stream_read_UINT32(s, infoType); /* infoType (4 bytes) */
//printf("%s\n", INFO_TYPE_LOGON_STRINGS[infoType]);
//fprintf(stderr, "%s\n", INFO_TYPE_LOGON_STRINGS[infoType]);
switch (infoType)
{

View File

@ -336,7 +336,7 @@ static BOOL input_recv_event(rdpInput* input, wStream* s)
break;
default:
printf("Unknown messageType %u\n", messageType);
fprintf(stderr, "Unknown messageType %u\n", messageType);
/* Each input event uses 6 bytes. */
stream_seek(s, 6);
break;

View File

@ -88,10 +88,10 @@ void license_print_product_info(PRODUCT_INFO* productInfo)
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbProductId,
productInfo->cbProductId / 2, &ProductId, 0, NULL, NULL);
printf("ProductInfo:\n");
printf("\tdwVersion: 0x%08X\n", productInfo->dwVersion);
printf("\tCompanyName: %s\n", CompanyName);
printf("\tProductId: %s\n", ProductId);
fprintf(stderr, "ProductInfo:\n");
fprintf(stderr, "\tdwVersion: 0x%08X\n", productInfo->dwVersion);
fprintf(stderr, "\tCompanyName: %s\n", CompanyName);
fprintf(stderr, "\tProductId: %s\n", ProductId);
free(CompanyName);
free(ProductId);
@ -102,12 +102,12 @@ void license_print_scope_list(SCOPE_LIST* scopeList)
int index;
LICENSE_BLOB* scope;
printf("ScopeList (%d):\n", scopeList->count);
fprintf(stderr, "ScopeList (%d):\n", scopeList->count);
for (index = 0; index < scopeList->count; index++)
{
scope = &scopeList->array[index];
printf("\t%s\n", (char*) scope->buffer);
fprintf(stderr, "\t%s\n", (char*) scope->buffer);
}
}
@ -202,7 +202,7 @@ BOOL license_send(rdpLicense* license, wStream* s, BYTE type)
license_write_preamble(s, type, flags, wMsgSize);
#ifdef WITH_DEBUG_LICENSE
printf("Sending %s Packet, length %d\n", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize);
fprintf(stderr, "Sending %s Packet, length %d\n", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize);
winpr_HexDump(s->pointer - 4, wMsgSize);
#endif
@ -233,7 +233,7 @@ BOOL license_recv(rdpLicense* license, wStream* s)
if (!rdp_read_header(license->rdp, s, &length, &channelId))
{
printf("Incorrect RDP header.\n");
fprintf(stderr, "Incorrect RDP header.\n");
return FALSE;
}
@ -244,7 +244,7 @@ BOOL license_recv(rdpLicense* license, wStream* s)
{
if (!rdp_decrypt(license->rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return FALSE;
}
}
@ -256,7 +256,7 @@ BOOL license_recv(rdpLicense* license, wStream* s)
if (rdp_recv_out_of_sequence_pdu(license->rdp, s) != TRUE)
{
printf("Unexpected license packet.\n");
fprintf(stderr, "Unexpected license packet.\n");
return FALSE;
}
@ -296,7 +296,7 @@ BOOL license_recv(rdpLicense* license, wStream* s)
break;
default:
printf("invalid bMsgType:%d\n", bMsgType);
fprintf(stderr, "invalid bMsgType:%d\n", bMsgType);
return FALSE;
}
@ -337,33 +337,33 @@ void license_generate_keys(rdpLicense* license)
license->ServerRandom, license->LicensingEncryptionKey); /* LicensingEncryptionKey */
#ifdef WITH_DEBUG_LICENSE
printf("ClientRandom:\n");
fprintf(stderr, "ClientRandom:\n");
winpr_HexDump(license->ClientRandom, CLIENT_RANDOM_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("ServerRandom:\n");
fprintf(stderr, "ServerRandom:\n");
winpr_HexDump(license->ServerRandom, SERVER_RANDOM_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("PremasterSecret:\n");
fprintf(stderr, "PremasterSecret:\n");
winpr_HexDump(license->PremasterSecret, PREMASTER_SECRET_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("MasterSecret:\n");
fprintf(stderr, "MasterSecret:\n");
winpr_HexDump(license->MasterSecret, MASTER_SECRET_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("SessionKeyBlob:\n");
fprintf(stderr, "SessionKeyBlob:\n");
winpr_HexDump(license->SessionKeyBlob, SESSION_KEY_BLOB_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("MacSaltKey:\n");
fprintf(stderr, "MacSaltKey:\n");
winpr_HexDump(license->MacSaltKey, MAC_SALT_KEY_LENGTH);
printf("\n");
fprintf(stderr, "\n");
printf("LicensingEncryptionKey:\n");
fprintf(stderr, "LicensingEncryptionKey:\n");
winpr_HexDump(license->LicensingEncryptionKey, LICENSING_ENCRYPTION_KEY_LENGTH);
printf("\n");
fprintf(stderr, "\n");
#endif
}
@ -416,13 +416,13 @@ void license_encrypt_premaster_secret(rdpLicense* license)
license_get_server_rsa_public_key(license);
#ifdef WITH_DEBUG_LICENSE
printf("Modulus (%d bits):\n", license->ModulusLength * 8);
fprintf(stderr, "Modulus (%d bits):\n", license->ModulusLength * 8);
winpr_HexDump(license->Modulus, license->ModulusLength);
printf("\n");
fprintf(stderr, "\n");
printf("Exponent:\n");
fprintf(stderr, "Exponent:\n");
winpr_HexDump(license->Exponent, 4);
printf("\n");
fprintf(stderr, "\n");
#endif
EncryptedPremasterSecret = (BYTE*) malloc(license->ModulusLength);
@ -558,7 +558,7 @@ BOOL license_read_binary_blob(wStream* s, LICENSE_BLOB* blob)
if ((blob->type != wBlobType) && (blob->type != BB_ANY_BLOB))
{
printf("license binary blob type (%x) does not match expected type (%x).\n", wBlobType, blob->type);
fprintf(stderr, "license binary blob type (%x) does not match expected type (%x).\n", wBlobType, blob->type);
}
blob->type = wBlobType;
@ -592,7 +592,7 @@ void license_write_encrypted_premaster_secret_blob(wStream* s, LICENSE_BLOB* blo
if (blob->length > ModulusLength)
{
printf("license_write_encrypted_premaster_secret_blob: invalid blob\n");
fprintf(stderr, "license_write_encrypted_premaster_secret_blob: invalid blob\n");
return;
}
@ -753,15 +753,15 @@ BOOL license_read_license_request_packet(rdpLicense* license, wStream* s)
license_encrypt_premaster_secret(license);
#ifdef WITH_DEBUG_LICENSE
printf("ServerRandom:\n");
fprintf(stderr, "ServerRandom:\n");
winpr_HexDump(license->ServerRandom, 32);
printf("\n");
fprintf(stderr, "\n");
license_print_product_info(license->ProductInfo);
printf("\n");
fprintf(stderr, "\n");
license_print_scope_list(license->ScopeList);
printf("\n");
fprintf(stderr, "\n");
#endif
return TRUE;
@ -799,20 +799,20 @@ BOOL license_read_platform_challenge_packet(rdpLicense* license, wStream* s)
license_decrypt_platform_challenge(license);
#ifdef WITH_DEBUG_LICENSE
printf("ConnectFlags: 0x%08X\n", ConnectFlags);
printf("\n");
fprintf(stderr, "ConnectFlags: 0x%08X\n", ConnectFlags);
fprintf(stderr, "\n");
printf("EncryptedPlatformChallenge:\n");
fprintf(stderr, "EncryptedPlatformChallenge:\n");
winpr_HexDump(license->EncryptedPlatformChallenge->buffer, license->EncryptedPlatformChallenge->length);
printf("\n");
fprintf(stderr, "\n");
printf("PlatformChallenge:\n");
fprintf(stderr, "PlatformChallenge:\n");
winpr_HexDump(license->PlatformChallenge->buffer, license->PlatformChallenge->length);
printf("\n");
fprintf(stderr, "\n");
printf("MacData:\n");
fprintf(stderr, "MacData:\n");
winpr_HexDump(MacData, 16);
printf("\n");
fprintf(stderr, "\n");
#endif
return TRUE;
@ -866,7 +866,7 @@ BOOL license_read_error_alert_packet(rdpLicense* license, wStream* s)
return FALSE;
#ifdef WITH_DEBUG_LICENSE
printf("dwErrorCode: %s, dwStateTransition: %s\n",
fprintf(stderr, "dwErrorCode: %s, dwStateTransition: %s\n",
error_codes[dwErrorCode], state_transitions[dwStateTransition]);
#endif
@ -922,22 +922,22 @@ void license_write_new_license_request_packet(rdpLicense* license, wStream* s)
license_write_binary_blob(s, license->ClientMachineName); /* ClientMachineName */
#ifdef WITH_DEBUG_LICENSE
printf("PreferredKeyExchangeAlg: 0x%08X\n", PreferredKeyExchangeAlg);
printf("\n");
fprintf(stderr, "PreferredKeyExchangeAlg: 0x%08X\n", PreferredKeyExchangeAlg);
fprintf(stderr, "\n");
printf("ClientRandom:\n");
fprintf(stderr, "ClientRandom:\n");
winpr_HexDump(license->ClientRandom, 32);
printf("\n");
fprintf(stderr, "\n");
printf("EncryptedPremasterSecret\n");
fprintf(stderr, "EncryptedPremasterSecret\n");
winpr_HexDump(license->EncryptedPremasterSecret->buffer, license->EncryptedPremasterSecret->length);
printf("\n");
fprintf(stderr, "\n");
printf("ClientUserName (%d): %s\n", license->ClientUserName->length, (char*) license->ClientUserName->buffer);
printf("\n");
fprintf(stderr, "ClientUserName (%d): %s\n", license->ClientUserName->length, (char*) license->ClientUserName->buffer);
fprintf(stderr, "\n");
printf("ClientMachineName (%d): %s\n", license->ClientMachineName->length, (char*) license->ClientMachineName->buffer);
printf("\n");
fprintf(stderr, "ClientMachineName (%d): %s\n", license->ClientMachineName->length, (char*) license->ClientMachineName->buffer);
fprintf(stderr, "\n");
#endif
}
@ -1030,17 +1030,17 @@ void license_send_platform_challenge_response_packet(rdpLicense* license)
license->EncryptedHardwareId->length = HWID_LENGTH;
#ifdef WITH_DEBUG_LICENSE
printf("LicensingEncryptionKey:\n");
fprintf(stderr, "LicensingEncryptionKey:\n");
winpr_HexDump(license->LicensingEncryptionKey, 16);
printf("\n");
fprintf(stderr, "\n");
printf("HardwareId:\n");
fprintf(stderr, "HardwareId:\n");
winpr_HexDump(license->HardwareId, 20);
printf("\n");
fprintf(stderr, "\n");
printf("EncryptedHardwareId:\n");
fprintf(stderr, "EncryptedHardwareId:\n");
winpr_HexDump(license->EncryptedHardwareId->buffer, 20);
printf("\n");
fprintf(stderr, "\n");
#endif
license_write_platform_challenge_response_packet(license, s, mac_data);

View File

@ -163,7 +163,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a
else
sin_addr = &(((struct sockaddr_in6*) ai->ai_addr)->sin6_addr);
printf("Listening on %s port %s.\n", inet_ntop(ai->ai_family, sin_addr, buf, sizeof(buf)), servname);
fprintf(stderr, "Listening on %s port %s.\n", inet_ntop(ai->ai_family, sin_addr, buf, sizeof(buf)), servname);
}
freeaddrinfo(res);
@ -213,7 +213,7 @@ static BOOL freerdp_listener_open_local(freerdp_listener* instance, const char*
listener->sockfds[listener->num_sockfds++] = sockfd;
printf("Listening on socket %s.\n", addr.sun_path);
fprintf(stderr, "Listening on socket %s.\n", addr.sun_path);
return TRUE;
#else

View File

@ -307,16 +307,16 @@ void mcs_write_domain_parameters(wStream* s, DomainParameters* domainParameters)
void mcs_print_domain_parameters(DomainParameters* domainParameters)
{
printf("DomainParameters {\n");
printf("\tmaxChannelIds:%d\n", domainParameters->maxChannelIds);
printf("\tmaxUserIds:%d\n", domainParameters->maxUserIds);
printf("\tmaxTokenIds:%d\n", domainParameters->maxTokenIds);
printf("\tnumPriorities:%d\n", domainParameters->numPriorities);
printf("\tminThroughput:%d\n", domainParameters->minThroughput);
printf("\tmaxHeight:%d\n", domainParameters->maxHeight);
printf("\tmaxMCSPDUsize:%d\n", domainParameters->maxMCSPDUsize);
printf("\tprotocolVersion:%d\n", domainParameters->protocolVersion);
printf("}\n");
fprintf(stderr, "DomainParameters {\n");
fprintf(stderr, "\tmaxChannelIds:%d\n", domainParameters->maxChannelIds);
fprintf(stderr, "\tmaxUserIds:%d\n", domainParameters->maxUserIds);
fprintf(stderr, "\tmaxTokenIds:%d\n", domainParameters->maxTokenIds);
fprintf(stderr, "\tnumPriorities:%d\n", domainParameters->numPriorities);
fprintf(stderr, "\tminThroughput:%d\n", domainParameters->minThroughput);
fprintf(stderr, "\tmaxHeight:%d\n", domainParameters->maxHeight);
fprintf(stderr, "\tmaxMCSPDUsize:%d\n", domainParameters->maxMCSPDUsize);
fprintf(stderr, "\tprotocolVersion:%d\n", domainParameters->protocolVersion);
fprintf(stderr, "}\n");
}
/**
@ -517,7 +517,7 @@ BOOL mcs_recv_connect_response(rdpMcs* mcs, wStream* s)
if (!gcc_read_conference_create_response(s, mcs->transport->settings))
{
printf("mcs_recv_connect_response: gcc_read_conference_create_response failed\n");
fprintf(stderr, "mcs_recv_connect_response: gcc_read_conference_create_response failed\n");
return FALSE;
}

View File

@ -1481,7 +1481,7 @@ int update_message_process_class(rdpUpdateProxy* proxy, wMessage* msg, int msgCl
}
if (status < 0)
printf("Unknown message: class: %d type: %d\n", msgClass, msgType);
fprintf(stderr, "Unknown message: class: %d type: %d\n", msgClass, msgType);
return status;
}
@ -1854,7 +1854,7 @@ int input_message_process_class(rdpInputProxy* proxy, wMessage* msg, int msgClas
}
if (status < 0)
printf("Unknown event: class: %d type: %d\n", msgClass, msgType);
fprintf(stderr, "Unknown event: class: %d type: %d\n", msgClass, msgType);
return status;
}

View File

@ -543,7 +543,7 @@ int nego_recv(rdpTransport* transport, wStream* s, void* extra)
}
else
{
printf("invalid negotiation response\n");
fprintf(stderr, "invalid negotiation response\n");
nego->state = NEGO_STATE_FAIL;
}
@ -568,7 +568,7 @@ BOOL nego_read_request(rdpNego* nego, wStream* s)
if (li != stream_get_left(s) + 6)
{
printf("Incorrect TPDU length indicator.\n");
fprintf(stderr, "Incorrect TPDU length indicator.\n");
return FALSE;
}
@ -600,7 +600,7 @@ BOOL nego_read_request(rdpNego* nego, wStream* s)
if (type != TYPE_RDP_NEG_REQ)
{
printf("Incorrect negotiation request type %d\n", type);
fprintf(stderr, "Incorrect negotiation request type %d\n", type);
return FALSE;
}
@ -822,7 +822,7 @@ BOOL nego_send_negotiation_response(rdpNego* nego)
* TODO: Check for other possibilities,
* like SSL_NOT_ALLOWED_BY_SERVER.
*/
printf("nego_send_negotiation_response: client supports only Standard RDP Security\n");
fprintf(stderr, "nego_send_negotiation_response: client supports only Standard RDP Security\n");
stream_write_UINT32(s, SSL_REQUIRED_BY_SERVER);
length += 8;
status = FALSE;

View File

@ -216,7 +216,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("QuerySecurityPackageInfo status: 0x%08X\n", status);
fprintf(stderr, "QuerySecurityPackageInfo status: 0x%08X\n", status);
return 0;
}
@ -227,7 +227,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("AcquireCredentialsHandle status: 0x%08X\n", status);
fprintf(stderr, "AcquireCredentialsHandle status: 0x%08X\n", status);
return 0;
}
@ -278,7 +278,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
if (credssp->table->QueryContextAttributes(&credssp->context, SECPKG_ATTR_SIZES, &credssp->ContextSizes) != SEC_E_OK)
{
printf("QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
fprintf(stderr, "QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
return 0;
}
@ -298,7 +298,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
credssp->negoToken.cbBuffer = output_buffer.cbBuffer;
#ifdef WITH_DEBUG_CREDSSP
printf("Sending Authentication Token\n");
fprintf(stderr, "Sending Authentication Token\n");
winpr_HexDump(credssp->negoToken.pvBuffer, credssp->negoToken.cbBuffer);
#endif
@ -320,7 +320,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
return -1;
#ifdef WITH_DEBUG_CREDSSP
printf("Receiving Authentication Token (%d)\n", (int) credssp->negoToken.cbBuffer);
fprintf(stderr, "Receiving Authentication Token (%d)\n", (int) credssp->negoToken.cbBuffer);
winpr_HexDump(credssp->negoToken.pvBuffer, credssp->negoToken.cbBuffer);
#endif
@ -342,7 +342,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("Could not verify public key echo!\n");
fprintf(stderr, "Could not verify public key echo!\n");
return -1;
}
@ -352,7 +352,7 @@ int credssp_client_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("credssp_encrypt_ts_credentials status: 0x%08X\n", status);
fprintf(stderr, "credssp_encrypt_ts_credentials status: 0x%08X\n", status);
return 0;
}
@ -432,7 +432,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("QuerySecurityPackageInfo status: 0x%08X\n", status);
fprintf(stderr, "QuerySecurityPackageInfo status: 0x%08X\n", status);
return 0;
}
@ -443,7 +443,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("AcquireCredentialsHandle status: 0x%08X\n", status);
fprintf(stderr, "AcquireCredentialsHandle status: 0x%08X\n", status);
return 0;
}
@ -493,7 +493,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
return -1;
#ifdef WITH_DEBUG_CREDSSP
printf("Receiving Authentication Token\n");
fprintf(stderr, "Receiving Authentication Token\n");
credssp_buffer_print(credssp);
#endif
@ -502,7 +502,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (credssp->negoToken.cbBuffer < 1)
{
printf("CredSSP: invalid negoToken!\n");
fprintf(stderr, "CredSSP: invalid negoToken!\n");
return -1;
}
@ -538,13 +538,13 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (credssp->table->QueryContextAttributes(&credssp->context, SECPKG_ATTR_SIZES, &credssp->ContextSizes) != SEC_E_OK)
{
printf("QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
fprintf(stderr, "QueryContextAttributes SECPKG_ATTR_SIZES failure\n");
return 0;
}
if (credssp_decrypt_public_key_echo(credssp) != SEC_E_OK)
{
printf("Error: could not verify client's public key echo\n");
fprintf(stderr, "Error: could not verify client's public key echo\n");
return -1;
}
@ -557,14 +557,14 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED))
{
printf("AcceptSecurityContext status: 0x%08X\n", status);
fprintf(stderr, "AcceptSecurityContext status: 0x%08X\n", status);
return -1;
}
/* send authentication token */
#ifdef WITH_DEBUG_CREDSSP
printf("Sending Authentication Token\n");
fprintf(stderr, "Sending Authentication Token\n");
credssp_buffer_print(credssp);
#endif
@ -584,13 +584,13 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (credssp_decrypt_ts_credentials(credssp) != SEC_E_OK)
{
printf("Could not decrypt TSCredentials status: 0x%08X\n", status);
fprintf(stderr, "Could not decrypt TSCredentials status: 0x%08X\n", status);
return 0;
}
if (status != SEC_E_OK)
{
printf("AcceptSecurityContext status: 0x%08X\n", status);
fprintf(stderr, "AcceptSecurityContext status: 0x%08X\n", status);
return 0;
}
@ -598,7 +598,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("ImpersonateSecurityContext status: 0x%08X\n", status);
fprintf(stderr, "ImpersonateSecurityContext status: 0x%08X\n", status);
return 0;
}
else
@ -607,7 +607,7 @@ int credssp_server_authenticate(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("RevertSecurityContext status: 0x%08X\n", status);
fprintf(stderr, "RevertSecurityContext status: 0x%08X\n", status);
return 0;
}
}
@ -704,7 +704,7 @@ SECURITY_STATUS credssp_encrypt_public_key_echo(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("EncryptMessage status: 0x%08X\n", status);
fprintf(stderr, "EncryptMessage status: 0x%08X\n", status);
return status;
}
@ -725,7 +725,7 @@ SECURITY_STATUS credssp_decrypt_public_key_echo(rdpCredssp* credssp)
if (credssp->PublicKey.cbBuffer + credssp->ContextSizes.cbMaxSignature != credssp->pubKeyAuth.cbBuffer)
{
printf("unexpected pubKeyAuth buffer size:%d\n", (int) credssp->pubKeyAuth.cbBuffer);
fprintf(stderr, "unexpected pubKeyAuth buffer size:%d\n", (int) credssp->pubKeyAuth.cbBuffer);
return SEC_E_INVALID_TOKEN;
}
@ -752,7 +752,7 @@ SECURITY_STATUS credssp_decrypt_public_key_echo(rdpCredssp* credssp)
if (status != SEC_E_OK)
{
printf("DecryptMessage failure: 0x%08X\n", status);
fprintf(stderr, "DecryptMessage failure: 0x%08X\n", status);
return status;
}
@ -767,12 +767,12 @@ SECURITY_STATUS credssp_decrypt_public_key_echo(rdpCredssp* credssp)
if (memcmp(public_key1, public_key2, public_key_length) != 0)
{
printf("Could not verify server's public key echo\n");
fprintf(stderr, "Could not verify server's public key echo\n");
printf("Expected (length = %d):\n", public_key_length);
fprintf(stderr, "Expected (length = %d):\n", public_key_length);
winpr_HexDump(public_key1, public_key_length);
printf("Actual (length = %d):\n", public_key_length);
fprintf(stderr, "Actual (length = %d):\n", public_key_length);
winpr_HexDump(public_key2, public_key_length);
return SEC_E_MESSAGE_ALTERED; /* DO NOT SEND CREDENTIALS! */
@ -1002,7 +1002,7 @@ SECURITY_STATUS credssp_decrypt_ts_credentials(rdpCredssp* credssp)
if (credssp->authInfo.cbBuffer < 1)
{
printf("credssp_decrypt_ts_credentials missing authInfo buffer\n");
fprintf(stderr, "credssp_decrypt_ts_credentials missing authInfo buffer\n");
return SEC_E_INVALID_TOKEN;
}
@ -1152,7 +1152,7 @@ int credssp_recv(rdpCredssp* credssp)
if (status < 0)
{
printf("credssp_recv() error: %d\n", status);
fprintf(stderr, "credssp_recv() error: %d\n", status);
stream_free(s);
return -1;
}
@ -1208,19 +1208,19 @@ void credssp_buffer_print(rdpCredssp* credssp)
{
if (credssp->negoToken.cbBuffer > 0)
{
printf("CredSSP.negoToken (length = %d):\n", (int) credssp->negoToken.cbBuffer);
fprintf(stderr, "CredSSP.negoToken (length = %d):\n", (int) credssp->negoToken.cbBuffer);
winpr_HexDump(credssp->negoToken.pvBuffer, credssp->negoToken.cbBuffer);
}
if (credssp->pubKeyAuth.cbBuffer > 0)
{
printf("CredSSP.pubKeyAuth (length = %d):\n", (int) credssp->pubKeyAuth.cbBuffer);
fprintf(stderr, "CredSSP.pubKeyAuth (length = %d):\n", (int) credssp->pubKeyAuth.cbBuffer);
winpr_HexDump(credssp->pubKeyAuth.pvBuffer, credssp->pubKeyAuth.cbBuffer);
}
if (credssp->authInfo.cbBuffer > 0)
{
printf("CredSSP.authInfo (length = %d):\n", (int) credssp->authInfo.cbBuffer);
fprintf(stderr, "CredSSP.authInfo (length = %d):\n", (int) credssp->authInfo.cbBuffer);
winpr_HexDump(credssp->authInfo.pvBuffer, credssp->authInfo.cbBuffer);
}
}

View File

@ -502,7 +502,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 1) {\
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
fprintf(stderr, "%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_BYTE(s, TARGET); \
@ -514,7 +514,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 2) { \
printf("%s: error reading %s or %s\n", __FUNCTION__, #TARGET1, #TARGET2); \
fprintf(stderr, "%s: error reading %s or %s\n", __FUNCTION__, #TARGET1, #TARGET2); \
return FALSE; \
} \
stream_read_BYTE(s, TARGET1); \
@ -527,7 +527,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 2) { \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
fprintf(stderr, "%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_UINT16(s, TARGET); \
@ -538,7 +538,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
if (orderInfo->fieldFlags & (1 << (NO-1))) \
{ \
if (stream_get_left(s) < 4) { \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
fprintf(stderr, "%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
stream_read_UINT32(s, TARGET); \
@ -548,14 +548,14 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
#define ORDER_FIELD_COORD(NO, TARGET) \
do { \
if ((orderInfo->fieldFlags & (1 << (NO-1))) && !update_read_coord(s, &TARGET, orderInfo->deltaCoordinates)) { \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
fprintf(stderr, "%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
} while(0)
#define ORDER_FIELD_COLOR(NO, TARGET) \
do { \
if ((orderInfo->fieldFlags & (1 << (NO-1))) && !update_read_color(s, &TARGET)) { \
printf("%s: error reading %s\n", __FUNCTION__, #TARGET); \
fprintf(stderr, "%s: error reading %s\n", __FUNCTION__, #TARGET); \
return FALSE; \
} \
} while(0)
@ -564,12 +564,12 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, int
#define FIELD_SKIP_BUFFER16(s, TARGET_LEN) \
do { \
if (stream_get_left(s) < 2) {\
printf("%s: error reading length %s\n", __FUNCTION__, #TARGET_LEN); \
fprintf(stderr, "%s: error reading length %s\n", __FUNCTION__, #TARGET_LEN); \
return FALSE; \
}\
stream_read_UINT16(s, TARGET_LEN); \
if (!stream_skip(s, TARGET_LEN)) { \
printf("%s: error skipping %d bytes\n", __FUNCTION__, TARGET_LEN); \
fprintf(stderr, "%s: error skipping %d bytes\n", __FUNCTION__, TARGET_LEN); \
return FALSE; \
} \
} while(0)
@ -1415,7 +1415,7 @@ BOOL update_read_cache_brush_order(wStream* s, CACHE_BRUSH_ORDER* cache_brush_or
{
if (cache_brush_order->length != 8)
{
printf("incompatible 1bpp brush of length:%d\n", cache_brush_order->length);
fprintf(stderr, "incompatible 1bpp brush of length:%d\n", cache_brush_order->length);
return TRUE; // should be FALSE ?
}
@ -1743,7 +1743,7 @@ BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
if (orderInfo->orderType >= PRIMARY_DRAWING_ORDER_COUNT)
{
printf("Invalid Primary Drawing Order (0x%02X)\n", orderInfo->orderType);
fprintf(stderr, "Invalid Primary Drawing Order (0x%02X)\n", orderInfo->orderType);
return FALSE;
}
@ -1765,7 +1765,7 @@ BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
orderInfo->deltaCoordinates = (flags & ORDER_DELTA_COORDINATES) ? TRUE : FALSE;
#ifdef WITH_DEBUG_ORDERS
printf("%s Primary Drawing Order (0x%02X)\n", PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
fprintf(stderr, "%s Primary Drawing Order (0x%02X)\n", PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
#endif
switch (orderInfo->orderType)
@ -1933,9 +1933,9 @@ BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags)
#ifdef WITH_DEBUG_ORDERS
if (orderType < SECONDARY_DRAWING_ORDER_COUNT)
printf("%s Secondary Drawing Order (0x%02X)\n", SECONDARY_DRAWING_ORDER_STRINGS[orderType], orderType);
fprintf(stderr, "%s Secondary Drawing Order (0x%02X)\n", SECONDARY_DRAWING_ORDER_STRINGS[orderType], orderType);
else
printf("Unknown Secondary Drawing Order (0x%02X)\n", orderType);
fprintf(stderr, "Unknown Secondary Drawing Order (0x%02X)\n", orderType);
#endif
switch (orderType)
@ -2015,9 +2015,9 @@ BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, BYTE flags)
#ifdef WITH_DEBUG_ORDERS
if (orderType < ALTSEC_DRAWING_ORDER_COUNT)
printf("%s Alternate Secondary Drawing Order (0x%02X)\n", ALTSEC_DRAWING_ORDER_STRINGS[orderType], orderType);
fprintf(stderr, "%s Alternate Secondary Drawing Order (0x%02X)\n", ALTSEC_DRAWING_ORDER_STRINGS[orderType], orderType);
else
printf("Unknown Alternate Secondary Drawing Order: 0x%02X\n", orderType);
fprintf(stderr, "Unknown Alternate Secondary Drawing Order: 0x%02X\n", orderType);
#endif
switch (orderType)

View File

@ -151,7 +151,7 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s)
break;
default:
printf("Data PDU type %d\n", type);
fprintf(stderr, "Data PDU type %d\n", type);
break;
}
@ -172,7 +172,7 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s)
if (!rdp_read_header(rdp, s, &length, &channelId))
{
printf("Incorrect RDP header.\n");
fprintf(stderr, "Incorrect RDP header.\n");
return -1;
}
@ -185,7 +185,7 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return -1;
}
}
@ -211,7 +211,7 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s)
break;
default:
printf("Client sent pduType %d\n", pduType);
fprintf(stderr, "Client sent pduType %d\n", pduType);
return -1;
}
}
@ -234,7 +234,7 @@ static int peer_recv_fastpath_pdu(freerdp_peer* client, wStream* s)
if ((length == 0) || (length > stream_get_left(s)))
{
printf("incorrect FastPath PDU header length %d\n", length);
fprintf(stderr, "incorrect FastPath PDU header length %d\n", length);
return -1;
}
@ -337,7 +337,7 @@ static int peer_recv_callback(rdpTransport* transport, wStream* s, void* extra)
break;
default:
printf("Invalid state %d\n", rdp->state);
fprintf(stderr, "Invalid state %d\n", rdp->state);
return -1;
}

View File

@ -515,7 +515,7 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s)
{
if (stream_get_left(s) < compressed_len - 18)
{
printf("decompress_rdp: not enough bytes for compressed_len=%d\n", compressed_len);
fprintf(stderr, "decompress_rdp: not enough bytes for compressed_len=%d\n", compressed_len);
return -1;
}
if (decompress_rdp(rdp->mppc_dec, s->pointer, compressed_len - 18, compressed_type, &roff, &rlen))
@ -527,7 +527,7 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s)
}
else
{
printf("decompress_rdp() failed\n");
fprintf(stderr, "decompress_rdp() failed\n");
return -1;
}
stream_seek(s, compressed_len - 18);
@ -697,13 +697,13 @@ BOOL rdp_decrypt(rdpRdp* rdp, wStream* s, int length, UINT16 securityFlags)
if (!security_fips_decrypt(s->pointer, length, rdp))
{
printf("FATAL: cannot decrypt\n");
fprintf(stderr, "FATAL: cannot decrypt\n");
return FALSE; /* TODO */
}
if (!security_fips_check_signature(s->pointer, length - pad, sig, rdp))
{
printf("FATAL: invalid packet signature\n");
fprintf(stderr, "FATAL: invalid packet signature\n");
return FALSE; /* TODO */
}
@ -727,7 +727,7 @@ BOOL rdp_decrypt(rdpRdp* rdp, wStream* s, int length, UINT16 securityFlags)
if (memcmp(wmac, cmac, sizeof(wmac)) != 0)
{
printf("WARNING: invalid packet signature\n");
fprintf(stderr, "WARNING: invalid packet signature\n");
/*
* Because Standard RDP Security is totally broken,
* and cannot protect against MITM, don't treat signature
@ -759,7 +759,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
if (!rdp_read_header(rdp, s, &length, &channelId))
{
printf("Incorrect RDP header.\n");
fprintf(stderr, "Incorrect RDP header.\n");
return -1;
}
@ -772,7 +772,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
printf("rdp_decrypt failed\n");
fprintf(stderr, "rdp_decrypt failed\n");
return -1;
}
}
@ -812,7 +812,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
case PDU_TYPE_DATA:
if (rdp_recv_data_pdu(rdp, s) < 0)
{
printf("rdp_recv_data_pdu failed\n");
fprintf(stderr, "rdp_recv_data_pdu failed\n");
return -1;
}
break;
@ -828,7 +828,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
break;
default:
printf("incorrect PDU type: 0x%04X\n", pduType);
fprintf(stderr, "incorrect PDU type: 0x%04X\n", pduType);
break;
}
stream_set_mark(s, nextp);
@ -850,7 +850,7 @@ static int rdp_recv_fastpath_pdu(rdpRdp* rdp, wStream* s)
if ((length == 0) || (length > stream_get_left(s)))
{
printf("incorrect FastPath PDU header length %d\n", length);
fprintf(stderr, "incorrect FastPath PDU header length %d\n", length);
return -1;
}
@ -931,7 +931,7 @@ static int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra)
break;
default:
printf("Invalid state %d\n", rdp->state);
fprintf(stderr, "Invalid state %d\n", rdp->state);
status = -1;
break;
}

View File

@ -29,36 +29,36 @@
void rdp_print_redirection_flags(UINT32 flags)
{
printf("redirectionFlags = {\n");
fprintf(stderr, "redirectionFlags = {\n");
if (flags & LB_TARGET_NET_ADDRESS)
printf("\tLB_TARGET_NET_ADDRESS\n");
fprintf(stderr, "\tLB_TARGET_NET_ADDRESS\n");
if (flags & LB_LOAD_BALANCE_INFO)
printf("\tLB_LOAD_BALANCE_INFO\n");
fprintf(stderr, "\tLB_LOAD_BALANCE_INFO\n");
if (flags & LB_USERNAME)
printf("\tLB_USERNAME\n");
fprintf(stderr, "\tLB_USERNAME\n");
if (flags & LB_DOMAIN)
printf("\tLB_DOMAIN\n");
fprintf(stderr, "\tLB_DOMAIN\n");
if (flags & LB_PASSWORD)
printf("\tLB_PASSWORD\n");
fprintf(stderr, "\tLB_PASSWORD\n");
if (flags & LB_DONTSTOREUSERNAME)
printf("\tLB_DONTSTOREUSERNAME\n");
fprintf(stderr, "\tLB_DONTSTOREUSERNAME\n");
if (flags & LB_SMARTCARD_LOGON)
printf("\tLB_SMARTCARD_LOGON\n");
fprintf(stderr, "\tLB_SMARTCARD_LOGON\n");
if (flags & LB_NOREDIRECT)
printf("\tLB_NOREDIRECT\n");
fprintf(stderr, "\tLB_NOREDIRECT\n");
if (flags & LB_TARGET_FQDN)
printf("\tLB_TARGET_FQDN\n");
fprintf(stderr, "\tLB_TARGET_FQDN\n");
if (flags & LB_TARGET_NETBIOS_NAME)
printf("\tLB_TARGET_NETBIOS_NAME\n");
fprintf(stderr, "\tLB_TARGET_NETBIOS_NAME\n");
if (flags & LB_TARGET_NET_ADDRESSES)
printf("\tLB_TARGET_NET_ADDRESSES\n");
fprintf(stderr, "\tLB_TARGET_NET_ADDRESSES\n");
if (flags & LB_CLIENT_TSV_URL)
printf("\tLB_CLIENT_TSV_URL\n");
fprintf(stderr, "\tLB_CLIENT_TSV_URL\n");
if (flags & LB_SERVER_TSV_CAPABLE)
printf("\tLB_SERVER_TSV_CAPABLE\n");
fprintf(stderr, "\tLB_SERVER_TSV_CAPABLE\n");
printf("}\n");
fprintf(stderr, "}\n");
}
BOOL rdp_string_read_length32(wStream* s, rdpString* string)

View File

@ -373,7 +373,7 @@ BOOL security_establish_keys(const BYTE* client_random, rdpRdp* rdp)
BYTE client_encrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
BYTE client_decrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
printf("FIPS Compliant encryption level.\n");
fprintf(stderr, "FIPS Compliant encryption level.\n");
/* disable fastpath input; it doesnt handle FIPS encryption yet */
rdp->settings->FastPathInput = FALSE;

View File

@ -104,14 +104,14 @@ void tcp_get_mac_address(rdpTcp * tcp)
if (ioctl(tcp->sockfd, SIOCGIFHWADDR, &if_req) != 0)
{
printf("failed to obtain MAC address\n");
fprintf(stderr, "failed to obtain MAC address\n");
return;
}
memmove((void*) mac, (void*) &if_req.ifr_ifru.ifru_hwaddr.sa_data[0], 6);
#endif
/* printf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
/* fprintf(stderr, "MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); */
}
@ -194,7 +194,7 @@ BOOL tcp_set_blocking_mode(rdpTcp* tcp, BOOL blocking)
if (flags == -1)
{
printf("tcp_set_blocking_mode: fcntl failed.\n");
fprintf(stderr, "tcp_set_blocking_mode: fcntl failed.\n");
return FALSE;
}
@ -209,7 +209,7 @@ BOOL tcp_set_blocking_mode(rdpTcp* tcp, BOOL blocking)
status = ioctlsocket(tcp->sockfd, FIONBIO, &arg);
if (status != NO_ERROR)
printf("ioctlsocket() failed with error: %ld\n", status);
fprintf(stderr, "ioctlsocket() failed with error: %ld\n", status);
tcp->wsa_event = WSACreateEvent();
WSAEventSelect(tcp->sockfd, tcp->wsa_event, FD_READ);

View File

@ -128,7 +128,7 @@ BOOL tpdu_read_connection_request(wStream* s, BYTE *li)
if (code != X224_TPDU_CONNECTION_REQUEST)
{
printf("Error: expected X224_TPDU_CONNECTION_REQUEST\n");
fprintf(stderr, "Error: expected X224_TPDU_CONNECTION_REQUEST\n");
return FALSE;
}
@ -161,7 +161,7 @@ BOOL tpdu_read_connection_confirm(wStream* s, BYTE *li)
if (code != X224_TPDU_CONNECTION_CONFIRM)
{
printf("Error: expected X224_TPDU_CONNECTION_CONFIRM\n");
fprintf(stderr, "Error: expected X224_TPDU_CONNECTION_CONFIRM\n");
return FALSE;
}

View File

@ -159,7 +159,7 @@ BOOL transport_connect_nla(rdpTransport* transport)
if (!connectErrorCode)
connectErrorCode = AUTHENTICATIONERROR;
printf("Authentication failure, check credentials.\n"
fprintf(stderr, "Authentication failure, check credentials.\n"
"If credentials are valid, the NTLMSSP implementation may be to blame.\n");
credssp_free(transport->credssp);
@ -294,7 +294,7 @@ BOOL transport_accept_nla(rdpTransport* transport)
if (credssp_authenticate(transport->credssp) < 0)
{
printf("client authentication failure\n");
fprintf(stderr, "client authentication failure\n");
credssp_free(transport->credssp);
return FALSE;
}
@ -332,7 +332,7 @@ UINT32 nla_read_header(wStream* s)
}
else
{
printf("Error reading TSRequest!\n");
fprintf(stderr, "Error reading TSRequest!\n");
}
}
else
@ -356,7 +356,7 @@ UINT32 nla_header_length(wStream* s)
else if ((s->pointer[1] & ~(0x80)) == 2)
length = 4;
else
printf("Error reading TSRequest!\n");
fprintf(stderr, "Error reading TSRequest!\n");
}
else
{
@ -456,7 +456,7 @@ int transport_read(rdpTransport* transport, wStream* s)
}
else
{
printf("Error reading TSRequest!\n");
fprintf(stderr, "Error reading TSRequest!\n");
}
}
else
@ -486,7 +486,7 @@ int transport_read(rdpTransport* transport, wStream* s)
/* dump when whole PDU is read */
if (stream_bytes + status >= pdu_bytes)
{
printf("Local < Remote\n");
fprintf(stderr, "Local < Remote\n");
winpr_HexDump(s->buffer, pdu_bytes);
}
#endif
@ -520,7 +520,7 @@ int transport_write(rdpTransport* transport, wStream* s)
#ifdef WITH_DEBUG_TRANSPORT
if (length > 0)
{
printf("Local > Remote\n");
fprintf(stderr, "Local > Remote\n");
winpr_HexDump(s->buffer, length);
}
#endif
@ -691,7 +691,7 @@ int transport_check_fds(rdpTransport** ptransport)
if (length == 0)
{
printf("transport_check_fds: protocol error, not a TPKT or Fast Path header.\n");
fprintf(stderr, "transport_check_fds: protocol error, not a TPKT or Fast Path header.\n");
winpr_HexDump(stream_get_head(transport->ReceiveBuffer), pos);
return -1;
}

View File

@ -349,7 +349,7 @@ BOOL update_recv(rdpUpdate* update, wStream* s)
stream_read_UINT16(s, updateType); /* updateType (2 bytes) */
//printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]);
//fprintf(stderr, "%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]);
IFCALL(update->BeginPaint, context);

View File

@ -399,12 +399,12 @@ BOOL ber_read_integer(wStream* s, UINT32* value)
}
else if (length == 8)
{
printf("%s: should implement reading an 8 bytes integer\n", __FUNCTION__);
fprintf(stderr, "%s: should implement reading an 8 bytes integer\n", __FUNCTION__);
return FALSE;
}
else
{
printf("%s: should implement reading an integer with length=%d\n", __FUNCTION__, length);
fprintf(stderr, "%s: should implement reading an integer with length=%d\n", __FUNCTION__, length);
return FALSE;
}

View File

@ -47,7 +47,7 @@ void certificate_store_init(rdpCertificateStore* certificate_store)
if (!PathFileExistsA(settings->ConfigPath))
{
CreateDirectoryA(settings->ConfigPath, 0);
printf("creating directory %s\n", settings->ConfigPath);
fprintf(stderr, "creating directory %s\n", settings->ConfigPath);
}
certificate_store->path = GetCombinedPath(settings->ConfigPath, (char*) certificate_store_dir);
@ -55,7 +55,7 @@ void certificate_store_init(rdpCertificateStore* certificate_store)
if (!PathFileExistsA(certificate_store->path))
{
CreateDirectoryA(certificate_store->path, 0);
printf("creating directory %s\n", certificate_store->path);
fprintf(stderr, "creating directory %s\n", certificate_store->path);
}
certificate_store->file = GetCombinedPath(settings->ConfigPath, (char*) certificate_known_hosts_file);
@ -66,7 +66,7 @@ void certificate_store_init(rdpCertificateStore* certificate_store)
if (certificate_store->fp == NULL)
{
printf("certificate_store_open: error opening [%s] for writing\n", certificate_store->file);
fprintf(stderr, "certificate_store_open: error opening [%s] for writing\n", certificate_store->file);
return;
}

View File

@ -180,7 +180,7 @@ BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* Public
if (!pkey)
{
printf("crypto_cert_get_public_key: X509_get_pubkey() failed\n");
fprintf(stderr, "crypto_cert_get_public_key: X509_get_pubkey() failed\n");
status = FALSE;
goto exit;
}
@ -189,7 +189,7 @@ BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* Public
if (length < 1)
{
printf("crypto_cert_get_public_key: i2d_PublicKey() failed\n");
fprintf(stderr, "crypto_cert_get_public_key: i2d_PublicKey() failed\n");
status = FALSE;
goto exit;
}
@ -512,11 +512,11 @@ void crypto_cert_print_info(X509* xcert)
issuer = crypto_cert_issuer(xcert);
fp = crypto_cert_fingerprint(xcert);
printf("Certificate details:\n");
printf("\tSubject: %s\n", subject);
printf("\tIssuer: %s\n", issuer);
printf("\tThumbprint: %s\n", fp);
printf("The above X.509 certificate could not be verified, possibly because you do not have "
fprintf(stderr, "Certificate details:\n");
fprintf(stderr, "\tSubject: %s\n", subject);
fprintf(stderr, "\tIssuer: %s\n", issuer);
fprintf(stderr, "\tThumbprint: %s\n", fp);
fprintf(stderr, "The above X.509 certificate could not be verified, possibly because you do not have "
"the CA certificate in your certificate store, or the certificate has expired. "
"Please look at the documentation on how to create local certificate store for a private CA.\n");

View File

@ -41,7 +41,7 @@ static CryptoCert tls_get_certificate(rdpTls* tls, BOOL peer)
if (!server_cert)
{
printf("tls_get_certificate: failed to get the server TLS certificate\n");
fprintf(stderr, "tls_get_certificate: failed to get the server TLS certificate\n");
cert = NULL;
}
else
@ -105,7 +105,7 @@ BOOL tls_connect(rdpTls* tls)
if (tls->ctx == NULL)
{
printf("SSL_CTX_new failed\n");
fprintf(stderr, "SSL_CTX_new failed\n");
return FALSE;
}
@ -146,13 +146,13 @@ BOOL tls_connect(rdpTls* tls)
if (tls->ssl == NULL)
{
printf("SSL_new failed\n");
fprintf(stderr, "SSL_new failed\n");
return FALSE;
}
if (SSL_set_fd(tls->ssl, tls->sockfd) < 1)
{
printf("SSL_set_fd failed\n");
fprintf(stderr, "SSL_set_fd failed\n");
return FALSE;
}
@ -170,7 +170,7 @@ BOOL tls_connect(rdpTls* tls)
if (cert == NULL)
{
printf("tls_connect: tls_get_certificate failed to return the server certificate.\n");
fprintf(stderr, "tls_connect: tls_get_certificate failed to return the server certificate.\n");
return FALSE;
}
@ -178,14 +178,14 @@ BOOL tls_connect(rdpTls* tls)
if (!crypto_cert_get_public_key(cert, &tls->PublicKey, &tls->PublicKeyLength))
{
printf("tls_connect: crypto_cert_get_public_key failed to return the server public key.\n");
fprintf(stderr, "tls_connect: crypto_cert_get_public_key failed to return the server public key.\n");
tls_free_certificate(cert);
return FALSE;
}
if (!tls_verify_certificate(tls, cert, tls->settings->ServerHostname))
{
printf("tls_connect: certificate not trusted, aborting.\n");
fprintf(stderr, "tls_connect: certificate not trusted, aborting.\n");
tls_disconnect(tls);
tls_free_certificate(cert);
return FALSE;
@ -206,7 +206,7 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
if (tls->ctx == NULL)
{
printf("SSL_CTX_new failed\n");
fprintf(stderr, "SSL_CTX_new failed\n");
return FALSE;
}
@ -249,11 +249,11 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
SSL_CTX_set_options(tls->ctx, options);
printf("private key file: %s\n", privatekey_file);
fprintf(stderr, "private key file: %s\n", privatekey_file);
if (SSL_CTX_use_RSAPrivateKey_file(tls->ctx, privatekey_file, SSL_FILETYPE_PEM) <= 0)
{
printf("SSL_CTX_use_RSAPrivateKey_file failed\n");
fprintf(stderr, "SSL_CTX_use_RSAPrivateKey_file failed\n");
return FALSE;
}
@ -261,13 +261,13 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
if (tls->ssl == NULL)
{
printf("SSL_new failed\n");
fprintf(stderr, "SSL_new failed\n");
return FALSE;
}
if (SSL_use_certificate_file(tls->ssl, cert_file, SSL_FILETYPE_PEM) <= 0)
{
printf("SSL_use_certificate_file failed\n");
fprintf(stderr, "SSL_use_certificate_file failed\n");
return FALSE;
}
@ -275,13 +275,13 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
if (cert == NULL)
{
printf("tls_connect: tls_get_certificate failed to return the server certificate.\n");
fprintf(stderr, "tls_connect: tls_get_certificate failed to return the server certificate.\n");
return FALSE;
}
if (!crypto_cert_get_public_key(cert, &tls->PublicKey, &tls->PublicKeyLength))
{
printf("tls_connect: crypto_cert_get_public_key failed to return the server public key.\n");
fprintf(stderr, "tls_connect: crypto_cert_get_public_key failed to return the server public key.\n");
tls_free_certificate(cert);
return FALSE;
}
@ -290,7 +290,7 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
if (SSL_set_fd(tls->ssl, tls->sockfd) < 1)
{
printf("SSL_set_fd failed\n");
fprintf(stderr, "SSL_set_fd failed\n");
return FALSE;
}
@ -319,7 +319,7 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file)
}
}
printf("TLS connection accepted\n");
fprintf(stderr, "TLS connection accepted\n");
return TRUE;
}
@ -343,7 +343,7 @@ int tls_read(rdpTls* tls, BYTE* data, int length)
{
error = SSL_get_error(tls->ssl, status);
//printf("tls_read: length: %d status: %d error: 0x%08X\n",
//fprintf(stderr, "tls_read: length: %d status: %d error: 0x%08X\n",
// length, status, error);
switch (error)
@ -392,7 +392,7 @@ int tls_write(rdpTls* tls, BYTE* data, int length)
{
error = SSL_get_error(tls->ssl, status);
//printf("tls_write: length: %d status: %d error: 0x%08X\n", length, status, error);
//fprintf(stderr, "tls_write: length: %d status: %d error: 0x%08X\n", length, status, error);
switch (error)
{
@ -454,7 +454,7 @@ static void tls_errors(const char *prefix)
unsigned long error;
while ((error = ERR_get_error()) != 0)
printf("%s: %s\n", prefix, ERR_error_string(error, NULL));
fprintf(stderr, "%s: %s\n", prefix, ERR_error_string(error, NULL));
}
BOOL tls_print_error(char* func, SSL* connection, int value)
@ -462,29 +462,29 @@ BOOL tls_print_error(char* func, SSL* connection, int value)
switch (SSL_get_error(connection, value))
{
case SSL_ERROR_ZERO_RETURN:
printf("%s: Server closed TLS connection\n", func);
fprintf(stderr, "%s: Server closed TLS connection\n", func);
return TRUE;
case SSL_ERROR_WANT_READ:
printf("%s: SSL_ERROR_WANT_READ\n", func);
fprintf(stderr, "%s: SSL_ERROR_WANT_READ\n", func);
return FALSE;
case SSL_ERROR_WANT_WRITE:
printf("%s: SSL_ERROR_WANT_WRITE\n", func);
fprintf(stderr, "%s: SSL_ERROR_WANT_WRITE\n", func);
return FALSE;
case SSL_ERROR_SYSCALL:
printf("%s: I/O error\n", func);
fprintf(stderr, "%s: I/O error\n", func);
tls_errors(func);
return TRUE;
case SSL_ERROR_SSL:
printf("%s: Failure in SSL library (protocol error?)\n", func);
fprintf(stderr, "%s: Failure in SSL library (protocol error?)\n", func);
tls_errors(func);
return TRUE;
default:
printf("%s: Unknown error\n", func);
fprintf(stderr, "%s: Unknown error\n", func);
tls_errors(func);
return TRUE;
}
@ -647,48 +647,48 @@ BOOL tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname)
void tls_print_certificate_error(char* hostname, char* fingerprint)
{
printf("The host key for %s has changed\n", hostname);
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n");
printf("Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n");
printf("It is also possible that a host key has just been changed.\n");
printf("The fingerprint for the host key sent by the remote host is\n%s\n", fingerprint);
printf("Please contact your system administrator.\n");
printf("Add correct host key in ~/.freerdp/known_hosts to get rid of this message.\n");
printf("Host key for %s has changed and you have requested strict checking.\n", hostname);
printf("Host key verification failed.\n");
fprintf(stderr, "The host key for %s has changed\n", hostname);
fprintf(stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
fprintf(stderr, "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n");
fprintf(stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
fprintf(stderr, "IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n");
fprintf(stderr, "Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n");
fprintf(stderr, "It is also possible that a host key has just been changed.\n");
fprintf(stderr, "The fingerprint for the host key sent by the remote host is\n%s\n", fingerprint);
fprintf(stderr, "Please contact your system administrator.\n");
fprintf(stderr, "Add correct host key in ~/.freerdp/known_hosts to get rid of this message.\n");
fprintf(stderr, "Host key for %s has changed and you have requested strict checking.\n", hostname);
fprintf(stderr, "Host key verification failed.\n");
}
void tls_print_certificate_name_mismatch_error(char* hostname, char* common_name, char** alt_names, int alt_names_count)
{
int index;
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("@ WARNING: CERTIFICATE NAME MISMATCH! @\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
printf("The hostname used for this connection (%s) \n", hostname);
fprintf(stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
fprintf(stderr, "@ WARNING: CERTIFICATE NAME MISMATCH! @\n");
fprintf(stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
fprintf(stderr, "The hostname used for this connection (%s) \n", hostname);
if (alt_names_count < 1)
{
printf("does not match the name given in the certificate:\n");
printf("%s\n", common_name);
fprintf(stderr, "does not match the name given in the certificate:\n");
fprintf(stderr, "%s\n", common_name);
}
else
{
printf("does not match the names given in the certificate:\n");
printf("%s", common_name);
fprintf(stderr, "does not match the names given in the certificate:\n");
fprintf(stderr, "%s", common_name);
for (index = 0; index < alt_names_count; index++)
{
printf(", %s", alt_names[index]);
fprintf(stderr, ", %s", alt_names[index]);
}
printf("\n");
fprintf(stderr, "\n");
}
printf("A valid certificate for the wrong name should NOT be trusted!\n");
fprintf(stderr, "A valid certificate for the wrong name should NOT be trusted!\n");
}
rdpTls* tls_new(rdpSettings* settings)

View File

@ -388,7 +388,7 @@ static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWi
if (hdcSrc->bytesPerPixel != 1)
{
printf("BitBlt_DSPDxax expects 1 bpp, unimplemented for %d\n", hdcSrc->bytesPerPixel);
fprintf(stderr, "BitBlt_DSPDxax expects 1 bpp, unimplemented for %d\n", hdcSrc->bytesPerPixel);
return 0;
}
@ -846,7 +846,7 @@ int BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeigh
break;
}
printf("BitBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "BitBlt: unknown rop: 0x%08X\n", rop);
return 1;
}
@ -891,8 +891,7 @@ int PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
break;
}
printf("PatBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "PatBlt: unknown rop: 0x%08X\n", rop);
return 1;
}

View File

@ -946,7 +946,7 @@ int BitBlt_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeigh
break;
}
printf("BitBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "BitBlt: unknown rop: 0x%08X\n", rop);
return 1;
}
@ -991,8 +991,7 @@ int PatBlt_32bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, i
break;
}
printf("PatBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "PatBlt: unknown rop: 0x%08X\n", rop);
return 1;
}

View File

@ -762,7 +762,7 @@ int BitBlt_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight
break;
}
printf("BitBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "BitBlt: unknown rop: 0x%08X\n", rop);
return 1;
}
@ -807,7 +807,7 @@ int PatBlt_8bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, in
break;
}
printf("PatBlt: unknown rop: 0x%08X\n", rop);
fprintf(stderr, "PatBlt: unknown rop: 0x%08X\n", rop);
return 1;
}

View File

@ -341,7 +341,7 @@ INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
}
else
{
printf("gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d\n", x, y, hBmp->width, hBmp->height);
fprintf(stderr, "gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d\n", x, y, hBmp->width, hBmp->height);
return 0;
}
}
@ -543,7 +543,7 @@ void gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
else
{
printf("unimplemented brush style:%d\n", brush->style);
fprintf(stderr, "unimplemented brush style:%d\n", brush->style);
}
}
@ -715,28 +715,28 @@ void gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
else
{
printf("Mem3Blt unimplemented brush style:%d\n", brush->style);
fprintf(stderr, "Mem3Blt unimplemented brush style:%d\n", brush->style);
}
}
void gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
{
printf("PolygonSC\n");
fprintf(stderr, "PolygonSC\n");
}
void gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
{
printf("PolygonCB\n");
fprintf(stderr, "PolygonCB\n");
}
void gdi_ellipse_sc(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc)
{
printf("EllipseSC\n");
fprintf(stderr, "EllipseSC\n");
}
void gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
{
printf("EllipseCB\n");
fprintf(stderr, "EllipseCB\n");
}
int tilenum = 0;
@ -845,7 +845,7 @@ void gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_co
}
else
{
printf("Unsupported codecID %d\n", surface_bits_command->codecID);
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
}
if (tile_bitmap != NULL)

View File

@ -116,7 +116,7 @@ void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
switch (codec_id)
{
case RDP_CODEC_ID_NSCODEC:
printf("gdi_Bitmap_Decompress: nsc not done\n");
fprintf(stderr, "gdi_Bitmap_Decompress: nsc not done\n");
break;
case RDP_CODEC_ID_REMOTEFX:
gdi = context->gdi;
@ -124,7 +124,7 @@ void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
msg = rfx_process_message(gdi->rfx_context, data, length);
if (msg == NULL)
{
printf("gdi_Bitmap_Decompress: rfx Decompression Failed\n");
fprintf(stderr, "gdi_Bitmap_Decompress: rfx Decompression Failed\n");
}
else
{
@ -147,7 +147,7 @@ void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
#ifdef WITH_JPEG
if (!jpeg_decompress(data, bitmap->data, width, height, length, bpp))
{
printf("gdi_Bitmap_Decompress: jpeg Decompression Failed\n");
fprintf(stderr, "gdi_Bitmap_Decompress: jpeg Decompression Failed\n");
}
#endif
break;
@ -158,7 +158,7 @@ void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (status == FALSE)
{
printf("gdi_Bitmap_Decompress: Bitmap Decompression Failed\n");
fprintf(stderr, "gdi_Bitmap_Decompress: Bitmap Decompression Failed\n");
}
}
else

View File

@ -1565,7 +1565,7 @@ char* freerdp_get_unix_timezone_identifier()
return tzid;
}
printf("Unable to detect time zone\n");
fprintf(stderr, "Unable to detect time zone\n");
return tzid;
#else
return 0;
@ -1626,7 +1626,7 @@ TIME_ZONE_ENTRY* freerdp_detect_windows_time_zone(UINT32 bias)
}
}
printf("Unable to find a match for unix timezone: %s\n", tzid);
fprintf(stderr, "Unable to find a match for unix timezone: %s\n", tzid);
free(tzid);
return NULL;
}
@ -1642,12 +1642,12 @@ TIME_ZONE_RULE_ENTRY* freerdp_get_current_time_zone_rule(TIME_ZONE_RULE_ENTRY* r
{
if ((rules[i].TicksStart <= windows_time) && (windows_time >= rules[i].TicksEnd))
{
/*printf("Got rule %d from table at %p with count %u\n", i, rules, count);*/
/*fprintf(stderr, "Got rule %d from table at %p with count %u\n", i, rules, count);*/
return &rules[i];
}
}
printf("Unable to get current timezone rule\n");
fprintf(stderr, "Unable to get current timezone rule\n");
return NULL;
}

View File

@ -34,13 +34,13 @@ ICON_INFO* icon_cache_get(rdpIconCache* cache, BYTE id, UINT16 index, void** ext
if (id >= cache->numCaches)
{
printf("invalid window icon cache id:%d\n", id);
fprintf(stderr, "invalid window icon cache id:%d\n", id);
return (ICON_INFO*) NULL;
}
if (index >= cache->numCacheEntries)
{
printf("invalid window icon cache index:%d in cache id:%d\n", index, id);
fprintf(stderr, "invalid window icon cache index:%d in cache id:%d\n", index, id);
return (ICON_INFO*) NULL;
}
@ -56,13 +56,13 @@ void icon_cache_put(rdpIconCache* cache, BYTE id, UINT16 index, ICON_INFO* entry
{
if (id >= cache->numCaches)
{
printf("invalid window icon cache id:%d\n", id);
fprintf(stderr, "invalid window icon cache id:%d\n", id);
return;
}
if (index >= cache->numCacheEntries)
{
printf("invalid window icon cache index:%d in cache id:%d\n", index, id);
fprintf(stderr, "invalid window icon cache index:%d in cache id:%d\n", index, id);
return;
}

View File

@ -100,7 +100,7 @@ void print_window_styles(UINT32 style)
{
int i;
printf("Window Styles:\n{\n");
fprintf(stderr, "Window Styles:\n{\n");
for (i = 0; i < ARRAYSIZE(WINDOW_STYLES); i++)
{
if (style & WINDOW_STYLES[i].style)
@ -111,17 +111,17 @@ void print_window_styles(UINT32 style)
continue;
}
printf("\t%s\n", WINDOW_STYLES[i].name);
fprintf(stderr, "\t%s\n", WINDOW_STYLES[i].name);
}
}
printf("}\n");
fprintf(stderr, "}\n");
}
void print_extended_window_styles(UINT32 style)
{
int i;
printf("Extended Window Styles:\n{\n");
fprintf(stderr, "Extended Window Styles:\n{\n");
for (i = 0; i < ARRAYSIZE(EXTENDED_WINDOW_STYLES); i++)
{
if (style & EXTENDED_WINDOW_STYLES[i].style)
@ -132,10 +132,10 @@ void print_extended_window_styles(UINT32 style)
continue;
}
printf("\t%s\n", EXTENDED_WINDOW_STYLES[i].name);
fprintf(stderr, "\t%s\n", EXTENDED_WINDOW_STYLES[i].name);
}
}
printf("}\n");
fprintf(stderr, "}\n");
}
void window_state_update(rdpWindow* window, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state)

View File

@ -67,7 +67,7 @@ void freerdp_bitmap_write(char* filename, void* data, int width, int height, int
if (fp == NULL)
{
printf("failed to open file %s\n", filename);
fprintf(stderr, "failed to open file %s\n", filename);
return;
}

View File

@ -315,41 +315,41 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig)
MSUSB_PIPE_DESCRIPTOR * MsPipe;
int inum = 0, pnum = 0;
printf("=================MsConfig:========================\n");
printf("wTotalLength:%d\n", MsConfig->wTotalLength);
printf("bConfigurationValue:%d\n", MsConfig->bConfigurationValue);
printf("ConfigurationHandle:0x%x\n", MsConfig->ConfigurationHandle);
printf("InitCompleted:%d\n", MsConfig->InitCompleted);
printf("MsOutSize:%d\n", MsConfig->MsOutSize);
printf("NumInterfaces:%d\n\n", MsConfig->NumInterfaces);
fprintf(stderr, "=================MsConfig:========================\n");
fprintf(stderr, "wTotalLength:%d\n", MsConfig->wTotalLength);
fprintf(stderr, "bConfigurationValue:%d\n", MsConfig->bConfigurationValue);
fprintf(stderr, "ConfigurationHandle:0x%x\n", MsConfig->ConfigurationHandle);
fprintf(stderr, "InitCompleted:%d\n", MsConfig->InitCompleted);
fprintf(stderr, "MsOutSize:%d\n", MsConfig->MsOutSize);
fprintf(stderr, "NumInterfaces:%d\n\n", MsConfig->NumInterfaces);
MsInterfaces = MsConfig->MsInterfaces;
for(inum = 0; inum < MsConfig->NumInterfaces; inum++)
{
MsInterface = MsInterfaces[inum];
printf(" Interfase: %d\n", MsInterface->InterfaceNumber);
printf(" Length: %d\n", MsInterface->Length);
printf(" NumberOfPipesExpected: %d\n", MsInterface->NumberOfPipesExpected);
printf(" AlternateSetting: %d\n", MsInterface->AlternateSetting);
printf(" NumberOfPipes: %d\n", MsInterface->NumberOfPipes);
printf(" InterfaceHandle: 0x%x\n", MsInterface->InterfaceHandle);
printf(" bInterfaceClass: 0x%x\n", MsInterface->bInterfaceClass);
printf(" bInterfaceSubClass: 0x%x\n", MsInterface->bInterfaceSubClass);
printf(" bInterfaceProtocol: 0x%x\n", MsInterface->bInterfaceProtocol);
printf(" InitCompleted: %d\n\n", MsInterface->InitCompleted);
fprintf(stderr, " Interfase: %d\n", MsInterface->InterfaceNumber);
fprintf(stderr, " Length: %d\n", MsInterface->Length);
fprintf(stderr, " NumberOfPipesExpected: %d\n", MsInterface->NumberOfPipesExpected);
fprintf(stderr, " AlternateSetting: %d\n", MsInterface->AlternateSetting);
fprintf(stderr, " NumberOfPipes: %d\n", MsInterface->NumberOfPipes);
fprintf(stderr, " InterfaceHandle: 0x%x\n", MsInterface->InterfaceHandle);
fprintf(stderr, " bInterfaceClass: 0x%x\n", MsInterface->bInterfaceClass);
fprintf(stderr, " bInterfaceSubClass: 0x%x\n", MsInterface->bInterfaceSubClass);
fprintf(stderr, " bInterfaceProtocol: 0x%x\n", MsInterface->bInterfaceProtocol);
fprintf(stderr, " InitCompleted: %d\n\n", MsInterface->InitCompleted);
MsPipes = MsInterface->MsPipes;
for (pnum = 0; pnum < MsInterface->NumberOfPipes; pnum++)
{
MsPipe = MsPipes[pnum];
printf(" Pipe: %d\n", pnum);
printf(" MaximumPacketSize: 0x%x\n", MsPipe->MaximumPacketSize);
printf(" MaximumTransferSize: 0x%x\n", MsPipe->MaximumTransferSize);
printf(" PipeFlags: 0x%x\n", MsPipe->PipeFlags);
printf(" PipeHandle: 0x%x\n", MsPipe->PipeHandle);
printf(" bEndpointAddress: 0x%x\n", MsPipe->bEndpointAddress);
printf(" bInterval: %d\n", MsPipe->bInterval);
printf(" PipeType: 0x%x\n", MsPipe->PipeType);
printf(" InitCompleted: %d\n\n", MsPipe->InitCompleted);
fprintf(stderr, " Pipe: %d\n", pnum);
fprintf(stderr, " MaximumPacketSize: 0x%x\n", MsPipe->MaximumPacketSize);
fprintf(stderr, " MaximumTransferSize: 0x%x\n", MsPipe->MaximumTransferSize);
fprintf(stderr, " PipeFlags: 0x%x\n", MsPipe->PipeFlags);
fprintf(stderr, " PipeHandle: 0x%x\n", MsPipe->PipeHandle);
fprintf(stderr, " bEndpointAddress: 0x%x\n", MsPipe->bEndpointAddress);
fprintf(stderr, " bInterval: %d\n", MsPipe->bInterval);
fprintf(stderr, " PipeType: 0x%x\n", MsPipe->PipeType);
fprintf(stderr, " InitCompleted: %d\n\n", MsPipe->InitCompleted);
}
}
printf("==================================================\n");
fprintf(stderr, "==================================================\n");
}

View File

@ -57,12 +57,12 @@ void profiler_exit(PROFILER* profiler)
void profiler_print_header()
{
printf("\n");
printf(" |-----------------------|\n" );
printf(" PROFILER | elapsed seconds |\n" );
printf("|--------------------------------------------|-----------------------|\n" );
printf("| code section | iterations | total | avg. |\n" );
printf("|-------------------------------|------------|-----------|-----------|\n" );
fprintf(stderr, "\n");
fprintf(stderr, " |-----------------------|\n" );
fprintf(stderr, " PROFILER | elapsed seconds |\n" );
fprintf(stderr, "|--------------------------------------------|-----------------------|\n" );
fprintf(stderr, "| code section | iterations | total | avg. |\n" );
fprintf(stderr, "|-------------------------------|------------|-----------|-----------|\n" );
}
void profiler_print(PROFILER* profiler)
@ -70,10 +70,10 @@ void profiler_print(PROFILER* profiler)
double elapsed_sec = stopwatch_get_elapsed_time_in_seconds(profiler->stopwatch);
double avg_sec = elapsed_sec / (double) profiler->stopwatch->count;
printf("| %-30.30s| %'10lu | %'9f | %'9f |\n", profiler->name, profiler->stopwatch->count, elapsed_sec, avg_sec);
fprintf(stderr, "| %-30.30s| %'10lu | %'9f | %'9f |\n", profiler->name, profiler->stopwatch->count, elapsed_sec, avg_sec);
}
void profiler_print_footer()
{
printf("|--------------------------------------------------------------------|\n" );
fprintf(stderr, "|--------------------------------------------------------------------|\n" );
}

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