Fixed format strings to match arguments (#8254)

* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
This commit is contained in:
akallabeth 2022-09-29 14:55:27 +02:00 committed by GitHub
parent e4f476fce4
commit 1849632c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 176 additions and 127 deletions

View File

@ -480,7 +480,7 @@ static UINT audin_process_open(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* call
if (initialFormat >= callback->formats_count) if (initialFormat >= callback->formats_count)
{ {
WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %" PRIu32 ")",
initialFormat, callback->formats_count); initialFormat, callback->formats_count);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }
@ -521,8 +521,8 @@ static UINT audin_process_format_change(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLB
if (NewFormat >= callback->formats_count) if (NewFormat >= callback->formats_count)
{ {
WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %d)", NewFormat, WLog_Print(audin->log, WLOG_ERROR, "invalid format index %" PRIu32 " (total %" PRIu32 ")",
callback->formats_count); NewFormat, callback->formats_count);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }

View File

@ -365,7 +365,7 @@ static UINT audin_oss_free(IAudinDevice* device)
if ((error = audin_oss_close(device))) if ((error = audin_oss_close(device)))
{ {
WLog_ERR(TAG, "audin_oss_close failed with error code %d!", error); WLog_ERR(TAG, "audin_oss_close failed with error code %" PRIu32 "!", error);
} }
free(oss); free(oss);

View File

