Merge pull request #2027 from akallabeth/winpr-log

Replace stdout and logging defines with WLog, add logcat support
This commit is contained in:
Marc-André Moreau 2014-08-11 10:38:28 -04:00
commit 067da290dd
202 changed files with 2568 additions and 2422 deletions

View File

@ -72,7 +72,7 @@ static BOOL audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_hand
if ((error = snd_pcm_hw_params_malloc(&hw_params)) < 0)
{
DEBUG_WARN("snd_pcm_hw_params_malloc (%s)",
CLOG_ERR("snd_pcm_hw_params_malloc (%s)",
snd_strerror(error));
return FALSE;
}
@ -206,7 +206,7 @@ static void* audin_alsa_thread_func(void* arg)
{
if ((error = snd_pcm_open(&capture_handle, alsa->device_name, SND_PCM_STREAM_CAPTURE, 0)) < 0)
{
DEBUG_WARN("snd_pcm_open (%s)", snd_strerror(error));
CLOG_ERR("snd_pcm_open (%s)", snd_strerror(error));
break;
}
@ -226,7 +226,7 @@ static void* audin_alsa_thread_func(void* arg)
}
else if (error < 0)
{
DEBUG_WARN("snd_pcm_readi (%s)", snd_strerror(error));
CLOG_ERR("snd_pcm_readi (%s)", snd_strerror(error));
break;
}

View File

@ -133,7 +133,7 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, w
DEBUG_DVC("NumFormats %d", NumFormats);
if ((NumFormats < 1) || (NumFormats > 1000))
{
DEBUG_WARN("bad NumFormats %d", NumFormats);
CLOG_ERR("bad NumFormats %d", NumFormats);
return 1;
}
Stream_Seek_UINT32(s); /* cbSizeFormatsPacket */
@ -262,7 +262,7 @@ static int audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wStr
if (initialFormat >= (UINT32) callback->formats_count)
{
DEBUG_WARN("invalid format index %d (total %d)",
CLOG_ERR("invalid format index %d (total %d)",
initialFormat, callback->formats_count);
return 1;
}
@ -293,7 +293,7 @@ static int audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallb
if (NewFormat >= (UINT32) callback->formats_count)
{
DEBUG_WARN("invalid format index %d (total %d)",
CLOG_ERR("invalid format index %d (total %d)",
NewFormat, callback->formats_count);
return 1;
}
@ -340,7 +340,7 @@ static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
break;
default:
DEBUG_WARN("unknown MessageId=0x%x", MessageId);
CLOG_ERR("unknown MessageId=0x%x", MessageId);
error = 1;
break;
}
@ -429,7 +429,7 @@ static void audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice* devi
if (audin->device)
{
DEBUG_WARN("existing device, abort.");
CLOG_ERR("existing device, abort.");
return;
}
@ -454,7 +454,7 @@ static BOOL audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, ADDI
if (entry(&entryPoints) != 0)
{
DEBUG_WARN("%s entry returns error.", name);
CLOG_ERR("%s entry returns error.", name);
return FALSE;
}
@ -613,7 +613,7 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
if (audin->device == NULL)
{
DEBUG_WARN("no sound device.");
CLOG_ERR("no sound device.");
}
return error;

View File

@ -27,13 +27,13 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/audin.h>
#ifdef WITH_DEBUG_DVC
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
#else
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* FREERDP_AUDIN_CLIENT_MAIN_H */

View File

@ -96,7 +96,7 @@ static void* audin_opensles_thread_func(void* arg)
int rc = android_RecIn(opensles->stream, buffer.s, raw_size);
if (rc < 0)
{
DEBUG_WARN("android_RecIn %d", rc);
CLOG_ERR("android_RecIn %d", rc);
continue;
}
@ -250,7 +250,7 @@ static void audin_opensles_set_format(IAudinDevice* device,
break;
default:
DEBUG_WARN("Encoding '%d' [%08X] not supported",
CLOG_ERR("Encoding '%d' [%08X] not supported",
(format->wFormatTag),
format->wFormatTag);
return;
@ -309,7 +309,7 @@ static void audin_opensles_close(IAudinDevice* device)
* ignore duplicate requests. */
if (!opensles->stopEvent)
{
DEBUG_WARN("[ERROR] function called without matching open.");
CLOG_ERR("[ERROR] function called without matching open.");
return;
}

View File

@ -362,7 +362,7 @@ int android_RecIn(OPENSL_STREAM *p,short *buffer,int size)
e = Queue_Dequeue(p->queue);
if (!e)
{
DEBUG_WARN("[ERROR] got e=%p from queue", e);
CLOG_ERR("[ERROR] got e=%p from queue", e);
return -1;
}

View File

@ -94,7 +94,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
if (pa_context_connect(pulse->context, NULL, 0, NULL))
{
DEBUG_WARN("pa_context_connect failed (%d)",
CLOG_ERR("pa_context_connect failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -102,7 +102,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
if (pa_threaded_mainloop_start(pulse->mainloop) < 0)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
CLOG_ERR("pa_threaded_mainloop_start failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -113,7 +113,7 @@ static BOOL audin_pulse_connect(IAudinDevice* device)
break;
if (!PA_CONTEXT_IS_GOOD(state))
{
DEBUG_WARN("bad context state (%d)",
CLOG_ERR("bad context state (%d)",
pa_context_errno(pulse->context));
break;
}
@ -297,7 +297,7 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length
*/
if (pulse->buffer == NULL)
{
/* fprintf(stderr, "%s: ignoring input, pulse buffer not ready.\n", __func__); */
/* CLOG_ERR( "%s: ignoring input, pulse buffer not ready.\n", __func__); */
return;
}
@ -415,7 +415,7 @@ static void audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
&buffer_attr, PA_STREAM_ADJUST_LATENCY) < 0)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
CLOG_ERR("pa_stream_connect_playback failed (%d)",
pa_context_errno(pulse->context));
return;
}
@ -427,7 +427,7 @@ static void audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
break;
if (!PA_STREAM_IS_GOOD(state))
{
DEBUG_WARN("bad stream state (%d)",
CLOG_ERR("bad stream state (%d)",
pa_context_errno(pulse->context));
break;
}
@ -512,7 +512,7 @@ int freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEnt
if (!pulse->mainloop)
{
DEBUG_WARN("pa_threaded_mainloop_new failed");
CLOG_ERR("pa_threaded_mainloop_new failed");
audin_pulse_free((IAudinDevice*) pulse);
return 1;
}
@ -521,7 +521,7 @@ int freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEnt
if (!pulse->context)
{
DEBUG_WARN("pa_context_new failed");
CLOG_ERR("pa_context_new failed");
audin_pulse_free((IAudinDevice*) pulse);
return 1;
}

View File

@ -34,6 +34,7 @@
#include <freerdp/codec/audio.h>
#include <freerdp/channels/wtsvc.h>
#include <freerdp/server/audin.h>
#include <freerdp/channels/log.h>
#define MSG_SNDIN_VERSION 0x01
#define MSG_SNDIN_FORMATS 0x02
@ -385,7 +386,7 @@ static void* audin_server_thread_func(void* arg)
break;
default:
fprintf(stderr, "audin_server_thread_func: unknown MessageId %d\n", MessageId);
CLOG_ERR( "audin_server_thread_func: unknown MessageId %d\n", MessageId);
break;
}
}

View File

@ -140,7 +140,7 @@ void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, wStream* s, UINT
}
if (num_formats * 36 != length)
DEBUG_WARN("dataLen %d not divided by 36!", length);
CLOG_ERR("dataLen %d not divided by 36!", length);
ascii = (flags & CB_ASCII_NAMES) ? TRUE : FALSE;

View File

@ -87,7 +87,7 @@ void cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s)
Stream_SetPosition(s, pos);
#ifdef WITH_DEBUG_CLIPRDR
printf("Cliprdr Sending (%d bytes)\n", dataLen + 8);
CLOG_DBG("Cliprdr Sending (%d bytes)\n", dataLen + 8);
winpr_HexDump(Stream_Buffer(s), dataLen + 8);
#endif
@ -101,18 +101,18 @@ static void cliprdr_process_connect(rdpSvcPlugin* plugin)
void cliprdr_print_general_capability_flags(UINT32 flags)
{
fprintf(stderr, "generalFlags (0x%08X) {\n", flags);
CLOG_ERR( "generalFlags (0x%08X) {\n", flags);
if (flags & CB_USE_LONG_FORMAT_NAMES)
fprintf(stderr, "\tCB_USE_LONG_FORMAT_NAMES\n");
CLOG_ERR( "\tCB_USE_LONG_FORMAT_NAMES\n");
if (flags & CB_STREAM_FILECLIP_ENABLED)
fprintf(stderr, "\tCB_STREAM_FILECLIP_ENABLED\n");
CLOG_ERR( "\tCB_STREAM_FILECLIP_ENABLED\n");
if (flags & CB_FILECLIP_NO_FILE_PATHS)
fprintf(stderr, "\tCB_FILECLIP_NO_FILE_PATHS\n");
CLOG_ERR( "\tCB_FILECLIP_NO_FILE_PATHS\n");
if (flags & CB_CAN_LOCK_CLIPDATA)
fprintf(stderr, "\tCB_CAN_LOCK_CLIPDATA\n");
CLOG_ERR( "\tCB_CAN_LOCK_CLIPDATA\n");
fprintf(stderr, "}\n");
CLOG_ERR( "}\n");
}
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s)
@ -198,7 +198,7 @@ static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16
break;
default:
DEBUG_WARN("unknown cliprdr capability set: %d", capabilitySetType);
CLOG_ERR("unknown cliprdr capability set: %d", capabilitySetType);
break;
}
}
@ -380,7 +380,7 @@ static void cliprdr_process_receive(rdpSvcPlugin* plugin, wStream* s)
break;
default:
DEBUG_WARN("unknown msgType %d", msgType);
CLOG_ERR("unknown msgType %d", msgType);
break;
}
}
@ -496,7 +496,7 @@ static void cliprdr_process_event(rdpSvcPlugin* plugin, wMessage* event)
break;
default:
DEBUG_WARN("unknown event type %d", GetMessageType(event->id));
CLOG_ERR("unknown event type %d", GetMessageType(event->id));
break;
}

View File

@ -23,7 +23,7 @@
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/utils/svc_plugin.h>
struct cliprdr_plugin
@ -45,9 +45,9 @@ void cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out);
CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr);
#ifdef WITH_DEBUG_CLIPRDR
#define DEBUG_CLIPRDR(fmt, ...) DEBUG_CLASS(CLIPRDR, fmt, ## __VA_ARGS__)
#define DEBUG_CLIPRDR(fmt, ...) CLOG_CLASS(CLIPRDR, fmt, ## __VA_ARGS__)
#else
#define DEBUG_CLIPRDR(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_CLIPRDR(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* __CLIPRDR_MAIN_H */

View File

@ -25,6 +25,7 @@
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/channels/log.h>
#include "cliprdr_main.h"
/**
@ -70,7 +71,7 @@ static int cliprdr_server_send_capabilities(CliprdrServerContext* context)
CLIPRDR_HEADER header;
ULONG written;
printf("CliprdrServerSendCapabilities\n");
CLOG_DBG("CliprdrServerSendCapabilities\n");
header.msgType = CB_CLIP_CAPS;
header.msgFlags = 0;
@ -111,7 +112,7 @@ static int cliprdr_server_send_monitor_ready(CliprdrServerContext* context)
CLIPRDR_HEADER header;
ULONG written;
printf("CliprdrServerSendMonitorReady\n");
CLOG_DBG("CliprdrServerSendMonitorReady\n");
header.msgType = CB_MONITOR_READY;
header.msgFlags = 0;
@ -139,7 +140,7 @@ static int cliprdr_server_send_format_list_response(CliprdrServerContext* contex
CLIPRDR_HEADER header;
ULONG written;
printf("CliprdrServerSendFormatListResponse\n");
CLOG_DBG("CliprdrServerSendFormatListResponse\n");
header.msgType = CB_FORMAT_LIST_RESPONSE;
header.msgFlags = CB_RESPONSE_OK;
@ -207,7 +208,7 @@ static int cliprdr_server_receive_temporary_directory(CliprdrServerContext* cont
ConvertFromUnicode(CP_UTF8, 0, wszTempDir, -1,
&(context->priv->ClientTemporaryDirectory), 0, NULL, NULL);
printf("ClientTemporaryDirectory: %s\n", context->priv->ClientTemporaryDirectory);
CLOG_DBG("ClientTemporaryDirectory: %s\n", context->priv->ClientTemporaryDirectory);
return 0;
}
@ -252,7 +253,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
int length;
int position;
printf("%s\n", __FUNCTION__);
CLOG_DBG("%s\n", __FUNCTION__);
position = Stream_GetPosition(s);
Stream_SetPosition(s, Stream_Length(s));
@ -305,7 +306,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
for (i = 0; i < context->priv->ClientFormatNameCount; i++)
{
printf("Format %d: Id: 0x%04X Name: %s Length: %d\n", i,
CLOG_DBG("Format %d: Id: 0x%04X Name: %s Length: %d\n", i,
context->priv->ClientFormatNames[i].id,
context->priv->ClientFormatNames[i].name,
context->priv->ClientFormatNames[i].length);
@ -316,7 +317,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context
static int cliprdr_server_receive_short_format_list(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header)
{
printf("%s: unimplemented\n", __FUNCTION__);
CLOG_DBG("%s: unimplemented\n", __FUNCTION__);
return 0;
}
@ -340,7 +341,7 @@ static int cliprdr_server_receive_format_list(CliprdrServerContext* context, wSt
static int cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header)
{
printf("CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d\n",
CLOG_DBG("CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d\n",
header->msgType, header->msgFlags, header->dataLen);
switch (header->msgType)
@ -379,7 +380,7 @@ static int cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s,
break;
default:
printf("Unexpected clipboard PDU type: %d\n", header->msgType);
CLOG_DBG("Unexpected clipboard PDU type: %d\n", header->msgType);
break;
}

View File

@ -101,7 +101,7 @@ int disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback
Stream_Write_UINT32(s, NumMonitors); /* NumMonitors (4 bytes) */
//fprintf(stderr, "NumMonitors: %d\n", NumMonitors);
//CLOG_ERR( "NumMonitors: %d\n", NumMonitors);
for (index = 0; index < NumMonitors; index++)
{
@ -129,14 +129,14 @@ int disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback
Stream_Write_UINT32(s, Monitors[index].Orientation); /* Orientation (4 bytes) */
#if 0
fprintf(stderr, "\t: Flags: 0x%04X\n", Monitors[index].Flags);
fprintf(stderr, "\t: Left: %d\n", Monitors[index].Left);
fprintf(stderr, "\t: Top: %d\n", Monitors[index].Top);
fprintf(stderr, "\t: Width: %d\n", Monitors[index].Width);
fprintf(stderr, "\t: Height: %d\n", Monitors[index].Height);
fprintf(stderr, "\t: PhysicalWidth: %d\n", Monitors[index].PhysicalWidth);
fprintf(stderr, "\t: PhysicalHeight: %d\n", Monitors[index].PhysicalHeight);
fprintf(stderr, "\t: Orientation: %d\n", Monitors[index].Orientation);
CLOG_ERR( "\t: Flags: 0x%04X\n", Monitors[index].Flags);
CLOG_ERR( "\t: Left: %d\n", Monitors[index].Left);
CLOG_ERR( "\t: Top: %d\n", Monitors[index].Top);
CLOG_ERR( "\t: Width: %d\n", Monitors[index].Width);
CLOG_ERR( "\t: Height: %d\n", Monitors[index].Height);
CLOG_ERR( "\t: PhysicalWidth: %d\n", Monitors[index].PhysicalWidth);
CLOG_ERR( "\t: PhysicalHeight: %d\n", Monitors[index].PhysicalHeight);
CLOG_ERR( "\t: Orientation: %d\n", Monitors[index].Orientation);
#endif
Stream_Write_UINT32(s, Monitors[index].DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */
@ -162,7 +162,7 @@ int disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream*
Stream_Read_UINT32(s, disp->MaxMonitorWidth); /* MaxMonitorWidth (4 bytes) */
Stream_Read_UINT32(s, disp->MaxMonitorHeight); /* MaxMonitorHeight (4 bytes) */
//fprintf(stderr, "DisplayControlCapsPdu: MaxNumMonitors: %d MaxMonitorWidth: %d MaxMonitorHeight: %d\n",
//CLOG_ERR( "DisplayControlCapsPdu: MaxNumMonitors: %d MaxMonitorWidth: %d MaxMonitorHeight: %d\n",
// disp->MaxNumMonitors, disp->MaxMonitorWidth, disp->MaxMonitorHeight);
return 0;
@ -176,7 +176,7 @@ int disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s)
Stream_Read_UINT32(s, type); /* Type (4 bytes) */
Stream_Read_UINT32(s, length); /* Length (4 bytes) */
//fprintf(stderr, "Type: %d Length: %d\n", type, length);
//CLOG_ERR( "Type: %d Length: %d\n", type, length);
switch (type)
{

View File

@ -27,7 +27,7 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/disp.h>

View File

@ -130,7 +130,7 @@ int drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* data, UIN
if (status != CHANNEL_RC_OK)
{
drdynvc->channel_error = status;
DEBUG_WARN("VirtualChannelWrite failed %d", status);
CLOG_ERR("VirtualChannelWrite failed %d", status);
return 1;
}
@ -145,7 +145,7 @@ int drdynvc_push_event(drdynvcPlugin* drdynvc, wMessage* event)
if (status != CHANNEL_RC_OK)
{
DEBUG_WARN("pVirtualChannelEventPush failed %d", status);
CLOG_ERR("pVirtualChannelEventPush failed %d", status);
return 1;
}
@ -165,7 +165,7 @@ static int drdynvc_send_capability_response(drdynvcPlugin* drdynvc)
if (status != CHANNEL_RC_OK)
{
DEBUG_WARN("VirtualChannelWrite failed %d", status);
CLOG_ERR("VirtualChannelWrite failed %d", status);
return 1;
}
@ -270,7 +270,7 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
if (status != CHANNEL_RC_OK)
{
DEBUG_WARN("VirtualChannelWrite failed %d", status);
CLOG_ERR("VirtualChannelWrite failed %d", status);
return 1;
}
@ -329,7 +329,7 @@ static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbC
if (error != CHANNEL_RC_OK)
{
DEBUG_WARN("VirtualChannelWrite failed %d", error);
CLOG_ERR("VirtualChannelWrite failed %d", error);
return 1;
}
@ -376,7 +376,7 @@ static void drdynvc_process_receive(rdpSvcPlugin* plugin, wStream* s)
break;
default:
DEBUG_WARN("unknown drdynvc cmd 0x%x", Cmd);
CLOG_ERR("unknown drdynvc cmd 0x%x", Cmd);
break;
}
}

View File

@ -26,12 +26,12 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#ifdef WITH_DEBUG_DVC
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
#else
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif

View File

@ -71,7 +71,7 @@ static int dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr,
}
else
{
DEBUG_WARN("Maximum DVC listener number reached.");
CLOG_ERR("Maximum DVC listener number reached.");
return 1;
}
}
@ -89,7 +89,7 @@ static int dvcman_push_event(IWTSVirtualChannelManager* pChannelMgr, wMessage* p
}
else
{
DEBUG_WARN("event_type %d push failed.", GetMessageType(pEvent->id));
CLOG_ERR("event_type %d push failed.", GetMessageType(pEvent->id));
}
return status;
@ -108,7 +108,7 @@ static int dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const cha
}
else
{
DEBUG_WARN("Maximum DVC plugin number reached.");
CLOG_ERR("Maximum DVC plugin number reached.");
return 1;
}
}
@ -218,7 +218,7 @@ int dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args,
DVCMAN_ENTRY_POINTS entryPoints;
PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL;
fprintf(stderr, "Loading Dynamic Virtual Channel %s\n", args->argv[0]);
CLOG_ERR( "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);
@ -388,7 +388,7 @@ int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 Channel
}
else
{
DEBUG_WARN("channel rejected by plugin");
CLOG_ERR("channel rejected by plugin");
free(channel);
return 1;
@ -409,7 +409,7 @@ int dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId
if (!channel)
{
DEBUG_WARN("ChannelId %d not found!", ChannelId);
CLOG_ERR("ChannelId %d not found!", ChannelId);
return 1;
}
@ -434,7 +434,7 @@ int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelI
if (!channel)
{
DEBUG_WARN("ChannelId %d not found!", ChannelId);
CLOG_ERR("ChannelId %d not found!", ChannelId);
return 1;
}
@ -468,7 +468,7 @@ int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UI
if (!channel)
{
DEBUG_WARN("ChannelId %d not found!", ChannelId);
CLOG_ERR("ChannelId %d not found!", ChannelId);
return 1;
}
@ -491,7 +491,7 @@ int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 C
if (!channel)
{
DEBUG_WARN("ChannelId %d not found!", ChannelId);
CLOG_ERR("ChannelId %d not found!", ChannelId);
return 1;
}
@ -500,7 +500,7 @@ int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 C
/* Fragmented data */
if (Stream_GetPosition(channel->dvc_data) + dataSize > (UINT32) Stream_Capacity(channel->dvc_data))
{
DEBUG_WARN("data exceeding declared length!");
CLOG_ERR("data exceeding declared length!");
Stream_Release(channel->dvc_data);
channel->dvc_data = NULL;
return 1;

View File

@ -27,12 +27,12 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#ifdef WITH_DEBUG_DVC
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
#else
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* __ECHO_MAIN_H */

View File

@ -24,6 +24,7 @@
#include <winpr/crt.h>
#include <winpr/print.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/encomsp.h>
#include "encomsp_main.h"
@ -43,7 +44,7 @@ int encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s)
return -1;
#if 0
printf("EncomspWrite (%d)\n", Stream_Length(s));
CLOG_DBG("EncomspWrite (%d)\n", Stream_Length(s));
winpr_HexDump(Stream_Buffer(s), Stream_Length(s));
#endif
@ -52,7 +53,7 @@ int encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s)
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "encomsp_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "encomsp_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
return -1;
}
@ -590,7 +591,7 @@ static int encomsp_process_receive(encomspPlugin* encomsp, wStream* s)
if (encomsp_read_header(s, &header) < 0)
return -1;
//printf("EncomspReceive: Type: %d Length: %d\n", header.Type, header.Length);
//CLOG_DBG("EncomspReceive: Type: %d Length: %d\n", header.Type, header.Length);
switch (header.Type)
{
@ -722,7 +723,7 @@ int encomsp_send(encomspPlugin* encomsp, wStream* s)
if (status != CHANNEL_RC_OK)
{
Stream_Free(s, TRUE);
fprintf(stderr, "encomsp_send: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "encomsp_send: VirtualChannelWrite failed %d\n", status);
}
return status;
@ -754,7 +755,7 @@ static void encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp,
{
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
{
fprintf(stderr, "encomsp_plugin_process_received: read error\n");
CLOG_ERR( "encomsp_plugin_process_received: read error\n");
}
encomsp->data_in = NULL;
@ -774,7 +775,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event(DWORD openHandle, UINT
if (!encomsp)
{
fprintf(stderr, "encomsp_virtual_channel_open_event: error no match\n");
CLOG_ERR( "encomsp_virtual_channel_open_event: error no match\n");
return;
}
@ -834,7 +835,7 @@ static void encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, LPVO
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "encomsp_virtual_channel_event_connected: open failed: status: %d\n", status);
CLOG_ERR( "encomsp_virtual_channel_event_connected: open failed: status: %d\n", status);
return;
}
@ -872,7 +873,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event(LPVOID pInitHandle, UIN
if (!encomsp)
{
fprintf(stderr, "encomsp_virtual_channel_init_event: error no match\n");
CLOG_ERR( "encomsp_virtual_channel_init_event: error no match\n");
return;
}

View File

@ -23,9 +23,9 @@
rdpPrinterDriver* printer_win_get_driver(void);
#ifdef WITH_DEBUG_WINPR
#define DEBUG_WINPR(fmt, ...) DEBUG_CLASS(WINPR, fmt, ## __VA_ARGS__)
#define DEBUG_WINPR(fmt, ...) CLOG_CLASS(WINPR, fmt, ## __VA_ARGS__)
#else
#define DEBUG_WINPR(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_WINPR(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif

View File

@ -28,6 +28,7 @@
#include <winpr/crt.h>
#include <freerdp/utils/rail.h>
#include <freerdp/channels/log.h>
#include "rail_orders.h"
@ -522,7 +523,7 @@ BOOL rail_order_recv(railPlugin* rail, wStream* s)
}
default:
fprintf(stderr, "Unknown RAIL PDU order reveived.");
CLOG_ERR( "Unknown RAIL PDU order reveived.");
break;
}

View File

@ -32,6 +32,7 @@
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/client/channels.h>
#include <freerdp/channels/log.h>
#include "rdpdr_main.h"
@ -122,7 +123,7 @@ BOOL devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device)
if (!ServiceName)
return FALSE;
fprintf(stderr, "Loading device service %s (static)\n", ServiceName);
CLOG_ERR( "Loading device service %s (static)\n", ServiceName);
entry = (PDEVICE_SERVICE_ENTRY) freerdp_load_channel_addin_entry(ServiceName, NULL, "DeviceServiceEntry", 0);
if (!entry)

View File

