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;
}
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;
}
(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);
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
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
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))
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;
}
}
else
{
- fprintf(stderr, "update_activity_cb: No queue!\n");
+ DEBUG_WARN( "update_activity_cb: No queue!\n");
}
}
}
else
{
- fprintf(stderr, "input_activity_cb: No queue!\n");
+ DEBUG_WARN( "input_activity_cb: No queue!\n");
}
}
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))
{
if (!wfc->instance->settings->RedirectClipboard)
{
wfc->cliprdr_context = NULL;
- fprintf(stderr, "clipboard is not redirected.\n");
+ DEBUG_WARN( "clipboard is not redirected.\n");
return;
}
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);
hRet = OleGetClipboard(&pDataObj);
if (!SUCCEEDED(hRet))
{
- fprintf(stderr, "filecontents: get ole clipboard failed.\n");
+ DEBUG_WARN( "filecontents: get ole clipboard failed.\n");
goto error;
}
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;
}
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;
}
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
- fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
+ DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
}
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)
if (status != TRUE)
{
- fprintf(stderr, "Bitmap Decompression Failed\n");
+ DEBUG_WARN( "Bitmap Decompression Failed\n");
}
}
else
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
- fprintf(stderr, "Debug console created.\n");
+ DEBUG_WARN( "Debug console created.\n");
return 0;
}
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);
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;
}
if (status != NO_ERROR)
{
- fprintf(stderr, "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
+ DEBUG_WARN( "CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
return FALSE;
}
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);
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 */
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;
Sleep(5000);
}
- fprintf(stderr, "Maximum reconnect retries exceeded\n");
+ DEBUG_WARN( "Maximum reconnect retries exceeded\n");
return FALSE;
}
{
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;
}
{
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;
}
}
/* 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;
}
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;
}
}
}
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;
}
{
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;
}
{
if (status == -1)
{
- fprintf(stderr, "keyboard thread error getting message\n");
+ DEBUG_WARN( "keyboard thread error getting message\n");
break;
}
else
}
else
{
- fprintf(stderr, "failed to install keyboard hook\n");
+ DEBUG_WARN( "failed to install keyboard hook\n");
}
printf("Keyboard thread exited.\n");
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))
{
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))
{
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. */
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++] = '&';
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++] = '&';
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++] = '&';
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++] = '&';
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++] = '&';
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 */
* 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++)
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++)
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;
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);
{
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);
}
/* 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;
}
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 */
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;
}
sleep(5);
}
- fprintf(stderr, "Maximum reconnect retries exceeded\n");
+ DEBUG_WARN( "Maximum reconnect retries exceeded\n");
return FALSE;
}
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)
{
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;
}
{
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;
}
{
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;
}
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;
}
}
{
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;
}
}
{
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);
{
if(xf_process_x_events(instance) != TRUE)
{
- fprintf(stderr, "Closed from X11\n");
+ DEBUG_WARN( "Closed from X11\n");
break;
}
}
{
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;
}
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,
}
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;
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;
}
{
if ((rop2 < 0x01) || (rop2 > 0x10))
{
- fprintf(stderr, "Unsupported ROP2: %d\n", rop2);
+ DEBUG_WARN( "Unsupported ROP2: %d\n", rop2);
return FALSE;
}
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;
}
}
else
{
- fprintf(stderr, "unimplemented brush style:%d\n", brush->style);
+ DEBUG_WARN( "unimplemented brush style:%d\n", brush->style);
}
if (xfc->drawing == xfc->primary)
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)
}
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,
break;
default:
- fprintf(stderr, "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
+ DEBUG_WARN( "PolygonSC unknown fillMode: %d\n", polygon_sc->fillMode);
break;
}
break;
default:
- fprintf(stderr, "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
+ DEBUG_WARN( "PolygonCB unknown fillMode: %d\n", polygon_cb->fillMode);
break;
}
}
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);
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)
}
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);
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:
if (!msg)
{
- fprintf(stderr, "xf_Bitmap_Decompress: rfx Decompression Failed\n");
+ DEBUG_WARN( "xf_Bitmap_Decompress: rfx Decompression Failed\n");
}
else
{
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;
if (!status)
{
- fprintf(stderr, "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
+ DEBUG_WARN( "xf_Bitmap_Decompress: Bitmap Decompression Failed\n");
}
}
else
}
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)
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))
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;
}
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);
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);
}
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)
{
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
}
}
XFree(fo);
#ifdef WITH_DEBUG_XV
- fprintf(stderr, "\n");
+ DEBUG_WARN( "\n");
#endif
}
#include <freerdp/crypto/crypto.h>
#include <freerdp/locale/keyboard.h>
+#include <freerdp/utils/debug.h>
#include <freerdp/client/cmdline.h>
#include <freerdp/version.h>
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
if (!id)
{
- fprintf(stderr, "Could not identify keyboard layout: %s\n", arg->Value);
+ DEBUG_WARN( "Could not identify keyboard layout: %s\n", arg->Value);
}
}
}
else
{
- fprintf(stderr, "unknown protocol security: %s\n", arg->Value);
+ DEBUG_WARN( "unknown protocol security: %s\n", arg->Value);
}
}
CommandLineSwitchCase(arg, "sec-rdp")
}
else
{
- fprintf(stderr, "reconnect-cookie: invalid base64 '%s'\n",
+ DEBUG_WARN( "reconnect-cookie: invalid base64 '%s'\n",
arg->Value);
}
}
{
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;
}
}
#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>
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)
{
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")
{
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")
{
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")
{
CommandLineSwitchCase(arg, "no-auth")
{
settings->Authentication = FALSE;
- fprintf(stderr, "--no-auth -> -authentication\n");
+ DEBUG_WARN( "--no-auth -> -authentication\n");
}
CommandLineSwitchCase(arg, "authonly")
{
{
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")
{
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")
{
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")
{
CommandLineSwitchCase(arg, "ignore-certificate")
{
settings->IgnoreCertificate = TRUE;
- fprintf(stderr, "--ignore-certificate -> /cert-ignore\n");
+ DEBUG_WARN( "--ignore-certificate -> /cert-ignore\n");
}
CommandLineSwitchCase(arg, "sec")
{
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")
{
}
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;
}
#include "config.h"
#endif
+#include <freerdp/utils/debug.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
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)
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)
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;
}
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;
}