@ -209,7 +209,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 le
if (audin->context.num_client_formats <= 0) if (audin->context.num_client_formats <= 0)
{ {
WLog_ERR(TAG, "num_client_formats expected > 0 but got %d", WLog_ERR(TAG, "num_client_formats expected > 0 but got %" PRIuz,
audin->context.num_client_formats); audin->context.num_client_formats);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }
@ -254,7 +254,7 @@ static UINT audin_server_send_open(audin_server* audin, wStream* s)
WINPR_ASSERT(audin); WINPR_ASSERT(audin);
if (audin->context.selected_client_format < 0) if (audin->context.selected_client_format < 0)
{ {
WLog_ERR(TAG, "audin->context.selected_client_format = %d", WLog_ERR(TAG, "audin->context.selected_client_format = %" PRIdz,
audin->context.selected_client_format); audin->context.selected_client_format);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }
@ -330,7 +330,7 @@ static UINT audin_server_recv_data(audin_server* audin, wStream* s, UINT32 lengt
WINPR_ASSERT(audin); WINPR_ASSERT(audin);
if (audin->context.selected_client_format < 0) if (audin->context.selected_client_format < 0)
{ {
WLog_ERR(TAG, "audin->context.selected_client_format = %d", WLog_ERR(TAG, "audin->context.selected_client_format = %" PRIdz,
audin->context.selected_client_format); audin->context.selected_client_format);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }

View File

@ -130,8 +130,8 @@ disp_send_display_control_monitor_layout_pdu(GENERIC_CHANNEL_CALLBACK* callback,
Stream_Write_UINT32(s, current.DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */ Stream_Write_UINT32(s, current.DesktopScaleFactor); /* DesktopScaleFactor (4 bytes) */
Stream_Write_UINT32(s, current.DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ Stream_Write_UINT32(s, current.DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */
WLog_DBG(TAG, WLog_DBG(TAG,
"\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 "\t%" PRIu32 " : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32
"x%" PRIu32 ")", ") W/H=%" PRIu32 "x%" PRIu32 ")",
index, current.Flags, current.Left, current.Top, current.Width, current.Height); index, current.Flags, current.Left, current.Top, current.Width, current.Height);
WLog_DBG(TAG, WLog_DBG(TAG,
"\t PhysicalWidth: %" PRIu32 " PhysicalHeight: %" PRIu32 " Orientation: %" PRIu32 "\t PhysicalWidth: %" PRIu32 " PhysicalHeight: %" PRIu32 " Orientation: %" PRIu32

View File

@ -187,8 +187,8 @@ static UINT disp_recv_display_control_monitor_layout_pdu(wStream* s, DispServerC
disp_server_sanitize_monitor_layout(monitor); disp_server_sanitize_monitor_layout(monitor);
WLog_DBG(TAG, WLog_DBG(TAG,
"\t%d : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32 ") W/H=%" PRIu32 "\t%" PRIu32 " : Flags: 0x%08" PRIX32 " Left/Top: (%" PRId32 ",%" PRId32
"x%" PRIu32 ")", ") W/H=%" PRIu32 "x%" PRIu32 ")",
index, monitor->Flags, monitor->Left, monitor->Top, monitor->Width, index, monitor->Flags, monitor->Left, monitor->Top, monitor->Width,
monitor->Height); monitor->Height);
WLog_DBG(TAG, WLog_DBG(TAG,
@ -249,7 +249,7 @@ static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s)
if (end != (beg + header.length)) if (end != (beg + header.length))
{ {
WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %d, Expected: %" PRIu32 "", end, WLog_ERR(TAG, "Unexpected DISP pdu end: Actual: %" PRIuz ", Expected: %" PRIuz "", end,
(beg + header.length)); (beg + header.length));
Stream_SetPosition(s, (beg + header.length)); Stream_SetPosition(s, (beg + header.length));
} }

View File

@ -68,7 +68,7 @@ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr,
DVCMAN* dvcman = (DVCMAN*)pChannelMgr; DVCMAN* dvcman = (DVCMAN*)pChannelMgr;
DVCMAN_LISTENER* listener; DVCMAN_LISTENER* listener;
WLog_DBG(TAG, "create_listener: %d.%s.", HashTable_Count(dvcman->listeners) + 1, WLog_DBG(TAG, "create_listener: %" PRIuz ".%s.", HashTable_Count(dvcman->listeners) + 1,
pszChannelName); pszChannelName);
listener = (DVCMAN_LISTENER*)calloc(1, sizeof(DVCMAN_LISTENER)); listener = (DVCMAN_LISTENER*)calloc(1, sizeof(DVCMAN_LISTENER));
@ -132,7 +132,7 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const ch
if (!ArrayList_Append(dvcman->plugins, pPlugin)) if (!ArrayList_Append(dvcman->plugins, pPlugin))
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
WLog_DBG(TAG, "register_plugin: num_plugins %d", ArrayList_Count(dvcman->plugins)); WLog_DBG(TAG, "register_plugin: num_plugins %" PRIuz, ArrayList_Count(dvcman->plugins));
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }

View File

@ -658,8 +658,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
if (!SetFilePointerEx(file->file_handle, liSize, NULL, FILE_BEGIN)) if (!SetFilePointerEx(file->file_handle, liSize, NULL, FILE_BEGIN))
{ {
WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, WLog_ERR(TAG, "Unable to truncate %s to %" PRId64 " (%" PRId32 ")", file->fullpath,
GetLastError()); size, GetLastError());
return FALSE; return FALSE;
} }
@ -667,8 +667,8 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
if (SetEndOfFile(file->file_handle) == 0) if (SetEndOfFile(file->file_handle) == 0)
{ {
WLog_ERR(TAG, "Unable to truncate %s to %d (%" PRId32 ")", file->fullpath, size, WLog_ERR(TAG, "Unable to truncate %s to %" PRId64 " (%" PRId32 ")", file->fullpath,
GetLastError()); size, GetLastError());
return FALSE; return FALSE;
} }

View File

@ -856,7 +856,7 @@ static UINT rdpdr_server_receive_device_list_announce_request(RdpdrServerContext
if (!Stream_CheckAndLogRequiredLength(TAG, s, DeviceDataLength)) if (!Stream_CheckAndLogRequiredLength(TAG, s, DeviceDataLength))
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
WLog_DBG(TAG, "Device %d Name: %s Id: 0x%08" PRIX32 " DataLength: %" PRIu32 "", i, WLog_DBG(TAG, "Device %" PRIu32 " Name: %s Id: 0x%08" PRIX32 " DataLength: %" PRIu32 "", i,
PreferredDosName, DeviceId, DeviceDataLength); PreferredDosName, DeviceId, DeviceDataLength);
switch (DeviceType) switch (DeviceType)
@ -933,7 +933,7 @@ static UINT rdpdr_server_receive_device_list_remove_request(RdpdrServerContext*
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */
WLog_DBG(TAG, "Device %d Id: 0x%08" PRIX32 "", i, DeviceId); WLog_DBG(TAG, "Device %" PRIu32 " Id: 0x%08" PRIX32 "", i, DeviceId);
DeviceType = 0; /* TODO: Save the device type on the announce request. */ DeviceType = 0; /* TODO: Save the device type on the announce request. */
switch (DeviceType) switch (DeviceType)

View File

@ -2050,7 +2050,7 @@ static UINT rdpgfx_recv_pdu(GENERIC_CHANNEL_CALLBACK* callback, wStream* s)
if (end != (beg + header.pduLength)) if (end != (beg + header.pduLength))
{ {
WLog_Print(gfx->log, WLOG_ERROR, WLog_Print(gfx->log, WLOG_ERROR,
"Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, "Unexpected gfx pdu end: Actual: %" PRIuz ", Expected: %" PRIuz, end,
(beg + header.pduLength)); (beg + header.pduLength));
Stream_SetPosition(s, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength));
} }

View File

@ -1350,7 +1350,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s)
if (end != (beg + header.pduLength)) if (end != (beg + header.pduLength))
{ {
WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %" PRIu32 "", end, WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %" PRIuz ", Expected: %" PRIuz "", end,
(beg + header.pduLength)); (beg + header.pduLength));
Stream_SetPosition(s, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength));
} }

View File

@ -347,7 +347,7 @@ static UINT rdpsnd_server_select_format(RdpsndServerContext* context, UINT16 cli
if ((client_format_index >= context->num_client_formats) || (!context->src_format)) if ((client_format_index >= context->num_client_formats) || (!context->src_format))
{ {
WLog_ERR(TAG, "index %d is not correct.", client_format_index); WLog_ERR(TAG, "index %" PRIu16 " is not correct.", client_format_index);
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
} }

View File

@ -51,17 +51,19 @@ static void smartcard_context_free(void* pCtx);
static UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); static UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp);
static SMARTCARD_DEVICE* cast_device_from(DEVICE* device, const char* fkt, const char* file, static SMARTCARD_DEVICE* cast_device_from(DEVICE* device, const char* fkt, const char* file,
int line) size_t line)
{ {
if (!device) if (!device)
{ {
WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with NULL device", fkt, file, line); WLog_ERR(TAG, "%s [%s:%" PRIuz "] Called smartcard channel with NULL device", fkt, file,
line);
return NULL; return NULL;
} }
if (device->type != RDPDR_DTYP_SMARTCARD) if (device->type != RDPDR_DTYP_SMARTCARD)
{ {
WLog_ERR(TAG, "%s [%s:%d] Called smartcard channel with invalid device of type %" PRIx32, WLog_ERR(TAG,
"%s [%s:%" PRIuz "] Called smartcard channel with invalid device of type %" PRIx32,
fkt, file, line, device->type); fkt, file, line, device->type);
return NULL; return NULL;
} }

View File

@ -385,7 +385,7 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig)
for (pnum = 0; pnum < MsInterface->NumberOfPipes; pnum++) for (pnum = 0; pnum < MsInterface->NumberOfPipes; pnum++)
{ {
MsPipe = MsPipes[pnum]; MsPipe = MsPipes[pnum];
WLog_INFO(TAG, " Pipe: %d", pnum); WLog_INFO(TAG, " Pipe: %" PRIu32, pnum);
WLog_INFO(TAG, " MaximumPacketSize: 0x%04" PRIx16 "", MsPipe->MaximumPacketSize); WLog_INFO(TAG, " MaximumPacketSize: 0x%04" PRIx16 "", MsPipe->MaximumPacketSize);
WLog_INFO(TAG, " MaximumTransferSize: 0x%08" PRIx32 "", WLog_INFO(TAG, " MaximumTransferSize: 0x%08" PRIx32 "",
MsPipe->MaximumTransferSize); MsPipe->MaximumTransferSize);

View File

@ -378,7 +378,10 @@ static BOOL video_onMappedGeometryUpdate(MAPPED_GEOMETRY* geometry)
WINPR_ASSERT(presentation); WINPR_ASSERT(presentation);
r = &geometry->geometry.boundingRect; r = &geometry->geometry.boundingRect;
WLog_DBG(TAG, "geometry updated topGeom=(%d,%d-%dx%d) geom=(%d,%d-%dx%d) rects=(%d,%d-%dx%d)", WLog_DBG(TAG,
"geometry updated topGeom=(%" PRId32 ",%" PRId32 "-%" PRId32 "x%" PRId32
") geom=(%" PRId32 ",%" PRId32 "-%" PRId32 "x%" PRId32 ") rects=(%" PRId16 ",%" PRId16
"-%" PRId16 "x%" PRId16 ")",
geometry->topLevelLeft, geometry->topLevelTop, geometry->topLevelLeft, geometry->topLevelTop,
geometry->topLevelRight - geometry->topLevelLeft, geometry->topLevelRight - geometry->topLevelLeft,
geometry->topLevelBottom - geometry->topLevelTop, geometry->topLevelBottom - geometry->topLevelTop,
@ -435,12 +438,12 @@ static UINT video_PresentationRequest(VideoClientContext* video,
{ {
if (presentation->PresentationId == req->PresentationId) if (presentation->PresentationId == req->PresentationId)
{ {
WLog_ERR(TAG, "ignoring start request for existing presentation %d", WLog_ERR(TAG, "ignoring start request for existing presentation %" PRIu8,
req->PresentationId); req->PresentationId);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
WLog_ERR(TAG, "releasing current presentation %d", req->PresentationId); WLog_ERR(TAG, "releasing current presentation %" PRIu8, req->PresentationId);
PresentationContext_unref(presentation); PresentationContext_unref(presentation);
presentation = priv->currentPresentation = NULL; presentation = priv->currentPresentation = NULL;
} }
@ -489,7 +492,7 @@ static UINT video_PresentationRequest(VideoClientContext* video,
WLog_DBG(TAG, "stopping presentation 0x%x", req->PresentationId); WLog_DBG(TAG, "stopping presentation 0x%x", req->PresentationId);
if (!presentation) if (!presentation)
{ {
WLog_ERR(TAG, "unknown presentation to stop %d", req->PresentationId); WLog_ERR(TAG, "unknown presentation to stop %" PRIu8, req->PresentationId);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
@ -765,15 +768,17 @@ treat_feedback:
video_control_send_client_notification(video, &notif); video_control_send_client_notification(video, &notif);
priv->lastSentRate = computedRate; priv->lastSentRate = computedRate;
WLog_DBG(TAG, "server notified with rate %d published=%d dropped=%d", WLog_DBG(TAG,
"server notified with rate %" PRIu32 " published=%" PRIu32
" dropped=%" PRIu32,
priv->lastSentRate, priv->publishedFrames, priv->droppedFrames); priv->lastSentRate, priv->publishedFrames, priv->droppedFrames);
} }
PresentationContext_unref(priv->currentPresentation); PresentationContext_unref(priv->currentPresentation);
} }
WLog_DBG(TAG, "currentRate=%d published=%d dropped=%d", priv->lastSentRate, WLog_DBG(TAG, "currentRate=%" PRIu32 " published=%" PRIu32 " dropped=%" PRIu32,
priv->publishedFrames, priv->droppedFrames); priv->lastSentRate, priv->publishedFrames, priv->droppedFrames);
priv->droppedFrames = 0; priv->droppedFrames = 0;
priv->publishedFrames = 0; priv->publishedFrames = 0;
@ -802,7 +807,7 @@ static UINT video_VideoData(VideoClientContext* context, const TSMM_VIDEO_DATA*
if (presentation->PresentationId != data->PresentationId) if (presentation->PresentationId != data->PresentationId)
{ {
WLog_ERR(TAG, "current presentation id=%d doesn't match data id=%d", WLog_ERR(TAG, "current presentation id=%" PRIu8 " doesn't match data id=%" PRIu8,
presentation->PresentationId, data->PresentationId); presentation->PresentationId, data->PresentationId);
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }

View File

@ -2157,7 +2157,7 @@ static BOOL xf_cliprdr_fuse_generate_list(xfClipboard* clipboard, const BYTE* da
if (size < 4) if (size < 4)
{ {
WLog_ERR(TAG, "size of format data response invalid : %d", size); WLog_ERR(TAG, "size of format data response invalid : %" PRIu32, size);
return FALSE; return FALSE;
} }
size_t count = (size - 4) / sizeof(FILEDESCRIPTORW); size_t count = (size - 4) / sizeof(FILEDESCRIPTORW);
@ -3047,7 +3047,7 @@ static DWORD WINAPI xf_cliprdr_fuse_thread(LPVOID arg)
free(tmpPath); free(tmpPath);
return 0; return 0;
} }
_snprintf(&basePath[0], basePathSize, "%s/.xfreerdp.cliprdr.%d", tmpPath, _snprintf(&basePath[0], basePathSize, "%s/.xfreerdp.cliprdr.%" PRIu32, tmpPath,
GetCurrentProcessId()); GetCurrentProcessId());
free(tmpPath); free(tmpPath);

View File

@ -692,7 +692,8 @@ int xf_input_event(xfContext* xfc, const XEvent* xevent, XIDeviceEvent* event, i
} }
break; break;
default: default:
WLog_WARN(TAG, "[%s] Unhandled event %d: Event was registered but is not handled!"); WLog_WARN(TAG, "[%s] Unhandled event %d: Event was registered but is not handled!",
__FUNCTION__, evtype);
break; break;
} }

View File

@ -562,8 +562,8 @@ static xfRailIconCache* RailIconCache_New(rdpSettings* settings)
if (!cache->entries) if (!cache->entries)
{ {
WLog_ERR(TAG, "failed to allocate icon cache %d x %d entries", cache->numCaches, WLog_ERR(TAG, "failed to allocate icon cache %" PRIu32 " x %" PRIu32 " entries",
cache->numCacheEntries); cache->numCaches, cache->numCacheEntries);
free(cache); free(cache);
return NULL; return NULL;
} }

View File

@ -1410,8 +1410,8 @@ static BOOL freerdp_client_detect_command_line(int argc, char** argv, DWORD* fla
*flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; *flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS;
} }
WLog_DBG(TAG, "windows: %d/%d posix: %d/%d", windows_cli_status, windows_cli_count, WLog_DBG(TAG, "windows: %d/%" PRIuz " posix: %d/%" PRIuz "", windows_cli_status,
posix_cli_status, posix_cli_count); windows_cli_count, posix_cli_status, posix_cli_count);
if ((posix_cli_count == 0) && (windows_cli_count == 0)) if ((posix_cli_count == 0) && (windows_cli_count == 0))
{ {
if ((posix_cli_status == COMMAND_LINE_ERROR) && (windows_cli_status == COMMAND_LINE_ERROR)) if ((posix_cli_status == COMMAND_LINE_ERROR) && (windows_cli_status == COMMAND_LINE_ERROR))

View File

@ -229,7 +229,7 @@ static BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, const char* name,
{ {
BOOL standard = TRUE; BOOL standard = TRUE;
#ifdef DEBUG_CLIENT_FILE #ifdef DEBUG_CLIENT_FILE
WLog_DBG(TAG, "%s:i:%d", name, value); WLog_DBG(TAG, "%s:i:%ld", name, value);
#endif #endif
if (value < 0) if (value < 0)

View File

@ -37,7 +37,7 @@ BOOL freerdp_smartcard_list(const rdpSettings* settings)
WINPR_ASSERT(info); WINPR_ASSERT(info);
printf("%d: %s\n", i, info->subject); printf("%" PRIu32 ": %s\n", i, info->subject);
if (WideCharToMultiByte(CP_UTF8, 0, info->reader, -1, readerName, sizeof(readerName), NULL, if (WideCharToMultiByte(CP_UTF8, 0, info->reader, -1, readerName, sizeof(readerName), NULL,
NULL) > 0) NULL) > 0)

View File

@ -235,7 +235,7 @@ BOOL freerdp_image_copy_from_icon_data(BYTE* pDstData, UINT32 DstFormat, UINT32
break; break;
default: default:
WLog_WARN(TAG, "invalid icon bpp: %d", bpp); WLog_WARN(TAG, "invalid icon bpp: %" PRIu32, bpp);
return FALSE; return FALSE;
} }

View File

@ -697,8 +697,8 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, RFX_MESSAGE* messag
Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */ Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */
Stream_Read_UINT16(s, rect->height); /* height (2 bytes) */ Stream_Read_UINT16(s, rect->height); /* height (2 bytes) */
WLog_Print(context->priv->log, WLOG_DEBUG, WLog_Print(context->priv->log, WLOG_DEBUG,
"rect %d (x,y=%" PRIu16 ",%" PRIu16 " w,h=%" PRIu16 " %" PRIu16 ").", i, rect->x, "rect %" PRIu16 " (x,y=%" PRIu16 ",%" PRIu16 " w,h=%" PRIu16 " %" PRIu16 ").", i,
rect->y, rect->width, rect->height); rect->x, rect->y, rect->width, rect->height);
} }
if (!Stream_CheckAndLogRequiredLength(TAG, s, 4)) if (!Stream_CheckAndLogRequiredLength(TAG, s, 4))

View File

@ -336,7 +336,8 @@ BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp)
keyCount = rdp_load_persistent_key_list(rdp, &keyList); keyCount = rdp_load_persistent_key_list(rdp, &keyList);
WLog_DBG(TAG, "Persistent Key List: TotalKeyCount: %d MaxKeyFrag: %d", keyCount, keyMaxFrag); WLog_DBG(TAG, "Persistent Key List: TotalKeyCount: %" PRIu32 " MaxKeyFrag: %" PRIu32, keyCount,
keyMaxFrag);
// MS-RDPBCGR recommends sending no more than 169 entries at once. // MS-RDPBCGR recommends sending no more than 169 entries at once.
// In practice, sending more than 2042 entries at once triggers an error. // In practice, sending more than 2042 entries at once triggers an error.
@ -376,13 +377,17 @@ BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp)
info.keyCount = keyCount; info.keyCount = keyCount;
info.keyList = keyList; info.keyList = keyList;
WLog_DBG(TAG, "persistentKeyList count: %d", info.keyCount); WLog_DBG(TAG, "persistentKeyList count: %" PRIu32, info.keyCount);
WLog_DBG(TAG, "numEntriesCache: [0]: %d [1]: %d [2]: %d [3]: %d [4]: %d", info.numEntriesCache0, WLog_DBG(TAG,
info.numEntriesCache1, info.numEntriesCache2, info.numEntriesCache3, "numEntriesCache: [0]: %" PRIu16 " [1]: %" PRIu16 " [2]: %" PRIu16 " [3]: %" PRIu16
info.numEntriesCache4); " [4]: %" PRIu16,
info.numEntriesCache0, info.numEntriesCache1, info.numEntriesCache2,
info.numEntriesCache3, info.numEntriesCache4);
WLog_DBG(TAG, "totalEntriesCache: [0]: %d [1]: %d [2]: %d [3]: %d [4]: %d", WLog_DBG(TAG,
"totalEntriesCache: [0]: %" PRIu16 " [1]: %" PRIu16 " [2]: %" PRIu16 " [3]: %" PRIu16
" [4]: %" PRIu16,
info.totalEntriesCache0, info.totalEntriesCache1, info.totalEntriesCache2, info.totalEntriesCache0, info.totalEntriesCache1, info.totalEntriesCache2,
info.totalEntriesCache3, info.totalEntriesCache4); info.totalEntriesCache3, info.totalEntriesCache4);

View File

@ -3857,7 +3857,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, UINT16 t
if (numberCapabilities) if (numberCapabilities)
{ {
WLog_ERR(TAG, WLog_ERR(TAG,
"strange we haven't read the number of announced capacity sets, read=%d " "strange we haven't read the number of announced capacity sets, read=%" PRIu16 " "
"expected=%" PRIu16 "", "expected=%" PRIu16 "",
count - numberCapabilities, count); count - numberCapabilities, count);
} }

View File

@ -693,7 +693,7 @@ static BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certi
if (!Stream_CheckAndLogRequiredLength(TAG, s, certLength)) if (!Stream_CheckAndLogRequiredLength(TAG, s, certLength))
return FALSE; return FALSE;
DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%" PRIu32 "", i + 1, certLength); DEBUG_CERTIFICATE("X.509 Certificate #%" PRIu32 ", length:%" PRIu32 "", i + 1, certLength);
certificate->x509_cert_chain->array[i].data = (BYTE*)malloc(certLength); certificate->x509_cert_chain->array[i].data = (BYTE*)malloc(certLength);
if (!certificate->x509_cert_chain->array[i].data) if (!certificate->x509_cert_chain->array[i].data)

View File

@ -987,8 +987,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength)
if (bodyLength != response->BodyLength) if (bodyLength != response->BodyLength)
{ {
WLog_WARN(TAG, "%s: %s unexpected body length: actual: %d, expected: %d", __FUNCTION__, WLog_WARN(TAG, "%s: %s unexpected body length: actual: %" PRIuz ", expected: %" PRIuz,
response->ContentType, response->BodyLength, bodyLength); __FUNCTION__, response->ContentType, response->BodyLength, bodyLength);
if (bodyLength > 0) if (bodyLength > 0)
response->BodyLength = MIN(bodyLength, response->BodyLength); response->BodyLength = MIN(bodyLength, response->BodyLength);

View File

@ -58,12 +58,12 @@ struct rdp_ntlm
SecPkgContext_Bindings* Bindings; SecPkgContext_Bindings* Bindings;
}; };
static ULONG cast_from_size_(size_t size, const char* fkt, const char* file, int line) static ULONG cast_from_size_(size_t size, const char* fkt, const char* file, size_t line)
{ {
if (size > ULONG_MAX) if (size > ULONG_MAX)
{ {
WLog_ERR(TAG, "[%s %s:%d] Size %" PRIdz " is larger than INT_MAX %lu", fkt, file, line, WLog_ERR(TAG, "[%s %s:%" PRIuz "] Size %" PRIdz " is larger than INT_MAX %lu", fkt, file,
size, ULONG_MAX); line, size, ULONG_MAX);
return 0; return 0;
} }

View File

@ -1756,7 +1756,7 @@ static BOOL rdg_establish_data_connection(rdpRdg* rdg, rdpTls* tls, const char*
encoding = http_response_get_transfer_encoding(response); encoding = http_response_get_transfer_encoding(response);
isWebsocket = http_response_is_websocket(rdg->http, response); isWebsocket = http_response_is_websocket(rdg->http, response);
http_response_free(response); http_response_free(response);
WLog_DBG(TAG, "%s authorization result: %d", method, statusCode); WLog_DBG(TAG, "%s authorization result: %ld", method, statusCode);
switch (statusCode) switch (statusCode)
{ {

View File

@ -476,8 +476,8 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, UINT16 length)
if (endPos != (begPos + blockLength)) if (endPos != (begPos + blockLength))
{ {
WLog_ERR(TAG, WLog_ERR(TAG,
"Error parsing GCC client data block 0x%04" PRIX16 "Error parsing GCC client data block 0x%04" PRIX16 ": Actual Offset: %" PRIuz
": Actual Offset: %d Expected Offset: %d", " Expected Offset: %" PRIuz,
type, endPos, begPos + blockLength); type, endPos, begPos + blockLength);
} }

View File

@ -142,7 +142,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a
WSAEventSelect(sockfd, listener->events[listener->num_sockfds], WSAEventSelect(sockfd, listener->events[listener->num_sockfds],
FD_READ | FD_ACCEPT | FD_CLOSE); FD_READ | FD_ACCEPT | FD_CLOSE);
listener->num_sockfds++; listener->num_sockfds++;
WLog_INFO(TAG, "Listening on [%s]:%d", addr, port); WLog_INFO(TAG, "Listening on [%s]:%" PRIu16, addr, port);
} }
freeaddrinfo(res); freeaddrinfo(res);

View File

@ -997,7 +997,7 @@ static int nla_client_init(rdpNla* nla)
if (nla->status != SEC_E_OK) if (nla->status != SEC_E_OK)
return -1; return -1;
WLog_DBG(TAG, "%s %" PRIu32 " : packageName=%s ; cbMaxToken=%d", __FUNCTION__, __LINE__, WLog_DBG(TAG, "%s %" PRIu32 " : packageName=%s ; cbMaxToken=%" PRIu32, __FUNCTION__, __LINE__,
nla->packageName, nla->cbMaxToken); nla->packageName, nla->cbMaxToken);
nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, SECPKG_CRED_OUTBOUND, nla->status = nla->table->AcquireCredentialsHandle(NULL, NLA_PKG_NAME, SECPKG_CRED_OUTBOUND,
NULL, nla->identity, NULL, NULL, NULL, nla->identity, NULL, NULL,
@ -1818,9 +1818,9 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla)
{ {
WLog_ERR(TAG, "Could not verify server's public key echo"); WLog_ERR(TAG, "Could not verify server's public key echo");
#if defined(WITH_DEBUG_NLA) #if defined(WITH_DEBUG_NLA)
WLog_ERR(TAG, "Expected (length = %d):", public_key_length); WLog_ERR(TAG, "Expected (length = %" PRIu32 "):", public_key_length);
winpr_HexDump(TAG, WLOG_ERROR, public_key1, public_key_length); winpr_HexDump(TAG, WLOG_ERROR, public_key1, public_key_length);
WLog_ERR(TAG, "Actual (length = %d):", public_key_length); WLog_ERR(TAG, "Actual (length = %" PRIu32 "):", public_key_length);
winpr_HexDump(TAG, WLOG_ERROR, public_key2, public_key_length); winpr_HexDump(TAG, WLOG_ERROR, public_key2, public_key_length);
#endif #endif
status = SEC_E_MESSAGE_ALTERED; /* DO NOT SEND CREDENTIALS! */ status = SEC_E_MESSAGE_ALTERED; /* DO NOT SEND CREDENTIALS! */

View File

@ -440,7 +440,7 @@ BOOL proxy_parse_uri(rdpSettings* settings, const char* uri_in)
port = 1080; port = 1080;
} }
WLog_DBG(TAG, "setting default proxy port: %d", port); WLog_DBG(TAG, "setting default proxy port: %" PRIu16, port);
} }
if (!freerdp_settings_set_uint16(settings, FreeRDP_ProxyPort, port)) if (!freerdp_settings_set_uint16(settings, FreeRDP_ProxyPort, port))
@ -460,14 +460,14 @@ BOOL proxy_parse_uri(rdpSettings* settings, const char* uri_in)
if (freerdp_settings_get_string(settings, FreeRDP_ProxyUsername)) if (freerdp_settings_get_string(settings, FreeRDP_ProxyUsername))
{ {
WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%s@%s:%d", protocol, WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%s@%s:%" PRIu16, protocol,
freerdp_settings_get_string(settings, FreeRDP_ProxyUsername), "******", freerdp_settings_get_string(settings, FreeRDP_ProxyUsername), "******",
freerdp_settings_get_string(settings, FreeRDP_ProxyHostname), freerdp_settings_get_string(settings, FreeRDP_ProxyHostname),
freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort)); freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort));
} }
else else
{ {
WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%d", protocol, WLog_INFO(TAG, "Parsed proxy configuration: %s://%s:%" PRIu16, protocol,
freerdp_settings_get_string(settings, FreeRDP_ProxyHostname), freerdp_settings_get_string(settings, FreeRDP_ProxyHostname),
freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort)); freerdp_settings_get_uint16(settings, FreeRDP_ProxyPort));
} }
@ -826,14 +826,14 @@ static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername,
if (buf[1] == 0) if (buf[1] == 0)
{ {
WLog_INFO(TAG, "Successfully connected to %s:%d", hostname, port); WLog_INFO(TAG, "Successfully connected to %s:%" PRIu16, hostname, port);
return TRUE; return TRUE;
} }
if (buf[1] > 0 && buf[1] < 9) if (buf[1] > 0 && buf[1] < 9)
WLog_INFO(TAG, "SOCKS Proxy replied: %s", rplstat[buf[1]]); WLog_INFO(TAG, "SOCKS Proxy replied: %s", rplstat[buf[1]]);
else else
WLog_INFO(TAG, "SOCKS Proxy replied: %d status not listed in rfc1928", buf[1]); WLog_INFO(TAG, "SOCKS Proxy replied: %" PRIu8 " status not listed in rfc1928", buf[1]);
return FALSE; return FALSE;
} }