@ -31,6 +31,7 @@
#include <freerdp/types.h>
#include <freerdp/constants.h>
#include <freerdp/channels/log.h>
#include <freerdp/channels/rdpdr.h>
#ifdef _WIN32
@ -451,7 +452,7 @@ static void* drive_hotplug_thread_func(void* arg)
if (mfd < 0)
{
fprintf(stderr, "ERROR: Unable to open /proc/mounts.");
CLOG_ERR( "ERROR: Unable to open /proc/mounts.");
return NULL;
}
@ -662,7 +663,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
count++;
fprintf(stderr, "registered device #%d: %s (type=%d id=%d)\n",
CLOG_ERR( "registered device #%d: %s (type=%d id=%d)\n",
count, device->name, device->type, device->id);
}
}
@ -845,7 +846,7 @@ int rdpdr_send(rdpdrPlugin* rdpdr, wStream* s)
if (status != CHANNEL_RC_OK)
{
Stream_Free(s, TRUE);
fprintf(stderr, "rdpdr_send: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "rdpdr_send: VirtualChannelWrite failed %d\n", status);
}
return status;
@ -883,7 +884,7 @@ static void rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr,
{
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
{
fprintf(stderr, "svc_plugin_process_received: read error\n");
CLOG_ERR( "svc_plugin_process_received: read error\n");
}
rdpdr->data_in = NULL;
@ -903,7 +904,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle, UINT ev
if (!rdpdr)
{
fprintf(stderr, "rdpdr_virtual_channel_open_event: error no match\n");
CLOG_ERR( "rdpdr_virtual_channel_open_event: error no match\n");
return;
}
@ -963,7 +964,7 @@ static void rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pDa
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "rdpdr_virtual_channel_event_connected: open failed: status: %d\n", status);
CLOG_ERR( "rdpdr_virtual_channel_event_connected: open failed: status: %d\n", status);
return;
}
@ -1009,7 +1010,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle, UINT
if (!rdpdr)
{
fprintf(stderr, "rdpdr_virtual_channel_init_event: error no match\n");
CLOG_ERR( "rdpdr_virtual_channel_init_event: error no match\n");
return;
}

View File

@ -25,6 +25,7 @@
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/channels/log.h>
#include "rdpdr_main.h"
static UINT32 g_ClientId = 0;
@ -36,7 +37,7 @@ static int rdpdr_server_send_announce_request(RdpdrServerContext* context)
RDPDR_HEADER header;
ULONG written;
printf("RdpdrServerSendAnnounceRequest\n");
CLOG_DBG("RdpdrServerSendAnnounceRequest\n");
header.Component = RDPDR_CTYP_CORE;
header.PacketId = PAKID_CORE_SERVER_ANNOUNCE;
@ -69,7 +70,7 @@ static int rdpdr_server_receive_announce_response(RdpdrServerContext* context, w
Stream_Read_UINT16(s, VersionMinor); /* VersionMinor (2 bytes) */
Stream_Read_UINT32(s, ClientId); /* ClientId (4 bytes) */
printf("Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X\n",
CLOG_DBG("Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X\n",
VersionMajor, VersionMinor, ClientId);
context->priv->ClientId = ClientId;
@ -109,7 +110,7 @@ static int rdpdr_server_receive_client_name_request(RdpdrServerContext* context,
Stream_Seek(s, ComputerNameLen);
printf("ClientComputerName: %s\n", context->priv->ClientComputerName);
CLOG_DBG("ClientComputerName: %s\n", context->priv->ClientComputerName);
return 0;
}
@ -298,7 +299,7 @@ static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context
UINT16 numCapabilities;
ULONG written;
printf("RdpdrServerSendCoreCapabilityRequest\n");
CLOG_DBG("RdpdrServerSendCoreCapabilityRequest\n");
header.Component = RDPDR_CTYP_CORE;
header.PacketId = PAKID_CORE_SERVER_CAPABILITY;
@ -364,7 +365,7 @@ static int rdpdr_server_receive_core_capability_response(RdpdrServerContext* con
break;
default:
printf("Unknown capabilityType %d\n", capabilityHeader.CapabilityType);
CLOG_DBG("Unknown capabilityType %d\n", capabilityHeader.CapabilityType);
Stream_Seek(s, capabilityHeader.CapabilityLength - RDPDR_CAPABILITY_HEADER_LENGTH);
break;
}
@ -380,7 +381,7 @@ static int rdpdr_server_send_client_id_confirm(RdpdrServerContext* context)
RDPDR_HEADER header;
ULONG written;
printf("RdpdrServerSendClientIdConfirm\n");
CLOG_DBG("RdpdrServerSendClientIdConfirm\n");
header.Component = RDPDR_CTYP_CORE;
header.PacketId = PAKID_CORE_CLIENTID_CONFIRM;
@ -416,7 +417,7 @@ static int rdpdr_server_receive_device_list_announce_request(RdpdrServerContext*
Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */
printf("%s: DeviceCount: %d\n", __FUNCTION__, DeviceCount);
CLOG_DBG("%s: DeviceCount: %d\n", __FUNCTION__, DeviceCount);
for (i = 0; i < DeviceCount; i++)
{
@ -425,7 +426,7 @@ static int rdpdr_server_receive_device_list_announce_request(RdpdrServerContext*
Stream_Read(s, PreferredDosName, 8); /* PreferredDosName (8 bytes) */
Stream_Read_UINT32(s, DeviceDataLength); /* DeviceDataLength (4 bytes) */
printf("Device %d Name: %s Id: 0x%04X DataLength: %d\n",
CLOG_DBG("Device %d Name: %s Id: 0x%04X DataLength: %d\n",
i, PreferredDosName, DeviceId, DeviceDataLength);
switch (DeviceId)
@ -462,7 +463,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context)
RDPDR_HEADER header;
ULONG written;
printf("%s\n", __FUNCTION__);
CLOG_DBG("%s\n", __FUNCTION__);
header.Component = RDPDR_CTYP_CORE;
header.PacketId = PAKID_CORE_USER_LOGGEDON;
@ -483,7 +484,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context)
static int rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header)
{
printf("RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X\n",
CLOG_DBG("RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X\n",
header->Component, header->PacketId);
winpr_HexDump(Stream_Buffer(s), Stream_Length(s));
@ -545,7 +546,7 @@ static int rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDP
}
else
{
printf("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component);
CLOG_DBG("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component);
return -1;
}

View File

@ -201,7 +201,7 @@ int rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId,
status = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), Stream_Buffer(s), NULL);
#ifdef WITH_DEBUG_RDPEI
fprintf(stderr, "rdpei_send_pdu: eventId: %d (%s) length: %d status: %d\n",
CLOG_ERR( "rdpei_send_pdu: eventId: %d (%s) length: %d status: %d\n",
eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength, status);
#endif
@ -239,17 +239,17 @@ int rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback)
void rdpei_print_contact_flags(UINT32 contactFlags)
{
if (contactFlags & CONTACT_FLAG_DOWN)
printf(" CONTACT_FLAG_DOWN");
CLOG_DBG(" CONTACT_FLAG_DOWN");
if (contactFlags & CONTACT_FLAG_UPDATE)
printf(" CONTACT_FLAG_UPDATE");
CLOG_DBG(" CONTACT_FLAG_UPDATE");
if (contactFlags & CONTACT_FLAG_UP)
printf(" CONTACT_FLAG_UP");
CLOG_DBG(" CONTACT_FLAG_UP");
if (contactFlags & CONTACT_FLAG_INRANGE)
printf(" CONTACT_FLAG_INRANGE");
CLOG_DBG(" CONTACT_FLAG_INRANGE");
if (contactFlags & CONTACT_FLAG_INCONTACT)
printf(" CONTACT_FLAG_INCONTACT");
CLOG_DBG(" CONTACT_FLAG_INCONTACT");
if (contactFlags & CONTACT_FLAG_CANCELED)
printf(" CONTACT_FLAG_CANCELED");
CLOG_DBG(" CONTACT_FLAG_CANCELED");
}
int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
@ -259,8 +259,8 @@ int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
RDPINPUT_CONTACT_DATA* contact;
#ifdef WITH_DEBUG_RDPEI
printf("contactCount: %d\n", frame->contactCount);
printf("frameOffset: 0x%08X\n", (UINT32) frame->frameOffset);
CLOG_DBG("contactCount: %d\n", frame->contactCount);
CLOG_DBG("frameOffset: 0x%08X\n", (UINT32) frame->frameOffset);
#endif
rdpei_write_2byte_unsigned(s, frame->contactCount); /* contactCount (TWO_BYTE_UNSIGNED_INTEGER) */
@ -284,13 +284,13 @@ int rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame)
contact->contactRectBottom = contact->y + rectSize;
#ifdef WITH_DEBUG_RDPEI
printf("contact[%d].contactId: %d\n", index, contact->contactId);
printf("contact[%d].fieldsPresent: %d\n", index, contact->fieldsPresent);
printf("contact[%d].x: %d\n", index, contact->x);
printf("contact[%d].y: %d\n", index, contact->y);
printf("contact[%d].contactFlags: 0x%04X", index, contact->contactFlags);
CLOG_DBG("contact[%d].contactId: %d\n", index, contact->contactId);
CLOG_DBG("contact[%d].fieldsPresent: %d\n", index, contact->fieldsPresent);
CLOG_DBG("contact[%d].x: %d\n", index, contact->x);
CLOG_DBG("contact[%d].y: %d\n", index, contact->y);
CLOG_DBG("contact[%d].contactFlags: 0x%04X", index, contact->contactFlags);
rdpei_print_contact_flags(contact->contactFlags);
printf("\n");
CLOG_DBG("\n");
#endif
Stream_Write_UINT8(s, contact->contactId); /* contactId (1 byte) */
@ -371,7 +371,7 @@ int rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s)
#if 0
if (protocolVersion != RDPINPUT_PROTOCOL_V10)
{
fprintf(stderr, "Unknown [MS-RDPEI] protocolVersion: 0x%08X\n", protocolVersion);
CLOG_ERR( "Unknown [MS-RDPEI] protocolVersion: 0x%08X\n", protocolVersion);
return -1;
}
#endif
@ -408,7 +408,7 @@ int rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s)
Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */
#ifdef WITH_DEBUG_RDPEI
fprintf(stderr, "rdpei_recv_pdu: eventId: %d (%s) length: %d\n",
CLOG_ERR( "rdpei_recv_pdu: eventId: %d (%s) length: %d\n",
eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength);
#endif

View File

@ -27,7 +27,7 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/rdpei.h>
@ -100,9 +100,9 @@ struct _RDPINPUT_CONTACT_POINT
typedef struct _RDPINPUT_CONTACT_POINT RDPINPUT_CONTACT_POINT;
#ifdef WITH_DEBUG_DVC
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
#else
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* FREERDP_CHANNEL_RDPEI_CLIENT_MAIN_H */

View File

@ -37,6 +37,7 @@
#include <winpr/collections.h>
#include <freerdp/addin.h>
#include <freerdp/channels/log.h>
#include "rdpgfx_common.h"
#include "rdpgfx_codec.h"
@ -802,7 +803,7 @@ int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
if (status < 0)
{
fprintf(stderr, "Error while parsing GFX cmdId: %s (0x%04X)\n",
CLOG_ERR( "Error while parsing GFX cmdId: %s (0x%04X)\n",
rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId);
return -1;
}
@ -811,7 +812,7 @@ int rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
if (end != (beg + header.pduLength))
{
fprintf(stderr, "Unexpected gfx pdu end: Actual: %d, Expected: %d\n",
CLOG_ERR( "Unexpected gfx pdu end: Actual: %d, Expected: %d\n",
end, (beg + header.pduLength));
Stream_SetPosition(s, (beg + header.pduLength));
@ -833,7 +834,7 @@ static int rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
if (status < 0)
{
printf("zgfx_decompress failure! status: %d\n", status);
CLOG_DBG("zgfx_decompress failure! status: %d\n", status);
return 0;
}

View File

@ -35,7 +35,7 @@
#include <freerdp/types.h>
#include <freerdp/codec/dsp.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include "rdpsnd_main.h"
@ -68,7 +68,7 @@ struct rdpsnd_alsa_plugin
#define SND_PCM_CHECK(_func, _status) \
if (_status < 0) \
{ \
fprintf(stderr, "%s: %d\n", _func, _status); \
CLOG_ERR( "%s: %d\n", _func, _status); \
return -1; \
}
@ -106,7 +106,7 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa)
if (alsa->buffer_size > buffer_size_max)
{
fprintf(stderr, "Warning: requested sound buffer size %d, got %d instead\n",
CLOG_ERR( "Warning: requested sound buffer size %d, got %d instead\n",
(int) alsa->buffer_size, (int) buffer_size_max);
alsa->buffer_size = buffer_size_max;
}
@ -262,7 +262,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
if (status < 0)
{
DEBUG_WARN("snd_mixer_open failed");
CLOG_ERR("snd_mixer_open failed");
return;
}
@ -270,7 +270,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
if (status < 0)
{
DEBUG_WARN("snd_mixer_attach failed");
CLOG_ERR("snd_mixer_attach failed");
snd_mixer_close(alsa->mixer_handle);
return;
}
@ -279,7 +279,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
if (status < 0)
{
DEBUG_WARN("snd_mixer_selem_register failed");
CLOG_ERR("snd_mixer_selem_register failed");
snd_mixer_close(alsa->mixer_handle);
return;
}
@ -288,7 +288,7 @@ static void rdpsnd_alsa_open_mixer(rdpsndAlsaPlugin* alsa)
if (status < 0)
{
DEBUG_WARN("snd_mixer_load failed");
CLOG_ERR("snd_mixer_load failed");
snd_mixer_close(alsa->mixer_handle);
return;
}
@ -310,7 +310,7 @@ static void rdpsnd_alsa_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, i
if (status < 0)
{
DEBUG_WARN("snd_pcm_open failed");
CLOG_ERR("snd_pcm_open failed");
}
else
{
@ -579,7 +579,7 @@ static void rdpsnd_alsa_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
}
else if (status < 0)
{
fprintf(stderr, "status: %d\n", status);
CLOG_ERR( "status: %d\n", status);
snd_pcm_close(alsa->pcm_handle);
alsa->pcm_handle = NULL;
rdpsnd_alsa_open((rdpsndDevicePlugin*) alsa, NULL, alsa->latency);
@ -600,7 +600,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;
//fprintf(stderr, "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
//CLOG_ERR( "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency);
}
static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] =

View File

@ -37,7 +37,7 @@
#define reportResult(result,operation) (_reportResult((result),(operation),__FILE__,__LINE__))
static inline bool _reportResult(kern_return_t result, const char *operation, const char* file, int line) {
if ( result != ERR_SUCCESS ) {
printf("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result));
CLOG_DBG("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result));
return false;
}
return true;
@ -108,7 +108,7 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
if ( virtualAddress != bufferAddress+buffer->length ) {
// If the memory is not contiguous, clean up both allocated buffers and try again
if ( retries-- == 0 ) {
printf("Couldn't map buffer memory to end of buffer\n");
CLOG_DBG("Couldn't map buffer memory to end of buffer\n");
return false;
}

View File

@ -121,7 +121,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
if (status != 0)
{
fprintf(stderr, "AudioQueueNewOutput failure\n");
CLOG_ERR( "AudioQueueNewOutput failure\n");
return;
}
@ -135,7 +135,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
if (status != 0)
{
printf("AudioQueueGetProperty failure: kAudioQueueProperty_DecodeBufferSizeFrames\n");
CLOG_DBG("AudioQueueGetProperty failure: kAudioQueueProperty_DecodeBufferSizeFrames\n");
}
for (index = 0; index < MAC_AUDIO_QUEUE_NUM_BUFFERS; index++)
@ -144,7 +144,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in
if (status != 0)
{
fprintf(stderr, "AudioQueueAllocateBuffer failed\n");
CLOG_ERR( "AudioQueueAllocateBuffer failed\n");
}
}
@ -219,7 +219,7 @@ static void rdpsnd_mac_set_volume(rdpsndDevicePlugin* device, UINT32 value)
if (status != 0)
{
fprintf(stderr, "AudioQueueSetParameter kAudioQueueParam_Volume failed: %f\n", fVolume);
CLOG_ERR( "AudioQueueSetParameter kAudioQueueParam_Volume failed: %f\n", fVolume);
}
}
@ -238,7 +238,7 @@ static void rdpsnd_mac_start(rdpsndDevicePlugin* device)
if (status != 0)
{
fprintf(stderr, "AudioQueueStart failed\n");
CLOG_ERR( "AudioQueueStart failed\n");
}
mac->isPlaying = TRUE;

View File

@ -35,7 +35,7 @@
#include <freerdp/types.h>
#include <freerdp/codec/dsp.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include "opensl_io.h"
#include "rdpsnd_main.h"
@ -187,7 +187,7 @@ static void rdpsnd_opensles_open(rdpsndDevicePlugin* device,
assert(opensles->stream);
if (!opensles->stream)
DEBUG_WARN("android_OpenAudioDevice failed");
CLOG_ERR("android_OpenAudioDevice failed");
else
rdpsnd_opensles_set_volume(device, opensles->volume);
@ -364,7 +364,7 @@ static void rdpsnd_opensles_play(rdpsndDevicePlugin* device,
ret = android_AudioOut(opensles->stream, src.s, size / 2);
if (ret < 0)
DEBUG_WARN("android_AudioOut failed (%d)", ret);
CLOG_ERR("android_AudioOut failed (%d)", ret);
}
static void rdpsnd_opensles_start(rdpsndDevicePlugin* device)

View File

@ -45,7 +45,7 @@
#include <freerdp/types.h>
#include <freerdp/addin.h>
#include <freerdp/constants.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/utils/signal.h>
#include "rdpsnd_main.h"
@ -195,13 +195,13 @@ void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd)
}
#if 0
fprintf(stderr, "Server ");
CLOG_ERR( "Server ");
rdpsnd_print_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats);
fprintf(stderr, "\n");
CLOG_ERR( "\n");
fprintf(stderr, "Client ");
CLOG_ERR( "Client ");
rdpsnd_print_audio_formats(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats);
fprintf(stderr, "\n");
CLOG_ERR( "\n");
#endif
}
@ -544,7 +544,7 @@ static void rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s)
Stream_Seek_UINT8(s); /* bPad */
Stream_Read_UINT16(s, BodySize);
//fprintf(stderr, "msgType %d BodySize %d\n", msgType, BodySize);
//CLOG_ERR( "msgType %d BodySize %d\n", msgType, BodySize);
switch (msgType)
{
@ -569,7 +569,7 @@ static void rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s)
break;
default:
DEBUG_WARN("unknown msgType %d", msgType);
CLOG_ERR("unknown msgType %d", msgType);
break;
}
@ -580,7 +580,7 @@ static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, rdpsndDevicePlug
{
if (rdpsnd->device)
{
DEBUG_WARN("existing device, abort.");
CLOG_ERR("existing device, abort.");
return;
}
@ -606,7 +606,7 @@ static BOOL rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, AD
if (entry(&entryPoints) != 0)
{
DEBUG_WARN("%s entry returns error.", name);
CLOG_ERR("%s entry returns error.", name);
return FALSE;
}
@ -795,7 +795,7 @@ static void rdpsnd_process_connect(rdpsndPlugin* rdpsnd)
if (!rdpsnd->device)
{
DEBUG_WARN("no sound device.");
CLOG_ERR("no sound device.");
return;
}
@ -875,7 +875,7 @@ int rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s)
if (status != CHANNEL_RC_OK)
{
Stream_Free(s, TRUE);
fprintf(stderr, "rdpdr_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "rdpdr_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
}
return status;
@ -907,7 +907,7 @@ static void rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin,
{
if (Stream_Capacity(s) != Stream_GetPosition(s))
{
fprintf(stderr, "rdpsnd_virtual_channel_event_data_received: read error\n");
CLOG_ERR( "rdpsnd_virtual_channel_event_data_received: read error\n");
}
plugin->data_in = NULL;
@ -927,7 +927,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event(DWORD openHandle, UINT e
if (!plugin)
{
fprintf(stderr, "rdpsnd_virtual_channel_open_event: error no match\n");
CLOG_ERR( "rdpsnd_virtual_channel_open_event: error no match\n");
return;
}
@ -987,7 +987,7 @@ static void rdpsnd_virtual_channel_event_connected(rdpsndPlugin* plugin, LPVOID
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "rdpsnd_virtual_channel_event_connected: open failed: status: %d\n", status);
CLOG_ERR( "rdpsnd_virtual_channel_event_connected: open failed: status: %d\n", status);
return;
}
@ -1040,7 +1040,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event(LPVOID pInitHandle, UINT
if (!plugin)
{
fprintf(stderr, "rdpsnd_virtual_channel_init_event: error no match\n");
CLOG_ERR( "rdpsnd_virtual_channel_init_event: error no match\n");
return;
}

View File

@ -27,7 +27,7 @@
#include <freerdp/client/rdpsnd.h>
#if defined(WITH_DEBUG_SND)
#define DEBUG_SND(fmt, ...) DEBUG_CLASS("rdpsnd", fmt, ## __VA_ARGS__)
#define DEBUG_SND(fmt, ...) CLOG_CLASS("rdpsnd", fmt, ## __VA_ARGS__)
#else
#define DEBUG_SND(fmt, ...) do { } while (0)
#endif

View File

@ -34,6 +34,7 @@
#include <freerdp/types.h>
#include <freerdp/codec/dsp.h>
#include <freerdp/channels/log.h>
#include "rdpsnd_main.h"
@ -101,11 +102,11 @@ static void CALLBACK rdpsnd_winmm_callback_function(HWAVEOUT hwo, UINT uMsg, DWO
switch (uMsg)
{
case MM_WOM_OPEN:
fprintf(stderr, "MM_WOM_OPEN\n");
CLOG_ERR( "MM_WOM_OPEN\n");
break;
case MM_WOM_CLOSE:
fprintf(stderr, "MM_WOM_CLOSE\n");
CLOG_ERR( "MM_WOM_CLOSE\n");
break;
case MM_WOM_DONE:
@ -121,7 +122,7 @@ static void CALLBACK rdpsnd_winmm_callback_function(HWAVEOUT hwo, UINT uMsg, DWO
if (!wave)
return;
fprintf(stderr, "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d\n",
CLOG_ERR( "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d\n",
lpWaveHdr->dwBufferLength, wave->cBlockNo);
wave->wLocalTimeB = GetTickCount();
@ -155,7 +156,7 @@ static void rdpsnd_winmm_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format,
if (mmResult != MMSYSERR_NOERROR)
{
fprintf(stderr, "waveOutOpen failed: %d\n", mmResult);
CLOG_ERR( "waveOutOpen failed: %d\n", mmResult);
}
}
@ -172,7 +173,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device)
if (mmResult != MMSYSERR_NOERROR)
{
fprintf(stderr, "waveOutClose failure: %d\n", mmResult);
CLOG_ERR( "waveOutClose failure: %d\n", mmResult);
}
winmm->hWaveOut = NULL;
@ -299,7 +300,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
if (mmResult != MMSYSERR_NOERROR)
{
fprintf(stderr, "waveOutPrepareHeader failure: %d\n", mmResult);
CLOG_ERR( "waveOutPrepareHeader failure: %d\n", mmResult);
return;
}
@ -307,7 +308,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
if (mmResult != MMSYSERR_NOERROR)
{
fprintf(stderr, "waveOutWrite failure: %d\n", mmResult);
CLOG_ERR( "waveOutWrite failure: %d\n", mmResult);
waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR));
return;
}

View File

@ -29,6 +29,8 @@
#include <winpr/print.h>
#include <winpr/stream.h>
#include <freerdp/channels/log.h>
#include "rdpsnd_main.h"
BOOL rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s)
@ -108,7 +110,7 @@ static BOOL rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStrea
Stream_Read_UINT16(s, quality);
Stream_Seek_UINT16(s); // reserved
fprintf(stderr, "Client requested sound quality: %#0X\n", quality);
CLOG_ERR( "Client requested sound quality: %#0X\n", quality);
return TRUE;
}
@ -137,7 +139,7 @@ static BOOL rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s)
if (!context->num_client_formats)
{
fprintf(stderr, "%s: client doesn't support any format!\n", __FUNCTION__);
CLOG_ERR( "%s: client doesn't support any format!\n", __FUNCTION__);
return FALSE;
}
@ -174,7 +176,7 @@ static BOOL rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s)
if (!context->num_client_formats)
{
fprintf(stderr, "%s: client doesn't support any known format!\n", __FUNCTION__);
CLOG_ERR( "%s: client doesn't support any known format!\n", __FUNCTION__);
goto out_free;
}
@ -230,7 +232,7 @@ static BOOL rdpsnd_server_select_format(RdpsndServerContext* context, int client
if (client_format_index < 0 || client_format_index >= context->num_client_formats)
{
fprintf(stderr, "%s: index %d is not correct.\n", __FUNCTION__, client_format_index);
CLOG_ERR( "%s: index %d is not correct.\n", __FUNCTION__, client_format_index);
return FALSE;
}
@ -242,7 +244,7 @@ static BOOL rdpsnd_server_select_format(RdpsndServerContext* context, int client
if (format->nSamplesPerSec == 0)
{
fprintf(stderr, "%s: invalid Client Sound Format!!\n", __FUNCTION__);
CLOG_ERR( "%s: invalid Client Sound Format!!\n", __FUNCTION__);
return FALSE;
}
@ -475,7 +477,7 @@ static int rdpsnd_server_start(RdpsndServerContext* context)
if (!WTSVirtualChannelQuery(priv->ChannelHandle, WTSVirtualEventHandle, &buffer, &bytesReturned) || (bytesReturned != sizeof(HANDLE)))
{
fprintf(stderr, "%s: error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)\n",
CLOG_ERR( "%s: error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)\n",
__FUNCTION__, bytesReturned);
if (buffer)
WTSFreeMemory(buffer);
@ -631,7 +633,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
if (GetLastError() == ERROR_NO_DATA)
return TRUE;
fprintf(stderr, "%s: channel connection closed\n", __FUNCTION__);
CLOG_ERR( "%s: channel connection closed\n", __FUNCTION__);
return FALSE;
}
priv->expectedBytes -= bytesReturned;
@ -659,7 +661,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
/* when here we have the header + the body */
#ifdef WITH_DEBUG_SND
fprintf(stderr, "%s: message type %d\n", __FUNCTION__, priv->msgType);
CLOG_ERR( "%s: message type %d\n", __FUNCTION__, priv->msgType);
#endif
priv->expectedBytes = 4;
priv->waitingHeader = TRUE;
@ -685,7 +687,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context)
break;
default:
fprintf(stderr, "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType);
CLOG_ERR( "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType);
ret = FALSE;
break;
}

View File

@ -26,6 +26,7 @@
#include <freerdp/assistance.h>
#include <freerdp/channels/log.h>
#include <freerdp/client/remdesk.h>
#include "remdesk_main.h"
@ -49,7 +50,7 @@ int remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s)
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "remdesk_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "remdesk_virtual_channel_write: VirtualChannelWrite failed %d\n", status);
return -1;
}
@ -225,7 +226,7 @@ int remdesk_recv_result_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_
*pResult = result;
//printf("RemdeskRecvResult: 0x%04X\n", result);
//CLOG_DBG("RemdeskRecvResult: 0x%04X\n", result);
return 1;
}
@ -396,7 +397,7 @@ int remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEA
Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */
//printf("msgType: %d\n", msgType);
//CLOG_DBG("msgType: %d\n", msgType);
switch (msgType)
{
@ -461,7 +462,7 @@ int remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEA
break;
default:
fprintf(stderr, "remdesk_recv_control_pdu: unknown msgType: %d\n", msgType);
CLOG_ERR( "remdesk_recv_control_pdu: unknown msgType: %d\n", msgType);
status = -1;
break;
}
@ -475,7 +476,7 @@ int remdesk_process_receive(remdeskPlugin* remdesk, wStream* s)
REMDESK_CHANNEL_HEADER header;
#if 0
printf("RemdeskReceive: %d\n", Stream_GetRemainingLength(s));
CLOG_DBG("RemdeskReceive: %d\n", Stream_GetRemainingLength(s));
winpr_HexDump(Stream_Pointer(s), Stream_GetRemainingLength(s));
#endif
@ -585,7 +586,7 @@ int remdesk_send(remdeskPlugin* remdesk, wStream* s)
if (status != CHANNEL_RC_OK)
{
Stream_Free(s, TRUE);
fprintf(stderr, "remdesk_send: VirtualChannelWrite failed %d\n", status);
CLOG_ERR( "remdesk_send: VirtualChannelWrite failed %d\n", status);
}
return status;
@ -617,7 +618,7 @@ static void remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk,
{
if (Stream_Capacity(data_in) != Stream_GetPosition(data_in))
{
fprintf(stderr, "remdesk_plugin_process_received: read error\n");
CLOG_ERR( "remdesk_plugin_process_received: read error\n");
}
remdesk->data_in = NULL;
@ -637,7 +638,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event(DWORD openHandle, UINT
if (!remdesk)
{
fprintf(stderr, "remdesk_virtual_channel_open_event: error no match\n");
CLOG_ERR( "remdesk_virtual_channel_open_event: error no match\n");
return;
}
@ -697,7 +698,7 @@ static void remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, LPVO
if (status != CHANNEL_RC_OK)
{
fprintf(stderr, "remdesk_virtual_channel_event_connected: open failed: status: %d\n", status);
CLOG_ERR( "remdesk_virtual_channel_event_connected: open failed: status: %d\n", status);
return;
}
@ -735,7 +736,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event(LPVOID pInitHandle, UIN
if (!remdesk)
{
fprintf(stderr, "remdesk_virtual_channel_init_event: error no match\n");
CLOG_ERR( "remdesk_virtual_channel_init_event: error no match\n");
return;
}

View File

@ -372,7 +372,7 @@ void smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp)
}
else
{
fprintf(stderr, "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X",
CLOG_ERR( "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X",
irp->MajorFunction, irp->MinorFunction);
irp->IoStatus = STATUS_NOT_SUPPORTED;

View File

@ -21,7 +21,7 @@
#ifndef FREERDP_CHANNEL_SMARTCARD_CLIENT_MAIN_H
#define FREERDP_CHANNEL_SMARTCARD_CLIENT_MAIN_H
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/channels/rdpdr.h>
#include <winpr/crt.h>

View File

@ -1142,7 +1142,7 @@ UINT32 smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCAR
smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId);
#if 0
printf("%s (0x%08X) FileId: %d CompletionId: %d\n",
CLOG_DBG("%s (0x%08X) FileId: %d CompletionId: %d\n",
smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId);
#endif

View File

@ -56,7 +56,7 @@ static BOOL tsmf_alsa_open_device(TSMFAlsaAudioDevice *alsa)
error = snd_pcm_open(&alsa->out_handle, alsa->device, SND_PCM_STREAM_PLAYBACK, 0);
if(error < 0)
{
DEBUG_WARN("failed to open device %s", alsa->device);
CLOG_ERR("failed to open device %s", alsa->device);
return FALSE;
}
DEBUG_TSMF("open device %s", alsa->device);
@ -95,7 +95,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice *audio,
error = snd_pcm_hw_params_malloc(&hw_params);
if(error < 0)
{
DEBUG_WARN("snd_pcm_hw_params_malloc failed");
CLOG_ERR("snd_pcm_hw_params_malloc failed");
return FALSE;
}
snd_pcm_hw_params_any(alsa->out_handle, hw_params);
@ -115,7 +115,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice *audio,
error = snd_pcm_sw_params_malloc(&sw_params);
if(error < 0)
{
DEBUG_WARN("snd_pcm_sw_params_malloc");
CLOG_ERR("snd_pcm_sw_params_malloc");
return FALSE;
}
snd_pcm_sw_params_current(alsa->out_handle, sw_params);

View File

@ -27,10 +27,12 @@
#include <winpr/crt.h>
#include <freerdp/channels/log.h>
#include <freerdp/utils/event.h>
#include <freerdp/client/tsmf.h>
#include <libavcodec/avcodec.h>
#include <libavutil/common.h>
#include "tsmf_constants.h"
#include "tsmf_decoder.h"
@ -87,7 +89,7 @@ static BOOL tsmf_ffmpeg_init_context(ITSMFDecoder *decoder)
mdecoder->codec_context = avcodec_alloc_context3(NULL);
if(!mdecoder->codec_context)
{
DEBUG_WARN("avcodec_alloc_context failed.");
CLOG_ERR("avcodec_alloc_context failed.");
return FALSE;
}
return TRUE;
@ -141,7 +143,7 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder *decoder, const TS_AM_MEDIA_TYP
mdecoder->codec = avcodec_find_decoder(mdecoder->codec_id);
if(!mdecoder->codec)
{
DEBUG_WARN("avcodec_find_decoder failed.");
CLOG_ERR("avcodec_find_decoder failed.");
return FALSE;
}
mdecoder->codec_context->codec_id = mdecoder->codec_id;
@ -203,7 +205,7 @@ static BOOL tsmf_ffmpeg_prepare(ITSMFDecoder *decoder)
TSMFFFmpegDecoder *mdecoder = (TSMFFFmpegDecoder *) decoder;
if(avcodec_open2(mdecoder->codec_context, mdecoder->codec, NULL) < 0)
{
DEBUG_WARN("avcodec_open2 failed.");
CLOG_ERR("avcodec_open2 failed.");
return FALSE;
}
mdecoder->prepared = 1;
@ -299,13 +301,13 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder *decoder, const BYTE *data, UI
#endif
if(len < 0)
{
DEBUG_WARN("data_size %d, avcodec_decode_video failed (%d)", data_size, len);
CLOG_ERR("data_size %d, avcodec_decode_video failed (%d)", data_size, len);
ret = FALSE;
}
else
if(!decoded)
{
DEBUG_WARN("data_size %d, no frame is decoded.", data_size);
CLOG_ERR("data_size %d, no frame is decoded.", data_size);
ret = FALSE;
}
else
@ -401,7 +403,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder *decoder, const BYTE *data, UI
#endif
if(len <= 0 || frame_size <= 0)
{
DEBUG_WARN("error decoding");
CLOG_ERR("error decoding");
break;
}
src += len;
@ -441,7 +443,7 @@ static BOOL tsmf_ffmpeg_decode(ITSMFDecoder *decoder, const BYTE *data, UINT32 d
case AVMEDIA_TYPE_AUDIO:
return tsmf_ffmpeg_decode_audio(decoder, data, data_size, extensions);
default:
DEBUG_WARN("unknown media type.");
CLOG_ERR("unknown media type.");
return FALSE;
}
}
@ -465,7 +467,7 @@ static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder *decoder)
case PIX_FMT_YUV420P:
return RDP_PIXFMT_I420;
default:
DEBUG_WARN("unsupported pixel format %u",
CLOG_ERR("unsupported pixel format %u",
mdecoder->codec_context->pix_fmt);
return (UINT32) -1;
}
@ -518,7 +520,7 @@ ITSMFDecoder *freerdp_tsmf_client_decoder_subsystem_entry(void)
avcodec_register_all();
initialized = TRUE;
}
fprintf(stderr, "TSMFDecoderEntry FFMPEG\n");
CLOG_ERR( "TSMFDecoderEntry FFMPEG\n");
decoder = (TSMFFFmpegDecoder *) malloc(sizeof(TSMFFFmpegDecoder));
ZeroMemory(decoder, sizeof(TSMFFFmpegDecoder));
decoder->iface.SetFormat = tsmf_ffmpeg_set_format;

