diff --git a/channels/audin/client/pulse/audin_pulse.c b/channels/audin/client/pulse/audin_pulse.c index b731c2246..5dab7badb 100644 --- a/channels/audin/client/pulse/audin_pulse.c +++ b/channels/audin/client/pulse/audin_pulse.c @@ -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__); */ + /* DEBUG_WARN( "%s: ignoring input, pulse buffer not ready.\n", __func__); */ return; } diff --git a/channels/audin/server/audin.c b/channels/audin/server/audin.c index 31b3943f0..a7d50c73a 100644 --- a/channels/audin/server/audin.c +++ b/channels/audin/server/audin.c @@ -385,7 +385,7 @@ static void* audin_server_thread_func(void* arg) break; default: - fprintf(stderr, "audin_server_thread_func: unknown MessageId %d\n", MessageId); + DEBUG_WARN( "audin_server_thread_func: unknown MessageId %d\n", MessageId); break; } } diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 7eeaad6a9..8753d773a 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -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); + DEBUG_MSG("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); + DEBUG_WARN( "generalFlags (0x%08X) {\n", flags); if (flags & CB_USE_LONG_FORMAT_NAMES) - fprintf(stderr, "\tCB_USE_LONG_FORMAT_NAMES\n"); + DEBUG_WARN( "\tCB_USE_LONG_FORMAT_NAMES\n"); if (flags & CB_STREAM_FILECLIP_ENABLED) - fprintf(stderr, "\tCB_STREAM_FILECLIP_ENABLED\n"); + DEBUG_WARN( "\tCB_STREAM_FILECLIP_ENABLED\n"); if (flags & CB_FILECLIP_NO_FILE_PATHS) - fprintf(stderr, "\tCB_FILECLIP_NO_FILE_PATHS\n"); + DEBUG_WARN( "\tCB_FILECLIP_NO_FILE_PATHS\n"); if (flags & CB_CAN_LOCK_CLIPDATA) - fprintf(stderr, "\tCB_CAN_LOCK_CLIPDATA\n"); + DEBUG_WARN( "\tCB_CAN_LOCK_CLIPDATA\n"); - fprintf(stderr, "}\n"); + DEBUG_WARN( "}\n"); } static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s) diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 1a701e8a1..20aefb180 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -70,7 +70,7 @@ static int cliprdr_server_send_capabilities(CliprdrServerContext* context) CLIPRDR_HEADER header; ULONG written; - printf("CliprdrServerSendCapabilities\n"); + DEBUG_MSG("CliprdrServerSendCapabilities\n"); header.msgType = CB_CLIP_CAPS; header.msgFlags = 0; @@ -111,7 +111,7 @@ static int cliprdr_server_send_monitor_ready(CliprdrServerContext* context) CLIPRDR_HEADER header; ULONG written; - printf("CliprdrServerSendMonitorReady\n"); + DEBUG_MSG("CliprdrServerSendMonitorReady\n"); header.msgType = CB_MONITOR_READY; header.msgFlags = 0; @@ -139,7 +139,7 @@ static int cliprdr_server_send_format_list_response(CliprdrServerContext* contex CLIPRDR_HEADER header; ULONG written; - printf("CliprdrServerSendFormatListResponse\n"); + DEBUG_MSG("CliprdrServerSendFormatListResponse\n"); header.msgType = CB_FORMAT_LIST_RESPONSE; header.msgFlags = CB_RESPONSE_OK; @@ -207,7 +207,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); + DEBUG_MSG("ClientTemporaryDirectory: %s\n", context->priv->ClientTemporaryDirectory); return 0; } @@ -252,7 +252,7 @@ static int cliprdr_server_receive_long_format_list(CliprdrServerContext* context int length; int position; - printf("%s\n", __FUNCTION__); + DEBUG_MSG("%s\n", __FUNCTION__); position = Stream_GetPosition(s); Stream_SetPosition(s, Stream_Length(s)); @@ -305,7 +305,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, + DEBUG_MSG("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 +316,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__); + DEBUG_MSG("%s: unimplemented\n", __FUNCTION__); return 0; } @@ -340,7 +340,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", + DEBUG_MSG("CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d\n", header->msgType, header->msgFlags, header->dataLen); switch (header->msgType) @@ -379,7 +379,7 @@ static int cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, break; default: - printf("Unexpected clipboard PDU type: %d\n", header->msgType); + DEBUG_MSG("Unexpected clipboard PDU type: %d\n", header->msgType); break; } diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index e8827366b..b3954d078 100644 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -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); + //DEBUG_WARN( "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); + DEBUG_WARN( "\t: Flags: 0x%04X\n", Monitors[index].Flags); + DEBUG_WARN( "\t: Left: %d\n", Monitors[index].Left); + DEBUG_WARN( "\t: Top: %d\n", Monitors[index].Top); + DEBUG_WARN( "\t: Width: %d\n", Monitors[index].Width); + DEBUG_WARN( "\t: Height: %d\n", Monitors[index].Height); + DEBUG_WARN( "\t: PhysicalWidth: %d\n", Monitors[index].PhysicalWidth); + DEBUG_WARN( "\t: PhysicalHeight: %d\n", Monitors[index].PhysicalHeight); + DEBUG_WARN( "\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", + //DEBUG_WARN( "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); + //DEBUG_WARN( "Type: %d Length: %d\n", type, length); switch (type) { diff --git a/channels/drdynvc/client/dvcman.c b/channels/drdynvc/client/dvcman.c index 9a6d80537..3b936d974 100644 --- a/channels/drdynvc/client/dvcman.c +++ b/channels/drdynvc/client/dvcman.c @@ -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]); + DEBUG_WARN( "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); diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index 1ed31296f..74858b89d 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -24,6 +24,7 @@ #include #include +#include #include #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)); + DEBUG_MSG("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); + DEBUG_WARN( "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); + //DEBUG_MSG("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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "encomsp_virtual_channel_init_event: error no match\n"); return; } diff --git a/channels/printer/client/printer_win.c b/channels/printer/client/printer_win.c index fcbbbc1fd..a91ddbce5 100644 --- a/channels/printer/client/printer_win.c +++ b/channels/printer/client/printer_win.c @@ -185,7 +185,7 @@ static rdpPrinter* printer_win_new_printer(rdpWinPrinterDriver* win_driver, cons win_printer->printer.FindPrintJob = printer_win_find_printjob; win_printer->printer.Free = printer_win_free_printer; - swprintf(wname, 256, L"%hs", name); + swDEBUG_MSG(wname, 256, L"%hs", name); OpenPrinter(wname, &(win_printer->hPrinter), NULL); GetPrinter(win_printer->hPrinter, 2, (LPBYTE) prninfo, 0, &needed); diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index 3096f543b..0eeb7839c 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -522,7 +522,7 @@ BOOL rail_order_recv(railPlugin* rail, wStream* s) } default: - fprintf(stderr, "Unknown RAIL PDU order reveived."); + DEBUG_WARN( "Unknown RAIL PDU order reveived."); break; } diff --git a/channels/rdpdr/client/devman.c b/channels/rdpdr/client/devman.c index 75778fe01..18f326adf 100644 --- a/channels/rdpdr/client/devman.c +++ b/channels/rdpdr/client/devman.c @@ -32,6 +32,7 @@ #include #include #include +#include #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); + DEBUG_WARN( "Loading device service %s (static)\n", ServiceName); entry = (PDEVICE_SERVICE_ENTRY) freerdp_load_channel_addin_entry(ServiceName, NULL, "DeviceServiceEntry", 0); if (!entry) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index c1b4975c2..0574ee8b2 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -31,6 +31,7 @@ #include #include +#include #include #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."); + DEBUG_WARN( "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", + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "rdpdr_virtual_channel_init_event: error no match\n"); return; } diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index 09d768413..d10188f67 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -36,7 +36,7 @@ static int rdpdr_server_send_announce_request(RdpdrServerContext* context) RDPDR_HEADER header; ULONG written; - printf("RdpdrServerSendAnnounceRequest\n"); + DEBUG_MSG("RdpdrServerSendAnnounceRequest\n"); header.Component = RDPDR_CTYP_CORE; header.PacketId = PAKID_CORE_SERVER_ANNOUNCE; @@ -69,7 +69,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", + DEBUG_MSG("Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X\n", VersionMajor, VersionMinor, ClientId); context->priv->ClientId = ClientId; @@ -109,7 +109,7 @@ static int rdpdr_server_receive_client_name_request(RdpdrServerContext* context, Stream_Seek(s, ComputerNameLen); - printf("ClientComputerName: %s\n", context->priv->ClientComputerName); + DEBUG_MSG("ClientComputerName: %s\n", context->priv->ClientComputerName); return 0; } @@ -298,7 +298,7 @@ static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context UINT16 numCapabilities; ULONG written; - printf("RdpdrServerSendCoreCapabilityRequest\n"); + DEBUG_MSG("RdpdrServerSendCoreCapabilityRequest\n"); header.Component = RDPDR_CTYP_CORE; header.PacketId = PAKID_CORE_SERVER_CAPABILITY; @@ -364,7 +364,7 @@ static int rdpdr_server_receive_core_capability_response(RdpdrServerContext* con break; default: - printf("Unknown capabilityType %d\n", capabilityHeader.CapabilityType); + DEBUG_MSG("Unknown capabilityType %d\n", capabilityHeader.CapabilityType); Stream_Seek(s, capabilityHeader.CapabilityLength - RDPDR_CAPABILITY_HEADER_LENGTH); break; } @@ -380,7 +380,7 @@ static int rdpdr_server_send_client_id_confirm(RdpdrServerContext* context) RDPDR_HEADER header; ULONG written; - printf("RdpdrServerSendClientIdConfirm\n"); + DEBUG_MSG("RdpdrServerSendClientIdConfirm\n"); header.Component = RDPDR_CTYP_CORE; header.PacketId = PAKID_CORE_CLIENTID_CONFIRM; @@ -416,7 +416,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); + DEBUG_MSG("%s: DeviceCount: %d\n", __FUNCTION__, DeviceCount); for (i = 0; i < DeviceCount; i++) { @@ -425,7 +425,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", + DEBUG_MSG("Device %d Name: %s Id: 0x%04X DataLength: %d\n", i, PreferredDosName, DeviceId, DeviceDataLength); switch (DeviceId) @@ -462,7 +462,7 @@ static int rdpdr_server_send_user_logged_on(RdpdrServerContext* context) RDPDR_HEADER header; ULONG written; - printf("%s\n", __FUNCTION__); + DEBUG_MSG("%s\n", __FUNCTION__); header.Component = RDPDR_CTYP_CORE; header.PacketId = PAKID_CORE_USER_LOGGEDON; @@ -483,7 +483,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", + DEBUG_MSG("RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X\n", header->Component, header->PacketId); winpr_HexDump(Stream_Buffer(s), Stream_Length(s)); @@ -545,7 +545,7 @@ static int rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDP } else { - printf("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component); + DEBUG_MSG("Unknown RDPDR_HEADER.Component: 0x%04X\n", header->Component); return -1; } diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index cd837669f..18e0d29ec 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -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", + DEBUG_WARN( "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"); + DEBUG_MSG(" CONTACT_FLAG_DOWN"); if (contactFlags & CONTACT_FLAG_UPDATE) - printf(" CONTACT_FLAG_UPDATE"); + DEBUG_MSG(" CONTACT_FLAG_UPDATE"); if (contactFlags & CONTACT_FLAG_UP) - printf(" CONTACT_FLAG_UP"); + DEBUG_MSG(" CONTACT_FLAG_UP"); if (contactFlags & CONTACT_FLAG_INRANGE) - printf(" CONTACT_FLAG_INRANGE"); + DEBUG_MSG(" CONTACT_FLAG_INRANGE"); if (contactFlags & CONTACT_FLAG_INCONTACT) - printf(" CONTACT_FLAG_INCONTACT"); + DEBUG_MSG(" CONTACT_FLAG_INCONTACT"); if (contactFlags & CONTACT_FLAG_CANCELED) - printf(" CONTACT_FLAG_CANCELED"); + DEBUG_MSG(" 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); + DEBUG_MSG("contactCount: %d\n", frame->contactCount); + DEBUG_MSG("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); + DEBUG_MSG("contact[%d].contactId: %d\n", index, contact->contactId); + DEBUG_MSG("contact[%d].fieldsPresent: %d\n", index, contact->fieldsPresent); + DEBUG_MSG("contact[%d].x: %d\n", index, contact->x); + DEBUG_MSG("contact[%d].y: %d\n", index, contact->y); + DEBUG_MSG("contact[%d].contactFlags: 0x%04X", index, contact->contactFlags); rdpei_print_contact_flags(contact->contactFlags); - printf("\n"); + DEBUG_MSG("\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); + DEBUG_WARN( "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", + DEBUG_WARN( "rdpei_recv_pdu: eventId: %d (%s) length: %d\n", eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength); #endif diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index f50010f93..8bca50d4a 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -37,6 +37,7 @@ #include #include +#include #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", + DEBUG_WARN( "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", + DEBUG_WARN( "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); + DEBUG_MSG("zgfx_decompress failure! status: %d\n", status); return 0; } diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index 0edc08d93..0ea935f5e 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -68,7 +68,7 @@ struct rdpsnd_alsa_plugin #define SND_PCM_CHECK(_func, _status) \ if (_status < 0) \ { \ - fprintf(stderr, "%s: %d\n", _func, _status); \ + DEBUG_WARN( "%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", + DEBUG_WARN( "Warning: requested sound buffer size %d, got %d instead\n", (int) alsa->buffer_size, (int) buffer_size_max); alsa->buffer_size = buffer_size_max; } @@ -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); + DEBUG_WARN( "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); + //DEBUG_WARN( "wTimeStampA: %d wTimeStampB: %d wLatency: %d\n", wave->wTimeStampA, wave->wTimeStampB, wave->wLatency); } static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] = diff --git a/channels/rdpsnd/client/ios/TPCircularBuffer.c b/channels/rdpsnd/client/ios/TPCircularBuffer.c index 1dcf47190..47143ea03 100644 --- a/channels/rdpsnd/client/ios/TPCircularBuffer.c +++ b/channels/rdpsnd/client/ios/TPCircularBuffer.c @@ -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)); + DEBUG_MSG("%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"); + DEBUG_MSG("Couldn't map buffer memory to end of buffer\n"); return false; } diff --git a/channels/rdpsnd/client/mac/rdpsnd_mac.c b/channels/rdpsnd/client/mac/rdpsnd_mac.c index 96ffacd89..fe2a21ef2 100644 --- a/channels/rdpsnd/client/mac/rdpsnd_mac.c +++ b/channels/rdpsnd/client/mac/rdpsnd_mac.c @@ -121,7 +121,7 @@ static void rdpsnd_mac_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, in if (status != 0) { - fprintf(stderr, "AudioQueueNewOutput failure\n"); + DEBUG_WARN( "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"); + DEBUG_MSG("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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "AudioQueueStart failed\n"); } mac->isPlaying = TRUE; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index c4fc84637..f72ff8279 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -195,13 +195,13 @@ void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd) } #if 0 - fprintf(stderr, "Server "); + DEBUG_WARN( "Server "); rdpsnd_print_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats); - fprintf(stderr, "\n"); + DEBUG_WARN( "\n"); - fprintf(stderr, "Client "); + DEBUG_WARN( "Client "); rdpsnd_print_audio_formats(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats); - fprintf(stderr, "\n"); + DEBUG_WARN( "\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); + //DEBUG_WARN( "msgType %d BodySize %d\n", msgType, BodySize); switch (msgType) { @@ -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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "rdpsnd_virtual_channel_init_event: error no match\n"); return; } diff --git a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c index 961b95e83..8c8e22bc9 100644 --- a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c +++ b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c @@ -101,11 +101,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"); + DEBUG_WARN( "MM_WOM_OPEN\n"); break; case MM_WOM_CLOSE: - fprintf(stderr, "MM_WOM_CLOSE\n"); + DEBUG_WARN( "MM_WOM_CLOSE\n"); break; case MM_WOM_DONE: @@ -121,7 +121,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", + DEBUG_WARN( "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d\n", lpWaveHdr->dwBufferLength, wave->cBlockNo); wave->wLocalTimeB = GetTickCount(); @@ -155,7 +155,7 @@ static void rdpsnd_winmm_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, if (mmResult != MMSYSERR_NOERROR) { - fprintf(stderr, "waveOutOpen failed: %d\n", mmResult); + DEBUG_WARN( "waveOutOpen failed: %d\n", mmResult); } } @@ -172,7 +172,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device) if (mmResult != MMSYSERR_NOERROR) { - fprintf(stderr, "waveOutClose failure: %d\n", mmResult); + DEBUG_WARN( "waveOutClose failure: %d\n", mmResult); } winmm->hWaveOut = NULL; @@ -299,7 +299,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) if (mmResult != MMSYSERR_NOERROR) { - fprintf(stderr, "waveOutPrepareHeader failure: %d\n", mmResult); + DEBUG_WARN( "waveOutPrepareHeader failure: %d\n", mmResult); return; } @@ -307,7 +307,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) if (mmResult != MMSYSERR_NOERROR) { - fprintf(stderr, "waveOutWrite failure: %d\n", mmResult); + DEBUG_WARN( "waveOutWrite failure: %d\n", mmResult); waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR)); return; } diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 74fe4ec14..1d56bf1f9 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -108,7 +108,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); + DEBUG_WARN( "Client requested sound quality: %#0X\n", quality); return TRUE; } @@ -137,7 +137,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__); + DEBUG_WARN( "%s: client doesn't support any format!\n", __FUNCTION__); return FALSE; } @@ -174,7 +174,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__); + DEBUG_WARN( "%s: client doesn't support any known format!\n", __FUNCTION__); goto out_free; } @@ -230,7 +230,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); + DEBUG_WARN( "%s: index %d is not correct.\n", __FUNCTION__, client_format_index); return FALSE; } @@ -242,7 +242,7 @@ static BOOL rdpsnd_server_select_format(RdpsndServerContext* context, int client if (format->nSamplesPerSec == 0) { - fprintf(stderr, "%s: invalid Client Sound Format!!\n", __FUNCTION__); + DEBUG_WARN( "%s: invalid Client Sound Format!!\n", __FUNCTION__); return FALSE; } @@ -475,7 +475,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", + DEBUG_WARN( "%s: error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)\n", __FUNCTION__, bytesReturned); if (buffer) WTSFreeMemory(buffer); @@ -631,7 +631,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context) if (GetLastError() == ERROR_NO_DATA) return TRUE; - fprintf(stderr, "%s: channel connection closed\n", __FUNCTION__); + DEBUG_WARN( "%s: channel connection closed\n", __FUNCTION__); return FALSE; } priv->expectedBytes -= bytesReturned; @@ -659,7 +659,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); + DEBUG_WARN( "%s: message type %d\n", __FUNCTION__, priv->msgType); #endif priv->expectedBytes = 4; priv->waitingHeader = TRUE; @@ -685,7 +685,7 @@ BOOL rdpsnd_server_handle_messages(RdpsndServerContext *context) break; default: - fprintf(stderr, "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType); + DEBUG_WARN( "%s: UNKOWN MESSAGE TYPE!! (%#0X)\n\n", __FUNCTION__, priv->msgType); ret = FALSE; break; } diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index 8527b59c8..4917b6efc 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -26,6 +26,7 @@ #include +#include #include #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); + DEBUG_WARN( "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); + //DEBUG_MSG("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); + //DEBUG_MSG("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); + DEBUG_WARN( "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)); + DEBUG_MSG("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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "remdesk_virtual_channel_init_event: error no match\n"); return; } diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index e60926ab6..4d18979b9 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -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", + DEBUG_WARN( "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X", irp->MajorFunction, irp->MinorFunction); irp->IoStatus = STATUS_NOT_SUPPORTED; diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 0e9fad24e..59155c703 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -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", + DEBUG_MSG("%s (0x%08X) FileId: %d CompletionId: %d\n", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId); #endif diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c index e2c9da2c5..df0421926 100644 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c @@ -27,10 +27,12 @@ #include +#include #include #include #include +#include #include "tsmf_constants.h" #include "tsmf_decoder.h" @@ -504,7 +506,7 @@ ITSMFDecoder *freerdp_tsmf_client_decoder_subsystem_entry(void) avcodec_register_all(); initialized = TRUE; } - fprintf(stderr, "TSMFDecoderEntry FFMPEG\n"); + DEBUG_WARN( "TSMFDecoderEntry FFMPEG\n"); decoder = (TSMFFFmpegDecoder *) malloc(sizeof(TSMFFFmpegDecoder)); ZeroMemory(decoder, sizeof(TSMFFFmpegDecoder)); decoder->iface.SetFormat = tsmf_ffmpeg_set_format; diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index 5fac84991..65beff7c3 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -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, "-"); + DEBUG_WARN( "%02X", guid[i]); + DEBUG_WARN( "-"); for(i = 5; i >= 4; i--) - fprintf(stderr, "%02X", guid[i]); - fprintf(stderr, "-"); + DEBUG_WARN( "%02X", guid[i]); + DEBUG_WARN( "-"); for(i = 7; i >= 6; i--) - fprintf(stderr, "%02X", guid[i]); - fprintf(stderr, "-"); + DEBUG_WARN( "%02X", guid[i]); + DEBUG_WARN( "-"); for(i = 8; i < 16; i++) { - fprintf(stderr, "%02X", guid[i]); + DEBUG_WARN( "%02X", guid[i]); if(i == 9) - fprintf(stderr, "-"); + DEBUG_WARN( "-"); } - fprintf(stderr, "\n"); + DEBUG_WARN( "\n"); #endif } diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index f0aa961d1..2e6918035 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -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"); + DEBUG_WARN( " 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"); + DEBUG_WARN( " 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"); + DEBUG_WARN( " 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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "urb_control_feature_request: Error Command %x\n", command); zfree(out_data); return -1; } diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index 82775fffb..3687e238a 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -201,7 +201,7 @@ static void func_iso_callback(struct libusb_transfer *transfer) } else { - //fprintf(stderr, "actual length %d \n", act_len); + //DEBUG_WARN( "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); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + //DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_COMPLETED\n"); break; case LIBUSB_TRANSFER_ERROR: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_ERROR\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_ERROR\n"); break; case LIBUSB_TRANSFER_TIMED_OUT: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_TIMED_OUT\n"); break; case LIBUSB_TRANSFER_CANCELLED: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_CANCELLED\n"); break; case LIBUSB_TRANSFER_STALL: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_STALL\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_STALL\n"); break; case LIBUSB_TRANSFER_NO_DEVICE: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_NO_DEVICE\n"); break; case LIBUSB_TRANSFER_OVERFLOW: - fprintf(stderr, "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n"); + DEBUG_WARN( "Transfer Status: LIBUSB_TRANSFER_OVERFLOW\n"); break; default: - fprintf(stderr, "Transfer Status: Get unknow error num %d (0x%x)\n", + DEBUG_WARN( "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"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_COMPLETED\n"); break; case LIBUSB_TRANSFER_ERROR: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_ERROR\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_ERROR\n"); break; case LIBUSB_TRANSFER_TIMED_OUT: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_TIMED_OUT\n"); break; case LIBUSB_TRANSFER_CANCELLED: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_CANCELLED\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_CANCELLED\n"); break; case LIBUSB_TRANSFER_STALL: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_STALL\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_STALL\n"); break; case LIBUSB_TRANSFER_NO_DEVICE: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_NO_DEVICE\n"); break; case LIBUSB_TRANSFER_OVERFLOW: - fprintf(stderr, "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n"); + DEBUG_WARN( "Transfer status: LIBUSB_TRANSFER_OVERFLOW\n"); break; default: - fprintf(stderr, "Transfer status: unknow status %d(0x%x)\n", status, status); + DEBUG_WARN( "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"); + DEBUG_WARN( "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", + DEBUG_WARN( "%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 " + DEBUG_WARN( "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); + DEBUG_WARN( "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); + DEBUG_WARN( "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); + DEBUG_WARN( "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); + //DEBUG_WARN( "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); + //DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( " 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); + DEBUG_WARN( "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); + DEBUG_WARN( "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"); + DEBUG_WARN( "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"); + DEBUG_WARN( "libusb_open: (by addr) ERROR!!\n"); zfree(pDev); return NULL; } diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index ebf5e4b5a..7635d039b 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -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!!"); + DEBUG_WARN( "udevman_register_udevice: function error!!"); return 0; } diff --git a/channels/urbdrc/client/libusb/request_queue.c b/channels/urbdrc/client/libusb/request_queue.c index e5ebfef71..06ef4045a 100644 --- a/channels/urbdrc/client/libusb/request_queue.c +++ b/channels/urbdrc/client/libusb/request_queue.c @@ -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"); + DEBUG_WARN( "request_queue_get_request_by_id: ERROR!!\n"); return NULL; } diff --git a/channels/urbdrc/client/searchman.c b/channels/urbdrc/client/searchman.c index 18fc5b73e..04b9fe05b 100644 --- a/channels/urbdrc/client/searchman.c +++ b/channels/urbdrc/client/searchman.c @@ -156,16 +156,16 @@ static void searchman_list_show(USB_SEARCHMAN* self) int num = 0; USB_SEARCHDEV* usb; - fprintf(stderr, "=========== Usb Search List ========= \n"); + DEBUG_WARN( "=========== 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); + DEBUG_WARN( " USB %d: \n", num++); + DEBUG_WARN( " idVendor: 0x%04X \n", usb->idVendor); + DEBUG_WARN( " idProduct: 0x%04X \n", usb->idProduct); } - fprintf(stderr, "================= END =============== \n"); + DEBUG_WARN( "================= 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"); + DEBUG_WARN( "searchman mutex initialization: searchman->mutex failed"); exit(EXIT_FAILURE); } diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index e010bba10..a4b2a6f0a 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -468,7 +468,7 @@ static void* urbdrc_search_usb_device(void* arg) if (!udev) { - fprintf(stderr, "Can't create udev\n"); + DEBUG_WARN( "Can't create udev\n"); return 0; } @@ -652,7 +652,7 @@ static void* urbdrc_search_usb_device(void* arg) } else { - fprintf(stderr, "No Device from receive_device(). An error occured.\n"); + DEBUG_WARN( "No Device from receive_device(). An error occured.\n"); } } } @@ -835,7 +835,7 @@ static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (transfer_data == NULL) { - fprintf(stderr, "transfer_data is NULL!!"); + DEBUG_WARN( "transfer_data is NULL!!"); return 0; }