View File

@ -414,7 +414,8 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s)
if (!rdp_redirection_read_unicode_string(s, &(redirection->TargetNetAddresses[i]), 80)) if (!rdp_redirection_read_unicode_string(s, &(redirection->TargetNetAddresses[i]), 80))
return FALSE; return FALSE;
WLog_DBG(TAG, "TargetNetAddresses[%d]: %s", i, redirection->TargetNetAddresses[i]); WLog_DBG(TAG, "TargetNetAddresses[%" PRIuz "]: %s", i,
redirection->TargetNetAddresses[i]);
} }
} }

View File

@ -369,7 +369,7 @@ static BOOL smartcard_hw_enumerateCerts(const rdpSettings* settings, LPCWSTR csp
certBytes = calloc(1, cbOutput); certBytes = calloc(1, cbOutput);
if (!certBytes) if (!certBytes)
{ {
WLog_ERR(TAG, "unable to allocate %d certBytes for key %s", cbOutput, WLog_ERR(TAG, "unable to allocate %" PRIu32 " certBytes for key %s", cbOutput,
cert->info.containerName); cert->info.containerName);
goto endofloop; goto endofloop;
} }

View File

@ -612,7 +612,7 @@ BOOL ber_read_integer(wStream* s, UINT32* value)
} }
else else
{ {
WLog_ERR(TAG, "should implement reading an integer with length=%d", length); WLog_ERR(TAG, "should implement reading an integer with length=%" PRIuz, length);
return FALSE; return FALSE;
} }