View File

@ -87,7 +87,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
if (!hdl)
{
DEBUG_WARN("%s: Could not allocate handle.", __func__);
CLOG_ERR("%s: Could not allocate handle.", __func__);
return -1;
}
@ -97,7 +97,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
if (hdl->shmid < 0)
{
DEBUG_WARN("%s: failed to get access to shared memory - shmget()",
CLOG_ERR("%s: failed to get access to shared memory - shmget()",
__func__);
return -2;
}
@ -106,7 +106,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
if (hdl->xfwin == (int *)-1)
{
DEBUG_WARN("%s: shmat failed!", __func__);
CLOG_ERR("%s: shmat failed!", __func__);
return -3;
}
@ -114,7 +114,7 @@ int tsmf_platform_create(TSMFGstreamerDecoder *decoder)
if (!hdl->disp)
{
DEBUG_WARN("Failed to open display");
CLOG_ERR("Failed to open display");
return -4;
}
@ -140,7 +140,7 @@ int tsmf_platform_register_handler(TSMFGstreamerDecoder *decoder)
if (!bus)
{
DEBUG_WARN("gst_pipeline_get_bus failed!");
CLOG_ERR("gst_pipeline_get_bus failed!");
return 1;
}
@ -193,7 +193,7 @@ int tsmf_window_create(TSMFGstreamerDecoder *decoder)
if (!hdl->subwin)
{
DEBUG_WARN("Could not create subwindow!");
CLOG_ERR("Could not create subwindow!");
}
XMapWindow(hdl->disp, hdl->subwin);
@ -238,14 +238,14 @@ int tsmf_window_resize(TSMFGstreamerDecoder *decoder, int x, int y, int width,
if (!gst_video_overlay_set_render_rectangle(overlay, 0, 0, width, height))
{
DEBUG_WARN("Could not resize overlay!");
CLOG_ERR("Could not resize overlay!");
}
gst_video_overlay_expose(overlay);
#else
if (!gst_x_overlay_set_render_rectangle(overlay, 0, 0, width, height))
{
DEBUG_WARN("Could not resize overlay!");
CLOG_ERR("Could not resize overlay!");
}
gst_x_overlay_expose(overlay);

View File

@ -120,10 +120,10 @@ int tsmf_gstreamer_pipeline_set_state(TSMFGstreamerDecoder *mdecoder, GstState d
state_change = gst_element_set_state(mdecoder->pipe, desired_state);
if (state_change == GST_STATE_CHANGE_FAILURE)
DEBUG_WARN("%s: (%s) GST_STATE_CHANGE_FAILURE.", sname, name);
CLOG_ERR("%s: (%s) GST_STATE_CHANGE_FAILURE.", sname, name);
else if (state_change == GST_STATE_CHANGE_ASYNC)
{
DEBUG_WARN("%s: (%s) GST_STATE_CHANGE_ASYNC.", sname, name);
CLOG_ERR("%s: (%s) GST_STATE_CHANGE_ASYNC.", sname, name);
mdecoder->state = desired_state;
}
else
@ -142,7 +142,7 @@ static GstBuffer *tsmf_get_buffer_from_data(const void *raw_data, gsize size)
if (!data)
{
DEBUG_WARN("Could not allocate %"G_GSIZE_FORMAT" bytes of data.", size);
CLOG_ERR("Could not allocate %"G_GSIZE_FORMAT" bytes of data.", size);
return NULL;
}
@ -154,7 +154,7 @@ static GstBuffer *tsmf_get_buffer_from_data(const void *raw_data, gsize size)
if (!buffer)
{
DEBUG_WARN("Could not create GstBuffer");
CLOG_ERR("Could not create GstBuffer");
free(data);
return NULL;
}
@ -346,7 +346,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *m
NULL);
break;
default:
DEBUG_WARN("unknown format:(%d).", media_type->SubType);
CLOG_ERR("unknown format:(%d).", media_type->SubType);
return FALSE;
}
@ -358,7 +358,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder *decoder, TS_AM_MEDIA_TYPE *m
if (!buffer)
{
DEBUG_WARN("could not allocate GstBuffer!");
CLOG_ERR("could not allocate GstBuffer!");
return FALSE;
}
@ -416,7 +416,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
if (!mdecoder->pipe)
{
DEBUG_WARN("Failed to create new pipe");
CLOG_ERR("Failed to create new pipe");
return FALSE;
}
@ -424,7 +424,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
if (!mdecoder->src)
{
DEBUG_WARN("Failed to get appsrc");
CLOG_ERR("Failed to get appsrc");
return FALSE;
}
@ -432,7 +432,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
if (!mdecoder->outsink)
{
DEBUG_WARN("Failed to get sink");
CLOG_ERR("Failed to get sink");
return FALSE;
}
@ -442,7 +442,7 @@ BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder *mdecoder)
if (!mdecoder->volume)
{
DEBUG_WARN("Failed to get volume");
CLOG_ERR("Failed to get volume");
return FALSE;
}
}
@ -482,7 +482,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
if (!mdecoder)
{
DEBUG_WARN("Decoder not initialized!");
CLOG_ERR("Decoder not initialized!");
return FALSE;
}
@ -498,13 +498,13 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
if (mdecoder->gst_caps == NULL)
{
DEBUG_WARN("tsmf_gstreamer_set_format not called or invalid format.");
CLOG_ERR("tsmf_gstreamer_set_format not called or invalid format.");
return FALSE;
}
if (!mdecoder->src)
{
DEBUG_WARN("failed to construct pipeline correctly. Unable to push buffer to source element.");
CLOG_ERR("failed to construct pipeline correctly. Unable to push buffer to source element.");
return FALSE;
}
@ -512,7 +512,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
if (gst_buf == NULL)
{
DEBUG_WARN("tsmf_get_buffer_from_data(%p, %d) failed.", data, data_size);
CLOG_ERR("tsmf_get_buffer_from_data(%p, %d) failed.", data, data_size);
return FALSE;
}
@ -534,7 +534,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder *decoder, const BYTE *data, UIN
GST_SEEK_TYPE_SET, sample_time,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
{
DEBUG_WARN("seek failed");
CLOG_ERR("seek failed");
}
mdecoder->pipeline_start_time_valid = 0;
@ -608,7 +608,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
if (mdecoder->paused)
{
DEBUG_WARN("%s: Ignoring control PAUSE, already received!", get_type(mdecoder));
CLOG_ERR("%s: Ignoring control PAUSE, already received!", get_type(mdecoder));
return;
}
@ -624,7 +624,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
if (!mdecoder->paused && !mdecoder->shutdown)
{
DEBUG_WARN("%s: Ignoring control RESUME, already received!", get_type(mdecoder));
CLOG_ERR("%s: Ignoring control RESUME, already received!", get_type(mdecoder));
return;
}
@ -642,7 +642,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
if (mdecoder->shutdown)
{
DEBUG_WARN("%s: Ignoring control STOP, already received!", get_type(mdecoder));
CLOG_ERR("%s: Ignoring control STOP, already received!", get_type(mdecoder));
return;
}
@ -656,7 +656,7 @@ static void tsmf_gstreamer_control(ITSMFDecoder *decoder, ITSMFControlMsg contro
gst_app_src_end_of_stream((GstAppSrc *)mdecoder->src);
}
else
DEBUG_WARN("Unknown control message %08x", control_msg);
CLOG_ERR("Unknown control message %08x", control_msg);
}
static BOOL tsmf_gstreamer_buffer_filled(ITSMFDecoder *decoder)

View File