View File

@ -1412,8 +1412,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
accept_cert(tls, pemCert, length); accept_cert(tls, pemCert, length);
else if (verification_status < 0) else if (verification_status < 0)
{ {
WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %d) status: [%d] %s", length, WLog_ERR(TAG, "VerifyX509Certificate failed: (length = %" PRIuz ") status: [%d] %s",
verification_status, pemCert); length, verification_status, pemCert);
goto end; goto end;
} }
} }
@ -1556,7 +1556,8 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
hostname, port, pem, certificate_store_get_hosts_file(tls->certificate_store)); hostname, port, pem, certificate_store_get_hosts_file(tls->certificate_store));
if (!stored_data) if (!stored_data)
WLog_WARN(TAG, "Failed to get certificate entry for %s:%d", hostname, port); WLog_WARN(TAG, "Failed to get certificate entry for %s:%" PRIu16 "", hostname,
port);
if (tls->settings->AutoDenyCertificate) if (tls->settings->AutoDenyCertificate)
{ {

View File

@ -67,7 +67,7 @@ typedef enum
#define smartcard_ndr_pointer_read(s, index, ptr) \ #define smartcard_ndr_pointer_read(s, index, ptr) \
smartcard_ndr_pointer_read_((s), (index), (ptr), __FILE__, __FUNCTION__, __LINE__) smartcard_ndr_pointer_read_((s), (index), (ptr), __FILE__, __FUNCTION__, __LINE__)
static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr, const char* file, static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr, const char* file,
const char* fkt, int line) const char* fkt, size_t line)
{ {
const UINT32 expect = 0x20000 + (*index) * 4; const UINT32 expect = 0x20000 + (*index) * 4;
UINT32 ndrPtr; UINT32 ndrPtr;
@ -85,8 +85,9 @@ static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr,
/* Allow NULL pointer if we read the result */ /* Allow NULL pointer if we read the result */
if (ptr && (ndrPtr == 0)) if (ptr && (ndrPtr == 0))
return TRUE; return TRUE;
WLog_WARN(TAG, "[%s:%d] Read context pointer 0x%08" PRIx32 ", expected 0x%08" PRIx32, fkt, WLog_WARN(TAG,
line, ndrPtr, expect); "[%s:%" PRIuz "] Read context pointer 0x%08" PRIx32 ", expected 0x%08" PRIx32,
fkt, line, ndrPtr, expect);
return FALSE; return FALSE;
} }