@ -72,7 +72,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice *pulse)
return FALSE;
if(pa_context_connect(pulse->context, NULL, 0, NULL))
{
DEBUG_WARN("pa_context_connect failed (%d)",
CLOG_ERR("pa_context_connect failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -80,7 +80,7 @@ static BOOL tsmf_pulse_connect(TSMFPulseAudioDevice *pulse)
if(pa_threaded_mainloop_start(pulse->mainloop) < 0)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_threaded_mainloop_start failed (%d)",
CLOG_ERR("pa_threaded_mainloop_start failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -120,19 +120,19 @@ static BOOL tsmf_pulse_open(ITSMFAudioDevice *audio, const char *device)
pulse->mainloop = pa_threaded_mainloop_new();
if(!pulse->mainloop)
{
DEBUG_WARN("pa_threaded_mainloop_new failed");
CLOG_ERR("pa_threaded_mainloop_new failed");
return FALSE;
}
pulse->context = pa_context_new(pa_threaded_mainloop_get_api(pulse->mainloop), "freerdp");
if(!pulse->context)
{
DEBUG_WARN("pa_context_new failed");
CLOG_ERR("pa_context_new failed");
return FALSE;
}
pa_context_set_state_callback(pulse->context, tsmf_pulse_context_state_callback, pulse);
if(tsmf_pulse_connect(pulse))
{
DEBUG_WARN("tsmf_pulse_connect failed");
CLOG_ERR("tsmf_pulse_connect failed");
return FALSE;
}
DEBUG_TSMF("open device %s", pulse->device);
@ -214,7 +214,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
if(!pulse->stream)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_stream_new failed (%d)",
CLOG_ERR("pa_stream_new failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -233,7 +233,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
NULL, NULL) < 0)
{
pa_threaded_mainloop_unlock(pulse->mainloop);
DEBUG_WARN("pa_stream_connect_playback failed (%d)",
CLOG_ERR("pa_stream_connect_playback failed (%d)",
pa_context_errno(pulse->context));
return FALSE;
}
@ -244,7 +244,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice *pulse)
break;
if(!PA_STREAM_IS_GOOD(state))
{
DEBUG_WARN("bad stream state (%d)",
CLOG_ERR("bad stream state (%d)",
pa_context_errno(pulse->context));
break;
}

View File

@ -41,7 +41,7 @@ static ITSMFAudioDevice* tsmf_load_audio_device_by_name(const char* name, const
if (audio == NULL)
{
DEBUG_WARN("failed to call export function in %s", name);
CLOG_ERR("failed to call export function in %s", name);
return NULL;
}

View File

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

View File

@ -42,7 +42,7 @@ static ITSMFDecoder *tsmf_load_decoder_by_name(const char *name, TS_AM_MEDIA_TYP
decoder = entry();
if(decoder == NULL)
{
DEBUG_WARN("failed to call export function in %s", name);
CLOG_ERR("failed to call export function in %s", name);
return NULL;
}
if(!decoder->SetFormat(decoder, media_type))

View File

@ -80,7 +80,7 @@ int tsmf_ifman_exchange_capability_request(TSMF_IFMAN *ifman)
MMREDIR_CAPABILITY_PLATFORM_MF | MMREDIR_CAPABILITY_PLATFORM_DSHOW);
break;
default:
DEBUG_WARN("unknown capability type %d", CapabilityType);
CLOG_ERR("unknown capability type %d", CapabilityType);
break;
}
Stream_SetPosition(ifman->output, pos + cbCapabilityLength);
@ -236,7 +236,7 @@ int tsmf_ifman_shutdown_presentation(TSMF_IFMAN *ifman)
if(presentation)
tsmf_presentation_free(presentation);
else
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
Stream_EnsureRemainingCapacity(ifman->output, 4);
Stream_Write_UINT32(ifman->output, 0); /* Result */
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
@ -261,7 +261,7 @@ int tsmf_ifman_on_stream_volume(TSMF_IFMAN *ifman)
}
else
{
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
}
ifman->output_pending = TRUE;
return 0;
@ -393,13 +393,13 @@ int tsmf_ifman_on_sample(TSMF_IFMAN *ifman)
presentation = tsmf_presentation_find_by_id(ifman->presentation_id);
if(presentation == NULL)
{
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
return 1;
}
stream = tsmf_stream_find_by_id(presentation, StreamId);
if(stream == NULL)
{
DEBUG_WARN("unknown stream id");
CLOG_ERR("unknown stream id");
return 1;
}
tsmf_stream_push_sample(stream, ifman->channel_callback,
@ -420,7 +420,7 @@ int tsmf_ifman_on_flush(TSMF_IFMAN *ifman)
presentation = tsmf_presentation_find_by_id(ifman->presentation_id);
if(presentation == NULL)
{
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
return 1;
}
tsmf_presentation_flush(presentation);
@ -460,7 +460,7 @@ int tsmf_ifman_on_playback_started(TSMF_IFMAN *ifman)
if(presentation)
tsmf_presentation_start(presentation);
else
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
Stream_EnsureRemainingCapacity(ifman->output, 16);
Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
Stream_Write_UINT32(ifman->output, 0); /* StreamId */
@ -480,7 +480,7 @@ int tsmf_ifman_on_playback_paused(TSMF_IFMAN *ifman)
if(presentation)
tsmf_presentation_paused(presentation);
else
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
return 0;
}
@ -494,7 +494,7 @@ int tsmf_ifman_on_playback_restarted(TSMF_IFMAN *ifman)
if(presentation)
tsmf_presentation_restarted(presentation);
else
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
return 0;
}
@ -506,7 +506,7 @@ int tsmf_ifman_on_playback_stopped(TSMF_IFMAN *ifman)
if(presentation)
tsmf_presentation_stop(presentation);
else
DEBUG_WARN("unknown presentation id");
CLOG_ERR("unknown presentation id");
Stream_EnsureRemainingCapacity(ifman->output, 16);
Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
Stream_Write_UINT32(ifman->output, 0); /* StreamId */

View File

@ -89,14 +89,14 @@ void tsmf_playback_ack(IWTSVirtualChannelCallback *pChannelCallback,
Stream_Write_UINT64(s, data_size); /* cbData */
DEBUG_TSMF("response size %d", (int) Stream_GetPosition(s));
if(!callback || !callback->channel || !callback->channel->Write)
DEBUG_WARN("callback=%p, channel=%p, write=%p", callback,
CLOG_ERR("callback=%p, channel=%p, write=%p", callback,
callback->channel, callback->channel->Write);
else
status = callback->channel->Write(callback->channel,
Stream_GetPosition(s), Stream_Buffer(s), NULL);
if(status)
{
DEBUG_WARN("response error %d", status);
CLOG_ERR("response error %d", status);
}
Stream_Free(s, TRUE);
}
@ -108,7 +108,7 @@ BOOL tsmf_push_event(IWTSVirtualChannelCallback *pChannelCallback, wMessage *eve
status = callback->channel_mgr->PushEvent(callback->channel_mgr, event);
if(status)
{
DEBUG_WARN("response error %d", status);
CLOG_ERR("response error %d", status);
return FALSE;
}
return TRUE;
@ -130,7 +130,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
/* 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */
if(cbSize < 12)
{
DEBUG_WARN("invalid size. cbSize=%d", cbSize);
CLOG_ERR("invalid size. cbSize=%d", cbSize);
return 1;
}
@ -272,7 +272,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
}
if(status == -1)
{
DEBUG_WARN("InterfaceId 0x%X FunctionId 0x%X not processed.",
CLOG_ERR("InterfaceId 0x%X FunctionId 0x%X not processed.",
InterfaceId, FunctionId);
/* When a request is not implemented we return empty response indicating error */
}
@ -289,7 +289,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, w
status = callback->channel->Write(callback->channel, length, Stream_Buffer(output), NULL);
if(status)
{
DEBUG_WARN("response error %d", status);
CLOG_ERR("response error %d", status);
}
}
Stream_Free(output, TRUE);

View File

@ -271,7 +271,7 @@ TSMF_PRESENTATION *tsmf_presentation_new(const BYTE *guid, IWTSVirtualChannelCal
if (!presentation)
{
DEBUG_WARN("calloc failed");
CLOG_ERR("calloc failed");
return NULL;
}
@ -320,7 +320,7 @@ TSMF_PRESENTATION *tsmf_presentation_find_by_id(const BYTE *guid)
ArrayList_Unlock(presentation_list);
if (!found)
DEBUG_WARN("presentation id %s not found", guid_to_string(guid, guid_str, sizeof(guid_str)));
CLOG_ERR("presentation id %s not found", guid_to_string(guid, guid_str, sizeof(guid_str)));
return (found) ? presentation : NULL;
}
@ -902,7 +902,7 @@ TSMF_STREAM *tsmf_stream_new(TSMF_PRESENTATION *presentation, UINT32 stream_id)
if (stream)
{
DEBUG_WARN("duplicated stream id %d!", stream_id);
CLOG_ERR("duplicated stream id %d!", stream_id);
return NULL;
}
@ -910,7 +910,7 @@ TSMF_STREAM *tsmf_stream_new(TSMF_PRESENTATION *presentation, UINT32 stream_id)
if (!stream)
{
DEBUG_WARN("Calloc failed");
CLOG_ERR("Calloc failed");
return NULL;
}
@ -966,7 +966,7 @@ void tsmf_stream_set_format(TSMF_STREAM *stream, const char *name, wStream *s)
if (stream->decoder)
{
DEBUG_WARN("duplicated call");
CLOG_ERR("duplicated call");
return;
}
@ -1071,7 +1071,7 @@ void tsmf_stream_push_sample(TSMF_STREAM *stream, IWTSVirtualChannelCallback *pC
if (!sample)
{
DEBUG_WARN("calloc failed!");
CLOG_ERR("calloc failed!");
return;
}
@ -1087,7 +1087,7 @@ void tsmf_stream_push_sample(TSMF_STREAM *stream, IWTSVirtualChannelCallback *pC
if (!sample->data)
{
DEBUG_WARN("calloc failed!");
CLOG_ERR("calloc failed!");
free(sample);
return;
}

View File

@ -26,12 +26,12 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#ifdef WITH_DEBUG_TSMF
#define DEBUG_TSMF(fmt, ...) DEBUG_CLASS(TSMF, fmt, ## __VA_ARGS__)
#define DEBUG_TSMF(fmt, ...) CLOG_CLASS(TSMF, fmt, ## __VA_ARGS__)
#else
#define DEBUG_TSMF(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_TSMF(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
typedef struct _TS_AM_MEDIA_TYPE

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"));
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_URB: Unchecked\n");
CLOG_ERR( " 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"));
fprintf(stderr, " Function IOCTL_INTERNAL_USB_CYCLE_PORT: Unchecked\n");
CLOG_ERR( " 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"));
fprintf(stderr, " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
CLOG_ERR( " Function IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: Unchecked\n");
break;
default:
@ -448,7 +448,7 @@ static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* dat
if (transferDir == 0)
{
fprintf(stderr, "urb_select_configuration: not support transfer out\n");
CLOG_ERR( "urb_select_configuration: not support transfer out\n");
return -1;
}
@ -540,7 +540,7 @@ static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, U
if (transferDir == 0)
{
fprintf(stderr, "urb_select_interface: not support transfer out\n");
CLOG_ERR( "urb_select_interface: not support transfer out\n");
return -1;
}
@ -1297,7 +1297,7 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback,
switch (transferDir)
{
case USBD_TRANSFER_DIRECTION_OUT:
fprintf(stderr, "Function urb_os_feature_descriptor_request: OUT Unchecked\n");
CLOG_ERR( "Function urb_os_feature_descriptor_request: OUT Unchecked\n");
memcpy(buffer, data + offset, OutputBufferSize);
break;
case USBD_TRANSFER_DIRECTION_IN:
@ -1700,7 +1700,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
switch (transferDir)
{
case USBD_TRANSFER_DIRECTION_OUT:
fprintf(stderr, "Function urb_control_feature_request: OUT Unchecked\n");
CLOG_ERR( "Function urb_control_feature_request: OUT Unchecked\n");
memcpy(buffer, data + offset, OutputBufferSize);
bmRequestType |= 0x00;
break;
@ -1718,7 +1718,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE
bmRequest = 0x01; /* REQUEST_CLEAR_FEATURE */
break;
default:
fprintf(stderr, "urb_control_feature_request: Error Command %x\n", command);
CLOG_ERR( "urb_control_feature_request: Error Command %x\n", command);
zfree(out_data);
return -1;
}

View File

@ -201,7 +201,7 @@ static void func_iso_callback(struct libusb_transfer *transfer)
}
else
{
//fprintf(stderr, "actual length %d \n", act_len);
//CLOG_ERR( "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)
{
fprintf(stderr, "config_release_all_interface: error num %d\n", ret);
CLOG_ERR( "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)
{
fprintf(stderr, "claim_all_interface: error num %d\n", ret);
CLOG_ERR( "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:
//fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
//CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n");
break;
case LIBUSB_TRANSFER_ERROR:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_ERROR\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_ERROR\n");
break;
case LIBUSB_TRANSFER_TIMED_OUT:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n");
break;
case LIBUSB_TRANSFER_CANCELLED:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n");
break;
case LIBUSB_TRANSFER_STALL:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_STALL\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_STALL\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n");
break;
case LIBUSB_TRANSFER_OVERFLOW:
fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
CLOG_ERR( "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n");
break;
default:
fprintf(stderr, "Transfer Status: Get unknow error num %d (0x%x)\n",
CLOG_ERR( "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:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_COMPLETED\n");
break;
case LIBUSB_TRANSFER_ERROR:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_ERROR\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_ERROR\n");
break;
case LIBUSB_TRANSFER_TIMED_OUT:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n");
break;
case LIBUSB_TRANSFER_CANCELLED:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_CANCELLED\n");
break;
case LIBUSB_TRANSFER_STALL:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_STALL\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_STALL\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n");
break;
case LIBUSB_TRANSFER_OVERFLOW:
fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
CLOG_ERR( "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n");
break;
default:
fprintf(stderr, "Transfer status: unknow status %d(0x%x)\n", status, status);
CLOG_ERR( "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)
{
fprintf(stderr, "libusb_get_device_descriptor: ERROR!!\n");
CLOG_ERR( "libusb_get_device_descriptor: ERROR!!\n");
free(descriptor);
return NULL;
}
@ -654,7 +654,7 @@ static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BY
if (error < 0)
{
fprintf(stderr, "%s: Set interface altsetting get error num %d\n",
CLOG_ERR( "%s: Set interface altsetting get error num %d\n",
__func__, error);
}
}
@ -681,7 +681,7 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id
LibusbConfig = pdev->LibusbConfig;
if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces)
{
fprintf(stderr, "Select Configuration: Libusb NumberInterfaces(%d) is different "
CLOG_ERR( "Select Configuration: Libusb NumberInterfaces(%d) is different "
"with MsConfig NumberInterfaces(%d)\n",
LibusbConfig->bNumInterfaces, MsConfig->NumInterfaces);
}
@ -827,7 +827,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
ret = libusb_set_configuration(libusb_handle, bConfigurationValue);
if (ret < 0){
fprintf(stderr, "libusb_set_configuration: ERROR number %d!!\n", ret);
CLOG_ERR( "libusb_set_configuration: ERROR number %d!!\n", ret);
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
return -1;
}
@ -835,7 +835,7 @@ static int libusb_udev_select_configuration(IUDEVICE* idev, UINT32 bConfiguratio
{
ret = libusb_get_active_config_descriptor (libusb_dev, LibusbConfig);
if (ret < 0){
fprintf(stderr, "libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
CLOG_ERR( "libusb_get_config_descriptor_by_value: ERROR number %d!!\n", ret);
func_claim_all_interface(libusb_handle, (*LibusbConfig)->bNumInterfaces);
return -1;
}
@ -885,7 +885,7 @@ static int libusb_udev_control_pipe_request(IUDEVICE* idev, UINT32 RequestId,
*UsbdStatus = 0;
/*
if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId))
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
*/
return error;
}
@ -980,12 +980,12 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
ms_string_desc,
0x12,
Timeout);
//fprintf(stderr, "Get ms string: result number %d", error);
//CLOG_ERR( "Get ms string: result number %d", error);
if (error > 0)
{
BYTE bMS_Vendorcode;
data_read_BYTE(ms_string_desc + 16, bMS_Vendorcode);
//fprintf(stderr, "bMS_Vendorcode:0x%x", bMS_Vendorcode);
//CLOG_ERR( "bMS_Vendorcode:0x%x", bMS_Vendorcode);
/** get os descriptor */
error = libusb_control_transfer(pdev->libusb_handle,
LIBUSB_ENDPOINT_IN |LIBUSB_REQUEST_TYPE_VENDOR | Recipient,
@ -1004,7 +1004,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))
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
*/
return error;
}
@ -1263,7 +1263,7 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, UINT32 RequestId, UINT32 E
if (iso_transfer == NULL)
{
fprintf(stderr, "Error: libusb_alloc_transfer.\n");
CLOG_ERR( "Error: libusb_alloc_transfer.\n");
status = -1;
}
@ -1368,7 +1368,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request
if (!ep_desc)
{
fprintf(stderr, "func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
CLOG_ERR( "func_get_ep_desc: endpoint 0x%x is not found!!\n", EndpointAddress);
return -1;
}
transfer_type = (ep_desc->bmAttributes) & 0x3;
@ -1494,7 +1494,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))
fprintf(stderr, "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
CLOG_ERR( "request_queue_unregister_request: not fount request 0x%x\n", RequestId);
}
libusb_free_transfer(transfer);
@ -1704,7 +1704,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (status < 0)
{
fprintf(stderr, "USB init: Error to get HUB handle!!\n");
CLOG_ERR( "USB init: Error to get HUB handle!!\n");
pdev->hub_handle = NULL;
}
@ -1712,7 +1712,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (!pdev->devDescriptor)
{
fprintf(stderr, "USB init: Error to get device descriptor!!\n");
CLOG_ERR( "USB init: Error to get device descriptor!!\n");
zfree(pdev);
return NULL;
}
@ -1723,7 +1723,7 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
if (status < 0)
{
fprintf(stderr, "libusb_get_descriptor: ERROR!!ret:%d\n", status);
CLOG_ERR( "libusb_get_descriptor: ERROR!!ret:%d\n", status);
zfree(pdev);
return NULL;
}
@ -1752,7 +1752,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:
fprintf(stderr, " Device is not supported!!\n");
CLOG_ERR( " Device is not supported!!\n");
zfree(pdev);
return NULL;
default:
@ -1818,7 +1818,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
ssize_t total_device;
int i, status, num = 0;
fprintf(stderr, "VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
CLOG_ERR( "VID: 0x%04X PID: 0x%04X\n", idVendor, idProduct);
array = (UDEVICE**) malloc(16 * sizeof(UDEVICE*));
@ -1839,7 +1839,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray)
if (status < 0)
{
fprintf(stderr, "libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
CLOG_ERR( "libusb_open: (by id) error: 0x%08X (%d)\n", status, status);
zfree(descriptor);
zfree(array[num]);
continue;
@ -1876,7 +1876,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
if (pDev->libusb_dev == NULL)
{
fprintf(stderr, "libusb_device_new: ERROR!!\n");
CLOG_ERR( "libusb_device_new: ERROR!!\n");
zfree(pDev);
return NULL;
}
@ -1885,7 +1885,7 @@ IUDEVICE* udev_new_by_addr(int bus_number, int dev_number)
if (status < 0)
{
fprintf(stderr, "libusb_open: (by addr) ERROR!!\n");
CLOG_ERR( "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
{
fprintf(stderr, "udevman_register_udevice: function error!!");
CLOG_ERR( "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);
fprintf(stderr, "request_queue_get_request_by_id: ERROR!!\n");
CLOG_ERR( "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;
fprintf(stderr, "=========== Usb Search List ========= \n");
CLOG_ERR( "=========== Usb Search List ========= \n");
self->rewind(self);
while (self->has_next(self))
{
usb = self->get_next(self);
fprintf(stderr, " USB %d: \n", num++);
fprintf(stderr, " idVendor: 0x%04X \n", usb->idVendor);
fprintf(stderr, " idProduct: 0x%04X \n", usb->idProduct);
CLOG_ERR( " USB %d: \n", num++);
CLOG_ERR( " idVendor: 0x%04X \n", usb->idVendor);
CLOG_ERR( " idProduct: 0x%04X \n", usb->idProduct);
}
fprintf(stderr, "================= END =============== \n");
CLOG_ERR( "================= END =============== \n");
}
void searchman_free(USB_SEARCHMAN* self)
@ -202,7 +202,7 @@ USB_SEARCHMAN* searchman_new(void * urbdrc, UINT32 UsbDevice)
if (ret != 0)
{
fprintf(stderr, "searchman mutex initialization: searchman->mutex failed");
CLOG_ERR( "searchman mutex initialization: searchman->mutex failed");
exit(EXIT_FAILURE);
}

View File

@ -32,6 +32,7 @@
#include <freerdp/dvc.h>
#include <freerdp/addin.h>
#include <freerdp/channels/log.h>
#include "urbdrc_types.h"
#include "urbdrc_main.h"
@ -468,7 +469,7 @@ static void* urbdrc_search_usb_device(void* arg)
if (!udev)
{
fprintf(stderr, "Can't create udev\n");
CLOG_ERR( "Can't create udev\n");
return 0;
}
@ -652,7 +653,7 @@ static void* urbdrc_search_usb_device(void* arg)
}
else
{
fprintf(stderr, "No Device from receive_device(). An error occured.\n");
CLOG_ERR( "No Device from receive_device(). An error occured.\n");
}
}
}
@ -835,7 +836,7 @@ static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
if (transfer_data == NULL)
{
fprintf(stderr, "transfer_data is NULL!!");
CLOG_ERR( "transfer_data is NULL!!");
return 0;
}
@ -1000,7 +1001,7 @@ static void urbdrc_register_udevman_addin(IWTSPlugin* pPlugin, IUDEVMAN* udevman
if (urbdrc->udevman)
{
DEBUG_WARN("existing device, abort.");
CLOG_ERR("existing device, abort.");
return;
}
@ -1025,7 +1026,7 @@ static int urbdrc_load_udevman_addin(IWTSPlugin* pPlugin, const char* name, ADDI
if (entry(&entryPoints) != 0)
{
DEBUG_WARN("%s entry returns error.", name);
CLOG_ERR("%s entry returns error.", name);
return FALSE;
}

View File

@ -27,7 +27,7 @@
#include <freerdp/dvc.h>
#include <freerdp/types.h>
#include <freerdp/utils/debug.h>
#include <freerdp/channels/log.h>
#include <freerdp/utils/msusb.h>
#include <uuid/uuid.h>
@ -37,9 +37,9 @@
#include <winpr/stream.h>
#ifdef WITH_DEBUG_DVC
#define DEBUG_DVC(fmt, ...) DEBUG_CLASS(DVC, fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_CLASS(DVC, fmt, ## __VA_ARGS__)
#else
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#define DEBUG_DVC(fmt, ...) CLOG_NULL(fmt, ## __VA_ARGS__)
#endif
#define CAPABILITIES_NEGOTIATOR 0x00000000
@ -316,10 +316,10 @@ enum device_descriptor_table
#define MAX_URB_REQUSET_NUM 0x80
#define LOG_LEVEL 1
#define LLOG(_level, _args) \
do { if (_level < LOG_LEVEL) { printf _args ; } } while (0)
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { printf _args ; printf("\n"); } } while (0)
#define LLOG(_level, args) \
do { if (_level < LOG_LEVEL) { CLOG_DBG args ; } } while (0)
#define LLOGLN(_level, args) \
do { if (_level < LOG_LEVEL) { CLOG_DBG args ; } } while (0)
#define dummy_wait_obj(void) do{ sleep(5); } while(0)
#define dummy_wait_s_obj(_s) do{ sleep(_s); } while(0)

View File

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

View File

@ -617,7 +617,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
vkcode &= 0xFF;
#if 0
fprintf(stderr, "keyDown: keyCode: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
DEBUG_WARN( "keyDown: keyCode: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
keyCode, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode));
#endif
@ -654,7 +654,7 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
vkcode &= 0xFF;
#if 0
fprintf(stderr, "keyUp: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
DEBUG_WARN( "keyUp: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X keyFlags: %d name: %s\n",
keyCode, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode));
#endif
@ -683,29 +683,29 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
vkcode &= 0xFF;
#if 0
fprintf(stderr, "flagsChanged: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X extended: %d name: %s modFlags: 0x%04X\n",
DEBUG_WARN( "flagsChanged: key: 0x%04X scancode: 0x%04X vkcode: 0x%04X extended: %d name: %s modFlags: 0x%04X\n",
key - 8, scancode, vkcode, keyFlags, GetVirtualKeyName(vkcode), modFlags);
if (modFlags & NSAlphaShiftKeyMask)
fprintf(stderr, "NSAlphaShiftKeyMask\n");
DEBUG_WARN( "NSAlphaShiftKeyMask\n");
if (modFlags & NSShiftKeyMask)
fprintf(stderr, "NSShiftKeyMask\n");
DEBUG_WARN( "NSShiftKeyMask\n");
if (modFlags & NSControlKeyMask)
fprintf(stderr, "NSControlKeyMask\n");
DEBUG_WARN( "NSControlKeyMask\n");
if (modFlags & NSAlternateKeyMask)
fprintf(stderr, "NSAlternateKeyMask\n");
DEBUG_WARN( "NSAlternateKeyMask\n");
if (modFlags & NSCommandKeyMask)
fprintf(stderr, "NSCommandKeyMask\n");
DEBUG_WARN( "NSCommandKeyMask\n");
if (modFlags & NSNumericPadKeyMask)
fprintf(stderr, "NSNumericPadKeyMask\n");
DEBUG_WARN( "NSNumericPadKeyMask\n");
if (modFlags & NSHelpKeyMask)
fprintf(stderr, "NSHelpKeyMask\n");
DEBUG_WARN( "NSHelpKeyMask\n");
#endif
if ((modFlags & NSAlphaShiftKeyMask) && !(kbdModFlags & NSAlphaShiftKeyMask))
@ -832,7 +832,7 @@ BOOL mac_pre_connect(freerdp* instance)
if (!settings->ServerHostname)
{
fprintf(stderr, "error: server hostname was not specified with /v:<server>[:port]\n");
DEBUG_WARN( "error: server hostname was not specified with /v:<server>[:port]\n");
[NSApp terminate:nil];
return -1;
}
@ -1200,7 +1200,7 @@ static void update_activity_cb(freerdp* instance)
}
else
{
fprintf(stderr, "update_activity_cb: No queue!\n");
DEBUG_WARN( "update_activity_cb: No queue!\n");
}
}
@ -1225,7 +1225,7 @@ static void input_activity_cb(freerdp* instance)
}
else
{
fprintf(stderr, "input_activity_cb: No queue!\n");
DEBUG_WARN( "input_activity_cb: No queue!\n");
}
}
@ -1238,7 +1238,7 @@ static void channel_activity_cb(freerdp* instance)
if (event)
{
fprintf(stderr, "channel_activity_cb: message %d\n", event->id);
DEBUG_WARN( "channel_activity_cb: message %d\n", event->id);
switch (GetMessageClass(event->id))
{

View File

@ -568,7 +568,7 @@ void wf_cliprdr_init(wfContext* wfc, rdpChannels* channels)
if (!wfc->instance->settings->RedirectClipboard)
{
wfc->cliprdr_context = NULL;
fprintf(stderr, "clipboard is not redirected.\n");
DEBUG_WARN( "clipboard is not redirected.\n");
return;
}
@ -658,7 +658,7 @@ static BOOL wf_cliprdr_get_file_contents(wchar_t *file_name, BYTE *buffer, int p
if (file_name == NULL || buffer == NULL || puSize == NULL)
{
fprintf(stderr, "get file contents Invalid Arguments.\n");
DEBUG_WARN( "get file contents Invalid Arguments.\n");
return FALSE;
}
hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
@ -1175,7 +1175,7 @@ static void wf_cliprdr_process_cb_filecontents_request_event(wfContext *wfc, RDP
hRet = OleGetClipboard(&pDataObj);
if (!SUCCEEDED(hRet))
{
fprintf(stderr, "filecontents: get ole clipboard failed.\n");
DEBUG_WARN( "filecontents: get ole clipboard failed.\n");
goto error;
}
@ -1273,7 +1273,7 @@ static void wf_cliprdr_process_cb_filecontents_request_event(wfContext *wfc, RDP
event->nPositionLow, event->nPositionHigh, event->cbRequested, &uSize);
if (bRet == FALSE)
{
fprintf(stderr, "get file contents failed.\n");
DEBUG_WARN( "get file contents failed.\n");
uSize = 0;
goto error;
}
@ -1304,7 +1304,7 @@ error:
IDataObject_Release(pDataObj);
pDataObj = NULL;
}
fprintf(stderr, "filecontents: send failed response.\n");
DEBUG_WARN( "filecontents: send failed response.\n");
cliprdr_send_response_filecontents(cliprdr, event->streamId, 0, NULL);
return;
}

View File

@ -63,7 +63,7 @@ BOOL wf_set_rop2(HDC hdc, int rop2)
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
@ -643,7 +643,7 @@ void wf_gdi_surface_bits(wfContext* wfc, SURFACE_BITS_COMMAND* surface_bits_comm
}
else
{
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
DEBUG_WARN( "Unsupported codecID %d\n", surface_bits_command->codecID);
}
if (tile_bitmap != NULL)

View File

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

View File

@ -65,7 +65,7 @@ int wf_create_console(void)
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
fprintf(stderr, "Debug console created.\n");
DEBUG_WARN( "Debug console created.\n");
return 0;
}
@ -202,7 +202,7 @@ BOOL wf_pre_connect(freerdp* instance)
wfc->connectionRdpFile = freerdp_client_rdp_file_new();
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
DEBUG_WARN( "Using connection file: %s\n", settings->ConnectionFile);
freerdp_client_parse_rdp_file(wfc->connectionRdpFile, settings->ConnectionFile);
freerdp_client_populate_settings_from_rdp_file(wfc->connectionRdpFile, settings);
@ -291,7 +291,7 @@ BOOL wf_pre_connect(freerdp* instance)
if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) ||
(settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096))
{
fprintf(stderr, "wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
DEBUG_WARN( "wf_pre_connect: invalid dimensions %d %d\n", settings->DesktopWidth, settings->DesktopHeight);
return 1;
}
@ -487,7 +487,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
if (status != NO_ERROR)
{
fprintf(stderr, "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
DEBUG_WARN( "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
return FALSE;
}
@ -496,7 +496,7 @@ BOOL wf_authenticate(freerdp* instance, char** username, char** password, char**
status = CredUIParseUserNameA(UserName, User, sizeof(User), Domain, sizeof(Domain));
//fprintf(stderr, "User: %s Domain: %s Password: %s\n", User, Domain, Password);
//DEBUG_WARN( "User: %s Domain: %s Password: %s\n", User, Domain, Password);
*username = _strdup(User);
@ -590,7 +590,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
return FALSE;
/* A network disconnect was detected */
fprintf(stderr, "Network disconnect!\n");
DEBUG_WARN( "Network disconnect!\n");
if (!instance->settings->AutoReconnectionEnabled)
{
/* No auto-reconnect - just quit */
@ -605,7 +605,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
return FALSE;
/* Attempt the next reconnect */
fprintf(stderr, "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
DEBUG_WARN( "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
if (freerdp_reconnect(instance))
{
return TRUE;
@ -614,7 +614,7 @@ static BOOL wf_auto_reconnect(freerdp* instance)
Sleep(5000);
}
fprintf(stderr, "Maximum reconnect retries exceeded\n");
DEBUG_WARN( "Maximum reconnect retries exceeded\n");
return FALSE;
}
@ -784,13 +784,13 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
{
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
break;
}
}
if (wf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get wfreerdp file descriptor\n");
DEBUG_WARN( "Failed to get wfreerdp file descriptor\n");
break;
}
@ -798,7 +798,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
{
if (freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get channel manager file descriptor\n");
DEBUG_WARN( "Failed to get channel manager file descriptor\n");
break;
}
}
@ -816,14 +816,14 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
/* exit if nothing to do */
if (fds_count == 0)
{
fprintf(stderr, "wfreerdp_run: fds_count is zero\n");
DEBUG_WARN( "wfreerdp_run: fds_count is zero\n");
//break;
}
/* do the wait */
if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED)
{
fprintf(stderr, "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
DEBUG_WARN( "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
break;
}
@ -834,7 +834,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
if (wf_auto_reconnect(instance))
continue;
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
break;
}
}
@ -844,7 +844,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
}
if (wf_check_fds(instance) != TRUE)
{
fprintf(stderr, "Failed to check wfreerdp file descriptor\n");
DEBUG_WARN( "Failed to check wfreerdp file descriptor\n");
break;
}
@ -852,7 +852,7 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
{
if (freerdp_channels_check_fds(channels, instance) != TRUE)
{
fprintf(stderr, "Failed to check channel manager file descriptor\n");
DEBUG_WARN( "Failed to check channel manager file descriptor\n");
break;
}
@ -960,7 +960,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
{
if (status == -1)
{
fprintf(stderr, "keyboard thread error getting message\n");
DEBUG_WARN( "keyboard thread error getting message\n");
break;
}
else
@ -974,7 +974,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
}
else
{
fprintf(stderr, "failed to install keyboard hook\n");
DEBUG_WARN( "failed to install keyboard hook\n");
}
printf("Keyboard thread exited.\n");
@ -1002,7 +1002,7 @@ int freerdp_client_focus_out(wfContext* wfc)
int freerdp_client_set_window_size(wfContext* wfc, int width, int height)
{
fprintf(stderr, "freerdp_client_set_window_size %d, %d", width, height);
DEBUG_WARN( "freerdp_client_set_window_size %d, %d", width, height);
if ((width != wfc->client_width) || (height != wfc->client_height))
{
@ -1027,7 +1027,7 @@ int freerdp_client_load_settings_from_rdp_file(wfContext* wfc, char* filename)
freerdp_client_rdp_file_free(wfc->connectionRdpFile);
wfc->connectionRdpFile = freerdp_client_rdp_file_new();
fprintf(stderr, "Using connection file: %s\n", settings->ConnectionFile);
DEBUG_WARN( "Using connection file: %s\n", settings->ConnectionFile);
if (!freerdp_client_parse_rdp_file(wfc->connectionRdpFile, settings->ConnectionFile))
{

View File

@ -26,7 +26,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not allocate string buffer.");
DEBUG_WARN( "Could not allocate string buffer.");
exit(-2);
}
/* Copy character for character and check, if it is necessary to escape. */
@ -40,7 +40,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not reallocate string buffer.");
DEBUG_WARN( "Could not reallocate string buffer.");
exit(-3);
}
tmp[cs++] = '&';
@ -53,7 +53,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not reallocate string buffer.");
DEBUG_WARN( "Could not reallocate string buffer.");
exit(-4);
}
tmp[cs++] = '&';
@ -66,7 +66,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not reallocate string buffer.");
DEBUG_WARN( "Could not reallocate string buffer.");
exit(-5);
}
tmp[cs++] = '&';
@ -81,7 +81,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not reallocate string buffer.");
DEBUG_WARN( "Could not reallocate string buffer.");
exit(-6);
}
tmp[cs++] = '&';
@ -96,7 +96,7 @@ LPSTR tr_esc_str(LPCSTR arg)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if(NULL == tmp)
{
fprintf(stderr, "Could not reallocate string buffer.");
DEBUG_WARN( "Could not reallocate string buffer.");
exit(-7);
}
tmp[cs++] = '&';
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
fp = fopen(fname, "w");
if(NULL == fp)
{
fprintf(stderr, "Could not open '%s' for writing.", fname);
DEBUG_WARN( "Could not open '%s' for writing.", fname);
return -1;
}
/* The tag used as header in the manpage */
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
* compatible XML */
if(elements < 2)
{
fprintf(stderr, "The argument array 'args' is empty, writing an empty file.");
DEBUG_WARN( "The argument array 'args' is empty, writing an empty file.");
elements = 1;
}
for(x=0; x<elements - 1; x++)

View File

@ -573,7 +573,7 @@ BOOL xf_get_pixmap_info(xfContext *xfc)
pfs = XListPixmapFormats(xfc->display, &pf_count);
if(pfs == NULL)
{
fprintf(stderr, "xf_get_pixmap_info: XListPixmapFormats failed\n");
DEBUG_WARN( "xf_get_pixmap_info: XListPixmapFormats failed\n");
return 1;
}
for(i = 0; i < pf_count; i++)
@ -592,13 +592,13 @@ BOOL xf_get_pixmap_info(xfContext *xfc)
template.screen = xfc->screen_number;
if(XGetWindowAttributes(xfc->display, RootWindowOfScreen(xfc->screen), &window_attributes) == 0)
{
fprintf(stderr, "xf_get_pixmap_info: XGetWindowAttributes failed\n");
DEBUG_WARN( "xf_get_pixmap_info: XGetWindowAttributes failed\n");
return FALSE;
}
vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask, &template, &vi_count);
if(vis == NULL)
{
fprintf(stderr, "xf_get_pixmap_info: XGetVisualInfo failed\n");
DEBUG_WARN( "xf_get_pixmap_info: XGetVisualInfo failed\n");
return FALSE;
}
vi = NULL;
@ -637,7 +637,7 @@ int xf_error_handler(Display *d, XErrorEvent *ev)
char buf[256];
int do_abort = TRUE;
XGetErrorText(d, ev->error_code, buf, sizeof(buf));
fprintf(stderr, "%s", buf);
DEBUG_WARN( "%s", buf);
if(do_abort)
abort();
_def_error_handler(d, ev);
@ -721,20 +721,20 @@ BOOL xf_pre_connect(freerdp *instance)
{
if(!XInitThreads())
{
fprintf(stderr, "warning: XInitThreads() failure\n");
DEBUG_WARN( "warning: XInitThreads() failure\n");
xfc->UseXThreads = FALSE;
}
}
xfc->display = XOpenDisplay(NULL);
if(!xfc->display)
{
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");
DEBUG_WARN( "xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
DEBUG_WARN( "Please check that the $DISPLAY environment variable is properly set.\n");
return FALSE;
}
if(xfc->debug)
{
fprintf(stderr, "Enabling X11 debug mode.\n");
DEBUG_WARN( "Enabling X11 debug mode.\n");
XSynchronize(xfc->display, TRUE);
_def_error_handler = XSetErrorHandler(_xf_error_handler);
}
@ -750,15 +750,15 @@ BOOL xf_pre_connect(freerdp *instance)
/* Check --authonly has a username and password. */
if(settings->Username == NULL)
{
fprintf(stderr, "--authonly, but no -u username. Please provide one.\n");
DEBUG_WARN( "--authonly, but no -u username. Please provide one.\n");
return FALSE;
}
if(settings->Password == NULL)
{
fprintf(stderr, "--authonly, but no -p password. Please provide one.\n");
DEBUG_WARN( "--authonly, but no -p password. Please provide one.\n");
return FALSE;
}
fprintf(stderr, "Authentication only. Don't connect to X.\n");
DEBUG_WARN( "Authentication only. Don't connect to X.\n");
/* Avoid XWindows initialization and configuration below. */
return TRUE;
}
@ -1225,7 +1225,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
if(freerdp_error_info(instance) != 0)
return FALSE;
/* A network disconnect was detected */
fprintf(stderr, "Network disconnect!\n");
DEBUG_WARN( "Network disconnect!\n");
if(!instance->settings->AutoReconnectionEnabled)
{
/* No auto-reconnect - just quit */
@ -1240,7 +1240,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
return FALSE;
}
/* Attempt the next reconnect */
fprintf(stderr, "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
DEBUG_WARN( "Attempting reconnect (%u of %u)\n", num_retries, max_retries);
if(freerdp_reconnect(instance))
{
xfc->disconnect = FALSE;
@ -1248,7 +1248,7 @@ BOOL xf_auto_reconnect(freerdp *instance)
}
sleep(5);
}
fprintf(stderr, "Maximum reconnect retries exceeded\n");
DEBUG_WARN( "Maximum reconnect retries exceeded\n");
return FALSE;
}
@ -1301,7 +1301,7 @@ void *xf_thread(void *param)
if(instance->settings->AuthenticationOnly)
{
freerdp_disconnect(instance);
fprintf(stderr, "Authentication only, exit status %d\n", !status);
DEBUG_WARN( "Authentication only, exit status %d\n", !status);
ExitThread(exit_code);
}
if(!status)
@ -1352,7 +1352,7 @@ void *xf_thread(void *param)
{
if(freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
exit_code = XF_EXIT_CONN_FAILED;
break;
}
@ -1361,7 +1361,7 @@ void *xf_thread(void *param)
{
if(freerdp_channels_get_fds(channels, instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get channel manager file descriptor\n");
DEBUG_WARN( "Failed to get channel manager file descriptor\n");
exit_code = XF_EXIT_CONN_FAILED;
break;
}
@ -1370,7 +1370,7 @@ void *xf_thread(void *param)
{
if(xf_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
{
fprintf(stderr, "Failed to get xfreerdp file descriptor\n");
DEBUG_WARN( "Failed to get xfreerdp file descriptor\n");
exit_code = XF_EXIT_CONN_FAILED;
break;
}
@ -1407,7 +1407,7 @@ void *xf_thread(void *param)
if(!((errno == EAGAIN) || (errno == EWOULDBLOCK) ||
(errno == EINPROGRESS) || (errno == EINTR))) /* signal occurred */
{
fprintf(stderr, "xfreerdp_run: select failed\n");
DEBUG_WARN( "xfreerdp_run: select failed\n");
break;
}
}
@ -1417,7 +1417,7 @@ void *xf_thread(void *param)
{
if(xf_auto_reconnect(instance))
continue;
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
break;
}
}
@ -1425,7 +1425,7 @@ void *xf_thread(void *param)
{
if(freerdp_channels_check_fds(channels, instance) != TRUE)
{
fprintf(stderr, "Failed to check channel manager file descriptor\n");
DEBUG_WARN( "Failed to check channel manager file descriptor\n");
break;
}
xf_process_channel_event(channels, instance);
@ -1434,7 +1434,7 @@ void *xf_thread(void *param)
{
if(xf_process_x_events(instance) != TRUE)
{
fprintf(stderr, "Closed from X11\n");
DEBUG_WARN( "Closed from X11\n");
break;
}
}
@ -1444,7 +1444,7 @@ void *xf_thread(void *param)
{
if(!freerdp_message_queue_process_pending_messages(instance, FREERDP_INPUT_MESSAGE_QUEUE))
{
fprintf(stderr, "User Disconnect\n");
DEBUG_WARN( "User Disconnect\n");
xfc->disconnect = TRUE;
break;
}
@ -1559,7 +1559,7 @@ static int xfreerdp_client_start(rdpContext *context)
rdpSettings *settings = context->settings;
if(!settings->ServerHostname)
{
fprintf(stderr, "error: server hostname was not specified with /v:<server>[:port]\n");
DEBUG_WARN( "error: server hostname was not specified with /v:<server>[:port]\n");
return -1;
}
xfc->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) xf_thread,

View File

@ -143,15 +143,15 @@ void xf_cliprdr_init(xfContext* xfc, rdpChannels* channels)
}
else
{
fprintf(stderr, "%s: Error querying X Fixes extension version\n", __FUNCTION__);
DEBUG_WARN( "%s: Error querying X Fixes extension version\n", __FUNCTION__);
}
}
else
{
fprintf(stderr, "%s: Error loading X Fixes extension\n", __FUNCTION__);
DEBUG_WARN( "%s: Error loading X Fixes extension\n", __FUNCTION__);
}
#else
fprintf(stderr, "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!\n");
DEBUG_WARN( "Warning: Using clipboard redirection without XFIXES extension is strongly discouraged!\n");
#endif
n = 0;
@ -970,7 +970,7 @@ static BOOL xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
Stream_Read_UINT16(s, bpp);
if ((bpp < 1) || (bpp > 32))
{
fprintf(stderr, "%s: invalid bpp value %d", __FUNCTION__, bpp);
DEBUG_WARN( "%s: invalid bpp value %d", __FUNCTION__, bpp);
return FALSE;
}

View File

@ -68,7 +68,7 @@ BOOL xf_set_rop2(xfContext* xfc, int rop2)
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
@ -204,7 +204,7 @@ BOOL xf_set_rop3(xfContext* xfc, int rop3)
if (function < 0)
{
fprintf(stderr, "Unsupported ROP3: 0x%08X\n", rop3);
DEBUG_WARN( "Unsupported ROP3: 0x%08X\n", rop3);
XSetFunction(xfc->display, xfc->gc, GXclear);
return FALSE;
}
@ -398,7 +398,7 @@ void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
else
{
fprintf(stderr, "unimplemented brush style:%d\n", brush->style);
DEBUG_WARN( "unimplemented brush style:%d\n", brush->style);
}
if (xfc->drawing == xfc->primary)
@ -522,7 +522,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)
{
fprintf(stderr, "DrawNineGrid\n");
DEBUG_WARN( "DrawNineGrid\n");
}
void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
@ -713,7 +713,7 @@ void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
else
{
fprintf(stderr, "Mem3Blt unimplemented brush style:%d\n", brush->style);
DEBUG_WARN( "Mem3Blt unimplemented brush style:%d\n", brush->style);
}
XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc,
@ -777,7 +777,7 @@ void xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
break;
default:
fprintf(stderr, "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
DEBUG_WARN( "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
break;
}
@ -839,7 +839,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
break;
default:
fprintf(stderr, "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
DEBUG_WARN( "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
break;
}
@ -897,7 +897,7 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
}
else
{
fprintf(stderr, "PolygonCB unimplemented brush style:%d\n", brush->style);
DEBUG_WARN( "PolygonCB unimplemented brush style:%d\n", brush->style);
}
XSetFunction(xfc->display, xfc->gc, GXcopy);
@ -908,12 +908,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)
{
fprintf(stderr, "EllipseSC\n");
DEBUG_WARN( "EllipseSC\n");
}
void xf_gdi_ellipse_cb(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb)
{
fprintf(stderr, "EllipseCB\n");
DEBUG_WARN( "EllipseCB\n");
}
void xf_gdi_surface_frame_marker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker)
@ -1111,12 +1111,12 @@ void xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits
}
else
{
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);
DEBUG_WARN( "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
{
fprintf(stderr, "Unsupported codecID %d\n", surface_bits_command->codecID);
DEBUG_WARN( "Unsupported codecID %d\n", surface_bits_command->codecID);
}
xf_unlock_x11(xfc, FALSE);

View File

@ -141,7 +141,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
switch (codec_id)
{
case RDP_CODEC_ID_NSCODEC:
fprintf(stderr, "xf_Bitmap_Decompress: nsc not done\n");
DEBUG_WARN( "xf_Bitmap_Decompress: nsc not done\n");
break;
case RDP_CODEC_ID_REMOTEFX:
@ -150,7 +150,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (!msg)
{
fprintf(stderr, "xf_Bitmap_Decompress: rfx Decompression Failed\n");
DEBUG_WARN( "xf_Bitmap_Decompress: rfx Decompression Failed\n");
}
else
{
@ -173,7 +173,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
case RDP_CODEC_ID_JPEG:
if (!jpeg_decompress(data, bitmap->data, width, height, length, bpp))
{
fprintf(stderr, "xf_Bitmap_Decompress: jpeg Decompression Failed\n");
DEBUG_WARN( "xf_Bitmap_Decompress: jpeg Decompression Failed\n");
}
break;
@ -184,7 +184,7 @@ void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (!status)
{
fprintf(stderr, "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
DEBUG_WARN( "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
}
}
else

View File

@ -624,7 +624,7 @@ int xf_input_touch_remote(xfContext* xfc, XIDeviceEvent* event, int evtype)
}
else if (evtype == XI_TouchUpdate)
{
printf("TouchUpdate: %d\n", touchId);
DEBUG_MSG("TouchUpdate: %d\n", touchId);
contactId = rdpei->TouchUpdate(rdpei, touchId, x, y);
}
else if (evtype == XI_TouchEnd)

View File

@ -191,7 +191,7 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BYTE keycode)
if (rdp_scancode == RDP_SCANCODE_UNKNOWN)
{
fprintf(stderr, "Unknown key with X keycode 0x%02x\n", keycode);
DEBUG_WARN( "Unknown key with X keycode 0x%02x\n", keycode);
}
else if (rdp_scancode == RDP_SCANCODE_PAUSE &&
!xf_keyboard_key_pressed(xfc, XK_Control_L) && !xf_keyboard_key_pressed(xfc, XK_Control_R))

View File

@ -497,7 +497,7 @@ void xf_process_rail_exec_result_event(xfContext* xfc, rdpChannels* channels, wM
if (exec_result->execResult != RAIL_EXEC_S_OK)
{
fprintf(stderr, "RAIL exec error: execResult=%s NtError=0x%X\n",
DEBUG_WARN( "RAIL exec error: execResult=%s NtError=0x%X\n",
error_code_names[exec_result->execResult], exec_result->rawResult);
xfc->disconnect = True;
}
@ -660,7 +660,7 @@ void xf_process_rail_appid_resp_event(xfContext* xfc, rdpChannels* channels, wMe
RAIL_GET_APPID_RESP_ORDER* appid_resp =
(RAIL_GET_APPID_RESP_ORDER*) event->wParam;
fprintf(stderr, "Server Application ID Response PDU: windowId=0x%X "
DEBUG_WARN( "Server Application ID Response PDU: windowId=0x%X "
"applicationId=(length=%d dump)\n",
appid_resp->windowId, 512);
@ -672,7 +672,7 @@ void xf_process_rail_langbarinfo_event(xfContext* xfc, rdpChannels* channels, wM
RAIL_LANGBAR_INFO_ORDER* langbar =
(RAIL_LANGBAR_INFO_ORDER*) event->wParam;
fprintf(stderr, "Language Bar Information PDU: languageBarStatus=0x%X\n",
DEBUG_WARN( "Language Bar Information PDU: languageBarStatus=0x%X\n",
langbar->languageBarStatus);
}

View File

@ -140,7 +140,7 @@ void xf_tsmf_init(xfContext* xfc, long xv_port)
XFree(attr);
#ifdef WITH_DEBUG_XV
fprintf(stderr, "xf_tsmf_init: pixel format ");
DEBUG_WARN( "xf_tsmf_init: pixel format ");
#endif
fo = XvListImageFormats(xfc->display, xv->xv_port, &ret);
if (ret > 0)
@ -152,7 +152,7 @@ void xf_tsmf_init(xfContext* xfc, long xv_port)
{
xv->xv_pixfmts[i] = fo[i].id;
#ifdef WITH_DEBUG_XV
fprintf(stderr, "%c%c%c%c ", ((char*)(xv->xv_pixfmts + i))[0], ((char*)(xv->xv_pixfmts + i))[1],
DEBUG_WARN( "%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(xfContext* xfc, long xv_port)
}
XFree(fo);
#ifdef WITH_DEBUG_XV
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
#endif
}

View File

@ -32,6 +32,7 @@
#include <freerdp/crypto/crypto.h>
#include <freerdp/locale/keyboard.h>
#include <freerdp/utils/debug.h>
#include <freerdp/client/cmdline.h>
#include <freerdp/version.h>
@ -1190,7 +1191,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (compatibility)
{
fprintf(stderr, "WARNING: Using deprecated command-line interface!\n");
DEBUG_WARN( "WARNING: Using deprecated command-line interface!\n");
return freerdp_client_parse_old_command_line_arguments(argc, argv, settings);
}
else
@ -1374,7 +1375,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (!id)
{
fprintf(stderr, "Could not identify keyboard layout: %s\n", arg->Value);
DEBUG_WARN( "Could not identify keyboard layout: %s\n", arg->Value);
}
}
@ -1732,7 +1733,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
}
else
{
fprintf(stderr, "unknown protocol security: %s\n", arg->Value);
DEBUG_WARN( "unknown protocol security: %s\n", arg->Value);
}
}
CommandLineSwitchCase(arg, "sec-rdp")
@ -1878,7 +1879,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
}
else
{
fprintf(stderr, "reconnect-cookie: invalid base64 '%s'\n",
DEBUG_WARN( "reconnect-cookie: invalid base64 '%s'\n",
arg->Value);
}
}
@ -1943,7 +1944,7 @@ int freerdp_client_load_static_channel_addin(rdpChannels* channels, rdpSettings*
{
if (freerdp_channels_client_load(channels, settings, entry, data) == 0)
{
fprintf(stderr, "loading channel %s\n", name);
DEBUG_WARN( "loading channel %s\n", name);
return 0;
}
}

View File

@ -27,6 +27,7 @@
#include <freerdp/addin.h>
#include <freerdp/settings.h>
#include <freerdp/client/channels.h>
#include <freerdp/utils/debug.h>
#include <freerdp/locale/keyboard.h>
#include <freerdp/client/cmdline.h>
@ -121,7 +122,7 @@ int freerdp_client_old_process_plugin(rdpSettings* settings, ADDIN_ARGV* args)
if (strcmp(args->argv[0], "cliprdr") == 0)
{
settings->RedirectClipboard = TRUE;
fprintf(stderr, "--plugin cliprdr -> +clipboard\n");
DEBUG_WARN( "--plugin cliprdr -> +clipboard\n");
}
else if (strcmp(args->argv[0], "rdpdr") == 0)
{
@ -437,37 +438,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "0")
{
settings->ConsoleSession = TRUE;
fprintf(stderr, "-0 -> /admin\n");
DEBUG_WARN( "-0 -> /admin\n");
}
CommandLineSwitchCase(arg, "a")
{
settings->ColorDepth = atoi(arg->Value);
fprintf(stderr, "-a %s -> /bpp:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-a %s -> /bpp:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "c")
{
settings->ShellWorkingDirectory = _strdup(arg->Value);
fprintf(stderr, "-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-c %s -> /shell-dir:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "D")
{
settings->Decorations = FALSE;
fprintf(stderr, "-D -> -decorations\n");
DEBUG_WARN( "-D -> -decorations\n");
}
CommandLineSwitchCase(arg, "T")
{
settings->WindowTitle = _strdup(arg->Value);
fprintf(stderr, "-T %s -> /title:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-T %s -> /title:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "d")
{
settings->Domain = _strdup(arg->Value);
fprintf(stderr, "-d %s -> /d:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-d %s -> /d:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "f")
{
settings->Fullscreen = TRUE;
fprintf(stderr, "-f -> /f\n");
DEBUG_WARN( "-f -> /f\n");
}
CommandLineSwitchCase(arg, "g")
{
@ -484,50 +485,50 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
free(str);
fprintf(stderr, "-g %s -> /size:%s or /w:%d /h:%d\n", arg->Value, arg->Value,
DEBUG_WARN( "-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));
fprintf(stderr, "-k %s -> /kbd:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-k %s -> /kbd:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "K")
{
settings->GrabKeyboard = FALSE;
fprintf(stderr, "-K -> -grab-keyboard\n");
DEBUG_WARN( "-K -> -grab-keyboard\n");
}
CommandLineSwitchCase(arg, "n")
{
settings->ClientHostname = _strdup(arg->Value);
fprintf(stderr, "-n -> /client-hostname:%s\n", arg->Value);
DEBUG_WARN( "-n -> /client-hostname:%s\n", arg->Value);
}
CommandLineSwitchCase(arg, "o")
{
settings->RemoteConsoleAudio = TRUE;
fprintf(stderr, "-o -> /audio-mode:1\n");
DEBUG_WARN( "-o -> /audio-mode:1\n");
}
CommandLineSwitchCase(arg, "p")
{
settings->Password = _strdup(arg->Value);
fprintf(stderr, "-p ****** -> /p:******\n");
DEBUG_WARN( "-p ****** -> /p:******\n");
/* Hide the value from 'ps'. */
FillMemory(arg->Value, strlen(arg->Value), '*');
}
CommandLineSwitchCase(arg, "s")
{
settings->AlternateShell = _strdup(arg->Value);
fprintf(stderr, "-s %s -> /shell:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-s %s -> /shell:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "t")
{
settings->ServerPort = atoi(arg->Value);
fprintf(stderr, "-t %s -> /port:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-t %s -> /port:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "u")
{
settings->Username = _strdup(arg->Value);
fprintf(stderr, "-u %s -> /u:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-u %s -> /u:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "x")
{
@ -555,31 +556,31 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
freerdp_performance_flags_split(settings);
}
fprintf(stderr, "-x %s -> /network:", arg->Value);
DEBUG_WARN( "-x %s -> /network:", arg->Value);
if (type == CONNECTION_TYPE_MODEM)
fprintf(stderr, "modem");
DEBUG_WARN( "modem");
else if (CONNECTION_TYPE_BROADBAND_HIGH)
fprintf(stderr, "broadband");
DEBUG_WARN( "broadband");
else if (CONNECTION_TYPE_LAN)
fprintf(stderr, "lan");
DEBUG_WARN( "lan");
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
}
CommandLineSwitchCase(arg, "X")
{
settings->ParentWindowId = strtol(arg->Value, NULL, 0);
fprintf(stderr, "-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "-X %s -> /parent-window:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "z")
{
settings->CompressionEnabled = TRUE;
fprintf(stderr, "-z -> /compression\n");
DEBUG_WARN( "-z -> /compression\n");
}
CommandLineSwitchCase(arg, "app")
{
settings->RemoteApplicationMode = TRUE;
fprintf(stderr, "--app -> /app: + program name or alias\n");
DEBUG_WARN( "--app -> /app: + program name or alias\n");
}
CommandLineSwitchCase(arg, "ext")
{
@ -588,7 +589,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "no-auth")
{
settings->Authentication = FALSE;
fprintf(stderr, "--no-auth -> -authentication\n");
DEBUG_WARN( "--no-auth -> -authentication\n");
}
CommandLineSwitchCase(arg, "authonly")
{
@ -602,12 +603,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
{
settings->FastPathInput = FALSE;
settings->FastPathOutput = FALSE;
fprintf(stderr, "--no-fastpath -> -fast-path\n");
DEBUG_WARN( "--no-fastpath -> -fast-path\n");
}
CommandLineSwitchCase(arg, "no-motion")
{
settings->MouseMotion = FALSE;
fprintf(stderr, "--no-motion -> -mouse-motion\n");
DEBUG_WARN( "--no-motion -> -mouse-motion\n");
}
CommandLineSwitchCase(arg, "gdi")
{
@ -616,26 +617,26 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
else if (strcmp(arg->Value, "hw") == 0)
settings->SoftwareGdi = FALSE;
fprintf(stderr, "--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "--gdi %s -> /gdi:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "no-osb")
{
settings->OffscreenSupportLevel = FALSE;
fprintf(stderr, "--no-osb -> -offscreen-cache\n");
DEBUG_WARN( "--no-osb -> -offscreen-cache\n");
}
CommandLineSwitchCase(arg, "no-bmp-cache")
{
settings->BitmapCacheEnabled = FALSE;
fprintf(stderr, "--no-bmp-cache -> -bitmap-cache\n");
DEBUG_WARN( "--no-bmp-cache -> -bitmap-cache\n");
}
CommandLineSwitchCase(arg, "plugin")
{
fprintf(stderr, "--plugin -> /a, /vc, /dvc and channel-specific options\n");
DEBUG_WARN( "--plugin -> /a, /vc, /dvc and channel-specific options\n");
}
CommandLineSwitchCase(arg, "rfx")
{
settings->RemoteFxCodec = TRUE;
fprintf(stderr, "--rfx -> /rfx\n");
DEBUG_WARN( "--rfx -> /rfx\n");
}
CommandLineSwitchCase(arg, "rfx-mode")
{
@ -644,37 +645,37 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
else if (arg->Value[0] == 'i')
settings->RemoteFxCodecMode = 0x02;
fprintf(stderr, "--rfx-mode -> /rfx-mode:%s\n", settings->RemoteFxCodecMode ? "image" : "video");
DEBUG_WARN( "--rfx-mode -> /rfx-mode:%s\n", settings->RemoteFxCodecMode ? "image" : "video");
}
CommandLineSwitchCase(arg, "nsc")
{
settings->NSCodec = TRUE;
fprintf(stderr, "--nsc -> /nsc\n");
DEBUG_WARN( "--nsc -> /nsc\n");
}
CommandLineSwitchCase(arg, "disable-wallpaper")
{
settings->DisableWallpaper = TRUE;
fprintf(stderr, "--disable-wallpaper -> -wallpaper\n");
DEBUG_WARN( "--disable-wallpaper -> -wallpaper\n");
}
CommandLineSwitchCase(arg, "composition")
{
settings->AllowDesktopComposition = TRUE;
fprintf(stderr, "--composition -> +composition\n");
DEBUG_WARN( "--composition -> +composition\n");
}
CommandLineSwitchCase(arg, "disable-full-window-drag")
{
settings->DisableFullWindowDrag = TRUE;
fprintf(stderr, "--disable-full-window-drag -> -window-drag\n");
DEBUG_WARN( "--disable-full-window-drag -> -window-drag\n");
}
CommandLineSwitchCase(arg, "disable-menu-animations")
{
settings->DisableMenuAnims = TRUE;
fprintf(stderr, "--disable-menu-animations -> -menu-anims\n");
DEBUG_WARN( "--disable-menu-animations -> -menu-anims\n");
}
CommandLineSwitchCase(arg, "disable-theming")
{
settings->DisableThemes = TRUE;
fprintf(stderr, "--disable-theming -> -themes\n");
DEBUG_WARN( "--disable-theming -> -themes\n");
}
CommandLineSwitchCase(arg, "ntlm")
{
@ -683,7 +684,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
CommandLineSwitchCase(arg, "ignore-certificate")
{
settings->IgnoreCertificate = TRUE;
fprintf(stderr, "--ignore-certificate -> /cert-ignore\n");
DEBUG_WARN( "--ignore-certificate -> /cert-ignore\n");
}
CommandLineSwitchCase(arg, "sec")
{
@ -709,22 +710,22 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
settings->NlaSecurity = TRUE;
}
fprintf(stderr, "--sec %s -> /sec:%s\n", arg->Value, arg->Value);
DEBUG_WARN( "--sec %s -> /sec:%s\n", arg->Value, arg->Value);
}
CommandLineSwitchCase(arg, "no-rdp")
{
settings->RdpSecurity = FALSE;
fprintf(stderr, "--no-rdp -> -sec-rdp\n");
DEBUG_WARN( "--no-rdp -> -sec-rdp\n");
}
CommandLineSwitchCase(arg, "no-tls")
{
settings->TlsSecurity = FALSE;
fprintf(stderr, "--no-tls -> -sec-tls\n");
DEBUG_WARN( "--no-tls -> -sec-tls\n");
}
CommandLineSwitchCase(arg, "no-nla")
{
settings->NlaSecurity = FALSE;
fprintf(stderr, "--no-nla -> -sec-nla\n");
DEBUG_WARN( "--no-nla -> -sec-nla\n");
}
CommandLineSwitchCase(arg, "secure-checksum")
{
@ -739,12 +740,12 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
}
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
fprintf(stderr, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
DEBUG_WARN( "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname);
if (settings->ServerPort != 3389)
fprintf(stderr, " /port:%d", settings->ServerPort);
DEBUG_WARN( " /port:%d", settings->ServerPort);
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
return 1;
}

View File

@ -21,6 +21,7 @@
#include "config.h"
#endif
#include <freerdp/utils/debug.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
@ -54,7 +55,7 @@ BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name, int va
BOOL bStandard = TRUE;
#ifdef DEBUG_CLIENT_FILE
fprintf(stderr, "%s:i:%d\n", name, value);
DEBUG_WARN( "%s:i:%d\n", name, value);
#endif
if (_stricmp(name, "use multimon") == 0)
@ -240,7 +241,7 @@ BOOL freerdp_client_rdp_file_set_string(rdpFile* file, const char* name, const c
BOOL bStandard = TRUE;
#ifdef DEBUG_CLIENT_FILE
fprintf(stderr, "%s:s:%s\n", name, value);
DEBUG_WARN( "%s:s:%s\n", name, value);
#endif
if (_stricmp(name, "username") == 0)
@ -665,7 +666,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
if (length < 0)
{
fprintf(stderr, "freerdp_client_write_rdp_file: error determining buffer size.\n");
DEBUG_WARN( "freerdp_client_write_rdp_file: error determining buffer size.\n");
return FALSE;
}
@ -673,7 +674,7 @@ BOOL freerdp_client_write_rdp_file(const rdpFile* file, const char* name, BOOL u
if (freerdp_client_write_rdp_file_buffer(file, buffer, length + 1) != length)
{
fprintf(stderr, "freerdp_client_write_rdp_file: error writing to output buffer\n");
DEBUG_WARN( "freerdp_client_write_rdp_file: error writing to output buffer\n");
free(buffer);
return FALSE;
}

View File

@ -0,0 +1,58 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Channel log defines
*
* Copyright 2014 Armin Novak <armin.novak@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FREERDP_CHANNELS_LOG_H
#define FREERDP_CHANNELS_LOG_H
#include <winpr/wlog.h>
#define CLOG_PRINT(level, file, fkt, line, dbg_str, fmt, ...) \
do { \
char tag[1024]; \
wLogMessage msg; \
wLog *log; \
\
strcat(tag, "com.freerdp.channels."); \
strcat(tag, dbg_str); \
log = WLog_Get(tag); \
\
msg.Type = WLOG_MESSAGE_TEXT; \
msg.Level = level; \
msg.FormatString = fmt; \
msg.LineNumber = line; \
msg.FileName = file; \
msg.FunctionName = fkt; \
WLog_PrintMessage(log, &msg, ##__VA_ARGS__); \
} while (0 )
#define CLOG_NULL(fmt, ...) do { } while (0)
#define CLOG_CLASS(_dbg_class, fmt, ...) CLOG_PRINT(WLOG_ERROR, __FILE__, \
__FUNCTION__, __LINE__, #_dbg_class, fmt, ## __VA_ARGS__)
#define CLOG_DBG(fmt, ...) CLOG_PRINT(WLOG_DEBUG, __FILE__, __FUNCTION__, \
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#define CLOG_INFO(fmt, ...) CLOG_PRINT(WLOG_INFO, __FILE__, __FUNCTION__, \
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#define CLOG_WARN(fmt, ...) CLOG_PRINT(WLOG_WARN, __FILE__, __FUNCTION__, \
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#define CLOG_ERR(fmt, ...) CLOG_PRINT(WLOG_ERROR, __FILE__, __FUNCTION__, \
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#define CLOG_FATAL(fmt, ...) CLOG_PRINT(WLOG_FATAL, __FILE__, __FUNCTION__, \
__LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
#endif /* FREERDP_UTILS_DEBUG_H */

View File

@ -20,41 +20,28 @@
#ifndef FREERDP_UTILS_DEBUG_H
#define FREERDP_UTILS_DEBUG_H
#include <winpr/wlog.h>
#define DEBUG_PRINT(level, file, fkt, line, dbg_str, fmt, ...) \
do { \
wLog *log = WLog_Get("com.freerdp." dbg_str); \
wLogMessage msg; \
\
msg.Type = WLOG_MESSAGE_TEXT; \
msg.Level = level; \
msg.FormatString = fmt; \
msg.LineNumber = line; \
msg.FileName = file; \
msg.FunctionName = fkt; \
WLog_PrintMessage(log, &msg, ##__VA_ARGS__); \
} while (0 )
#define DEBUG_NULL(fmt, ...) do { } while (0)
/* When building for android redirect all debug messages
* to logcat. */
#if defined(ANDROID)
#include <android/log.h>
#define APP_NAME "freerdp-debug"
#define ANDROID_DEBUG_PRINT(_dbg_str, fmt, ...) do { \
__android_log_print(_dbg_str, fmt, ##__VA_ARGS__); \
} while( 0 )
#define DEBUG_CLASS(_dbg_class, fmt, ...) \
ANDROID_DEBUG_PRINT(ANDROID_LOG_DEBUG, APP_NAME, \
"DBG_" #_dbg_class " %s (%s:%d): " \
fmt, __FUNCTION__, __FILE__, __LINE__, ## __VA_ARGS__)
#define DEBUG_WARN(fmt, ...) \
ANDROID_DEBUG_PRINT(ANDROID_LOG_WARN, APP_NAME, "Warning %s (%s:%d): " \
fmt, __FUNCTION__, __FILE__, __LINE__, ## __VA_ARGS__)
#else
/* By default all log messages are written to stdout */
#include <stdio.h>
#define DEBUG_PRINT(_dbg_str, fmt, ...) do { \
fprintf(stderr, _dbg_str, __FUNCTION__, __FILE__, __LINE__); \
fprintf(stderr, fmt, ## __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while( 0 )
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT("DBG_" #_dbg_class " %s (%s:%d): ", fmt, ## __VA_ARGS__)
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT("Warning %s (%s:%d): ", fmt, ## __VA_ARGS__)
#endif
#define DEBUG_CLASS(_dbg_class, fmt, ...) DEBUG_PRINT(WLOG_ERROR, __FILE__, \
__FUNCTION__, __LINE__, #_dbg_class, fmt, ## __VA_ARGS__)
#define DEBUG_MSG(fmt, ...) DEBUG_PRINT(WLOG_DEBUG, __FILE__, __FUNCTION__, \
__LINE__, "freerdp", fmt, ## __VA_ARGS__)
#define DEBUG_WARN(fmt, ...) DEBUG_PRINT(WLOG_ERROR, __FILE__, __FUNCTION__, \
__LINE__, "freerdp", fmt, ## __VA_ARGS__)
#endif /* FREERDP_UTILS_DEBUG_H */

View File

@ -29,6 +29,7 @@
#include <freerdp/constants.h>
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/bitmap.h>
void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
@ -222,7 +223,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index
if (id > bitmapCache->maxCells)
{
fprintf(stderr, "get invalid bitmap cell id: %d\n", id);
DEBUG_WARN( "get invalid bitmap cell id: %d\n", id);
return NULL;
}
@ -232,7 +233,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index
}
else if (index > bitmapCache->cells[id].number)
{
fprintf(stderr, "get invalid bitmap index %d in cell id: %d\n", index, id);
DEBUG_WARN( "get invalid bitmap index %d in cell id: %d\n", index, id);
return NULL;
}
@ -245,7 +246,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, rdpB
{
if (id > bitmapCache->maxCells)
{
fprintf(stderr, "put invalid bitmap cell id: %d\n", id);
DEBUG_WARN( "put invalid bitmap cell id: %d\n", id);
return;
}
@ -255,7 +256,7 @@ void bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, rdpB
}
else if (index > bitmapCache->cells[id].number)
{
fprintf(stderr, "put invalid bitmap index %d in cell id: %d\n", index, id);
DEBUG_WARN( "put invalid bitmap index %d in cell id: %d\n", index, id);
return;
}

View File

@ -28,6 +28,7 @@
#include <freerdp/freerdp.h>
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/brush.h>
void update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
@ -100,7 +101,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
{
if (index >= brushCache->maxMonoEntries)
{
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -111,7 +112,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
{
if (index >= brushCache->maxEntries)
{
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -121,7 +122,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp)
if (entry == NULL)
{
fprintf(stderr, "invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
DEBUG_WARN( "invalid brush (%d bpp) at index: 0x%04X\n", *bpp, index);
return NULL;
}
@ -136,7 +137,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3
{
if (index >= brushCache->maxMonoEntries)
{
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
if (entry)
free(entry);
@ -156,7 +157,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3
{
if (index >= brushCache->maxEntries)
{
fprintf(stderr, "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
DEBUG_WARN( "invalid brush (%d bpp) index: 0x%04X\n", bpp, index);
if (entry)
free(entry);

View File

@ -28,6 +28,7 @@
#include <freerdp/freerdp.h>
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/glyph.h>
void update_process_glyph(rdpContext* context, BYTE* data, int* index,
@ -367,20 +368,20 @@ rdpGlyph* glyph_cache_get(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index)
if (id > 9)
{
fprintf(stderr, "invalid glyph cache id: %d\n", id);
DEBUG_WARN( "invalid glyph cache id: %d\n", id);
return NULL;
}
if (index > glyphCache->glyphCache[id].number)
{
fprintf(stderr, "index %d out of range for cache id: %d\n", index, id);
DEBUG_WARN( "index %d out of range for cache id: %d\n", index, id);
return NULL;
}
glyph = glyphCache->glyphCache[id].entries[index];
if (!glyph)
fprintf(stderr, "no glyph found at cache index: %d in cache id: %d\n", index, id);
DEBUG_WARN( "no glyph found at cache index: %d in cache id: %d\n", index, id);
return glyph;
}
@ -391,13 +392,13 @@ void glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyp
if (id > 9)
{
fprintf(stderr, "invalid glyph cache id: %d\n", id);
DEBUG_WARN( "invalid glyph cache id: %d\n", id);
return;
}
if (index > glyphCache->glyphCache[id].number)
{
fprintf(stderr, "invalid glyph cache index: %d in cache id: %d\n", index, id);
DEBUG_WARN( "invalid glyph cache index: %d in cache id: %d\n", index, id);
return;
}
@ -423,7 +424,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UINT32*
if (index > 255)
{
fprintf(stderr, "invalid glyph cache fragment index: %d\n", index);
DEBUG_WARN( "invalid glyph cache fragment index: %d\n", index);
return NULL;
}
@ -433,7 +434,7 @@ void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, UINT32*
WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheFragmentGet: index: %d size: %d", index, *size);
if (!fragment)
fprintf(stderr, "invalid glyph fragment at index:%d\n", index);
DEBUG_WARN( "invalid glyph fragment at index:%d\n", index);
return fragment;
}
@ -444,7 +445,7 @@ void glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, UINT32 si
if (index > 255)
{
fprintf(stderr, "invalid glyph cache fragment index: %d\n", index);
DEBUG_WARN( "invalid glyph cache fragment index: %d\n", index);
return;
}

View File

@ -29,6 +29,7 @@
#include <freerdp/freerdp.h>
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/nine_grid.h>
void update_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid)
@ -60,7 +61,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
if (index >= nine_grid->maxEntries)
{
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
DEBUG_WARN( "invalid NineGrid index: 0x%04X\n", index);
return NULL;
}
@ -68,7 +69,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index)
if (entry == NULL)
{
fprintf(stderr, "invalid NineGrid at index: 0x%04X\n", index);
DEBUG_WARN( "invalid NineGrid at index: 0x%04X\n", index);
return NULL;
}
@ -81,7 +82,7 @@ void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry)
if (index >= nine_grid->maxEntries)
{
fprintf(stderr, "invalid NineGrid index: 0x%04X\n", index);
DEBUG_WARN( "invalid NineGrid index: 0x%04X\n", index);
return;
}

View File

@ -27,6 +27,7 @@
#include <winpr/stream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/offscreen.h>
void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap)
@ -80,7 +81,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index)
if (index >= offscreenCache->maxEntries)
{
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
DEBUG_WARN( "invalid offscreen bitmap index: 0x%04X\n", index);
return NULL;
}
@ -88,7 +89,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index)
if (!bitmap)
{
fprintf(stderr, "invalid offscreen bitmap at index: 0x%04X\n", index);
DEBUG_WARN( "invalid offscreen bitmap at index: 0x%04X\n", index);
return NULL;
}
@ -99,7 +100,7 @@ void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, rdpBit
{
if (index >= offscreenCache->maxEntries)
{
fprintf(stderr, "invalid offscreen bitmap index: 0x%04X\n", index);
DEBUG_WARN( "invalid offscreen bitmap index: 0x%04X\n", index);
return;
}
@ -113,7 +114,7 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreenCache, UINT32 index)
if (index >= offscreenCache->maxEntries)
{
fprintf(stderr, "invalid offscreen bitmap index (delete): 0x%04X\n", index);
DEBUG_WARN( "invalid offscreen bitmap index (delete): 0x%04X\n", index);
return;
}

View File

@ -25,6 +25,7 @@
#include <winpr/crt.h>
#include <freerdp/utils/debug.h>
#include <freerdp/cache/palette.h>
static void update_gdi_cache_color_table(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cacheColorTable)
@ -44,7 +45,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index)
if (index >= paletteCache->maxEntries)
{
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
DEBUG_WARN( "invalid color table index: 0x%04X\n", index);
return NULL;
}
@ -52,7 +53,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index)
if (!entry)
{
fprintf(stderr, "invalid color table at index: 0x%04X\n", index);
DEBUG_WARN( "invalid color table at index: 0x%04X\n", index);
return NULL;
}
@ -63,7 +64,7 @@ void palette_cache_put(rdpPaletteCache* paletteCache, UINT32 index, void* entry)
{
if (index >= paletteCache->maxEntries)
{
fprintf(stderr, "invalid color table index: 0x%04X\n", index);
DEBUG_WARN( "invalid color table index: 0x%04X\n", index);
if (entry)
free(entry);

View File

@ -28,6 +28,7 @@
#include <winpr/stream.h>
#include <freerdp/cache/pointer.h>
#include <freerdp/utils/debug.h>
void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position)
{
@ -47,7 +48,7 @@ void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_s
break;
default:
fprintf(stderr, "Unknown system pointer type (0x%08X)\n", pointer_system->type);
DEBUG_WARN( "Unknown system pointer type (0x%08X)\n", pointer_system->type);
break;
}
}
@ -140,7 +141,7 @@ rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index)
if (index >= pointer_cache->cacheSize)
{
fprintf(stderr, "invalid pointer index:%d\n", index);
DEBUG_WARN( "invalid pointer index:%d\n", index);
return NULL;
}
@ -155,7 +156,7 @@ void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer*
if (index >= pointer_cache->cacheSize)
{
fprintf(stderr, "invalid pointer index:%d\n", index);
DEBUG_WARN( "invalid pointer index:%d\n", index);
return;
}

View File

@ -23,6 +23,7 @@
#include <winpr/crt.h>
#include <freerdp/utils/debug.h>
#include <freerdp/codec/audio.h>
UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size)
@ -57,12 +58,12 @@ UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size)
}
else
{
fprintf(stderr, "rdpsnd_compute_audio_time_length: invalid WAVE_FORMAT_GSM610 format\n");
DEBUG_WARN( "rdpsnd_compute_audio_time_length: invalid WAVE_FORMAT_GSM610 format\n");
}
}
else
{
fprintf(stderr, "rdpsnd_compute_audio_time_length: unknown format %d\n", format->wFormatTag);
DEBUG_WARN( "rdpsnd_compute_audio_time_length: unknown format %d\n", format->wFormatTag);
}
}
@ -109,7 +110,7 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag)
void rdpsnd_print_audio_format(AUDIO_FORMAT* format)
{
fprintf(stderr, "%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d "
DEBUG_WARN( "%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,
@ -123,17 +124,17 @@ void rdpsnd_print_audio_formats(AUDIO_FORMAT* formats, UINT16 count)
if (formats)
{
fprintf(stderr, "AUDIO_FORMATS (%d) =\n{\n", count);
DEBUG_WARN( "AUDIO_FORMATS (%d) =\n{\n", count);
for (index = 0; index < (int) count; index++)
{
format = &formats[index];
fprintf(stderr, "\t");
DEBUG_WARN( "\t");
rdpsnd_print_audio_format(format);
}
fprintf(stderr, "}\n");
DEBUG_WARN( "}\n");
}
}

View File

@ -163,7 +163,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
subcodecByteCount = *((UINT32*) &pSrcData[offset + 8]);
offset += 12;
//printf("residualByteCount: %d bandsByteCount: %d subcodecByteCount: %d\n",
//DEBUG_MSG("residualByteCount: %d bandsByteCount: %d subcodecByteCount: %d\n",
// residualByteCount, bandsByteCount, subcodecByteCount);
if (residualByteCount > 0)
@ -528,7 +528,7 @@ int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize,
subcodecId = subcodecs[suboffset + 12];
suboffset += 13;
//printf("bitmapDataByteCount: %d subcodecByteCount: %d suboffset: %d subCodecId: %d\n",
//DEBUG_MSG("bitmapDataByteCount: %d subcodecByteCount: %d suboffset: %d subCodecId: %d\n",
// bitmapDataByteCount, subcodecByteCount, suboffset, subcodecId);
if ((subcodecByteCount - suboffset) < bitmapDataByteCount)

View File

@ -174,7 +174,7 @@ int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
return -1;
#if 0
printf("h264_decompress: pSrcData=%p, SrcSize=%u, pDstData=%p, DstFormat=%lx, nDstStep=%d, nXDst=%d, nYDst=%d, nWidth=%d, nHeight=%d)\n",
DEBUG_MSG("h264_decompress: pSrcData=%p, SrcSize=%u, pDstData=%p, DstFormat=%lx, nDstStep=%d, nXDst=%d, nYDst=%d, nWidth=%d, nHeight=%d)\n",
pSrcData, SrcSize, *ppDstData, DstFormat, nDstStep, nXDst, nYDst, nWidth, nHeight);
#endif
@ -217,7 +217,7 @@ int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
pSystemBuffer = &sBufferInfo.UsrData.sSystemBuffer;
#if 0
printf("h264_decompress: state=%u, pYUVData=[%p,%p,%p], bufferStatus=%d, width=%d, height=%d, format=%d, stride=[%d,%d]\n",
DEBUG_MSG("h264_decompress: state=%u, pYUVData=[%p,%p,%p], bufferStatus=%d, width=%d, height=%d, format=%d, stride=[%d,%d]\n",
state, pYUVData[0], pYUVData[1], pYUVData[2], sBufferInfo.iBufferStatus,
pSystemBuffer->iWidth, pSystemBuffer->iHeight, pSystemBuffer->iFormat,
pSystemBuffer->iStride[0], pSystemBuffer->iStride[1]);
@ -311,7 +311,7 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
if (!h264->pDecoder)
{
printf("Failed to create OpenH264 decoder\n");
DEBUG_MSG("Failed to create OpenH264 decoder\n");
goto EXCEPTION;
}
@ -320,14 +320,14 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
status = (*h264->pDecoder)->Initialize(h264->pDecoder, &sDecParam);
if (status != 0)
{
printf("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
DEBUG_MSG("Failed to initialize OpenH264 decoder (status=%ld)\n", status);
goto EXCEPTION;
}
status = (*h264->pDecoder)->SetOption(h264->pDecoder, DECODER_OPTION_DATAFORMAT, &videoFormat);
if (status != 0)
{
printf("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
DEBUG_MSG("Failed to set data format option on OpenH264 decoder (status=%ld)\n", status);
}
}
#endif

View File

@ -413,7 +413,7 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p
}
#ifdef DEBUG_MPPC
printf("<%d,%d>\n", (int) CopyOffset, (int) LengthOfMatch);
DEBUG_MSG("<%d,%d>\n", (int) CopyOffset, (int) LengthOfMatch);
#endif
SrcPtr = HistoryPtr - CopyOffset;
@ -555,7 +555,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
accumulator = Sym1;
#ifdef DEBUG_MPPC
printf("%c", accumulator);
DEBUG_MSG("%c", accumulator);
#endif
if (accumulator < 0x80)
@ -589,7 +589,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
}
#ifdef DEBUG_MPPC
printf("<%d,%d>", (int) CopyOffset, (int) LengthOfMatch);
DEBUG_MSG("<%d,%d>", (int) CopyOffset, (int) LengthOfMatch);
#endif
/* Encode CopyOffset */
@ -764,7 +764,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
accumulator = *pSrcPtr;
#ifdef DEBUG_MPPC
printf("%c", accumulator);
DEBUG_MSG("%c", accumulator);
#endif
if (accumulator < 0x80)
@ -799,7 +799,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD
mppc->HistoryOffset = HistoryPtr - HistoryBuffer;
#ifdef DEBUG_MPPC
printf("\n");
DEBUG_MSG("\n");
#endif
return 1;

View File

@ -25,6 +25,7 @@
#include <winpr/print.h>
#include <winpr/bitstream.h>
#include <freerdp/utils/debug.h>
#include <freerdp/codec/ncrush.h>
UINT16 HuffTableLEC[8192] =
@ -1847,7 +1848,7 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY
if (HistoryPtr >= HistoryBufferEnd)
{
fprintf(stderr, "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)\n",
DEBUG_WARN( "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)\n",
HistoryPtr, HistoryBufferEnd);
return -1003;
}
@ -2021,7 +2022,7 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY
if (ncrush->HistoryBufferFence != 0xABABABAB)
{
fprintf(stderr, "NCrushDecompress: history buffer fence was overwritten, potential buffer overflow detected!\n");
DEBUG_WARN( "NCrushDecompress: history buffer fence was overwritten, potential buffer overflow detected!\n");
return -1007;
}
@ -2695,7 +2696,7 @@ NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor)
ncrush->HistoryPtr = &(ncrush->HistoryBuffer[ncrush->HistoryOffset]);
if (ncrush_generate_tables(ncrush) < 0)
printf("ncrush_context_new: failed to initialize tables\n");
DEBUG_MSG("ncrush_context_new: failed to initialize tables\n");
ncrush_context_reset(ncrush, FALSE);
}

View File

@ -24,6 +24,7 @@
#include <winpr/crt.h>
#include <winpr/print.h>
#include <freerdp/utils/debug.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/primitives.h>
@ -75,7 +76,7 @@ static int planar_decompress_plane_rle(BYTE* pSrcData, UINT32 SrcSize, BYTE* pDs
if ((srcp - pSrcData) > SrcSize)
{
fprintf(stderr, "planar_decompress_plane_rle: error reading input buffer\n");
DEBUG_WARN( "planar_decompress_plane_rle: error reading input buffer\n");
return -1;
}
@ -95,7 +96,7 @@ static int planar_decompress_plane_rle(BYTE* pSrcData, UINT32 SrcSize, BYTE* pDs
if (((dstp + (cRawBytes + nRunLength)) - currentScanline) > nWidth * 4)
{
fprintf(stderr, "planar_decompress_plane_rle: too many pixels in scanline\n");
DEBUG_WARN( "planar_decompress_plane_rle: too many pixels in scanline\n");
return -1;
}
@ -335,7 +336,7 @@ int planar_decompress(BITMAP_PLANAR_CONTEXT* planar, BYTE* pSrcData, UINT32 SrcS
{
static BOOL been_warned = FALSE;
if (!been_warned)
fprintf(stderr, "Chroma-Subsampling is not implemented.\n");
DEBUG_WARN( "Chroma-Subsampling is not implemented.\n");
been_warned = TRUE;
}
else
@ -781,7 +782,7 @@ BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, BYTE* data,
context->rlePlanes[3] = &context->rlePlanesBuffer[offset];
offset += dstSizes[3];
//printf("R: [%d/%d] G: [%d/%d] B: [%d/%d]\n",
//DEBUG_MSG("R: [%d/%d] G: [%d/%d] B: [%d/%d]\n",
// dstSizes[1], planeSize, dstSizes[2], planeSize, dstSizes[3], planeSize);
}
}

View File

@ -19,6 +19,7 @@
#include <assert.h>
#include <winpr/memory.h>
#include <freerdp/utils/debug.h>
#include <freerdp/codec/region.h>
/*
@ -219,20 +220,20 @@ void region16_print(const REGION16 *region)
int currentBandY = -1;
rects = region16_rects(region, &nbRects);
fprintf(stderr, "nrects=%d", nbRects);
DEBUG_WARN( "nrects=%d", nbRects);
for (i = 0; i < nbRects; i++, rects++)
{
if (rects->top != currentBandY)
{
currentBandY = rects->top;
fprintf(stderr, "\nband %d: ", currentBandY);
DEBUG_WARN( "\nband %d: ", currentBandY);
}
fprintf(stderr, "(%d,%d-%d,%d)", rects->left, rects->top, rects->right, rects->bottom);
DEBUG_WARN( "(%d,%d-%d,%d)", rects->left, rects->top, rects->right, rects->bottom);
}
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
}
void region16_copy_band_with_union(RECTANGLE_16 *dst,

View File

@ -378,7 +378,7 @@ void rfx_context_free(RFX_CONTEXT* context)
free(priv->tileWorkParams);
#ifdef WITH_PROFILER
fprintf(stderr, "\nWARNING: Profiling results probably unusable with multithreaded RemoteFX codec!\n");
DEBUG_WARN( "\nWARNING: Profiling results probably unusable with multithreaded RemoteFX codec!\n");
#endif
}
@ -1428,7 +1428,7 @@ out_clean_tiles:
free(message->tiles);
region16_uninit(&tilesRegion);
out_free_message:
fprintf(stderr, "remoteFx error\n");
DEBUG_WARN( "remoteFx error\n");
region16_uninit(&rectsRegion);
free(message);
return 0;

View File

@ -990,7 +990,7 @@ int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE
OriginalData[1] = (BYTE) Level2ComprFlags;
#if 0
printf("XCrushCompress: Level1ComprFlags: %s Level2ComprFlags: %s\n",
DEBUG_MSG("XCrushCompress: Level1ComprFlags: %s Level2ComprFlags: %s\n",
xcrush_get_level_1_compression_flags_string(Level1ComprFlags),
xcrush_get_level_2_compression_flags_string(Level2ComprFlags));
#endif

View File

@ -34,6 +34,7 @@
#include <openssl/rand.h>
#include <openssl/engine.h>
#include <freerdp/utils/debug.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
@ -426,7 +427,7 @@ BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* pas
if (!status)
{
fprintf(stderr, "EVP_CipherInit_ex failure\n");
DEBUG_WARN( "EVP_CipherInit_ex failure\n");
return NULL;
}
@ -434,7 +435,7 @@ BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* pas
if (!status)
{
fprintf(stderr, "EVP_CipherInit_ex failure\n");
DEBUG_WARN( "EVP_CipherInit_ex failure\n");
return NULL;
}
@ -445,7 +446,7 @@ BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* pas
if (!status)
{
fprintf(stderr, "EVP_CipherUpdate failure\n");
DEBUG_WARN( "EVP_CipherUpdate failure\n");
return NULL;
}
@ -453,7 +454,7 @@ BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* pas
if (!status)
{
fprintf(stderr, "EVP_CipherFinal_ex failure\n");
DEBUG_WARN( "EVP_CipherFinal_ex failure\n");
return NULL;
}
@ -534,7 +535,7 @@ int freerdp_assistance_decrypt2(rdpAssistanceFile* file, const char* password)
if (status != 1)
{
fprintf(stderr, "EVP_DecryptFinal_ex failure\n");
DEBUG_WARN( "EVP_DecryptFinal_ex failure\n");
return -1;
}
@ -557,7 +558,7 @@ int freerdp_assistance_decrypt2(rdpAssistanceFile* file, const char* password)
status = freerdp_assistance_parse_connection_string2(file);
printf("freerdp_assistance_parse_connection_string2: %d\n", status);
DEBUG_MSG("freerdp_assistance_parse_connection_string2: %d\n", status);
return 1;
}
@ -873,7 +874,7 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu
if (status < 0)
{
fprintf(stderr, "freerdp_assistance_parse_connection_string1 failure: %d\n", status);
DEBUG_WARN( "freerdp_assistance_parse_connection_string1 failure: %d\n", status);
return -1;
}

View File

@ -29,6 +29,7 @@
#include <freerdp/settings.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/debug.h>
int freerdp_addin_set_argument(ADDIN_ARGV* args, char* argument)
{
@ -339,7 +340,7 @@ out_parallel_name_error:
}
fprintf(stderr, "%s: unknown device type %d\n", __FUNCTION__, device->Type);
DEBUG_WARN( "%s: unknown device type %d\n", __FUNCTION__, device->Type);
return NULL;
}
@ -1028,7 +1029,7 @@ BOOL freerdp_get_param_bool(rdpSettings* settings, int id)
return settings->RedirectClipboard;
default:
fprintf(stderr, "freerdp_get_param_bool: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_bool: unknown id: %d\n", id);
return -1;
}
}
@ -1534,7 +1535,7 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)
break;
default:
fprintf(stderr, "freerdp_set_param_bool: unknown id %d (param = %d)\n", id, param);
DEBUG_WARN( "freerdp_set_param_bool: unknown id %d (param = %d)\n", id, param);
return -1;
}
@ -1555,7 +1556,7 @@ int freerdp_get_param_int(rdpSettings* settings, int id)
return settings->YPan;
default:
fprintf(stderr, "freerdp_get_param_int: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_int: unknown id: %d\n", id);
return 0;
}
}
@ -1573,7 +1574,7 @@ int freerdp_set_param_int(rdpSettings* settings, int id, int param)
break;
default:
fprintf(stderr, "freerdp_set_param_int: unknown id %d (param = %d)\n", id, param);
DEBUG_WARN( "freerdp_set_param_int: unknown id %d (param = %d)\n", id, param);
return -1;
}
@ -1809,7 +1810,7 @@ UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)
return settings->DynamicChannelArraySize;
default:
fprintf(stderr, "freerdp_get_param_uint32: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_uint32: unknown id: %d\n", id);
return 0;
}
}
@ -2115,7 +2116,7 @@ int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param)
break;
default:
fprintf(stderr, "freerdp_set_param_uint32: unknown id %d (param = %u)\n", id, param);
DEBUG_WARN( "freerdp_set_param_uint32: unknown id %d (param = %u)\n", id, param);
return -1;
}
@ -2133,7 +2134,7 @@ UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id)
return settings->ParentWindowId;
default:
fprintf(stderr, "freerdp_get_param_uint64: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_uint64: unknown id: %d\n", id);
return -1;
}
}
@ -2147,7 +2148,7 @@ int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param)
break;
default:
fprintf(stderr, "freerdp_set_param_uint64: unknown id %d (param = %u)\n", id, (UINT32) param);
DEBUG_WARN( "freerdp_set_param_uint64: unknown id %d (param = %u)\n", id, (UINT32) param);
return -1;
}
@ -2297,7 +2298,7 @@ char* freerdp_get_param_string(rdpSettings* settings, int id)
return settings->DrivesToRedirect;
default:
fprintf(stderr, "freerdp_get_param_string: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_string: unknown id: %d\n", id);
return NULL;
}
}
@ -2532,7 +2533,7 @@ int freerdp_set_param_string(rdpSettings* settings, int id, const char* param)
break;
default:
fprintf(stderr, "freerdp_set_param_string: unknown id %d (param = %s)\n", id, param);
DEBUG_WARN( "freerdp_set_param_string: unknown id %d (param = %s)\n", id, param);
return -1;
}
@ -2550,7 +2551,7 @@ double freerdp_get_param_double(rdpSettings* settings, int id)
return settings->ScalingFactor;
default:
fprintf(stderr, "freerdp_get_param_double: unknown id: %d\n", id);
DEBUG_WARN( "freerdp_get_param_double: unknown id: %d\n", id);
return 0;
}
}

View File

@ -85,25 +85,25 @@ int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE**
if (status < 0)
{
printf("compression/decompression failure\n");
DEBUG_MSG("compression/decompression failure\n");
return status;
}
if (_DstSize != SrcSize)
{
printf("compression/decompression size mismatch: Actual: %d, Expected: %d\n", _DstSize, SrcSize);
DEBUG_MSG("compression/decompression size mismatch: Actual: %d, Expected: %d\n", _DstSize, SrcSize);
return -1;
}
if (memcmp(_pDstData, pSrcData, SrcSize) != 0)
{
printf("compression/decompression input/output mismatch! flags: 0x%04X\n", _Flags);
DEBUG_MSG("compression/decompression input/output mismatch! flags: 0x%04X\n", _Flags);
#if 1
printf("Actual:\n");
DEBUG_MSG("Actual:\n");
winpr_HexDump(_pDstData, SrcSize);
printf("Expected:\n");
DEBUG_MSG("Expected:\n");
winpr_HexDump(pSrcData, SrcSize);
#endif
@ -170,7 +170,7 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD
#ifdef WITH_BULK_DEBUG
{
printf("Decompress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)\n",
DEBUG_MSG("Decompress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)\n",
type, bulk_get_compression_flags_string(flags), flags,
CompressionRatio, CompressedBytes, UncompressedBytes,
metrics->TotalCompressionRatio, (UINT32) metrics->TotalCompressedBytes,
@ -180,7 +180,7 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD
}
else
{
fprintf(stderr, "Decompression failure!\n");
DEBUG_WARN( "Decompression failure!\n");
}
return status;
@ -237,7 +237,7 @@ int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstDat
#ifdef WITH_BULK_DEBUG
{
printf("Compress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)\n",
DEBUG_MSG("Compress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)\n",
bulk->CompressionLevel, bulk_get_compression_flags_string(*pFlags), *pFlags,
CompressionRatio, CompressedBytes, UncompressedBytes,
metrics->TotalCompressionRatio, (UINT32) metrics->TotalCompressedBytes,

View File

@ -262,7 +262,7 @@ BOOL rdp_print_general_capability_set(wStream* s, UINT16 length)
if (length < 24)
return FALSE;
fprintf(stderr, "GeneralCapabilitySet (length %d):\n", length);
DEBUG_WARN( "GeneralCapabilitySet (length %d):\n", length);
Stream_Read_UINT16(s, osMajorType); /* osMajorType (2 bytes) */
Stream_Read_UINT16(s, osMinorType); /* osMinorType (2 bytes) */
@ -276,17 +276,17 @@ BOOL rdp_print_general_capability_set(wStream* s, UINT16 length)
Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */
Stream_Read_UINT8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */
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);
DEBUG_WARN( "\tosMajorType: 0x%04X\n", osMajorType);
DEBUG_WARN( "\tosMinorType: 0x%04X\n", osMinorType);
DEBUG_WARN( "\tprotocolVersion: 0x%04X\n", protocolVersion);
DEBUG_WARN( "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
DEBUG_WARN( "\tgeneralCompressionTypes: 0x%04X\n", generalCompressionTypes);
DEBUG_WARN( "\textraFlags: 0x%04X\n", extraFlags);
DEBUG_WARN( "\tupdateCapabilityFlag: 0x%04X\n", updateCapabilityFlag);
DEBUG_WARN( "\tremoteUnshareFlag: 0x%04X\n", remoteUnshareFlag);
DEBUG_WARN( "\tgeneralCompressionLevel: 0x%04X\n", generalCompressionLevel);
DEBUG_WARN( "\trefreshRectSupport: 0x%02X\n", refreshRectSupport);
DEBUG_WARN( "\tsuppressOutputSupport: 0x%02X\n", suppressOutputSupport);
return TRUE;
}
@ -414,7 +414,7 @@ BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length)
UINT16 multipleRectangleSupport;
UINT16 pad2OctetsB;
fprintf(stderr, "BitmapCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCapabilitySet (length %d):\n", length);
if (length < 28)
return FALSE;
@ -433,19 +433,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) */
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);
DEBUG_WARN( "\tpreferredBitsPerPixel: 0x%04X\n", preferredBitsPerPixel);
DEBUG_WARN( "\treceive1BitPerPixel: 0x%04X\n", receive1BitPerPixel);
DEBUG_WARN( "\treceive4BitsPerPixel: 0x%04X\n", receive4BitsPerPixel);
DEBUG_WARN( "\treceive8BitsPerPixel: 0x%04X\n", receive8BitsPerPixel);
DEBUG_WARN( "\tdesktopWidth: 0x%04X\n", desktopWidth);
DEBUG_WARN( "\tdesktopHeight: 0x%04X\n", desktopHeight);
DEBUG_WARN( "\tpad2Octets: 0x%04X\n", pad2Octets);
DEBUG_WARN( "\tdesktopResizeFlag: 0x%04X\n", desktopResizeFlag);
DEBUG_WARN( "\tbitmapCompressionFlag: 0x%04X\n", bitmapCompressionFlag);
DEBUG_WARN( "\thighColorFlags: 0x%02X\n", highColorFlags);
DEBUG_WARN( "\tdrawingFlags: 0x%02X\n", drawingFlags);
DEBUG_WARN( "\tmultipleRectangleSupport: 0x%04X\n", multipleRectangleSupport);
DEBUG_WARN( "\tpad2OctetsB: 0x%04X\n", pad2OctetsB);
return TRUE;
}
@ -591,7 +591,7 @@ BOOL rdp_print_order_capability_set(wStream* s, UINT16 length)
UINT16 textANSICodePage;
UINT16 pad2OctetsE;
fprintf(stderr, "OrderCapabilitySet (length %d):\n", length);
DEBUG_WARN( "OrderCapabilitySet (length %d):\n", length);
if (length < 88)
return FALSE;
@ -614,56 +614,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) */
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);
DEBUG_WARN( "\tpad4OctetsA: 0x%08X\n", pad4OctetsA);
DEBUG_WARN( "\tdesktopSaveXGranularity: 0x%04X\n", desktopSaveXGranularity);
DEBUG_WARN( "\tdesktopSaveYGranularity: 0x%04X\n", desktopSaveYGranularity);
DEBUG_WARN( "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
DEBUG_WARN( "\tmaximumOrderLevel: 0x%04X\n", maximumOrderLevel);
DEBUG_WARN( "\tnumberFonts: 0x%04X\n", numberFonts);
DEBUG_WARN( "\torderFlags: 0x%04X\n", orderFlags);
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]);
DEBUG_WARN( "\torderSupport:\n");
DEBUG_WARN( "\t\tDSTBLT: %d\n", orderSupport[NEG_DSTBLT_INDEX]);
DEBUG_WARN( "\t\tPATBLT: %d\n", orderSupport[NEG_PATBLT_INDEX]);
DEBUG_WARN( "\t\tSCRBLT: %d\n", orderSupport[NEG_SCRBLT_INDEX]);
DEBUG_WARN( "\t\tMEMBLT: %d\n", orderSupport[NEG_MEMBLT_INDEX]);
DEBUG_WARN( "\t\tMEM3BLT: %d\n", orderSupport[NEG_MEM3BLT_INDEX]);
DEBUG_WARN( "\t\tATEXTOUT: %d\n", orderSupport[NEG_ATEXTOUT_INDEX]);
DEBUG_WARN( "\t\tAEXTTEXTOUT: %d\n", orderSupport[NEG_AEXTTEXTOUT_INDEX]);
DEBUG_WARN( "\t\tDRAWNINEGRID: %d\n", orderSupport[NEG_DRAWNINEGRID_INDEX]);
DEBUG_WARN( "\t\tLINETO: %d\n", orderSupport[NEG_LINETO_INDEX]);
DEBUG_WARN( "\t\tMULTI_DRAWNINEGRID: %d\n", orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]);
DEBUG_WARN( "\t\tOPAQUE_RECT: %d\n", orderSupport[NEG_OPAQUE_RECT_INDEX]);
DEBUG_WARN( "\t\tSAVEBITMAP: %d\n", orderSupport[NEG_SAVEBITMAP_INDEX]);
DEBUG_WARN( "\t\tWTEXTOUT: %d\n", orderSupport[NEG_WTEXTOUT_INDEX]);
DEBUG_WARN( "\t\tMEMBLT_V2: %d\n", orderSupport[NEG_MEMBLT_V2_INDEX]);
DEBUG_WARN( "\t\tMEM3BLT_V2: %d\n", orderSupport[NEG_MEM3BLT_V2_INDEX]);
DEBUG_WARN( "\t\tMULTIDSTBLT: %d\n", orderSupport[NEG_MULTIDSTBLT_INDEX]);
DEBUG_WARN( "\t\tMULTIPATBLT: %d\n", orderSupport[NEG_MULTIPATBLT_INDEX]);
DEBUG_WARN( "\t\tMULTISCRBLT: %d\n", orderSupport[NEG_MULTISCRBLT_INDEX]);
DEBUG_WARN( "\t\tMULTIOPAQUERECT: %d\n", orderSupport[NEG_MULTIOPAQUERECT_INDEX]);
DEBUG_WARN( "\t\tFAST_INDEX: %d\n", orderSupport[NEG_FAST_INDEX_INDEX]);
DEBUG_WARN( "\t\tPOLYGON_SC: %d\n", orderSupport[NEG_POLYGON_SC_INDEX]);
DEBUG_WARN( "\t\tPOLYGON_CB: %d\n", orderSupport[NEG_POLYGON_CB_INDEX]);
DEBUG_WARN( "\t\tPOLYLINE: %d\n", orderSupport[NEG_POLYLINE_INDEX]);
DEBUG_WARN( "\t\tUNUSED23: %d\n", orderSupport[NEG_UNUSED23_INDEX]);
DEBUG_WARN( "\t\tFAST_GLYPH: %d\n", orderSupport[NEG_FAST_GLYPH_INDEX]);
DEBUG_WARN( "\t\tELLIPSE_SC: %d\n", orderSupport[NEG_ELLIPSE_SC_INDEX]);
DEBUG_WARN( "\t\tELLIPSE_CB: %d\n", orderSupport[NEG_ELLIPSE_CB_INDEX]);
DEBUG_WARN( "\t\tGLYPH_INDEX: %d\n", orderSupport[NEG_GLYPH_INDEX_INDEX]);
DEBUG_WARN( "\t\tGLYPH_WEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]);
DEBUG_WARN( "\t\tGLYPH_WLONGTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]);
DEBUG_WARN( "\t\tGLYPH_WLONGEXTTEXTOUT: %d\n", orderSupport[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX]);
DEBUG_WARN( "\t\tUNUSED31: %d\n", orderSupport[NEG_UNUSED31_INDEX]);
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);
DEBUG_WARN( "\ttextFlags: 0x%04X\n", textFlags);
DEBUG_WARN( "\torderSupportExFlags: 0x%04X\n", orderSupportExFlags);
DEBUG_WARN( "\tpad4OctetsB: 0x%08X\n", pad4OctetsB);
DEBUG_WARN( "\tdesktopSaveSize: 0x%08X\n", desktopSaveSize);
DEBUG_WARN( "\tpad2OctetsC: 0x%04X\n", pad2OctetsC);
DEBUG_WARN( "\tpad2OctetsD: 0x%04X\n", pad2OctetsD);
DEBUG_WARN( "\ttextANSICodePage: 0x%04X\n", textANSICodePage);
DEBUG_WARN( "\tpad2OctetsE: 0x%04X\n", pad2OctetsE);
return TRUE;
}
@ -749,7 +749,7 @@ BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length)
UINT16 Cache2Entries;
UINT16 Cache2MaximumCellSize;
fprintf(stderr, "BitmapCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCacheCapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -767,18 +767,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) */
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);
DEBUG_WARN( "\tpad1: 0x%08X\n", pad1);
DEBUG_WARN( "\tpad2: 0x%08X\n", pad2);
DEBUG_WARN( "\tpad3: 0x%08X\n", pad3);
DEBUG_WARN( "\tpad4: 0x%08X\n", pad4);
DEBUG_WARN( "\tpad5: 0x%08X\n", pad5);
DEBUG_WARN( "\tpad6: 0x%08X\n", pad6);
DEBUG_WARN( "\tCache0Entries: 0x%04X\n", Cache0Entries);
DEBUG_WARN( "\tCache0MaximumCellSize: 0x%04X\n", Cache0MaximumCellSize);
DEBUG_WARN( "\tCache1Entries: 0x%04X\n", Cache1Entries);
DEBUG_WARN( "\tCache1MaximumCellSize: 0x%04X\n", Cache1MaximumCellSize);
DEBUG_WARN( "\tCache2Entries: 0x%04X\n", Cache2Entries);
DEBUG_WARN( "\tCache2MaximumCellSize: 0x%04X\n", Cache2MaximumCellSize);
return TRUE;
}
@ -834,7 +834,7 @@ BOOL rdp_print_control_capability_set(wStream* s, UINT16 length)
UINT16 controlInterest;
UINT16 detachInterest;
fprintf(stderr, "ControlCapabilitySet (length %d):\n", length);
DEBUG_WARN( "ControlCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -844,10 +844,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) */
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);
DEBUG_WARN( "\tcontrolFlags: 0x%04X\n", controlFlags);
DEBUG_WARN( "\tremoteDetachFlag: 0x%04X\n", remoteDetachFlag);
DEBUG_WARN( "\tcontrolInterest: 0x%04X\n", controlInterest);
DEBUG_WARN( "\tdetachInterest: 0x%04X\n", detachInterest);
return TRUE;
}
@ -903,7 +903,7 @@ BOOL rdp_print_window_activation_capability_set(wStream* s, UINT16 length)
UINT16 helpExtendedKeyFlag;
UINT16 windowManagerKeyFlag;
fprintf(stderr, "WindowActivationCapabilitySet (length %d):\n", length);
DEBUG_WARN( "WindowActivationCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -913,10 +913,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) */
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);
DEBUG_WARN( "\thelpKeyFlag: 0x%04X\n", helpKeyFlag);
DEBUG_WARN( "\thelpKeyIndexFlag: 0x%04X\n", helpKeyIndexFlag);
DEBUG_WARN( "\thelpExtendedKeyFlag: 0x%04X\n", helpExtendedKeyFlag);
DEBUG_WARN( "\twindowManagerKeyFlag: 0x%04X\n", windowManagerKeyFlag);
return TRUE;
}
@ -990,15 +990,15 @@ BOOL rdp_print_pointer_capability_set(wStream* s, UINT16 length)
if (length < 10)
return FALSE;
fprintf(stderr, "PointerCapabilitySet (length %d):\n", length);
DEBUG_WARN( "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) */
fprintf(stderr, "\tcolorPointerFlag: 0x%04X\n", colorPointerFlag);
fprintf(stderr, "\tcolorPointerCacheSize: 0x%04X\n", colorPointerCacheSize);
fprintf(stderr, "\tpointerCacheSize: 0x%04X\n", pointerCacheSize);
DEBUG_WARN( "\tcolorPointerFlag: 0x%04X\n", colorPointerFlag);
DEBUG_WARN( "\tcolorPointerCacheSize: 0x%04X\n", colorPointerCacheSize);
DEBUG_WARN( "\tpointerCacheSize: 0x%04X\n", pointerCacheSize);
return TRUE;
}
@ -1051,7 +1051,7 @@ BOOL rdp_print_share_capability_set(wStream* s, UINT16 length)
UINT16 nodeId;
UINT16 pad2Octets;
fprintf(stderr, "ShareCapabilitySet (length %d):\n", length);
DEBUG_WARN( "ShareCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1059,8 +1059,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) */
fprintf(stderr, "\tnodeId: 0x%04X\n", nodeId);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
DEBUG_WARN( "\tnodeId: 0x%04X\n", nodeId);
DEBUG_WARN( "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1110,7 +1110,7 @@ BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length)
UINT16 colorTableCacheSize;
UINT16 pad2Octets;
fprintf(stderr, "ColorCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "ColorCacheCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1118,8 +1118,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) */
fprintf(stderr, "\tcolorTableCacheSize: 0x%04X\n", colorTableCacheSize);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
DEBUG_WARN( "\tcolorTableCacheSize: 0x%04X\n", colorTableCacheSize);
DEBUG_WARN( "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1176,7 +1176,7 @@ BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length)
UINT16 soundFlags;
UINT16 pad2OctetsA;
fprintf(stderr, "SoundCapabilitySet (length %d):\n", length);
DEBUG_WARN( "SoundCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1184,8 +1184,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) */
fprintf(stderr, "\tsoundFlags: 0x%04X\n", soundFlags);
fprintf(stderr, "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
DEBUG_WARN( "\tsoundFlags: 0x%04X\n", soundFlags);
DEBUG_WARN( "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
return TRUE;
}
@ -1288,7 +1288,7 @@ BOOL rdp_print_input_capability_set(wStream* s, UINT16 length)
UINT32 keyboardSubType;
UINT32 keyboardFunctionKey;
fprintf(stderr, "InputCapabilitySet (length %d)\n", length);
DEBUG_WARN( "InputCapabilitySet (length %d)\n", length);
if (length < 88)
return FALSE;
@ -1301,12 +1301,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) */
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);
DEBUG_WARN( "\tinputFlags: 0x%04X\n", inputFlags);
DEBUG_WARN( "\tpad2OctetsA: 0x%04X\n", pad2OctetsA);
DEBUG_WARN( "\tkeyboardLayout: 0x%08X\n", keyboardLayout);
DEBUG_WARN( "\tkeyboardType: 0x%08X\n", keyboardType);
DEBUG_WARN( "\tkeyboardSubType: 0x%08X\n", keyboardSubType);
DEBUG_WARN( "\tkeyboardFunctionKey: 0x%08X\n", keyboardFunctionKey);
return TRUE;
}
@ -1356,7 +1356,7 @@ BOOL rdp_print_font_capability_set(wStream* s, UINT16 length)
UINT16 fontSupportFlags = 0;
UINT16 pad2Octets = 0;
fprintf(stderr, "FontCapabilitySet (length %d):\n", length);
DEBUG_WARN( "FontCapabilitySet (length %d):\n", length);
if (length > 4)
Stream_Read_UINT16(s, fontSupportFlags); /* fontSupportFlags (2 bytes) */
@ -1364,8 +1364,8 @@ BOOL rdp_print_font_capability_set(wStream* s, UINT16 length)
if (length > 6)
Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */
fprintf(stderr, "\tfontSupportFlags: 0x%04X\n", fontSupportFlags);
fprintf(stderr, "\tpad2Octets: 0x%04X\n", pad2Octets);
DEBUG_WARN( "\tfontSupportFlags: 0x%04X\n", fontSupportFlags);
DEBUG_WARN( "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1412,14 +1412,14 @@ BOOL rdp_print_brush_capability_set(wStream* s, UINT16 length)
{
UINT32 brushSupportLevel;
fprintf(stderr, "BrushCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BrushCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
Stream_Read_UINT32(s, brushSupportLevel); /* brushSupportLevel (4 bytes) */
fprintf(stderr, "\tbrushSupportLevel: 0x%08X\n", brushSupportLevel);
DEBUG_WARN( "\tbrushSupportLevel: 0x%08X\n", brushSupportLevel);
return TRUE;
}
@ -1521,7 +1521,7 @@ BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length)
UINT16 glyphSupportLevel;
UINT16 pad2Octets;
fprintf(stderr, "GlyphCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "GlyphCacheCapabilitySet (length %d):\n", length);
if (length < 52)
return FALSE;
@ -1542,19 +1542,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) */
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);
DEBUG_WARN( "\tglyphCache0: Entries: %d MaximumCellSize: %d\n", glyphCache[0].cacheEntries, glyphCache[0].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache1: Entries: %d MaximumCellSize: %d\n", glyphCache[1].cacheEntries, glyphCache[1].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache2: Entries: %d MaximumCellSize: %d\n", glyphCache[2].cacheEntries, glyphCache[2].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache3: Entries: %d MaximumCellSize: %d\n", glyphCache[3].cacheEntries, glyphCache[3].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache4: Entries: %d MaximumCellSize: %d\n", glyphCache[4].cacheEntries, glyphCache[4].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache5: Entries: %d MaximumCellSize: %d\n", glyphCache[5].cacheEntries, glyphCache[5].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache6: Entries: %d MaximumCellSize: %d\n", glyphCache[6].cacheEntries, glyphCache[6].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache7: Entries: %d MaximumCellSize: %d\n", glyphCache[7].cacheEntries, glyphCache[7].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache8: Entries: %d MaximumCellSize: %d\n", glyphCache[8].cacheEntries, glyphCache[8].cacheMaximumCellSize);
DEBUG_WARN( "\tglyphCache9: Entries: %d MaximumCellSize: %d\n", glyphCache[9].cacheEntries, glyphCache[9].cacheMaximumCellSize);
DEBUG_WARN( "\tfragCache: Entries: %d MaximumCellSize: %d\n", fragCache.cacheEntries, fragCache.cacheMaximumCellSize);
DEBUG_WARN( "\tglyphSupportLevel: 0x%04X\n", glyphSupportLevel);
DEBUG_WARN( "\tpad2Octets: 0x%04X\n", pad2Octets);
return TRUE;
}
@ -1616,7 +1616,7 @@ BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, UINT16 length)
UINT16 offscreenCacheSize;
UINT16 offscreenCacheEntries;
fprintf(stderr, "OffscreenBitmapCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "OffscreenBitmapCacheCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -1625,9 +1625,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) */
fprintf(stderr, "\toffscreenSupportLevel: 0x%08X\n", offscreenSupportLevel);
fprintf(stderr, "\toffscreenCacheSize: 0x%04X\n", offscreenCacheSize);
fprintf(stderr, "\toffscreenCacheEntries: 0x%04X\n", offscreenCacheEntries);
DEBUG_WARN( "\toffscreenSupportLevel: 0x%08X\n", offscreenSupportLevel);
DEBUG_WARN( "\toffscreenCacheSize: 0x%04X\n", offscreenCacheSize);
DEBUG_WARN( "\toffscreenCacheEntries: 0x%04X\n", offscreenCacheEntries);
return TRUE;
}
@ -1685,7 +1685,7 @@ BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, UINT16 lengt
BYTE pad1;
UINT16 pad2;
fprintf(stderr, "BitmapCacheHostSupportCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCacheHostSupportCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1694,9 +1694,9 @@ BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, UINT16 lengt
Stream_Read_UINT8(s, pad1); /* pad1 (1 byte) */
Stream_Read_UINT16(s, pad2); /* pad2 (2 bytes) */
fprintf(stderr, "\tcacheVersion: 0x%02X\n", cacheVersion);
fprintf(stderr, "\tpad1: 0x%02X\n", pad1);
fprintf(stderr, "\tpad2: 0x%04X\n", pad2);
DEBUG_WARN( "\tcacheVersion: 0x%02X\n", cacheVersion);
DEBUG_WARN( "\tpad1: 0x%02X\n", pad1);
DEBUG_WARN( "\tpad2: 0x%04X\n", pad2);
return TRUE;
}
@ -1796,7 +1796,7 @@ BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length)
BYTE numCellCaches;
BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[5];
fprintf(stderr, "BitmapCacheV2CapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCacheV2CapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -1811,14 +1811,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) */
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);
DEBUG_WARN( "\tcacheFlags: 0x%04X\n", cacheFlags);
DEBUG_WARN( "\tpad2: 0x%02X\n", pad2);
DEBUG_WARN( "\tnumCellCaches: 0x%02X\n", numCellCaches);
DEBUG_WARN( "\tbitmapCache0CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[0].numEntries, bitmapCacheV2CellInfo[0].persistent);
DEBUG_WARN( "\tbitmapCache1CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[1].numEntries, bitmapCacheV2CellInfo[1].persistent);
DEBUG_WARN( "\tbitmapCache2CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[2].numEntries, bitmapCacheV2CellInfo[2].persistent);
DEBUG_WARN( "\tbitmapCache3CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[3].numEntries, bitmapCacheV2CellInfo[3].persistent);
DEBUG_WARN( "\tbitmapCache4CellInfo: numEntries: %d persistent: %d\n", bitmapCacheV2CellInfo[4].numEntries, bitmapCacheV2CellInfo[4].persistent);
return TRUE;
}
@ -1881,7 +1881,7 @@ BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length)
UINT32 flags;
UINT32 VCChunkSize;
fprintf(stderr, "VirtualChannelCapabilitySet (length %d):\n", length);
DEBUG_WARN( "VirtualChannelCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
@ -1893,8 +1893,8 @@ BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length)
else
VCChunkSize = 1600;
fprintf(stderr, "\tflags: 0x%08X\n", flags);
fprintf(stderr, "\tVCChunkSize: 0x%08X\n", VCChunkSize);
DEBUG_WARN( "\tflags: 0x%08X\n", flags);
DEBUG_WARN( "\tVCChunkSize: 0x%08X\n", VCChunkSize);
return TRUE;
}
@ -1980,7 +1980,7 @@ BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length)
UINT16 DrawNineGridCacheSize;
UINT16 DrawNineGridCacheEntries;
fprintf(stderr, "DrawNineGridCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "DrawNineGridCacheCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -2060,7 +2060,7 @@ BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, UINT16 length)
UINT32 GdipVersion;
UINT32 drawGdiplusCacheLevel;
fprintf(stderr, "DrawGdiPlusCacheCapabilitySet (length %d):\n", length);
DEBUG_WARN( "DrawGdiPlusCacheCapabilitySet (length %d):\n", length);
if (length < 40)
return FALSE;
@ -2133,14 +2133,14 @@ BOOL rdp_print_remote_programs_capability_set(wStream* s, UINT16 length)
{
UINT32 railSupportLevel;
fprintf(stderr, "RemoteProgramsCapabilitySet (length %d):\n", length);
DEBUG_WARN( "RemoteProgramsCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
Stream_Read_UINT32(s, railSupportLevel); /* railSupportLevel (4 bytes) */
fprintf(stderr, "\trailSupportLevel: 0x%08X\n", railSupportLevel);
DEBUG_WARN( "\trailSupportLevel: 0x%08X\n", railSupportLevel);
return TRUE;
}
@ -2196,7 +2196,7 @@ BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length)
BYTE numIconCaches;
UINT16 numIconCacheEntries;
fprintf(stderr, "WindowListCapabilitySet (length %d):\n", length);
DEBUG_WARN( "WindowListCapabilitySet (length %d):\n", length);
if (length < 11)
return FALSE;
@ -2205,9 +2205,9 @@ BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length)
Stream_Read_UINT8(s, numIconCaches); /* numIconCaches (1 byte) */
Stream_Read_UINT16(s, numIconCacheEntries); /* numIconCacheEntries (2 bytes) */
fprintf(stderr, "\twndSupportLevel: 0x%08X\n", wndSupportLevel);
fprintf(stderr, "\tnumIconCaches: 0x%02X\n", numIconCaches);
fprintf(stderr, "\tnumIconCacheEntries: 0x%04X\n", numIconCacheEntries);
DEBUG_WARN( "\twndSupportLevel: 0x%08X\n", wndSupportLevel);
DEBUG_WARN( "\tnumIconCaches: 0x%02X\n", numIconCaches);
DEBUG_WARN( "\tnumIconCacheEntries: 0x%04X\n", numIconCacheEntries);
return TRUE;
}
@ -2257,14 +2257,14 @@ BOOL rdp_print_desktop_composition_capability_set(wStream* s, UINT16 length)
{
UINT16 compDeskSupportLevel;
fprintf(stderr, "DesktopCompositionCapabilitySet (length %d):\n", length);
DEBUG_WARN( "DesktopCompositionCapabilitySet (length %d):\n", length);
if (length < 6)
return FALSE;
Stream_Read_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */
fprintf(stderr, "\tcompDeskSupportLevel: 0x%04X\n", compDeskSupportLevel);
DEBUG_WARN( "\tcompDeskSupportLevel: 0x%04X\n", compDeskSupportLevel);
return TRUE;
}
@ -2386,14 +2386,14 @@ BOOL rdp_print_multifragment_update_capability_set(wStream* s, UINT16 length)
{
UINT32 maxRequestSize;
fprintf(stderr, "MultifragmentUpdateCapabilitySet (length %d):\n", length);
DEBUG_WARN( "MultifragmentUpdateCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
Stream_Read_UINT32(s, maxRequestSize); /* maxRequestSize (4 bytes) */
fprintf(stderr, "\tmaxRequestSize: 0x%04X\n", maxRequestSize);
DEBUG_WARN( "\tmaxRequestSize: 0x%04X\n", maxRequestSize);
return TRUE;
}
@ -2447,14 +2447,14 @@ BOOL rdp_print_large_pointer_capability_set(wStream* s, UINT16 length)
{
UINT16 largePointerSupportFlags;
fprintf(stderr, "LargePointerCapabilitySet (length %d):\n", length);
DEBUG_WARN( "LargePointerCapabilitySet (length %d):\n", length);
if (length < 6)
return FALSE;
Stream_Read_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */
fprintf(stderr, "\tlargePointerSupportFlags: 0x%04X\n", largePointerSupportFlags);
DEBUG_WARN( "\tlargePointerSupportFlags: 0x%04X\n", largePointerSupportFlags);
return TRUE;
}
@ -2514,7 +2514,7 @@ BOOL rdp_print_surface_commands_capability_set(wStream* s, UINT16 length)
UINT32 cmdFlags;
UINT32 reserved;
fprintf(stderr, "SurfaceCommandsCapabilitySet (length %d):\n", length);
DEBUG_WARN( "SurfaceCommandsCapabilitySet (length %d):\n", length);
if (length < 12)
return FALSE;
@ -2522,8 +2522,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) */
fprintf(stderr, "\tcmdFlags: 0x%08X\n", cmdFlags);
fprintf(stderr, "\treserved: 0x%08X\n", reserved);
DEBUG_WARN( "\tcmdFlags: 0x%08X\n", cmdFlags);
DEBUG_WARN( "\treserved: 0x%08X\n", reserved);
return TRUE;
}
@ -2573,7 +2573,7 @@ void rdp_write_bitmap_codec_guid(wStream* s, GUID* guid)
void rdp_print_bitmap_codec_guid(GUID* guid)
{
fprintf(stderr, "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
DEBUG_WARN( "%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]);
@ -2906,7 +2906,7 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
UINT16 codecPropertiesLength;
UINT16 remainingLength;
fprintf(stderr, "BitmapCodecsCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCodecsCapabilitySet (length %d):\n", length);
if (length < 5)
return FALSE;
@ -2914,7 +2914,7 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
Stream_Read_UINT8(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */
remainingLength = length - 5;
fprintf(stderr, "\tbitmapCodecCount: %d\n", bitmapCodecCount);
DEBUG_WARN( "\tbitmapCodecCount: %d\n", bitmapCodecCount);
while (bitmapCodecCount > 0)
{
@ -2924,14 +2924,14 @@ BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length)
rdp_read_bitmap_codec_guid(s, &codecGuid); /* codecGuid (16 bytes) */
Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */
fprintf(stderr, "\tcodecGuid: 0x");
DEBUG_WARN( "\tcodecGuid: 0x");
rdp_print_bitmap_codec_guid(&codecGuid);
fprintf(stderr, " (%s)\n", rdp_get_bitmap_codec_guid_name(&codecGuid));
DEBUG_WARN( " (%s)\n", rdp_get_bitmap_codec_guid_name(&codecGuid));
fprintf(stderr, "\tcodecId: %d\n", codecId);
DEBUG_WARN( "\tcodecId: %d\n", codecId);
Stream_Read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */
fprintf(stderr, "\tcodecPropertiesLength: %d\n", codecPropertiesLength);
DEBUG_WARN( "\tcodecPropertiesLength: %d\n", codecPropertiesLength);
remainingLength -= 19;
@ -2994,14 +2994,14 @@ BOOL rdp_print_frame_acknowledge_capability_set(wStream* s, UINT16 length)
{
UINT32 frameAcknowledge;
fprintf(stderr, "FrameAcknowledgeCapabilitySet (length %d):\n", length);
DEBUG_WARN( "FrameAcknowledgeCapabilitySet (length %d):\n", length);
if (length < 8)
return FALSE;
Stream_Read_UINT32(s, frameAcknowledge); /* frameAcknowledge (4 bytes) */
fprintf(stderr, "\tframeAcknowledge: 0x%08X\n", frameAcknowledge);
DEBUG_WARN( "\tframeAcknowledge: 0x%08X\n", frameAcknowledge);
return TRUE;
}
@ -3034,14 +3034,14 @@ BOOL rdp_print_bitmap_cache_v3_codec_id_capability_set(wStream* s, UINT16 length
{
BYTE bitmapCacheV3CodecId;
fprintf(stderr, "BitmapCacheV3CodecIdCapabilitySet (length %d):\n", length);
DEBUG_WARN( "BitmapCacheV3CodecIdCapabilitySet (length %d):\n", length);
if (length < 5)
return FALSE;
Stream_Read_UINT8(s, bitmapCacheV3CodecId); /* bitmapCacheV3CodecId (1 byte) */
fprintf(stderr, "\tbitmapCacheV3CodecId: 0x%02X\n", bitmapCacheV3CodecId);
DEBUG_WARN( "\tbitmapCacheV3CodecId: 0x%02X\n", bitmapCacheV3CodecId);
return TRUE;
}
@ -3058,13 +3058,13 @@ BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOOL recei
rdp_read_capability_set_header(s, &length, &type);
fprintf(stderr, "%s ", receiving ? "Receiving" : "Sending");
DEBUG_WARN( "%s ", receiving ? "Receiving" : "Sending");
em = bm + length;
if (Stream_GetRemainingLength(s) < (size_t) (length - 4))
{
fprintf(stderr, "error processing stream\n");
DEBUG_WARN( "error processing stream\n");
return FALSE;
}
@ -3216,13 +3216,13 @@ BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, BOOL recei
break;
default:
fprintf(stderr, "unknown capability type %d\n", type);
DEBUG_WARN( "unknown capability type %d\n", type);
break;
}
if (s->pointer != em)
{
fprintf(stderr, "incorrect offset, type:0x%02X actual:%d expected:%d\n",
DEBUG_WARN( "incorrect offset, type:0x%02X actual:%d expected:%d\n",
type, (int) (s->pointer - bm), (int) (em - bm));
}
@ -3256,14 +3256,14 @@ BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCa
}
else
{
fprintf(stderr, "%s: not handling capability type %d yet\n", __FUNCTION__, type);
DEBUG_WARN( "%s: not handling capability type %d yet\n", __FUNCTION__, type);
}
em = bm + length;
if (Stream_GetRemainingLength(s) < ((size_t) length - 4))
{
fprintf(stderr, "error processing stream\n");
DEBUG_WARN( "error processing stream\n");
return FALSE;
}
@ -3415,13 +3415,13 @@ BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCa
break;
default:
fprintf(stderr, "unknown capability type %d\n", type);
DEBUG_WARN( "unknown capability type %d\n", type);
break;
}
if (s->pointer != em)
{
fprintf(stderr, "incorrect offset, type:0x%02X actual:%d expected:%d\n",
DEBUG_WARN( "incorrect offset, type:0x%02X actual:%d expected:%d\n",
type, (int) (s->pointer - bm), (int) (em - bm));
}
@ -3431,7 +3431,7 @@ BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 numberCa
if (numberCapabilities)
{
fprintf(stderr, "%s: strange we haven't read the number of announced capacity sets, read=%d expected=%d\n",
DEBUG_WARN( "%s: strange we haven't read the number of announced capacity sets, read=%d expected=%d\n",
__FUNCTION__, count-numberCapabilities, count);
}
@ -3466,7 +3466,7 @@ BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
fprintf(stderr, "rdp_decrypt failed\n");
DEBUG_WARN( "rdp_decrypt failed\n");
return FALSE;
}
}
@ -3478,7 +3478,7 @@ BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId)
if ((mcsMessageChannelId == 0) || (*pChannelId != mcsMessageChannelId))
{
fprintf(stderr, "unexpected MCS channel id %04x received\n", *pChannelId);
DEBUG_WARN( "unexpected MCS channel id %04x received\n", *pChannelId);
return FALSE;
}
}
@ -3504,14 +3504,14 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
{
fprintf(stderr, "rdp_read_share_control_header failed\n");
DEBUG_WARN( "rdp_read_share_control_header failed\n");
return FALSE;
}
if (pduType != PDU_TYPE_DEMAND_ACTIVE)
{
if (pduType != PDU_TYPE_SERVER_REDIRECTION)
fprintf(stderr, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04x\n", PDU_TYPE_DEMAND_ACTIVE, pduType);
DEBUG_WARN( "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04x\n", PDU_TYPE_DEMAND_ACTIVE, pduType);
return FALSE;
}
@ -3534,7 +3534,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s)
/* capabilitySets */
if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities))
{
fprintf(stderr, "rdp_read_capability_sets failed\n");
DEBUG_WARN( "rdp_read_capability_sets failed\n");
return FALSE;
}

View File

@ -279,7 +279,7 @@ error2:
free(info->Modulus);
info->Modulus = 0;
error1:
fprintf(stderr, "error reading when reading certificate: part=%s error=%d\n", certificate_read_errors[error], error);
DEBUG_WARN( "error reading when reading certificate: part=%s error=%d\n", certificate_read_errors[error], error);
Stream_Free(s, FALSE);
return FALSE;
}
@ -344,7 +344,7 @@ static BOOL certificate_process_server_public_key(rdpCertificate* certificate, w
if (memcmp(magic, "RSA1", 4) != 0)
{
fprintf(stderr, "%s: magic error\n", __FUNCTION__);
DEBUG_WARN( "%s: magic error\n", __FUNCTION__);
return FALSE;
}
@ -391,7 +391,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
if (sum != 0)
{
fprintf(stderr, "%s: invalid signature\n", __FUNCTION__);
DEBUG_WARN( "%s: invalid signature\n", __FUNCTION__);
//return FALSE;
}
@ -403,7 +403,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
/* Verify signature. */
if (memcmp(md5hash, sig, sizeof(md5hash)) != 0)
{
fprintf(stderr, "%s: invalid signature\n", __FUNCTION__);
DEBUG_WARN( "%s: invalid signature\n", __FUNCTION__);
//return FALSE;
}
@ -419,7 +419,7 @@ static BOOL certificate_process_server_public_signature(rdpCertificate* certific
if (sig[16] != 0x00 || sum != 0xFF * (62 - 17) || sig[62] != 0x01)
{
fprintf(stderr, "%s: invalid signature\n", __FUNCTION__);
DEBUG_WARN( "%s: invalid signature\n", __FUNCTION__);
//return FALSE;
}
@ -453,7 +453,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (!(dwSigAlgId == SIGNATURE_ALG_RSA && dwKeyAlgId == KEY_EXCHANGE_ALG_RSA))
{
fprintf(stderr, "%s: unsupported signature or key algorithm, dwSigAlgId=%d dwKeyAlgId=%d\n",
DEBUG_WARN( "%s: unsupported signature or key algorithm, dwSigAlgId=%d dwKeyAlgId=%d\n",
__FUNCTION__, dwSigAlgId, dwKeyAlgId);
return FALSE;
}
@ -462,7 +462,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (wPublicKeyBlobType != BB_RSA_KEY_BLOB)
{
fprintf(stderr, "%s: unsupported public key blob type %d\n", __FUNCTION__, wPublicKeyBlobType);
DEBUG_WARN( "%s: unsupported public key blob type %d\n", __FUNCTION__, wPublicKeyBlobType);
return FALSE;
}
@ -472,7 +472,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (!certificate_process_server_public_key(certificate, s, wPublicKeyBlobLen))
{
fprintf(stderr, "%s: error in server public key\n", __FUNCTION__);
DEBUG_WARN( "%s: error in server public key\n", __FUNCTION__);
return FALSE;
}
@ -484,26 +484,26 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate
if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB)
{
fprintf(stderr, "%s: unsupported blob signature %d\n", __FUNCTION__, wSignatureBlobType);
DEBUG_WARN( "%s: unsupported blob signature %d\n", __FUNCTION__, wSignatureBlobType);
return FALSE;
}
Stream_Read_UINT16(s, wSignatureBlobLen);
if (Stream_GetRemainingLength(s) < wSignatureBlobLen)
{
fprintf(stderr, "%s: not enought bytes for signature(len=%d)\n", __FUNCTION__, wSignatureBlobLen);
DEBUG_WARN( "%s: not enought bytes for signature(len=%d)\n", __FUNCTION__, wSignatureBlobLen);
return FALSE;
}
if (wSignatureBlobLen != 72)
{
fprintf(stderr, "%s: invalid signature length (got %d, expected %d)\n", __FUNCTION__, wSignatureBlobLen, 64);
DEBUG_WARN( "%s: invalid signature length (got %d, expected %d)\n", __FUNCTION__, wSignatureBlobLen, 64);
return FALSE;
}
if (!certificate_process_server_public_signature(certificate, sigdata, sigdatalen, s, wSignatureBlobLen))
{
fprintf(stderr, "%s: unable to parse server public signature\n", __FUNCTION__);
DEBUG_WARN( "%s: unable to parse server public signature\n", __FUNCTION__);
return FALSE;
}
@ -560,7 +560,7 @@ BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate,
if (cert_info.Modulus)
free(cert_info.Modulus);
if (!ret) {
fprintf(stderr, "failed to read License Server, content follows:\n");
DEBUG_WARN( "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;
}
@ -608,7 +608,7 @@ BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* serv
break;
default:
fprintf(stderr, "invalid certificate chain version:%d\n", dwVersion & CERT_CHAIN_VERSION_MASK);
DEBUG_WARN( "invalid certificate chain version:%d\n", dwVersion & CERT_CHAIN_VERSION_MASK);
ret = FALSE;
break;
}
@ -631,14 +631,14 @@ rdpRsaKey* key_new(const char* keyfile)
fp = fopen(keyfile, "r");
if (fp == NULL)
{
fprintf(stderr, "%s: unable to open RSA key file %s: %s.", __FUNCTION__, keyfile, strerror(errno));
DEBUG_WARN( "%s: unable to open RSA key file %s: %s.", __FUNCTION__, keyfile, strerror(errno));
goto out_free;
}
rsa = PEM_read_RSAPrivateKey(fp, NULL, NULL, NULL);
if (rsa == NULL)
{
fprintf(stderr, "%s: unable to load RSA key from %s: %s.", __FUNCTION__, keyfile, strerror(errno));
DEBUG_WARN( "%s: unable to load RSA key from %s: %s.", __FUNCTION__, keyfile, strerror(errno));
ERR_print_errors_fp(stderr);
fclose(fp);
goto out_free;
@ -649,7 +649,7 @@ rdpRsaKey* key_new(const char* keyfile)
switch (RSA_check_key(rsa))
{
case 0:
fprintf(stderr, "%s: invalid RSA key in %s\n", __FUNCTION__, keyfile);
DEBUG_WARN( "%s: invalid RSA key in %s\n", __FUNCTION__, keyfile);
goto out_free_rsa;
case 1:
@ -657,14 +657,14 @@ rdpRsaKey* key_new(const char* keyfile)
break;
default:
fprintf(stderr, "%s: unexpected error when checking RSA key from %s: %s.", __FUNCTION__, keyfile, strerror(errno));
DEBUG_WARN( "%s: unexpected error when checking RSA key from %s: %s.", __FUNCTION__, keyfile, strerror(errno));
ERR_print_errors_fp(stderr);
goto out_free_rsa;
}
if (BN_num_bytes(rsa->e) > 4)
{
fprintf(stderr, "%s: RSA public exponent too large in %s\n", __FUNCTION__, keyfile);
DEBUG_WARN( "%s: RSA public exponent too large in %s\n", __FUNCTION__, keyfile);
goto out_free_rsa;
}

View File

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

View File

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

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