View File

@ -138,12 +138,39 @@ static DynvcReadResult dynvc_read_varInt(wStream* s, size_t len, UINT64* varInt,
break; break;
case 0x03: case 0x03:
default: default:
WLog_ERR(TAG, "Unknown int len %d", len); WLog_ERR(TAG, "Unknown int len %" PRIuz, len);
return DYNCVC_READ_ERROR; return DYNCVC_READ_ERROR;
} }
return DYNCVC_READ_OK; return DYNCVC_READ_OK;
} }
static const char* get_packet_type(BYTE cmd)
{
switch (cmd)
{
case CREATE_REQUEST_PDU:
return "CREATE_REQUEST_PDU";
case DATA_FIRST_PDU:
return "DATA_FIRST_PDU";
case DATA_PDU:
return "DATA_PDU";
case CLOSE_REQUEST_PDU:
return "CLOSE_REQUEST_PDU";
case CAPABILITY_REQUEST_PDU:
return "CAPABILITY_REQUEST_PDU";
case DATA_FIRST_COMPRESSED_PDU:
return "DATA_FIRST_COMPRESSED_PDU";
case DATA_COMPRESSED_PDU:
return "DATA_COMPRESSED_PDU";
case SOFT_SYNC_REQUEST_PDU:
return "SOFT_SYNC_REQUEST_PDU";
case SOFT_SYNC_RESPONSE_PDU:
return "SOFT_SYNC_RESPONSE_PDU";
default:
return "UNKNOWN";
}
}
static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL firstPacket, static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL firstPacket,
BOOL lastPacket) BOOL lastPacket)
{ {
@ -371,14 +398,15 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir
if (dynChannel->openStatus != CHANNEL_OPENSTATE_OPENED) if (dynChannel->openStatus != CHANNEL_OPENSTATE_OPENED)
{ {
WLog_ERR(TAG, "DynvcTracker(%s): channel is not opened", dynChannel->channel_name); WLog_ERR(TAG, "DynvcTracker(%s [%s]): channel is not opened", dynChannel->channel_name,
cmd);
return PF_CHANNEL_RESULT_ERROR; return PF_CHANNEL_RESULT_ERROR;
} }
if ((cmd == DATA_FIRST_PDU) || (cmd == DATA_FIRST_COMPRESSED_PDU)) if ((cmd == DATA_FIRST_PDU) || (cmd == DATA_FIRST_COMPRESSED_PDU))
{ {
WLog_DBG(TAG, "DynvcTracker(%s): %s DATA_FIRST currentPacketLength=%d", WLog_DBG(TAG, "DynvcTracker(%s [%s]): %s DATA_FIRST currentPacketLength=%" PRIu64 "",
dynChannel->channel_name, direction, Length); dynChannel->channel_name, cmd, direction, Length);
trackerState->currentDataLength = Length; trackerState->currentDataLength = Length;
trackerState->CurrentDataReceived = 0; trackerState->CurrentDataReceived = 0;
trackerState->CurrentDataFragments = 0; trackerState->CurrentDataFragments = 0;
@ -388,8 +416,9 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir
{ {
trackerState->CurrentDataFragments++; trackerState->CurrentDataFragments++;
trackerState->CurrentDataReceived += Stream_GetRemainingLength(s); trackerState->CurrentDataReceived += Stream_GetRemainingLength(s);
WLog_DBG(TAG, "DynvcTracker(%s): %s %s frags=%d received=%d(%d)", dynChannel->channel_name, WLog_DBG(TAG,
direction, cmd == DATA_PDU ? "DATA" : "DATA_FIRST", "DynvcTracker(%s [%s]): %s %s frags=%" PRIu32 " received=%" PRIu32 "(%" PRIu32 ")",
dynChannel->channel_name, cmd, direction, cmd == DATA_PDU ? "DATA" : "DATA_FIRST",
trackerState->CurrentDataFragments, trackerState->CurrentDataReceived, trackerState->CurrentDataFragments, trackerState->CurrentDataReceived,
trackerState->currentDataLength); trackerState->currentDataLength);
} }
@ -400,10 +429,11 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir
{ {
if (trackerState->CurrentDataReceived > trackerState->currentDataLength) if (trackerState->CurrentDataReceived > trackerState->currentDataLength)
{ {
WLog_ERR( WLog_ERR(TAG,
TAG, "DynvcTracker (%s [%s]): reassembled packet (%" PRIu32
"DynvcTracker: reassembled packet (%d) is bigger than announced length (%d)", ") is bigger than announced length (%" PRIu32 ")",
trackerState->CurrentDataReceived, trackerState->currentDataLength); dynChannel->channel_name, cmd, trackerState->CurrentDataReceived,
trackerState->currentDataLength);
return PF_CHANNEL_RESULT_ERROR; return PF_CHANNEL_RESULT_ERROR;
} }
} }

View File

@ -55,7 +55,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE*
WINPR_ASSERT(tracker); WINPR_ASSERT(tracker);
WLog_VRB(TAG, "channelTracker_update(%s): sz=%d first=%d last=%d", WLog_VRB(TAG, "channelTracker_update(%s): sz=%" PRIuz " first=%d last=%d",
tracker->channel->channel_name, xsize, firstPacket, lastPacket); tracker->channel->channel_name, xsize, firstPacket, lastPacket);
if (flags & CHANNEL_FLAG_FIRST) if (flags & CHANNEL_FLAG_FIRST)
{ {
@ -81,7 +81,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE*
} }
if (tracker->currentPacketReceived + xsize > tracker->currentPacketSize) if (tracker->currentPacketReceived + xsize > tracker->currentPacketSize)
WLog_INFO(TAG, "cumulated size is bigger (%d) than total size (%d)", WLog_INFO(TAG, "cumulated size is bigger (%" PRIuz ") than total size (%" PRIuz ")",
tracker->currentPacketReceived + xsize, tracker->currentPacketSize); tracker->currentPacketReceived + xsize, tracker->currentPacketSize);
tracker->currentPacketReceived += xsize; tracker->currentPacketReceived += xsize;
@ -110,7 +110,7 @@ PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE*
{ {
tracker->mode = CHANNEL_TRACKER_PEEK; tracker->mode = CHANNEL_TRACKER_PEEK;
if (tracker->currentPacketReceived != tracker->currentPacketSize) if (tracker->currentPacketReceived != tracker->currentPacketSize)
WLog_INFO(TAG, "cumulated size(%d) does not match total size (%d)", WLog_INFO(TAG, "cumulated size(%" PRIuz ") does not match total size (%" PRIuz ")",
tracker->currentPacketReceived, tracker->currentPacketSize); tracker->currentPacketReceived, tracker->currentPacketSize);
} }
@ -144,7 +144,7 @@ PfChannelResult channelTracker_flushCurrent(ChannelStateTracker* t, BOOL first,
WINPR_ASSERT(t); WINPR_ASSERT(t);
WLog_VRB(TAG, "channelTracker_flushCurrent(%s): %s sz=%d first=%d last=%d", WLog_VRB(TAG, "channelTracker_flushCurrent(%s): %s sz=%" PRIuz " first=%d last=%d",
t->channel->channel_name, direction, Stream_GetPosition(t->currentPacket), first, t->channel->channel_name, direction, Stream_GetPosition(t->currentPacket), first,
last); last);

View File

@ -206,7 +206,7 @@ static BOOL pf_server_setup_channels(freerdp_peer* peer)
const char* cname = accepted_channels[i]; const char* cname = accepted_channels[i];
UINT16 channelId = WTSChannelGetId(peer, cname); UINT16 channelId = WTSChannelGetId(peer, cname);
PROXY_LOG_INFO(TAG, ps, "Accepted channel: %s (%d)", cname, channelId); PROXY_LOG_INFO(TAG, ps, "Accepted channel: %s (%" PRIu16 ")", cname, channelId);
channelContext = StaticChannelContext_new(ps, cname, channelId); channelContext = StaticChannelContext_new(ps, cname, channelId);
if (!channelContext) if (!channelContext)
{ {
@ -411,7 +411,7 @@ static BOOL pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 chann
channel = HashTable_GetItemValue(ps->channelsById, &channelId64); channel = HashTable_GetItemValue(ps->channelsById, &channelId64);
if (!channel) if (!channel)
{ {
PROXY_LOG_ERR(TAG, ps, "channel id=%d not registered here, dropping", channelId64); PROXY_LOG_ERR(TAG, ps, "channel id=%" PRIu64 " not registered here, dropping", channelId64);
return TRUE; return TRUE;
} }
@ -628,7 +628,7 @@ static DWORD WINAPI pf_server_handle_peer(LPVOID arg)
if (status == WAIT_FAILED) if (status == WAIT_FAILED)
{ {
WLog_ERR(TAG, "WaitForMultipleObjects failed (status: %d)", status); WLog_ERR(TAG, "WaitForMultipleObjects failed (status: %" PRIu32 ")", status);
break; break;
} }

View File

@ -1265,7 +1265,7 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub)
if ((subsystem->depth != 24) && (subsystem->depth != 32)) if ((subsystem->depth != 24) && (subsystem->depth != 32))
{ {
WLog_ERR(TAG, "unsupported X11 server color depth: %d", subsystem->depth); WLog_ERR(TAG, "unsupported X11 server color depth: %" PRIu32, subsystem->depth);
return -1; return -1;
} }

View File

@ -215,8 +215,10 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH
WLog_INFO(TAG, "|%s|", rows[ty] ? "O" : "X"); WLog_INFO(TAG, "|%s|", rows[ty] ? "O" : "X");
} }
WLog_INFO(TAG, "left: %d top: %d right: %d bottom: %d ncol: %d nrow: %d", l, t, r, b, ncol, WLog_INFO(TAG,
nrow); "left: %" PRIu32 " top: %" PRIu32 " right: %" PRIu32 " bottom: %" PRIu32
" ncol: %" PRIu32 " nrow: %" PRIu32,
l, t, r, b, ncol, nrow);
free(col_str); free(col_str);
#endif #endif
return 1; return 1;

View File

@ -1774,8 +1774,9 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF
pSrcData = &pSrcData[((UINT16)subY * nSrcStep) + ((UINT16)subX * 4U)]; pSrcData = &pSrcData[((UINT16)subY * nSrcStep) + ((UINT16)subX * 4U)];
} }
// WLog_INFO(TAG, "shadow_client_send_surface_update: x: %d y: %d width: %d height: %d right: %d // WLog_INFO(TAG, "shadow_client_send_surface_update: x: %" PRId64 " y: %" PRId64 " width: %"
// bottom: %d", nXSrc, nYSrc, nWidth, nHeight, nXSrc + nWidth, nYSrc + nHeight); // PRId64 " height: %" PRId64 " right: %" PRId64 " bottom: %" PRId64, nXSrc, nYSrc, nWidth,
// nHeight, nXSrc + nWidth, nYSrc + nHeight);
if (settings->SupportGraphicsPipeline && pStatus->gfxOpened) if (settings->SupportGraphicsPipeline && pStatus->gfxOpened)
{ {

View File

@ -62,7 +62,7 @@ extern "C"
WINPR_API void Stream_Free(wStream* s, BOOL bFreeBuffer); WINPR_API void Stream_Free(wStream* s, BOOL bFreeBuffer);
#define Stream_CheckAndLogRequiredLength(tag, s, len) \ #define Stream_CheckAndLogRequiredLength(tag, s, len) \
Stream_CheckAndLogRequiredLengthEx(tag, WLOG_WARN, s, len, "%s(%s:%d)", __FUNCTION__, \ Stream_CheckAndLogRequiredLengthEx(tag, WLOG_WARN, s, len, "%s(%s:%" PRIuz ")", __FUNCTION__, \
__FILE__, __LINE__) __FILE__, __LINE__)
WINPR_API BOOL Stream_CheckAndLogRequiredLengthEx(const char* tag, DWORD level, wStream* s, WINPR_API BOOL Stream_CheckAndLogRequiredLengthEx(const char* tag, DWORD level, wStream* s,
UINT64 len, const char* fmt, ...); UINT64 len, const char* fmt, ...);

View File

@ -84,7 +84,7 @@ static struct synthetic_file* make_synthetic_file(const WCHAR* local_name, const
hFind = FindFirstFileW(local_name, &fd); hFind = FindFirstFileW(local_name, &fd);
if (INVALID_HANDLE_VALUE == hFind) if (INVALID_HANDLE_VALUE == hFind)
{ {
WLog_ERR(TAG, "FindFirstFile failed (%d)", GetLastError()); WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError());
return NULL; return NULL;
} }
FindClose(hFind); FindClose(hFind);
@ -330,7 +330,7 @@ static BOOL do_add_directory_contents_to_list(wClipboard* clipboard, const WCHAR
BOOL bRet = FindNextFileW(hFind, &FileData); BOOL bRet = FindNextFileW(hFind, &FileData);
if (!bRet) if (!bRet)
{ {
WLog_WARN(TAG, "FindNextFile failed (%d)", GetLastError()); WLog_WARN(TAG, "FindNextFile failed (%" PRIu32 ")", GetLastError());
if (ERROR_NO_MORE_FILES == GetLastError()) if (ERROR_NO_MORE_FILES == GetLastError())
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -369,7 +369,7 @@ static BOOL add_directory_contents_to_list(wClipboard* clipboard, const WCHAR* l
if (hFind == INVALID_HANDLE_VALUE) if (hFind == INVALID_HANDLE_VALUE)
{ {
WLog_ERR(TAG, "FindFirstFile failed (%d)", GetLastError()); WLog_ERR(TAG, "FindFirstFile failed (%" PRIu32 ")", GetLastError());
return FALSE; return FALSE;
} }
@ -1140,7 +1140,7 @@ UINT synthetic_file_read_close(struct synthetic_file* file, BOOL force)
WLog_VRB(TAG, "close file %d", file->fd); WLog_VRB(TAG, "close file %d", file->fd);
if (CloseHandle(file->fd) < 0) if (CloseHandle(file->fd) < 0)
{ {
WLog_WARN(TAG, "failed to close fd %d: %d", file->fd, GetLastError()); WLog_WARN(TAG, "failed to close fd %d: %" PRIu32, file->fd, GetLastError());
} }
file->fd = INVALID_HANDLE_VALUE; file->fd = INVALID_HANDLE_VALUE;
@ -1206,7 +1206,7 @@ static UINT file_get_range(struct synthetic_file* file, UINT64 offset, UINT32 si
*/ */
if (offset > INT64_MAX) if (offset > INT64_MAX)
{ {
WLog_ERR(TAG, "offset [%d] > INT64_MAX", offset); WLog_ERR(TAG, "offset [%" PRIu64 "] > INT64_MAX", offset);
error = ERROR_SEEK; error = ERROR_SEEK;
break; break;
} }

View File

@ -309,8 +309,8 @@ BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
#ifdef HAVE_SYS_AIO_H #ifdef HAVE_SYS_AIO_H
{ {
int aio_status; int aio_status;
struct aiocb cb; struct aiocb cb = { 0 };
ZeroMemory(&cb, sizeof(struct aiocb));
cb.aio_fildes = pipe->clientfd; cb.aio_fildes = pipe->clientfd;
cb.aio_buf = lpBuffer; cb.aio_buf = lpBuffer;
cb.aio_nbytes = nNumberOfBytesToRead; cb.aio_nbytes = nNumberOfBytesToRead;
@ -396,8 +396,8 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
pipe->lpOverlapped = lpOverlapped; pipe->lpOverlapped = lpOverlapped;
#ifdef HAVE_SYS_AIO_H #ifdef HAVE_SYS_AIO_H
{ {
struct aiocb cb; struct aiocb cb = { 0 };
ZeroMemory(&cb, sizeof(struct aiocb));
cb.aio_fildes = pipe->clientfd; cb.aio_fildes = pipe->clientfd;
cb.aio_buf = (void*)lpBuffer; cb.aio_buf = (void*)lpBuffer;
cb.aio_nbytes = nNumberOfBytesToWrite; cb.aio_nbytes = nNumberOfBytesToWrite;
@ -407,7 +407,7 @@ BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
cb.aio_sigevent.sigev_value.sival_ptr = (void*)lpOverlapped; cb.aio_sigevent.sigev_value.sival_ptr = (void*)lpOverlapped;
InstallAioSignalHandler(); InstallAioSignalHandler();
io_status = aio_write(&cb); io_status = aio_write(&cb);
WLog_DBG("aio_write status: %d", io_status); WLog_DBG("aio_write status: %" PRIdz, io_status);
if (io_status < 0) if (io_status < 0)
status = FALSE; status = FALSE;

View File

@ -1041,7 +1041,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULON
} }
#ifdef WITH_DEBUG_NTLM #ifdef WITH_DEBUG_NTLM
WLog_DBG(TAG, "Data Buffer (length = %d)", length); WLog_DBG(TAG, "Data Buffer (length = %" PRIuz ")", length);
winpr_HexDump(TAG, WLOG_DEBUG, data, length); winpr_HexDump(TAG, WLOG_DEBUG, data, length);
WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer);
winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer);
@ -1134,7 +1134,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSec
} }
#ifdef WITH_DEBUG_NTLM #ifdef WITH_DEBUG_NTLM
WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", length); WLog_DBG(TAG, "Encrypted Data Buffer (length = %" PRIuz ")", length);
winpr_HexDump(TAG, WLOG_DEBUG, data, length); winpr_HexDump(TAG, WLOG_DEBUG, data, length);
WLog_DBG(TAG, "Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer); WLog_DBG(TAG, "Data Buffer (length = %" PRIu32 ")", data_buffer->cbBuffer);
winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer);

View File

@ -199,7 +199,7 @@ BOOL pollset_isSignaled(WINPR_POLL_SET* set, size_t idx)
{ {
if (idx > set->fillIndex) if (idx > set->fillIndex)
{ {
WLog_ERR(TAG, "%s: index=%d out of pollset(fillIndex=%d)", __FUNCTION__, idx, WLog_ERR(TAG, "%s: index=%d out of pollset(fillIndex=%" PRIuz ")", __FUNCTION__, idx,
set->fillIndex); set->fillIndex);
return FALSE; return FALSE;
} }

View File

@ -459,11 +459,11 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait
if (status < 0) if (status < 0)
{ {
#ifdef HAVE_POLL_H #ifdef HAVE_POLL_H
WLog_ERR(TAG, "poll() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, WLog_ERR(TAG, "poll() handle %" PRIu32 " (%" PRIu32 ") failure [%d] %s", index,
errno, strerror(errno)); nCount, errno, strerror(errno));
#else #else
WLog_ERR(TAG, "select() handle %d (%" PRIu32 ") failure [%d] %s", index, nCount, WLog_ERR(TAG, "select() handle %" PRIu32 " (%" PRIu32 ") failure [%d] %s", index,
errno, strerror(errno)); nCount, errno, strerror(errno));
#endif #endif
winpr_log_backtrace(TAG, WLOG_ERROR, 20); winpr_log_backtrace(TAG, WLOG_ERROR, 20);
SetLastError(ERROR_INTERNAL_ERROR); SetLastError(ERROR_INTERNAL_ERROR);
@ -497,7 +497,7 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait
DWORD rc = winpr_Handle_cleanup(lpHandles[handlesIndex]); DWORD rc = winpr_Handle_cleanup(lpHandles[handlesIndex]);
if (rc != WAIT_OBJECT_0) if (rc != WAIT_OBJECT_0)
{ {
WLog_ERR(TAG, "error in cleanup function for handle at index=%d", WLog_ERR(TAG, "error in cleanup function for handle at index=%" PRIu32,
handlesIndex); handlesIndex);
ret = rc; ret = rc;
goto out; goto out;

View File

@ -384,8 +384,8 @@ winpr_get_current_time_zone_rule(const TIME_ZONE_RULE_ENTRY* rules, UINT32 count
{ {
if ((rules[i].TicksStart >= windows_time) && (windows_time >= rules[i].TicksEnd)) if ((rules[i].TicksStart >= windows_time) && (windows_time >= rules[i].TicksEnd))
{ {
/*WLog_ERR(TAG, "Got rule %d from table at %p with count %"PRIu32"", i, (void*) rules, /*WLog_ERR(TAG, "Got rule %" PRIu32 " from table at %p with count %"PRIu32"", i,
* count);*/ * (void*) rules, count);*/
return &rules[i]; return &rules[i];
} }
} }

View File

@ -199,11 +199,11 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, size_t line)
if (__android_log_print(ANDROID_LOG_FATAL, tag, "Recursion detected!!!") < 0) if (__android_log_print(ANDROID_LOG_FATAL, tag, "Recursion detected!!!") < 0)
goto out; goto out;
if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%d]", fkt, file, line) < 0) if (__android_log_print(ANDROID_LOG_FATAL, tag, "Check %s [%s:%zu]", fkt, file, line) < 0)
goto out; goto out;
for (i = 0; i < used; i++) for (i = 0; i < used; i++)
if (__android_log_print(ANDROID_LOG_FATAL, tag, "%zd: %s", i, msg[i]) < 0) if (__android_log_print(ANDROID_LOG_FATAL, tag, "%zu: %s", i, msg[i]) < 0)
goto out; goto out;
#else #else