diff --git a/channels/audin/client/alsa/audin_alsa.c b/channels/audin/client/alsa/audin_alsa.c index cca9b37da..c01eafccb 100644 --- a/channels/audin/client/alsa/audin_alsa.c +++ b/channels/audin/client/alsa/audin_alsa.c @@ -97,8 +97,8 @@ static BOOL audin_alsa_set_params(AudinALSADevice* alsa, if ((alsa->actual_rate != alsa->target_rate) || (alsa->actual_channels != alsa->target_channels)) { - DEBUG_DVC("actual rate %d / channel %d is " - "different from target rate %d / channel %d, resampling required.", + DEBUG_DVC("actual rate %"PRIu32" / channel %"PRIu32" is " + "different from target rate %"PRIu32" / channel %"PRIu32", resampling required.", alsa->actual_rate, alsa->actual_channels, alsa->target_rate, alsa->target_channels); } @@ -136,7 +136,7 @@ static UINT audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, alsa->actual_channels, alsa->actual_rate, size / rbytes_per_frame, alsa->target_channels, alsa->target_rate); frames = alsa->dsp_context->resampled_frames; - DEBUG_DVC("resampled %d frames at %d to %d frames at %d", + DEBUG_DVC("resampled %d frames at %"PRIu32" to %d frames at %"PRIu32"", size / rbytes_per_frame, alsa->actual_rate, frames, alsa->target_rate); size = frames * tbytes_per_frame; src = alsa->dsp_context->resampled_buffer; @@ -149,7 +149,7 @@ static UINT audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, if (status == WAIT_FAILED) { ret = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", ret); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", ret); break; } @@ -193,7 +193,7 @@ static UINT audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, if (status == WAIT_FAILED) { ret = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", ret); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", ret); break; } @@ -391,7 +391,7 @@ static UINT audin_alsa_set_format(IAudinDevice* device, audinFormat* format, bs = (format->nBlockAlign - 4 * format->nChannels) * 4; alsa->frames_per_packet = (alsa->frames_per_packet * format->nChannels * 2 / bs + 1) * bs / (format->nChannels * 2); - DEBUG_DVC("aligned FramesPerPacket=%d", + DEBUG_DVC("aligned FramesPerPacket=%"PRIu32"", alsa->frames_per_packet); break; } @@ -463,7 +463,7 @@ static UINT audin_alsa_close(IAudinDevice* device) if (WaitForSingleObject(alsa->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -562,7 +562,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = audin_alsa_parse_addin_args(alsa, args))) { - WLog_ERR(TAG, "audin_alsa_parse_addin_args failed with errorcode %u!", error); + WLog_ERR(TAG, "audin_alsa_parse_addin_args failed with errorcode %"PRIu32"!", error); goto error_out; } @@ -597,7 +597,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) alsa))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c index b97d94c54..6306af8d6 100644 --- a/channels/audin/client/audin_main.c +++ b/channels/audin/client/audin_main.c @@ -109,7 +109,7 @@ static UINT audin_process_version(IWTSVirtualChannelCallback* pChannelCallback, Stream_Read_UINT32(s, Version); - DEBUG_DVC("Version=%d", Version); + DEBUG_DVC("Version=%"PRIu32"", Version); out = Stream_New(NULL, 5); @@ -159,10 +159,10 @@ static UINT audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, UINT32 cbSizeFormatsPacket; Stream_Read_UINT32(s, NumFormats); - DEBUG_DVC("NumFormats %d", NumFormats); + DEBUG_DVC("NumFormats %"PRIu32"", NumFormats); if ((NumFormats < 1) || (NumFormats > 1000)) { - WLog_ERR(TAG, "bad NumFormats %d", NumFormats); + WLog_ERR(TAG, "bad NumFormats %"PRIu32"", NumFormats); return ERROR_INVALID_DATA; } Stream_Seek_UINT32(s); /* cbSizeFormatsPacket */ @@ -199,8 +199,8 @@ static UINT audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, format.data = Stream_Pointer(s); Stream_Seek(s, format.cbSize); - DEBUG_DVC("wFormatTag=%d nChannels=%d nSamplesPerSec=%d " - "nBlockAlign=%d wBitsPerSample=%d cbSize=%d", + DEBUG_DVC("wFormatTag=%"PRIu16" nChannels=%"PRIu16" nSamplesPerSec=%"PRIu32" " + "nBlockAlign=%"PRIu16" wBitsPerSample=%"PRIu16" cbSize=%"PRIu16"", format.wFormatTag, format.nChannels, format.nSamplesPerSec, format.nBlockAlign, format.wBitsPerSample, format.cbSize); @@ -358,12 +358,12 @@ static UINT audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wSt Stream_Read_UINT32(s, FramesPerPacket); Stream_Read_UINT32(s, initialFormat); - DEBUG_DVC("FramesPerPacket=%d initialFormat=%d", + DEBUG_DVC("FramesPerPacket=%"PRIu32" initialFormat=%"PRIu32"", FramesPerPacket, initialFormat); if (initialFormat >= (UINT32) callback->formats_count) { - WLog_ERR(TAG, "invalid format index %d (total %d)", + WLog_ERR(TAG, "invalid format index %"PRIu32" (total %d)", initialFormat, callback->formats_count); return ERROR_INVALID_DATA; } @@ -374,13 +374,13 @@ static UINT audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wSt IFCALLRET(audin->device->SetFormat, error, audin->device, format, FramesPerPacket); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "SetFormat failed with errorcode %u", error); + WLog_ERR(TAG, "SetFormat failed with errorcode %"PRIu32"", error); return error; } IFCALLRET(audin->device->Open, error, audin->device, audin_receive_wave_data, callback); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Open failed with errorcode %u", error); + WLog_ERR(TAG, "Open failed with errorcode %"PRIu32"", error); return error; } } @@ -412,11 +412,11 @@ static UINT audin_process_format_change(IWTSVirtualChannelCallback* pChannelCall Stream_Read_UINT32(s, NewFormat); - DEBUG_DVC("NewFormat=%d", NewFormat); + DEBUG_DVC("NewFormat=%"PRIu32"", NewFormat); if (NewFormat >= (UINT32) callback->formats_count) { - WLog_ERR(TAG, "invalid format index %d (total %d)", + WLog_ERR(TAG, "invalid format index %"PRIu32" (total %d)", NewFormat, callback->formats_count); return ERROR_INVALID_DATA; } @@ -428,19 +428,19 @@ static UINT audin_process_format_change(IWTSVirtualChannelCallback* pChannelCall IFCALLRET(audin->device->Close, error, audin->device); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Close failed with errorcode %u", error); + WLog_ERR(TAG, "Close failed with errorcode %"PRIu32"", error); return error; } IFCALLRET(audin->device->SetFormat, error, audin->device, format, 0); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "SetFormat failed with errorcode %u", error); + WLog_ERR(TAG, "SetFormat failed with errorcode %"PRIu32"", error); return error; } IFCALLRET(audin->device->Open, error, audin->device, audin_receive_wave_data, callback); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Open failed with errorcode %u", error); + WLog_ERR(TAG, "Open failed with errorcode %"PRIu32"", error); return error; } } @@ -463,7 +463,7 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, Stream_Read_UINT8(data, MessageId); - DEBUG_DVC("MessageId=0x%x", MessageId); + DEBUG_DVC("MessageId=0x%02"PRIx8"", MessageId); switch (MessageId) { @@ -484,7 +484,7 @@ static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, break; default: - WLog_ERR(TAG, "unknown MessageId=0x%x", MessageId); + WLog_ERR(TAG, "unknown MessageId=0x%02"PRIx8"", MessageId); error = ERROR_INVALID_DATA; break; } @@ -509,7 +509,7 @@ static UINT audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) { IFCALLRET(audin->device->Close, error, audin->device); if (error != CHANNEL_RC_OK) - WLog_ERR(TAG, "Close failed with errorcode %u", error); + WLog_ERR(TAG, "Close failed with errorcode %"PRIu32"", error); } free(callback->formats); @@ -593,7 +593,7 @@ static UINT audin_plugin_terminated(IWTSPlugin* pPlugin) IFCALLRET(audin->device->Free, error, audin->device); if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Free failed with errorcode %u", error); + WLog_ERR(TAG, "Free failed with errorcode %"PRIu32"", error); // dont stop on error } audin->device = NULL; @@ -662,7 +662,7 @@ static UINT audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, ADDI if ((error = entry(&entryPoints))) { - WLog_ERR(TAG, "%s entry returned error %u.", name, error); + WLog_ERR(TAG, "%s entry returned error %"PRIu32".", name, error); return error; } @@ -744,7 +744,7 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) { if ((error = audin_set_subsystem(audin, arg->Value))) { - WLog_ERR(TAG, "audin_set_subsystem failed with error %u!", error); + WLog_ERR(TAG, "audin_set_subsystem failed with error %"PRIu32"!", error); return FALSE; } } @@ -752,7 +752,7 @@ BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args) { if ((error = audin_set_device_name(audin, arg->Value))) { - WLog_ERR(TAG, "audin_set_device_name failed with error %u!", error); + WLog_ERR(TAG, "audin_set_device_name failed with error %"PRIu32"!", error); return FALSE; } } @@ -858,7 +858,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { if ((error = audin_load_device_plugin((IWTSPlugin*) audin, audin->subsystem, args))) { - WLog_ERR(TAG, "audin_load_device_plugin %s failed with error %u!", + WLog_ERR(TAG, "audin_load_device_plugin %s failed with error %"PRIu32"!", audin->subsystem, error); goto out; } @@ -869,17 +869,17 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { if ((error = audin_set_subsystem(audin, entry->subsystem))) { - WLog_ERR(TAG, "audin_set_subsystem for %s failed with error %u!", + WLog_ERR(TAG, "audin_set_subsystem for %s failed with error %"PRIu32"!", entry->subsystem, error); } else if ((error = audin_set_device_name(audin, entry->device))) { - WLog_ERR(TAG, "audin_set_device_name for %s failed with error %u!", + WLog_ERR(TAG, "audin_set_device_name for %s failed with error %"PRIu32"!", entry->subsystem, error); } else if ((error = audin_load_device_plugin((IWTSPlugin*) audin, audin->subsystem, args))) { - WLog_ERR(TAG, "audin_load_device_plugin %s failed with error %u!", + WLog_ERR(TAG, "audin_load_device_plugin %s failed with error %"PRIu32"!", entry->subsystem, error); } diff --git a/channels/audin/client/mac/audin_mac.c b/channels/audin/client/mac/audin_mac.c index 83bc6ec8f..d35783849 100644 --- a/channels/audin/client/mac/audin_mac.c +++ b/channels/audin/client/mac/audin_mac.c @@ -215,7 +215,7 @@ static void mac_audio_queue_input_cb(void *aqData, if ((error = mac->receive(encoded_data, encoded_size, mac->user_data))) { - WLog_ERR(TAG, "mac->receive failed with error %u", error); + WLog_ERR(TAG, "mac->receive failed with error %"PRIu32"", error); SetLastError(ERROR_INTERNAL_ERROR); return; } @@ -238,7 +238,7 @@ static UINT audin_mac_close(IAudinDevice *device) if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueStop failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueStop failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); } mac->isOpen = false; @@ -250,7 +250,7 @@ static UINT audin_mac_close(IAudinDevice *device) if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueDispose failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueDispose failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); } @@ -278,7 +278,7 @@ static UINT audin_mac_open(IAudinDevice *device, AudinReceive receive, void *use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueNewInput failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueNewInput failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -290,7 +290,7 @@ static UINT audin_mac_open(IAudinDevice *device, AudinReceive receive, void *use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueAllocateBuffer failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueAllocateBuffer failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -302,7 +302,7 @@ static UINT audin_mac_open(IAudinDevice *device, AudinReceive receive, void *use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueEnqueueBuffer failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueEnqueueBuffer failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -314,7 +314,7 @@ static UINT audin_mac_open(IAudinDevice *device, AudinReceive receive, void *use if (devStat != 0) { errCode = GetLastError(); - WLog_ERR(TAG, "AudioQueueStart failed with %s [%d]", + WLog_ERR(TAG, "AudioQueueStart failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); goto err_out; } @@ -421,7 +421,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if (!mac) { errCode = GetLastError(); - WLog_ERR(TAG, "calloc failed with %s [%d]", + WLog_ERR(TAG, "calloc failed with %s [%"PRIu32"]", winpr_strerror(errCode, errString, sizeof(errString)), errCode); return CHANNEL_RC_NO_MEMORY; } @@ -438,7 +438,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_mac_parse_addin_args(mac, args))) { - WLog_ERR(TAG, "audin_mac_parse_addin_args failed with %u!", error); + WLog_ERR(TAG, "audin_mac_parse_addin_args failed with %"PRIu32"!", error); goto error_out; } @@ -452,7 +452,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) mac))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/client/opensles/audin_opensl_es.c b/channels/audin/client/opensles/audin_opensl_es.c index 0b1470bb4..e19691661 100644 --- a/channels/audin/client/opensles/audin_opensl_es.c +++ b/channels/audin/client/opensles/audin_opensl_es.c @@ -84,7 +84,7 @@ static void* audin_opensles_thread_func(void* arg) UINT error = CHANNEL_RC_OK; DWORD status; - DEBUG_DVC("opensles=%p", opensles); + DEBUG_DVC("opensles=%p", (void*) opensles); assert(opensles); assert(opensles->frames_per_packet > 0); @@ -112,7 +112,7 @@ static void* audin_opensles_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -186,7 +186,7 @@ static UINT audin_opensles_free(IAudinDevice* device) { AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - DEBUG_DVC("device=%p", device); + DEBUG_DVC("device=%p", (void*) device); /* The function may have been called out of order, * ignore duplicate requests. */ @@ -212,7 +212,7 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, audinFormat* f AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; #endif - DEBUG_DVC("device=%p, format=%p", opensles, format); + DEBUG_DVC("device=%p, format=%p", (void*) opensles, (void*) format); assert(format); @@ -238,7 +238,7 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, audinFormat* f } break; default: - DEBUG_DVC("Encoding '%s' [%08X] not supported", + DEBUG_DVC("Encoding '%s' [0x%04X"PRIX16"] not supported", rdpsnd_get_audio_tag_string(format->wFormatTag), format->wFormatTag); break; @@ -258,8 +258,8 @@ static UINT audin_opensles_set_format(IAudinDevice* device, int bs; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - DEBUG_DVC("device=%p, format=%p, FramesPerPacket=%d", - device, format, FramesPerPacket); + DEBUG_DVC("device=%p, format=%p, FramesPerPacket=%"PRIu32"", + (void*) device, (void*) format, FramesPerPacket); assert(format); @@ -300,8 +300,8 @@ static UINT audin_opensles_set_format(IAudinDevice* device, break; default: - WLog_ERR(TAG, "Encoding '%d' [%08X] not supported", - (format->wFormatTag), + WLog_ERR(TAG, "Encoding '%"PRIu16"' [%04"PRIX16"] not supported", + format->wFormatTag, format->wFormatTag); return ERROR_UNSUPPORTED_TYPE; } @@ -312,7 +312,7 @@ static UINT audin_opensles_set_format(IAudinDevice* device, opensles->format = format->wFormatTag; opensles->block_size = format->nBlockAlign; - DEBUG_DVC("aligned frames_per_packet=%d, block_size=%d", + DEBUG_DVC("aligned frames_per_packet=%"PRIu32", block_size=%"PRIu32"", opensles->frames_per_packet, opensles->block_size); return CHANNEL_RC_OK; } @@ -327,7 +327,7 @@ static UINT audin_opensles_open(IAudinDevice* device, AudinReceive receive, { AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - DEBUG_DVC("device=%p, receive=%d, user_data=%p", device, receive, user_data); + DEBUG_DVC("device=%p, receive=%p, user_data=%p", (void*) device, (void*) receive, (void*) user_data); assert(opensles); @@ -381,7 +381,7 @@ static UINT audin_opensles_close(IAudinDevice* device) UINT error; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - DEBUG_DVC("device=%p", device); + DEBUG_DVC("device=%p", (void*) device); assert(opensles); @@ -401,7 +401,7 @@ static UINT audin_opensles_close(IAudinDevice* device) if (WaitForSingleObject(opensles->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } CloseHandle(opensles->stopEvent); @@ -438,7 +438,7 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, COMMAND_LINE_ARGUMENT_A* arg; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; - DEBUG_DVC("device=%p, args=%p", device, args); + DEBUG_DVC("device=%p, args=%p", (void*) device, (void*) args); flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; @@ -493,7 +493,7 @@ UINT freerdp_audin_client_subsystem_entry( AudinOpenSLESDevice* opensles; UINT error; - DEBUG_DVC("pEntryPoints=%p", pEntryPoints); + DEBUG_DVC("pEntryPoints=%p", (void*) pEntryPoints); opensles = (AudinOpenSLESDevice*) calloc(1, sizeof(AudinOpenSLESDevice)); if (!opensles) @@ -513,7 +513,7 @@ UINT freerdp_audin_client_subsystem_entry( if ((error = audin_opensles_parse_addin_args(opensles, args))) { - WLog_ERR(TAG, "audin_opensles_parse_addin_args failed with errorcode %d!", error); + WLog_ERR(TAG, "audin_opensles_parse_addin_args failed with errorcode %"PRIu32"!", error); goto error_out; } @@ -527,7 +527,7 @@ UINT freerdp_audin_client_subsystem_entry( if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) opensles))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %d!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/client/opensles/opensl_io.c b/channels/audin/client/opensles/opensl_io.c index 4792d3398..27f964c96 100644 --- a/channels/audin/client/opensles/opensl_io.c +++ b/channels/audin/client/opensles/opensl_io.c @@ -42,27 +42,27 @@ static SLresult openSLCreateEngine(OPENSL_STREAM* p) SLresult result; // create engine result = slCreateEngine(&(p->engineObject), 0, NULL, 0, NULL, NULL); - DEBUG_DVC("engineObject=%p", p->engineObject); + DEBUG_DVC("engineObject=%p", (void*) p->engineObject); if (result != SL_RESULT_SUCCESS) goto engine_end; // realize the engine result = (*p->engineObject)->Realize(p->engineObject, SL_BOOLEAN_FALSE); - DEBUG_DVC("Realize=%d", result); + DEBUG_DVC("Realize=%"PRIu32"", result); if (result != SL_RESULT_SUCCESS) goto engine_end; // get the engine interface, which is needed in order to create other objects result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, &(p->engineEngine)); - DEBUG_DVC("engineEngine=%p", p->engineEngine); + DEBUG_DVC("engineEngine=%p", (void*) p->engineEngine); if (result != SL_RESULT_SUCCESS) goto engine_end; // get the volume interface - important, this is optional! result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_DEVICEVOLUME, &(p->deviceVolume)); - DEBUG_DVC("deviceVolume=%p", p->deviceVolume); + DEBUG_DVC("deviceVolume=%p", (void*) p->deviceVolume); if (result != SL_RESULT_SUCCESS) { @@ -180,14 +180,14 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) const SLboolean req[] = {SL_BOOLEAN_TRUE}; result = (*p->engineEngine)->CreateAudioRecorder(p->engineEngine, &(p->recorderObject), &audioSrc, &audioSnk, 1, id, req); - DEBUG_DVC("p->recorderObject=%p", p->recorderObject); + DEBUG_DVC("p->recorderObject=%p", (void*) p->recorderObject); assert(!result); if (SL_RESULT_SUCCESS != result) goto end_recopen; // realize the audio recorder result = (*p->recorderObject)->Realize(p->recorderObject, SL_BOOLEAN_FALSE); - DEBUG_DVC("Realize=%d", result); + DEBUG_DVC("Realize=%"PRIu32"", result); assert(!result); if (SL_RESULT_SUCCESS != result) goto end_recopen; @@ -195,7 +195,7 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) // get the record interface result = (*p->recorderObject)->GetInterface(p->recorderObject, SL_IID_RECORD, &(p->recorderRecord)); - DEBUG_DVC("p->recorderRecord=%p", p->recorderRecord); + DEBUG_DVC("p->recorderRecord=%p", (void*) p->recorderRecord); assert(!result); if (SL_RESULT_SUCCESS != result) goto end_recopen; @@ -204,7 +204,7 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) result = (*p->recorderObject)->GetInterface(p->recorderObject, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &(p->recorderBufferQueue)); - DEBUG_DVC("p->recorderBufferQueue=%p", p->recorderBufferQueue); + DEBUG_DVC("p->recorderBufferQueue=%p", (void*) p->recorderBufferQueue); assert(!result); if (SL_RESULT_SUCCESS != result) goto end_recopen; @@ -212,7 +212,7 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) // register callback on the buffer queue result = (*p->recorderBufferQueue)->RegisterCallback(p->recorderBufferQueue, bqRecorderCallback, p); - DEBUG_DVC("p->recorderBufferQueue=%p", p->recorderBufferQueue); + DEBUG_DVC("p->recorderBufferQueue=%p", (void*) p->recorderBufferQueue); assert(!result); if (SL_RESULT_SUCCESS != result) @@ -227,7 +227,7 @@ static SLresult openSLRecOpen(OPENSL_STREAM* p) // close the OpenSL IO and destroy the audio engine static void openSLDestroyEngine(OPENSL_STREAM* p) { - DEBUG_DVC("p=%p", p); + DEBUG_DVC("p=%p", (void*) p); // destroy audio recorder object, and invalidate all associated interfaces if (p->recorderObject != NULL) @@ -288,7 +288,7 @@ OPENSL_STREAM* android_OpenRecDevice(char* name, int sr, int inchannels, // close the android audio device void android_CloseRecDevice(OPENSL_STREAM* p) { - DEBUG_DVC("p=%p", p); + DEBUG_DVC("p=%p", (void*) p); if (p == NULL) return; @@ -326,7 +326,7 @@ static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void* context) { queue_element* e; OPENSL_STREAM* p = (OPENSL_STREAM*) context; - DEBUG_DVC("p=%p", p); + DEBUG_DVC("p=%p", (void*) p); assert(p); assert(p->next); assert(p->prep); @@ -386,7 +386,7 @@ int android_RecIn(OPENSL_STREAM* p, short* buffer, int size) if (status == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu", (unsigned long)GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", GetLastError()); return -1; } } @@ -395,7 +395,7 @@ int android_RecIn(OPENSL_STREAM* p, short* buffer, int size) if (!e) { - WLog_ERR(TAG, "[ERROR] got e=%p from queue", e); + WLog_ERR(TAG, "[ERROR] got e=NULL from queue"); return -1; } diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index 4b0e8e011..9e166b037 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -280,7 +280,7 @@ static void* audin_oss_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); goto err_out; } @@ -334,7 +334,7 @@ static void* audin_oss_thread_func(void* arg) if ((error = oss->receive(encoded_data, encoded_size, oss->user_data))) { - WLog_ERR(TAG, "oss->receive failed with error %u", error); + WLog_ERR(TAG, "oss->receive failed with error %"PRIu32"", error); break; } } @@ -406,7 +406,7 @@ static UINT audin_oss_close(IAudinDevice* device) if (WaitForSingleObject(oss->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -538,7 +538,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = audin_oss_parse_addin_args(oss, args))) { - WLog_ERR(TAG, "audin_oss_parse_addin_args failed with errorcode %u!", error); + WLog_ERR(TAG, "audin_oss_parse_addin_args failed with errorcode %"PRIu32"!", error); goto error_out; } @@ -554,7 +554,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) oss))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/client/pulse/audin_pulse.c b/channels/audin/client/pulse/audin_pulse.c index dd7104c12..56ece86ed 100644 --- a/channels/audin/client/pulse/audin_pulse.c +++ b/channels/audin/client/pulse/audin_pulse.c @@ -79,12 +79,12 @@ static void audin_pulse_context_state_callback(pa_context* context, void* userda case PA_CONTEXT_FAILED: case PA_CONTEXT_TERMINATED: - DEBUG_DVC("state %d", (int)state); + DEBUG_DVC("state %d", state); pa_threaded_mainloop_signal (pulse->mainloop, 0); break; default: - DEBUG_DVC("state %d", (int)state); + DEBUG_DVC("state %d", state); break; } } @@ -257,7 +257,7 @@ static UINT audin_pulse_set_format(IAudinDevice* device, audinFormat* format, UI bs = (format->nBlockAlign - 4 * format->nChannels) * 4; pulse->frames_per_packet = (pulse->frames_per_packet * format->nChannels * 2 / bs + 1) * bs / (format->nChannels * 2); - DEBUG_DVC("aligned FramesPerPacket=%d", + DEBUG_DVC("aligned FramesPerPacket=%"PRIu32"", pulse->frames_per_packet); break; } @@ -283,12 +283,12 @@ static void audin_pulse_stream_state_callback(pa_stream* stream, void* userdata) case PA_STREAM_FAILED: case PA_STREAM_TERMINATED: - DEBUG_DVC("state %d", (int)state); + DEBUG_DVC("state %d", state); pa_threaded_mainloop_signal(pulse->mainloop, 0); break; default: - DEBUG_DVC("state %d", (int)state); + DEBUG_DVC("state %d", state); break; } } @@ -318,7 +318,7 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length pa_stream_peek(stream, &data, &length); frames = length / pulse->bytes_per_frame; - DEBUG_DVC("length %d frames %d", (int) length, frames); + DEBUG_DVC("length %"PRIdz" frames %d", length, frames); src = (const BYTE*) data; while (frames > 0) @@ -558,7 +558,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_pulse_parse_addin_args(pulse, args))) { - WLog_ERR(TAG, "audin_pulse_parse_addin_args failed with error %u!", error); + WLog_ERR(TAG, "audin_pulse_parse_addin_args failed with error %"PRIu32"!", error); goto error_out; } @@ -598,7 +598,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) pulse))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/client/winmm/audin_winmm.c b/channels/audin/client/winmm/audin_winmm.c index 5090dd82a..519d8fa95 100644 --- a/channels/audin/client/winmm/audin_winmm.c +++ b/channels/audin/client/winmm/audin_winmm.c @@ -127,7 +127,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInPrepareHeader(winmm->hWaveIn, &waveHdr[i], sizeof(waveHdr[i])); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInPrepareHeader failed. %d", rc); + DEBUG_DVC("waveInPrepareHeader failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -135,7 +135,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInAddBuffer(winmm->hWaveIn, &waveHdr[i], sizeof(waveHdr[i])); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInAddBuffer failed. %d", rc); + DEBUG_DVC("waveInAddBuffer failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -144,7 +144,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInStart(winmm->hWaveIn); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInStart failed. %d", rc); + DEBUG_DVC("waveInStart failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -161,7 +161,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInReset(winmm->hWaveIn); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInReset failed. %d", rc); + DEBUG_DVC("waveInReset failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -171,7 +171,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInUnprepareHeader(winmm->hWaveIn, &waveHdr[i], sizeof(waveHdr[i])); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInUnprepareHeader failed. %d", rc); + DEBUG_DVC("waveInUnprepareHeader failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -181,7 +181,7 @@ static DWORD audin_winmm_thread_func(void* arg) rc = waveInClose(winmm->hWaveIn); if (MMSYSERR_NOERROR != rc) { - DEBUG_DVC("waveInClose failed. %d", rc); + DEBUG_DVC("waveInClose failed. %"PRIu32"", rc); if (winmm->rdpcontext) setChannelError(winmm->rdpcontext, ERROR_INTERNAL_ERROR, "audin_winmm_thread_func reported an error"); } @@ -230,7 +230,7 @@ static UINT audin_winmm_close(IAudinDevice* device) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -426,7 +426,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = audin_winmm_parse_addin_args(winmm, args))) { - WLog_ERR(TAG, "audin_winmm_parse_addin_args failed with error %d!", error); + WLog_ERR(TAG, "audin_winmm_parse_addin_args failed with error %"PRIu32"!", error); goto error_out; } @@ -452,7 +452,7 @@ UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEn if ((error = pEntryPoints->pRegisterAudinDevice(pEntryPoints->plugin, (IAudinDevice*) winmm))) { - WLog_ERR(TAG, "RegisterAudinDevice failed with error %d!", error); + WLog_ERR(TAG, "RegisterAudinDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/audin/server/audin.c b/channels/audin/server/audin.c index 69926f3e5..106eb86ea 100644 --- a/channels/audin/server/audin.c +++ b/channels/audin/server/audin.c @@ -124,7 +124,7 @@ static UINT audin_server_recv_version(audin_server* audin, wStream* s, if (length < 4) { - WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %d", + WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %"PRIu32"", length); return ERROR_INVALID_DATA; } @@ -133,7 +133,7 @@ static UINT audin_server_recv_version(audin_server* audin, wStream* s, if (Version < 1) { - WLog_ERR(TAG, "expected Version > 0 but got %d", Version); + WLog_ERR(TAG, "expected Version > 0 but got %"PRIu32"", Version); return ERROR_INVALID_DATA; } @@ -207,7 +207,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, if (length < 8) { - WLog_ERR(TAG, "error parsing rec formats: expected at least 8 bytes, got %d", + WLog_ERR(TAG, "error parsing rec formats: expected at least 8 bytes, got %"PRIu32"", length); return ERROR_INVALID_DATA; } @@ -236,7 +236,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, { free(audin->context.client_formats); audin->context.client_formats = NULL; - WLog_ERR(TAG, "expected length at least 18, but got %d", length); + WLog_ERR(TAG, "expected length at least 18, but got %"PRIu32"", length); return ERROR_INVALID_DATA; } @@ -257,7 +257,7 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s, IFCALLRET(audin->context.Opening, success, &audin->context); if (success) - WLog_ERR(TAG, "context.Opening failed with error %u", success); + WLog_ERR(TAG, "context.Opening failed with error %"PRIu32"", success); return success; } @@ -314,7 +314,7 @@ static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, if (length < 4) { - WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %d", + WLog_ERR(TAG, "error parsing version info: expected at least 4 bytes, got %"PRIu32"", length); return ERROR_INVALID_DATA; } @@ -323,7 +323,7 @@ static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, IFCALLRET(audin->context.OpenResult, success, &audin->context, Result); if (success) - WLog_ERR(TAG, "context.OpenResult failed with error %u", success); + WLog_ERR(TAG, "context.OpenResult failed with error %"PRIu32"", success); return success; } @@ -396,7 +396,7 @@ static UINT audin_server_recv_data(audin_server* audin, wStream* s, IFCALLRET(audin->context.ReceiveSamples, success, &audin->context, src, frames); if (success) - WLog_ERR(TAG, "context.ReceiveSamples failed with error %u", success); + WLog_ERR(TAG, "context.ReceiveSamples failed with error %"PRIu32"", success); return success; } @@ -448,7 +448,7 @@ static void* audin_server_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); goto out; } @@ -480,7 +480,7 @@ static void* audin_server_thread_func(void* arg) { if ((error = audin_server_send_version(audin, s))) { - WLog_ERR(TAG, "audin_server_send_version failed with error %u!", error); + WLog_ERR(TAG, "audin_server_send_version failed with error %"PRIu32"!", error); goto out_capacity; } } @@ -494,7 +494,7 @@ static void* audin_server_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); goto out; } @@ -529,13 +529,13 @@ static void* audin_server_thread_func(void* arg) case MSG_SNDIN_VERSION: if ((error = audin_server_recv_version(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_version failed with error %u!", error); + WLog_ERR(TAG, "audin_server_recv_version failed with error %"PRIu32"!", error); goto out_capacity; } if ((error = audin_server_send_formats(audin, s))) { - WLog_ERR(TAG, "audin_server_send_formats failed with error %u!", error); + WLog_ERR(TAG, "audin_server_send_formats failed with error %"PRIu32"!", error); goto out_capacity; } @@ -544,13 +544,13 @@ static void* audin_server_thread_func(void* arg) case MSG_SNDIN_FORMATS: if ((error = audin_server_recv_formats(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_formats failed with error %u!", error); + WLog_ERR(TAG, "audin_server_recv_formats failed with error %"PRIu32"!", error); goto out_capacity; } if ((error = audin_server_send_open(audin, s))) { - WLog_ERR(TAG, "audin_server_send_open failed with error %u!", error); + WLog_ERR(TAG, "audin_server_send_open failed with error %"PRIu32"!", error); goto out_capacity; } @@ -559,7 +559,7 @@ static void* audin_server_thread_func(void* arg) case MSG_SNDIN_OPEN_REPLY: if ((error = audin_server_recv_open_reply(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_open_reply failed with error %u!", error); + WLog_ERR(TAG, "audin_server_recv_open_reply failed with error %"PRIu32"!", error); goto out_capacity; } @@ -571,7 +571,7 @@ static void* audin_server_thread_func(void* arg) case MSG_SNDIN_DATA: if ((error = audin_server_recv_data(audin, s, BytesReturned))) { - WLog_ERR(TAG, "audin_server_recv_data failed with error %u!", error); + WLog_ERR(TAG, "audin_server_recv_data failed with error %"PRIu32"!", error); goto out_capacity; }; @@ -581,7 +581,7 @@ static void* audin_server_thread_func(void* arg) break; default: - WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %d", MessageId); + WLog_ERR(TAG, "audin_server_thread_func: unknown MessageId %"PRIu8"", MessageId); break; } } @@ -658,7 +658,7 @@ static BOOL audin_server_close(audin_server_context* context) if (WaitForSingleObject(audin->thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu", (unsigned long)GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", GetLastError()); return FALSE; } diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index 4748afb1f..2e07d1cdc 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -80,7 +80,7 @@ UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data if ((formatList.numFormats * 36) != dataLen) { - WLog_ERR(TAG, "Invalid short format list length: %d", dataLen); + WLog_ERR(TAG, "Invalid short format list length: %"PRIu32"", dataLen); return ERROR_INTERNAL_ERROR; } @@ -218,13 +218,13 @@ UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data } } - WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatList: numFormats: %d", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatList: numFormats: %"PRIu32"", formatList.numFormats); if (context->ServerFormatList) { if ((error = context->ServerFormatList(context, &formatList))) - WLog_ERR(TAG, "ServerFormatList failed with error %d", error); + WLog_ERR(TAG, "ServerFormatList failed with error %"PRIu32"", error); } error_out: @@ -265,7 +265,7 @@ UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UI IFCALLRET(context->ServerFormatListResponse, error, context, &formatListResponse); if (error) - WLog_ERR(TAG, "ServerFormatListResponse failed with error %u!", error); + WLog_ERR(TAG, "ServerFormatListResponse failed with error %"PRIu32"!", error); return error; } @@ -298,7 +298,7 @@ UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UIN IFCALLRET(context->ServerFormatDataRequest, error, context, &formatDataRequest); if (error) - WLog_ERR(TAG, "ServerFormatDataRequest failed with error %u!", error); + WLog_ERR(TAG, "ServerFormatDataRequest failed with error %"PRIu32"!", error); return error; } @@ -332,7 +332,7 @@ UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UI IFCALLRET(context->ServerFormatDataResponse, error, context, &formatDataResponse); if (error) - WLog_ERR(TAG, "ServerFormatDataResponse failed with error %u!", error); + WLog_ERR(TAG, "ServerFormatDataResponse failed with error %"PRIu32"!", error); return error; } diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 0725b89be..9f17416b5 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -96,7 +96,7 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) Stream_Write_UINT32(s, dataLen); Stream_SetPosition(s, pos); #ifdef WITH_DEBUG_CLIPRDR - WLog_DBG(TAG, "Cliprdr Sending (%d bytes)", dataLen + 8); + WLog_DBG(TAG, "Cliprdr Sending (%"PRIu32" bytes)", dataLen + 8); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8); #endif @@ -112,7 +112,7 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) } if (status != CHANNEL_RC_OK) - WLog_ERR(TAG, "VirtualChannelWrite failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWrite failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; @@ -120,7 +120,7 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) static void cliprdr_print_general_capability_flags(UINT32 flags) { - WLog_INFO(TAG, "generalFlags (0x%08X) {", flags); + WLog_INFO(TAG, "generalFlags (0x%08"PRIX32") {", flags); if (flags & CB_USE_LONG_FORMAT_NAMES) WLog_INFO(TAG, "\tCB_USE_LONG_FORMAT_NAMES"); @@ -160,7 +160,7 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, Stream_Read_UINT32(s, version); /* version (4 bytes) */ Stream_Read_UINT32(s, generalFlags); /* generalFlags (4 bytes) */ - DEBUG_CLIPRDR("Version: %d", version); + DEBUG_CLIPRDR("Version: %"PRIu32"", version); #ifdef WITH_DEBUG_CLIPRDR cliprdr_print_general_capability_flags(generalFlags); #endif @@ -198,7 +198,7 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerCapabilities, error, context, &capabilities); if (error) - WLog_ERR(TAG, "ServerCapabilities failed with error %u!", error); + WLog_ERR(TAG, "ServerCapabilities failed with error %"PRIu32"!", error); return error; } @@ -230,7 +230,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, case CB_CAPSTYPE_GENERAL: if ((error = cliprdr_process_general_capability(cliprdr, s))) { - WLog_ERR(TAG, "cliprdr_process_general_capability failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_general_capability failed with error %"PRIu32"!", error); return error; } @@ -238,7 +238,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, break; default: - WLog_ERR(TAG, "unknown cliprdr capability set: %d", capabilitySetType); + WLog_ERR(TAG, "unknown cliprdr capability set: %"PRIu16"", capabilitySetType); return CHANNEL_RC_BAD_PROC; break; } @@ -286,7 +286,7 @@ static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, IFCALLRET(context->MonitorReady, error, context, &monitorReady); if (error) - WLog_ERR(TAG, "MonitorReady failed with error %u!", error); + WLog_ERR(TAG, "MonitorReady failed with error %"PRIu32"!", error); return error; } @@ -334,7 +334,7 @@ static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerFileContentsRequest, error, context, &request); if (error) - WLog_ERR(TAG, "ServerFileContentsRequest failed with error %u!", error); + WLog_ERR(TAG, "ServerFileContentsRequest failed with error %"PRIu32"!", error); return error; } @@ -373,7 +373,7 @@ static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, IFCALLRET(context->ServerFileContentsResponse, error, context, &response); if (error) - WLog_ERR(TAG, "ServerFileContentsResponse failed with error %u!", error); + WLog_ERR(TAG, "ServerFileContentsResponse failed with error %"PRIu32"!", error); return error; } @@ -410,7 +410,7 @@ static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, IFCALLRET(context->ServerLockClipboardData, error, context, &lockClipboardData); if (error) - WLog_ERR(TAG, "ServerLockClipboardData failed with error %u!", error); + WLog_ERR(TAG, "ServerLockClipboardData failed with error %"PRIu32"!", error); return error; } @@ -449,7 +449,7 @@ static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, &unlockClipboardData); if (error) - WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %u!", error); + WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %"PRIu32"!", error); return error; } @@ -469,7 +469,7 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) Stream_Read_UINT16(s, msgFlags); /* msgFlags (2 bytes) */ Stream_Read_UINT32(s, dataLen); /* dataLen (4 bytes) */ #ifdef WITH_DEBUG_CLIPRDR - WLog_DBG(TAG, "msgType: %s (%d), msgFlags: %d dataLen: %d", + WLog_DBG(TAG, "msgType: %s (%"PRIu16"), msgFlags: %"PRIu16" dataLen: %"PRIu32"", CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8); #endif @@ -478,26 +478,26 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) { case CB_CLIP_CAPS: if ((error = cliprdr_process_clip_caps(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_clip_caps failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_process_clip_caps failed with error %"PRIu32"!", error); break; case CB_MONITOR_READY: if ((error = cliprdr_process_monitor_ready(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_monitor_ready failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_process_monitor_ready failed with error %"PRIu32"!", error); break; case CB_FORMAT_LIST: if ((error = cliprdr_process_format_list(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_list failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_process_format_list failed with error %"PRIu32"!", error); break; case CB_FORMAT_LIST_RESPONSE: if ((error = cliprdr_process_format_list_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_list_response failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_format_list_response failed with error %"PRIu32"!", error); break; @@ -505,7 +505,7 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) case CB_FORMAT_DATA_REQUEST: if ((error = cliprdr_process_format_data_request(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_data_request failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_format_data_request failed with error %"PRIu32"!", error); break; @@ -513,7 +513,7 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) case CB_FORMAT_DATA_RESPONSE: if ((error = cliprdr_process_format_data_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_format_data_response failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_format_data_response failed with error %"PRIu32"!", error); break; @@ -521,7 +521,7 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) case CB_FILECONTENTS_REQUEST: if ((error = cliprdr_process_filecontents_request(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_filecontents_request failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_filecontents_request failed with error %"PRIu32"!", error); break; @@ -529,26 +529,26 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) case CB_FILECONTENTS_RESPONSE: if ((error = cliprdr_process_filecontents_response(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_filecontents_response failed with error %u!", + WLog_ERR(TAG, "cliprdr_process_filecontents_response failed with error %"PRIu32"!", error); break; case CB_LOCK_CLIPDATA: if ((error = cliprdr_process_lock_clipdata(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %"PRIu32"!", error); break; case CB_UNLOCK_CLIPDATA: if ((error = cliprdr_process_unlock_clipdata(cliprdr, s, dataLen, msgFlags))) - WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_process_lock_clipdata failed with error %"PRIu32"!", error); break; default: error = CHANNEL_RC_BAD_PROC; - WLog_ERR(TAG, "unknown msgType %d", msgType); + WLog_ERR(TAG, "unknown msgType %"PRIu16"", msgType); break; } @@ -743,7 +743,7 @@ static UINT cliprdr_client_format_list(CliprdrClientContext* context, } } - WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFormatList: numFormats: %d", + WLog_Print(cliprdr->log, WLOG_DEBUG, "ClientFormatList: numFormats: %"PRIu32"", formatList->numFormats); return cliprdr_packet_send(cliprdr, s); } @@ -794,7 +794,7 @@ static UINT cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, Stream_Write_UINT32(s, lockClipboardData->clipDataId); /* clipDataId (4 bytes) */ WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientLockClipboardData: clipDataId: 0x%04X", + "ClientLockClipboardData: clipDataId: 0x%08"PRIX32"", lockClipboardData->clipDataId); return cliprdr_packet_send(cliprdr, s);; } @@ -820,7 +820,7 @@ static UINT cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, Stream_Write_UINT32(s, unlockClipboardData->clipDataId); /* clipDataId (4 bytes) */ WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientUnlockClipboardData: clipDataId: 0x%04X", + "ClientUnlockClipboardData: clipDataId: 0x%08"PRIX32"", unlockClipboardData->clipDataId); return cliprdr_packet_send(cliprdr, s); } @@ -910,7 +910,7 @@ static UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, Stream_Write_UINT32(s, fileContentsRequest->clipDataId); /* clipDataId (4 bytes) */ WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientFileContentsRequest: streamId: 0x%04X", + "ClientFileContentsRequest: streamId: 0x%08"PRIX32"", fileContentsRequest->streamId); return cliprdr_packet_send(cliprdr, s); } @@ -947,7 +947,7 @@ static UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, Stream_Write(s, fileContentsResponse->requestedData, fileContentsResponse->cbRequested); WLog_Print(cliprdr->log, WLOG_DEBUG, - "ClientFileContentsResponse: streamId: 0x%04X", + "ClientFileContentsResponse: streamId: 0x%08"PRIX32"", fileContentsResponse->streamId); return cliprdr_packet_send(cliprdr, s); } @@ -1030,7 +1030,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DATA_RECEIVED: if ((error = cliprdr_virtual_channel_event_data_received(cliprdr, pData, dataLength, totalLength, dataFlags))) - WLog_ERR(TAG, "failed with error %u", error); + WLog_ERR(TAG, "failed with error %"PRIu32"", error); break; @@ -1079,7 +1079,7 @@ static void* cliprdr_virtual_channel_client_thread(void* arg) if ((error = cliprdr_order_recv(cliprdr, data))) { - WLog_ERR(TAG, "cliprdr_order_recv failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_order_recv failed with error %"PRIu32"!", error); break; } } @@ -1108,7 +1108,7 @@ static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -1147,7 +1147,7 @@ static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) && (WaitForSingleObject(cliprdr->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); return rc; } @@ -1157,7 +1157,7 @@ static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); return rc; } @@ -1202,7 +1202,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_CONNECTED: if ((error = cliprdr_virtual_channel_event_connected(cliprdr, pData, dataLength))) - WLog_ERR(TAG, "cliprdr_virtual_channel_event_connected failed with error %u!", + WLog_ERR(TAG, "cliprdr_virtual_channel_event_connected failed with error %"PRIu32"!", error); break; @@ -1210,13 +1210,13 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = cliprdr_virtual_channel_event_disconnected(cliprdr))) WLog_ERR(TAG, - "cliprdr_virtual_channel_event_disconnected failed with error %u!", error); + "cliprdr_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); break; case CHANNEL_EVENT_TERMINATED: if ((error = cliprdr_virtual_channel_event_terminated(cliprdr))) - WLog_ERR(TAG, "cliprdr_virtual_channel_event_terminated failed with error %u!", + WLog_ERR(TAG, "cliprdr_virtual_channel_event_terminated failed with error %"PRIu32"!", error); break; @@ -1295,7 +1295,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); free(cliprdr->context); free(cliprdr); diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 761ee974a..1b8268eed 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -281,7 +281,7 @@ static UINT cliprdr_server_format_list(CliprdrServerContext* context, } } - WLog_DBG(TAG, "ServerFormatList: numFormats: %d", + WLog_DBG(TAG, "ServerFormatList: numFormats: %"PRIu32"", formatList->numFormats); return cliprdr_server_packet_send(cliprdr, s); } @@ -331,7 +331,7 @@ static UINT cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, Stream_Write_UINT32(s, lockClipboardData->clipDataId); /* clipDataId (4 bytes) */ - WLog_DBG(TAG, "ServerLockClipboardData: clipDataId: 0x%04X", + WLog_DBG(TAG, "ServerLockClipboardData: clipDataId: 0x%08"PRIX32"", lockClipboardData->clipDataId); return cliprdr_server_packet_send(cliprdr, s); } @@ -356,7 +356,7 @@ static UINT cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, Stream_Write_UINT32(s, unlockClipboardData->clipDataId); /* clipDataId (4 bytes) */ - WLog_DBG(TAG, "ServerUnlockClipboardData: clipDataId: 0x%04X", + WLog_DBG(TAG, "ServerUnlockClipboardData: clipDataId: 0x%08"PRIX32"", unlockClipboardData->clipDataId); return cliprdr_server_packet_send(cliprdr, s); } @@ -445,7 +445,7 @@ static UINT cliprdr_server_file_contents_request(CliprdrServerContext* context, fileContentsRequest->cbRequested); /* cbRequested (4 bytes) */ Stream_Write_UINT32(s, fileContentsRequest->clipDataId); /* clipDataId (4 bytes) */ - WLog_DBG(TAG, "ServerFileContentsRequest: streamId: 0x%04X", + WLog_DBG(TAG, "ServerFileContentsRequest: streamId: 0x%08"PRIX32"", fileContentsRequest->streamId); return cliprdr_server_packet_send(cliprdr, s); } @@ -482,7 +482,7 @@ static UINT cliprdr_server_file_contents_response(CliprdrServerContext* context, */ Stream_Write(s, fileContentsResponse->requestedData, fileContentsResponse->cbRequested); - WLog_DBG(TAG, "ServerFileContentsResponse: streamId: 0x%04X", + WLog_DBG(TAG, "ServerFileContentsResponse: streamId: 0x%08"PRIX32"", fileContentsResponse->streamId); return cliprdr_server_packet_send(cliprdr, s); } @@ -545,7 +545,7 @@ static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, case CB_CAPSTYPE_GENERAL: if ((error = cliprdr_server_receive_general_capability(context, s))) { - WLog_ERR(TAG, "cliprdr_server_receive_general_capability failed with error %u", + WLog_ERR(TAG, "cliprdr_server_receive_general_capability failed with error %"PRIu32"", error); return error; } @@ -553,7 +553,7 @@ static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, break; default: - WLog_ERR(TAG, "unknown cliprdr capability set: %d", capabilitySetType); + WLog_ERR(TAG, "unknown cliprdr capability set: %"PRIu16"", capabilitySetType); return ERROR_INVALID_DATA; break; } @@ -580,7 +580,7 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* if ((slength = Stream_GetRemainingLength(s)) < 520) { WLog_ERR(TAG, - "Stream_GetRemainingLength returned %lu but should at least be 520", (unsigned long) slength); + "Stream_GetRemainingLength returned %"PRIuz" but should at least be 520", slength); return CHANNEL_RC_NO_MEMORY; } @@ -613,7 +613,7 @@ static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* IFCALLRET(context->TempDirectory, error, context, &tempDirectory); if (error) - WLog_ERR(TAG, "TempDirectory failed with error %u!", error); + WLog_ERR(TAG, "TempDirectory failed with error %"PRIu32"!", error); return error; } @@ -657,7 +657,7 @@ static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, if ((formatList.numFormats * 36) != dataLen) { - WLog_ERR(TAG, "Invalid short format list length: %d", dataLen); + WLog_ERR(TAG, "Invalid short format list length: %"PRIu32"", dataLen); return ERROR_INVALID_PARAMETER; } @@ -785,12 +785,12 @@ static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, } } - WLog_DBG(TAG, "ClientFormatList: numFormats: %d", + WLog_DBG(TAG, "ClientFormatList: numFormats: %"PRIu32"", formatList.numFormats); IFCALLRET(context->ClientFormatList, error, context, &formatList); if (error) - WLog_ERR(TAG, "ClientFormatList failed with error %u!", error); + WLog_ERR(TAG, "ClientFormatList failed with error %"PRIu32"!", error); out: @@ -821,7 +821,7 @@ static UINT cliprdr_server_receive_format_list_response( &formatListResponse); if (error) - WLog_ERR(TAG, "ClientFormatListResponse failed with error %u!", error); + WLog_ERR(TAG, "ClientFormatListResponse failed with error %"PRIu32"!", error); return error; } @@ -851,7 +851,7 @@ static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, IFCALLRET(context->ClientLockClipboardData, error, context, &lockClipboardData); if (error) - WLog_ERR(TAG, "ClientLockClipboardData failed with error %u!", error); + WLog_ERR(TAG, "ClientLockClipboardData failed with error %"PRIu32"!", error); return error; } @@ -883,7 +883,7 @@ static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* &unlockClipboardData); if (error) - WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %u!", error); + WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %"PRIu32"!", error); return error; } @@ -914,7 +914,7 @@ static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* IFCALLRET(context->ClientFormatDataRequest, error, context, &formatDataRequest); if (error) - WLog_ERR(TAG, "ClientFormatDataRequest failed with error %u!", error); + WLog_ERR(TAG, "ClientFormatDataRequest failed with error %"PRIu32"!", error); return error; } @@ -951,7 +951,7 @@ static UINT cliprdr_server_receive_format_data_response( &formatDataResponse); if (error) - WLog_ERR(TAG, "ClientFormatDataResponse failed with error %u!", error); + WLog_ERR(TAG, "ClientFormatDataResponse failed with error %"PRIu32"!", error); free(formatDataResponse.requestedFormatData); return error; @@ -993,7 +993,7 @@ static UINT cliprdr_server_receive_filecontents_request( IFCALLRET(context->ClientFileContentsRequest, error, context, &request); if (error) - WLog_ERR(TAG, "ClientFileContentsRequest failed with error %u!", error); + WLog_ERR(TAG, "ClientFileContentsRequest failed with error %"PRIu32"!", error); return error; } @@ -1025,7 +1025,7 @@ static UINT cliprdr_server_receive_filecontents_response( IFCALLRET(context->ClientFileContentsResponse, error, context, &response); if (error) - WLog_ERR(TAG, "ClientFileContentsResponse failed with error %u!", error); + WLog_ERR(TAG, "ClientFileContentsResponse failed with error %"PRIu32"!", error); return error; } @@ -1040,14 +1040,14 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, { UINT error; WLog_DBG(TAG, - "CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d", + "CliprdrServerReceivePdu: msgType: %"PRIu16" msgFlags: 0x%04"PRIX16" dataLen: %"PRIu32"", header->msgType, header->msgFlags, header->dataLen); switch (header->msgType) { case CB_CLIP_CAPS: if ((error = cliprdr_server_receive_capabilities(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_capabilities failed with error %u!", + WLog_ERR(TAG, "cliprdr_server_receive_capabilities failed with error %"PRIu32"!", error); break; @@ -1055,13 +1055,13 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_TEMP_DIRECTORY: if ((error = cliprdr_server_receive_temporary_directory(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_temporary_directory failed with error %u!", error); + "cliprdr_server_receive_temporary_directory failed with error %"PRIu32"!", error); break; case CB_FORMAT_LIST: if ((error = cliprdr_server_receive_format_list(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_format_list failed with error %u!", + WLog_ERR(TAG, "cliprdr_server_receive_format_list failed with error %"PRIu32"!", error); break; @@ -1069,20 +1069,20 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_FORMAT_LIST_RESPONSE: if ((error = cliprdr_server_receive_format_list_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_list_response failed with error %u!", error); + "cliprdr_server_receive_format_list_response failed with error %"PRIu32"!", error); break; case CB_LOCK_CLIPDATA: if ((error = cliprdr_server_receive_lock_clipdata(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_lock_clipdata failed with error %u!", + WLog_ERR(TAG, "cliprdr_server_receive_lock_clipdata failed with error %"PRIu32"!", error); break; case CB_UNLOCK_CLIPDATA: if ((error = cliprdr_server_receive_unlock_clipdata(context, s, header))) - WLog_ERR(TAG, "cliprdr_server_receive_unlock_clipdata failed with error %u!", + WLog_ERR(TAG, "cliprdr_server_receive_unlock_clipdata failed with error %"PRIu32"!", error); break; @@ -1090,34 +1090,34 @@ static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, case CB_FORMAT_DATA_REQUEST: if ((error = cliprdr_server_receive_format_data_request(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_data_request failed with error %u!", error); + "cliprdr_server_receive_format_data_request failed with error %"PRIu32"!", error); break; case CB_FORMAT_DATA_RESPONSE: if ((error = cliprdr_server_receive_format_data_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_format_data_response failed with error %u!", error); + "cliprdr_server_receive_format_data_response failed with error %"PRIu32"!", error); break; case CB_FILECONTENTS_REQUEST: if ((error = cliprdr_server_receive_filecontents_request(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_filecontents_request failed with error %u!", error); + "cliprdr_server_receive_filecontents_request failed with error %"PRIu32"!", error); break; case CB_FILECONTENTS_RESPONSE: if ((error = cliprdr_server_receive_filecontents_response(context, s, header))) WLog_ERR(TAG, - "cliprdr_server_receive_filecontents_response failed with error %u!", error); + "cliprdr_server_receive_filecontents_response failed with error %"PRIu32"!", error); break; default: error = ERROR_INVALID_DATA; - WLog_DBG(TAG, "Unexpected clipboard PDU type: %d", header->msgType); + WLog_DBG(TAG, "Unexpected clipboard PDU type: %"PRIu16"", header->msgType); break; } @@ -1164,13 +1164,13 @@ static UINT cliprdr_server_init(CliprdrServerContext* context) if ((error = context->ServerCapabilities(context, &capabilities))) { - WLog_ERR(TAG, "ServerCapabilities failed with error %u!", error); + WLog_ERR(TAG, "ServerCapabilities failed with error %"PRIu32"!", error); return error; } if ((error = context->MonitorReady(context, &monitorReady))) { - WLog_ERR(TAG, "MonitorReady failed with error %u!", error); + WLog_ERR(TAG, "MonitorReady failed with error %"PRIu32"!", error); return error; } @@ -1203,7 +1203,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -1245,7 +1245,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -1270,7 +1270,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if ((error = cliprdr_server_receive_pdu(context, s, &header))) { - WLog_ERR(TAG, "cliprdr_server_receive_pdu failed with error code %u!", error); + WLog_ERR(TAG, "cliprdr_server_receive_pdu failed with error code %"PRIu32"!", error); return error; } @@ -1281,7 +1281,7 @@ UINT cliprdr_server_read(CliprdrServerContext* context) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -1336,7 +1336,7 @@ static void* cliprdr_server_thread(void* arg) if ((error = cliprdr_server_init(context))) { - WLog_ERR(TAG, "cliprdr_server_init failed with error %u!", error); + WLog_ERR(TAG, "cliprdr_server_init failed with error %"PRIu32"!", error); goto out; } @@ -1347,7 +1347,7 @@ static void* cliprdr_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); goto out; } @@ -1356,7 +1356,7 @@ static void* cliprdr_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); goto out; } @@ -1368,7 +1368,7 @@ static void* cliprdr_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); goto out; } @@ -1376,7 +1376,7 @@ static void* cliprdr_server_thread(void* arg) { if ((error = context->CheckEventHandle(context))) { - WLog_ERR(TAG, "CheckEventHandle failed with error %u!", error); + WLog_ERR(TAG, "CheckEventHandle failed with error %"PRIu32"!", error); break; } } @@ -1507,7 +1507,7 @@ static UINT cliprdr_server_stop(CliprdrServerContext* context) if (WaitForSingleObject(cliprdr->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index 33f76b84e..98f8d1f21 100755 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -115,7 +115,7 @@ UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callbac Stream_Write_UINT32(s, NumMonitors); /* NumMonitors (4 bytes) */ - //WLog_ERR(TAG, "NumMonitors: %d", NumMonitors); + //WLog_ERR(TAG, "NumMonitors: %"PRIu32"", NumMonitors); for (index = 0; index < NumMonitors; index++) { @@ -148,14 +148,14 @@ UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callbac Stream_Write_UINT32(s, Monitors[index].DeviceScaleFactor); /* DeviceScaleFactor (4 bytes) */ #if 0 - WLog_DBG(TAG, "\t: Flags: 0x%04X", Monitors[index].Flags); - WLog_DBG(TAG, "\t: Left: %d", Monitors[index].Left); - WLog_DBG(TAG, "\t: Top: %d", Monitors[index].Top); - WLog_DBG(TAG, "\t: Width: %d", Monitors[index].Width); - WLog_DBG(TAG, "\t: Height: %d", Monitors[index].Height); - WLog_DBG(TAG, "\t: PhysicalWidth: %d", Monitors[index].PhysicalWidth); - WLog_DBG(TAG, "\t: PhysicalHeight: %d", Monitors[index].PhysicalHeight); - WLog_DBG(TAG, "\t: Orientation: %d", Monitors[index].Orientation); + WLog_DBG(TAG, "\t: Flags: 0x%08"PRIX32"", Monitors[index].Flags); + WLog_DBG(TAG, "\t: Left: %"PRId32"", Monitors[index].Left); + WLog_DBG(TAG, "\t: Top: %"PRId32"", Monitors[index].Top); + WLog_DBG(TAG, "\t: Width: %"PRIu32"", Monitors[index].Width); + WLog_DBG(TAG, "\t: Height: %"PRIu32"", Monitors[index].Height); + WLog_DBG(TAG, "\t: PhysicalWidth: %"PRIu32"", Monitors[index].PhysicalWidth); + WLog_DBG(TAG, "\t: PhysicalHeight: %"PRIu32"", Monitors[index].PhysicalHeight); + WLog_DBG(TAG, "\t: Orientation: %"PRIu32"", Monitors[index].Orientation); #endif } @@ -188,8 +188,8 @@ UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream Stream_Read_UINT32(s, disp->MaxNumMonitors); /* MaxNumMonitors (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorA); /* MaxMonitorAreaFactorA (4 bytes) */ Stream_Read_UINT32(s, disp->MaxMonitorAreaFactorB); /* MaxMonitorAreaFactorB (4 bytes) */ - //WLog_ERR(TAG, "DisplayControlCapsPdu: MaxNumMonitors: %d MaxMonitorWidth: %d MaxMonitorHeight: %d", - // disp->MaxNumMonitors, disp->MaxMonitorWidth, disp->MaxMonitorHeight); + //WLog_ERR(TAG, "DisplayControlCapsPdu: MaxNumMonitors: %"PRIu32" MaxMonitorAreaFactorA: %"PRIu32" MaxMonitorAreaFactorB: %"PRIu32"", + // disp->MaxNumMonitors, disp->MaxMonitorAreaFactorA, disp->MaxMonitorAreaFactorB); return CHANNEL_RC_OK; } @@ -213,7 +213,7 @@ UINT 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) */ - //WLog_ERR(TAG, "Type: %d Length: %d", type, length); + //WLog_ERR(TAG, "Type: %"PRIu32" Length: %"PRIu32"", type, length); switch (type) { @@ -221,7 +221,7 @@ UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) return disp_recv_display_control_caps_pdu(callback, s); default: - WLog_ERR(TAG, "Type %d not recognized!", type); + WLog_ERR(TAG, "Type %"PRIu32" not recognized!", type); return ERROR_INTERNAL_ERROR; } } diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 3f806fe80..252ec24cb 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -116,7 +116,7 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, } else { - WLog_ERR(TAG, "register_plugin: Maximum DVC plugin number %d reached.", + WLog_ERR(TAG, "register_plugin: Maximum DVC plugin number %u reached.", MAX_PLUGINS); return ERROR_INTERNAL_ERROR; } @@ -259,7 +259,7 @@ static DVCMAN_CHANNEL* dvcman_channel_new(IWTSVirtualChannelManager* if (dvcman_find_channel_by_id(pChannelMgr, ChannelId)) { - WLog_ERR(TAG, "Protocol error: Duplicated ChannelId %d (%s)!", ChannelId, + WLog_ERR(TAG, "Protocol error: Duplicated ChannelId %"PRIu32" (%s)!", ChannelId, ChannelName); return NULL; } @@ -345,7 +345,7 @@ static void dvcman_free(IWTSVirtualChannelManager* pChannelMgr) if (pPlugin->Terminated) if ((error = pPlugin->Terminated(pPlugin))) - WLog_ERR(TAG, "Terminated failed with error %u!", error); + WLog_ERR(TAG, "Terminated failed with error %"PRIu32"!", error); } dvcman->num_plugins = 0; @@ -372,7 +372,7 @@ static UINT dvcman_init(IWTSVirtualChannelManager* pChannelMgr) if (pPlugin->Initialize) if ((error = pPlugin->Initialize(pPlugin, pChannelMgr))) { - WLog_ERR(TAG, "Initialize failed with error %u!", error); + WLog_ERR(TAG, "Initialize failed with error %"PRIu32"!", error); return error; } } @@ -405,7 +405,7 @@ static UINT dvcman_write_channel(IWTSVirtualChannel* pChannel, ULONG cbSize, static UINT dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) { DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel; - WLog_DBG(TAG, "close_channel_iface: id=%d", channel->channel_id); + WLog_DBG(TAG, "close_channel_iface: id=%"PRIu32"", channel->channel_id); return CHANNEL_RC_OK; } @@ -451,7 +451,7 @@ static UINT dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, (IWTSVirtualChannel*) channel, NULL, &bAccept, &pCallback)) == CHANNEL_RC_OK && bAccept) { - WLog_DBG(TAG, "listener %s created new channel %d", + WLog_DBG(TAG, "listener %s created new channel %"PRIu32"", listener->channel_name, channel->channel_id); channel->status = 0; channel->channel_callback = pCallback; @@ -461,7 +461,7 @@ static UINT dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, listener->iface.pInterface); if (error) - WLog_ERR(TAG, "context.ReceiveSamples failed with error %u", error); + WLog_ERR(TAG, "context.ReceiveSamples failed with error %"PRIu32"", error); return error; } @@ -469,7 +469,7 @@ static UINT dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, { if (error) { - WLog_ERR(TAG, "OnNewChannelConnection failed with error %u!", error); + WLog_ERR(TAG, "OnNewChannelConnection failed with error %"PRIu32"!", error); return error; } else @@ -499,7 +499,7 @@ static UINT dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, if (!channel) { - WLog_ERR(TAG, "ChannelId %d not found!", ChannelId); + WLog_ERR(TAG, "ChannelId %"PRIu32" not found!", ChannelId); return ERROR_INTERNAL_ERROR; } @@ -509,11 +509,11 @@ static UINT dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, if ((pCallback->OnOpen) && (error = pCallback->OnOpen(pCallback))) { - WLog_ERR(TAG, "OnOpen failed with error %u!", error); + WLog_ERR(TAG, "OnOpen failed with error %"PRIu32"!", error); return error; } - WLog_DBG(TAG, "open_channel: ChannelId %d", ChannelId); + WLog_DBG(TAG, "open_channel: ChannelId %"PRIu32"", ChannelId); } return CHANNEL_RC_OK; @@ -536,7 +536,7 @@ static UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, if (!channel) { - //WLog_ERR(TAG, "ChannelId %d not found!", ChannelId); + //WLog_ERR(TAG, "ChannelId %"PRIu32" not found!", ChannelId); /** * Windows 8 / Windows Server 2012 send close requests for channels that failed to be created. * Do not warn, simply return success here. @@ -552,16 +552,16 @@ static UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, if (error) { - WLog_ERR(TAG, "OnChannelDisconnected returned with error %u!", error); + WLog_ERR(TAG, "OnChannelDisconnected returned with error %"PRIu32"!", error); return error; } - WLog_DBG(TAG, "dvcman_close_channel: channel %d closed", ChannelId); + WLog_DBG(TAG, "dvcman_close_channel: channel %"PRIu32" closed", ChannelId); ichannel = (IWTSVirtualChannel*) channel; if ((ichannel->Close) && (error = ichannel->Close(ichannel))) { - WLog_ERR(TAG, "Close failed with error %u!", error); + WLog_ERR(TAG, "Close failed with error %"PRIu32"!", error); return error; } } @@ -588,7 +588,7 @@ static UINT dvcman_receive_channel_data_first(IWTSVirtualChannelManager* * Windows Server 2012 R2 can send some messages over Microsoft::Windows::RDS::Geometry::v08.01 * even if the dynamic virtual channel wasn't registered on our side. Ignoring it works. */ - WLog_ERR(TAG, "ChannelId %d not found!", ChannelId); + WLog_ERR(TAG, "ChannelId %"PRIu32" not found!", ChannelId); return CHANNEL_RC_OK; } @@ -624,7 +624,7 @@ static UINT dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, { /* Windows 8.1 tries to open channels not created. * Ignore cases like this. */ - WLog_ERR(TAG, "ChannelId %d not found!", ChannelId); + WLog_ERR(TAG, "ChannelId %"PRIu32" not found!", ChannelId); return CHANNEL_RC_OK; } @@ -642,8 +642,7 @@ static UINT dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, Stream_Write(channel->dvc_data, Stream_Pointer(data), dataSize); - if (((size_t) Stream_GetPosition(channel->dvc_data)) >= - channel->dvc_data_length) + if (Stream_GetPosition(channel->dvc_data) >= channel->dvc_data_length) { Stream_SealLength(channel->dvc_data); Stream_SetPosition(channel->dvc_data, 0); @@ -707,7 +706,7 @@ static UINT drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", WTSErrorToString(status), status); + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } return status; @@ -727,7 +726,7 @@ static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, UINT32 cbLen; unsigned long chunkLength; UINT status; - WLog_DBG(TAG, "write_data: ChannelId=%d size=%d", ChannelId, dataSize); + WLog_DBG(TAG, "write_data: ChannelId=%"PRIu32" size=%"PRIu32"", ChannelId, dataSize); data_out = Stream_New(NULL, CHANNEL_CHUNK_LENGTH); if (!data_out) @@ -799,7 +798,7 @@ static UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -832,7 +831,7 @@ static UINT drdynvc_send_capability_response(drdynvcPlugin* drdynvc) if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -924,7 +923,7 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, ChannelId = drdynvc_read_variable_uint(s, cbChId); pos = Stream_GetPosition(s); - WLog_DBG(TAG, "process_create_request: ChannelId=%d ChannelName=%s", ChannelId, + WLog_DBG(TAG, "process_create_request: ChannelId=%"PRIu32" ChannelName=%s", ChannelId, Stream_Pointer(s)); channel_status = dvcman_create_channel(drdynvc->channel_mgr, ChannelId, (char*) Stream_Pointer(s)); @@ -956,7 +955,7 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -965,14 +964,14 @@ static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, { if ((status = dvcman_open_channel(drdynvc->channel_mgr, ChannelId))) { - WLog_ERR(TAG, "dvcman_open_channel failed with error %u!", status); + WLog_ERR(TAG, "dvcman_open_channel failed with error %"PRIu32"!", status); return status; } } else { if ((status = dvcman_close_channel(drdynvc->channel_mgr, ChannelId))) - WLog_ERR(TAG, "dvcman_close_channel failed with error %u!", status); + WLog_ERR(TAG, "dvcman_close_channel failed with error %"PRIu32"!", status); } return status; @@ -991,7 +990,7 @@ static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); - WLog_DBG(TAG, "process_data_first: Sp=%d cbChId=%d, ChannelId=%d Length=%d", Sp, + WLog_DBG(TAG, "process_data_first: Sp=%d cbChId=%d, ChannelId=%"PRIu32" Length=%"PRIu32"", Sp, cbChId, ChannelId, Length); status = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length); @@ -1012,7 +1011,7 @@ static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, { UINT32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); - WLog_DBG(TAG, "process_data: Sp=%d cbChId=%d, ChannelId=%d", Sp, cbChId, + WLog_DBG(TAG, "process_data: Sp=%d cbChId=%d, ChannelId=%"PRIu32"", Sp, cbChId, ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); } @@ -1030,12 +1029,12 @@ static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, UINT32 ChannelId; wStream* data_out; ChannelId = drdynvc_read_variable_uint(s, cbChId); - WLog_DBG(TAG, "process_close_request: Sp=%d cbChId=%d, ChannelId=%d", Sp, + WLog_DBG(TAG, "process_close_request: Sp=%d cbChId=%d, ChannelId=%"PRIu32"", Sp, cbChId, ChannelId); if ((error = dvcman_close_channel(drdynvc->channel_mgr, ChannelId))) { - WLog_ERR(TAG, "dvcman_close_channel failed with error %u!", error); + WLog_ERR(TAG, "dvcman_close_channel failed with error %"PRIu32"!", error); return error; } @@ -1053,7 +1052,7 @@ static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, error = drdynvc_send(drdynvc, data_out); if (error) - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(error), error); return error; @@ -1183,7 +1182,7 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DATA_RECEIVED: if ((error = drdynvc_virtual_channel_event_data_received(drdynvc, pData, dataLength, totalLength, dataFlags))) - WLog_ERR(TAG, "drdynvc_virtual_channel_event_data_received failed with error %u", error); + WLog_ERR(TAG, "drdynvc_virtual_channel_event_data_received failed with error %"PRIu32"", error); break; @@ -1232,7 +1231,7 @@ static void* drdynvc_virtual_channel_client_thread(void* arg) if ((error = drdynvc_order_recv(drdynvc, data))) { Stream_Free(data, TRUE); - WLog_ERR(TAG, "drdynvc_order_recv failed with error %u!", error); + WLog_ERR(TAG, "drdynvc_order_recv failed with error %"PRIu32"!", error); break; } @@ -1266,7 +1265,7 @@ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVO if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -1302,7 +1301,7 @@ static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVO if ((error = dvcman_init(drdynvc->channel_mgr))) { - WLog_ERR(TAG, "dvcman_init failed with error %u!", error); + WLog_ERR(TAG, "dvcman_init failed with error %"PRIu32"!", error); goto error; } @@ -1334,7 +1333,7 @@ static UINT drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) (WaitForSingleObject(drdynvc->thread, INFINITE) == WAIT_FAILED)) { status = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", status); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", status); return status; } @@ -1347,7 +1346,7 @@ static UINT drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -1396,19 +1395,19 @@ static VOID VCAPITYPE drdynvc_virtual_channel_init_event_ex(LPVOID lpUserParam, { case CHANNEL_EVENT_CONNECTED: if ((error = drdynvc_virtual_channel_event_connected(drdynvc, pData, dataLength))) - WLog_ERR(TAG, "drdynvc_virtual_channel_event_connected failed with error %u", error); + WLog_ERR(TAG, "drdynvc_virtual_channel_event_connected failed with error %"PRIu32"", error); break; case CHANNEL_EVENT_DISCONNECTED: if ((error = drdynvc_virtual_channel_event_disconnected(drdynvc))) - WLog_ERR(TAG, "drdynvc_virtual_channel_event_disconnected failed with error %u", error); + WLog_ERR(TAG, "drdynvc_virtual_channel_event_disconnected failed with error %"PRIu32"", error); break; case CHANNEL_EVENT_TERMINATED: if ((error = drdynvc_virtual_channel_event_terminated(drdynvc))) - WLog_ERR(TAG, "drdynvc_virtual_channel_event_terminated failed with error %u", error); + WLog_ERR(TAG, "drdynvc_virtual_channel_event_terminated failed with error %"PRIu32"", error); break; } @@ -1481,7 +1480,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); free(drdynvc->context); free(drdynvc); diff --git a/channels/drdynvc/server/drdynvc_main.c b/channels/drdynvc/server/drdynvc_main.c index d1b8a30d7..bdbc0a893 100644 --- a/channels/drdynvc/server/drdynvc_main.c +++ b/channels/drdynvc/server/drdynvc_main.c @@ -161,7 +161,7 @@ static UINT drdynvc_server_stop(DrdynvcServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index c9c64be0a..2dc8147d8 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -592,13 +592,13 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN hFd = CreateFileA(file->fullpath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFd == INVALID_HANDLE_VALUE) { - WLog_ERR(TAG, "Unable to truncate %s to %lld", file->fullpath, (long long) size); + WLog_ERR(TAG, "Unable to truncate %s to %"PRId64"", file->fullpath, size); return FALSE; } liSize.QuadPart = size; if (SetFilePointer(hFd, liSize.LowPart, &liSize.HighPart, FILE_BEGIN) == 0) { - WLog_ERR(TAG, "Unable to truncate %s to %lld", file->fullpath, (long long) size); + WLog_ERR(TAG, "Unable to truncate %s to %"PRId64"", file->fullpath, size); CloseHandle(hFd); return FALSE; } diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 3344cc9a4..24c483f67 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -708,7 +708,7 @@ static void* drive_thread_func(void* arg) if (irp) if ((error = drive_process_irp(drive, irp))) { - WLog_ERR(TAG, "drive_process_irp failed with error %u!", error); + WLog_ERR(TAG, "drive_process_irp failed with error %"PRIu32"!", error); break; } } @@ -753,7 +753,7 @@ static UINT drive_free(DEVICE* device) && (WaitForSingleObject(drive->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -844,7 +844,7 @@ UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) drive))) { - WLog_ERR(TAG, "RegisterDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); goto out_error; } diff --git a/channels/echo/server/echo_main.c b/channels/echo/server/echo_main.c index 1a2f6fd27..a58793f07 100644 --- a/channels/echo/server/echo_main.c +++ b/channels/echo/server/echo_main.c @@ -83,7 +83,7 @@ static UINT echo_server_open_channel(echo_server* echo) if (WaitForSingleObject(hEvent, 1000) == WAIT_FAILED) { Error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long)Error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", Error); return Error; } @@ -121,12 +121,12 @@ static void* echo_server_thread_func(void* arg) if ((error = echo_server_open_channel(echo))) { UINT error2 = 0; - WLog_ERR(TAG, "echo_server_open_channel failed with error %u!", error); + WLog_ERR(TAG, "echo_server_open_channel failed with error %"PRIu32"!", error); IFCALLRET(echo->context.OpenResult, error2, &echo->context, ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED); if (error2) - WLog_ERR(TAG, "echo server's OpenResult callback failed with error %u", + WLog_ERR(TAG, "echo server's OpenResult callback failed with error %"PRIu32"", error2); goto out; @@ -158,7 +158,7 @@ static void* echo_server_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); break; } @@ -168,7 +168,7 @@ static void* echo_server_thread_func(void* arg) ECHO_SERVER_OPEN_RESULT_CLOSED); if (error) - WLog_ERR(TAG, "OpenResult failed with error %u!", error); + WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); break; } @@ -180,7 +180,7 @@ static void* echo_server_thread_func(void* arg) ECHO_SERVER_OPEN_RESULT_ERROR); if (error) - WLog_ERR(TAG, "OpenResult failed with error %u!", error); + WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); break; } @@ -194,7 +194,7 @@ static void* echo_server_thread_func(void* arg) ECHO_SERVER_OPEN_RESULT_OK); if (error) - WLog_ERR(TAG, "OpenResult failed with error %u!", error); + WLog_ERR(TAG, "OpenResult failed with error %"PRIu32"!", error); break; } @@ -217,7 +217,7 @@ static void* echo_server_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); break; } @@ -250,7 +250,7 @@ static void* echo_server_thread_func(void* arg) if (error) { - WLog_ERR(TAG, "Response failed with error %u!", error); + WLog_ERR(TAG, "Response failed with error %"PRIu32"!", error); break; } } @@ -315,7 +315,7 @@ static UINT echo_server_close(echo_server_context* context) if (WaitForSingleObject(echo->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index f2c1afee9..96b60a625 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -80,7 +80,7 @@ static UINT encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) if (str->cchString > 1024) { - WLog_ERR(TAG, "cchString was %d but has to be < 1025!", str->cchString); + WLog_ERR(TAG, "cchString was %"PRIu16" but has to be < 1025!", str->cchString); return ERROR_INVALID_DATA; } @@ -115,7 +115,7 @@ static UINT encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) return ERROR_INVALID_HANDLE; #if 0 - WLog_INFO(TAG, "EncomspWrite (%d)", Stream_Length(s)); + WLog_INFO(TAG, "EncomspWrite (%"PRIuz")", Stream_Length(s)); winpr_HexDump(Stream_Buffer(s), Stream_Length(s)); #endif status = encomsp->channelEntryPoints.pVirtualChannelWriteEx(encomsp->InitHandle, @@ -123,7 +123,7 @@ static UINT encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) Stream_Buffer(s), (UINT32) Stream_Length(s), s); if (status != CHANNEL_RC_OK) - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; @@ -178,7 +178,7 @@ static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->FilterUpdated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->FilterUpdated failed with error %u", error); + WLog_ERR(TAG, "context->FilterUpdated failed with error %"PRIu32"", error); return error; } @@ -214,7 +214,7 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, if ((error = encomsp_read_unicode_string(s, &(pdu.Name)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %u", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); return error; } @@ -240,7 +240,7 @@ static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, IFCALLRET(context->ApplicationCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ApplicationCreated failed with error %u", error); + WLog_ERR(TAG, "context->ApplicationCreated failed with error %"PRIu32"", error); return error; } @@ -294,7 +294,7 @@ static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, IFCALLRET(context->ApplicationRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ApplicationRemoved failed with error %u", error); + WLog_ERR(TAG, "context->ApplicationRemoved failed with error %"PRIu32"", error); return error; } @@ -331,7 +331,7 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, if ((error = encomsp_read_unicode_string(s, &(pdu.Name)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %u", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); return error; } @@ -357,7 +357,7 @@ static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->WindowCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->WindowCreated failed with error %u", error); + WLog_ERR(TAG, "context->WindowCreated failed with error %"PRIu32"", error); return error; } @@ -411,7 +411,7 @@ static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->WindowRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->WindowRemoved failed with error %u", error); + WLog_ERR(TAG, "context->WindowRemoved failed with error %"PRIu32"", error); return error; } @@ -465,7 +465,7 @@ static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, IFCALLRET(context->ShowWindow, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ShowWindow failed with error %u", error); + WLog_ERR(TAG, "context->ShowWindow failed with error %"PRIu32"", error); return error; } @@ -502,7 +502,7 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, if ((error = encomsp_read_unicode_string(s, &(pdu.FriendlyName)))) { - WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %u", error); + WLog_ERR(TAG, "encomsp_read_unicode_string failed with error %"PRIu32"", error); return error; } @@ -528,7 +528,7 @@ static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, IFCALLRET(context->ParticipantCreated, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ParticipantCreated failed with error %u", error); + WLog_ERR(TAG, "context->ParticipantCreated failed with error %"PRIu32"", error); return error; } @@ -584,7 +584,7 @@ static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, IFCALLRET(context->ParticipantRemoved, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ParticipantRemoved failed with error %u", error); + WLog_ERR(TAG, "context->ParticipantRemoved failed with error %"PRIu32"", error); return error; } @@ -639,7 +639,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( IFCALLRET(context->ChangeParticipantControlLevel, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %u", + WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %"PRIu32"", error); return error; @@ -670,7 +670,7 @@ static UINT encomsp_send_change_participant_control_level_pdu( if ((error = encomsp_write_header(s, (ENCOMSP_ORDER_HEADER*) pdu))) { - WLog_ERR(TAG, "encomsp_write_header failed with error %u!", error); + WLog_ERR(TAG, "encomsp_write_header failed with error %"PRIu32"!", error); return error; } @@ -721,7 +721,7 @@ static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, IFCALLRET(context->GraphicsStreamPaused, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->GraphicsStreamPaused failed with error %u", error); + WLog_ERR(TAG, "context->GraphicsStreamPaused failed with error %"PRIu32"", error); return error; } @@ -767,7 +767,7 @@ static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, IFCALLRET(context->GraphicsStreamResumed, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->GraphicsStreamResumed failed with error %u", error); + WLog_ERR(TAG, "context->GraphicsStreamResumed failed with error %"PRIu32"", error); return error; } @@ -786,18 +786,18 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) { if ((error = encomsp_read_header(s, &header))) { - WLog_ERR(TAG, "encomsp_read_header failed with error %u!", error); + WLog_ERR(TAG, "encomsp_read_header failed with error %"PRIu32"!", error); return error; } - //WLog_DBG(TAG, "EncomspReceive: Type: %d Length: %d", header.Type, header.Length); + //WLog_DBG(TAG, "EncomspReceive: Type: %"PRIu16" Length: %"PRIu16"", header.Type, header.Length); switch (header.Type) { case ODTYPE_FILTER_STATE_UPDATED: if ((error = encomsp_recv_filter_updated_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_filter_updated_pdu failed with error %u!", error); + WLog_ERR(TAG, "encomsp_recv_filter_updated_pdu failed with error %"PRIu32"!", error); return error; } @@ -806,7 +806,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_APP_REMOVED: if ((error = encomsp_recv_application_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %"PRIu32"!", error); return error; } @@ -816,7 +816,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_APP_CREATED: if ((error = encomsp_recv_application_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_application_removed_pdu failed with error %"PRIu32"!", error); return error; } @@ -826,7 +826,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_REMOVED: if ((error = encomsp_recv_window_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_window_removed_pdu failed with error %u!", error); + WLog_ERR(TAG, "encomsp_recv_window_removed_pdu failed with error %"PRIu32"!", error); return error; } @@ -835,7 +835,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_CREATED: if ((error = encomsp_recv_window_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_window_created_pdu failed with error %u!", error); + WLog_ERR(TAG, "encomsp_recv_window_created_pdu failed with error %"PRIu32"!", error); return error; } @@ -844,7 +844,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_WND_SHOW: if ((error = encomsp_recv_show_window_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_show_window_pdu failed with error %u!", error); + WLog_ERR(TAG, "encomsp_recv_show_window_pdu failed with error %"PRIu32"!", error); return error; } @@ -853,7 +853,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_PARTICIPANT_REMOVED: if ((error = encomsp_recv_participant_removed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_participant_removed_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_participant_removed_pdu failed with error %"PRIu32"!", error); return error; } @@ -863,7 +863,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_PARTICIPANT_CREATED: if ((error = encomsp_recv_participant_created_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_participant_created_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_participant_created_pdu failed with error %"PRIu32"!", error); return error; } @@ -875,7 +875,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) &header))) { WLog_ERR(TAG, - "encomsp_recv_change_participant_control_level_pdu failed with error %u!", + "encomsp_recv_change_participant_control_level_pdu failed with error %"PRIu32"!", error); return error; } @@ -885,7 +885,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_GRAPHICS_STREAM_PAUSED: if ((error = encomsp_recv_graphics_stream_paused_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_graphics_stream_paused_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_graphics_stream_paused_pdu failed with error %"PRIu32"!", error); return error; } @@ -895,7 +895,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) case ODTYPE_GRAPHICS_STREAM_RESUMED: if ((error = encomsp_recv_graphics_stream_resumed_pdu(encomsp, s, &header))) { - WLog_ERR(TAG, "encomsp_recv_graphics_stream_resumed_pdu failed with error %u!", + WLog_ERR(TAG, "encomsp_recv_graphics_stream_resumed_pdu failed with error %"PRIu32"!", error); return error; } @@ -903,7 +903,7 @@ static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) break; default: - WLog_ERR(TAG, "header.Type %d not found", header.Type); + WLog_ERR(TAG, "header.Type %"PRIu16" not found", header.Type); return ERROR_INVALID_DATA; break; } @@ -934,7 +934,7 @@ static int encomsp_send(encomspPlugin* encomsp, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -1019,7 +1019,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, if ((error = encomsp_virtual_channel_event_data_received(encomsp, pData, dataLength, totalLength, dataFlags))) WLog_ERR(TAG, - "encomsp_virtual_channel_event_data_received failed with error %u", error); + "encomsp_virtual_channel_event_data_received failed with error %"PRIu32"", error); break; @@ -1070,7 +1070,7 @@ static void* encomsp_virtual_channel_client_thread(void* arg) if ((error = encomsp_process_receive(encomsp, data))) { - WLog_ERR(TAG, "encomsp_process_receive failed with error %u!", error); + WLog_ERR(TAG, "encomsp_process_receive failed with error %"PRIu32"!", error); break; } } @@ -1099,7 +1099,7 @@ static UINT encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -1137,7 +1137,7 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) && (WaitForSingleObject(encomsp->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); return rc; } @@ -1149,7 +1149,7 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelClose failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); return rc; } @@ -1195,7 +1195,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_CONNECTED: if ((error = encomsp_virtual_channel_event_connected(encomsp, pData, dataLength))) - WLog_ERR(TAG, "encomsp_virtual_channel_event_connected failed with error %u", + WLog_ERR(TAG, "encomsp_virtual_channel_event_connected failed with error %"PRIu32"", error); break; @@ -1203,7 +1203,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = encomsp_virtual_channel_event_disconnected(encomsp))) WLog_ERR(TAG, - "encomsp_virtual_channel_event_disconnected failed with error %u", error); + "encomsp_virtual_channel_event_disconnected failed with error %"PRIu32"", error); break; @@ -1212,7 +1212,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_init_event_ex(LPVOID lpUserParam, break; default: - WLog_ERR(TAG, "Unhandled event type %d", event); + WLog_ERR(TAG, "Unhandled event type %"PRIu32"", event); } if (error && encomsp->rdpcontext) @@ -1283,7 +1283,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints, PVOI if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "failed with %s [%08X]", + WLog_ERR(TAG, "failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); goto error_out; } diff --git a/channels/encomsp/server/encomsp_main.c b/channels/encomsp/server/encomsp_main.c index cae52d9ca..bbbe9a748 100644 --- a/channels/encomsp/server/encomsp_main.c +++ b/channels/encomsp/server/encomsp_main.c @@ -122,7 +122,7 @@ static UINT encomsp_recv_change_participant_control_level_pdu( IFCALLRET(context->ChangeParticipantControlLevel, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %u", + WLog_ERR(TAG, "context->ChangeParticipantControlLevel failed with error %"PRIu32"", error); return error; @@ -143,11 +143,11 @@ static UINT encomsp_server_receive_pdu(EncomspServerContext* context, { if ((error = encomsp_read_header(s, &header))) { - WLog_ERR(TAG, "encomsp_read_header failed with error %u!", error); + WLog_ERR(TAG, "encomsp_read_header failed with error %"PRIu32"!", error); return error; } - WLog_INFO(TAG, "EncomspReceive: Type: %d Length: %d", header.Type, + WLog_INFO(TAG, "EncomspReceive: Type: %"PRIu16" Length: %"PRIu16"", header.Type, header.Length); switch (header.Type) @@ -157,7 +157,7 @@ static UINT encomsp_server_receive_pdu(EncomspServerContext* context, &header))) { WLog_ERR(TAG, - "encomsp_recv_change_participant_control_level_pdu failed with error %u!", + "encomsp_recv_change_participant_control_level_pdu failed with error %"PRIu32"!", error); return error; } @@ -165,7 +165,7 @@ static UINT encomsp_server_receive_pdu(EncomspServerContext* context, break; default: - WLog_ERR(TAG, "header.Type unknown %d!", header.Type); + WLog_ERR(TAG, "header.Type unknown %"PRIu16"!", header.Type); return ERROR_INVALID_DATA; break; } @@ -220,7 +220,7 @@ static void* encomsp_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); break; } @@ -229,7 +229,7 @@ static void* encomsp_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); break; } @@ -269,7 +269,7 @@ static void* encomsp_server_thread(void* arg) if ((error = encomsp_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "encomsp_server_receive_pdu failed with error %u!", error); + WLog_ERR(TAG, "encomsp_server_receive_pdu failed with error %"PRIu32"!", error); break; } @@ -333,7 +333,7 @@ static UINT encomsp_server_stop(EncomspServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c index 0614ffcdf..b8c818041 100644 --- a/channels/parallel/client/parallel_main.c +++ b/channels/parallel/client/parallel_main.c @@ -252,7 +252,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_CREATE: if ((error = parallel_process_irp_create(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_create failed with error %d!", error); + WLog_ERR(TAG, "parallel_process_irp_create failed with error %"PRIu32"!", error); return error; } @@ -261,7 +261,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_CLOSE: if ((error = parallel_process_irp_close(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_close failed with error %d!", error); + WLog_ERR(TAG, "parallel_process_irp_close failed with error %"PRIu32"!", error); return error; } @@ -270,7 +270,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_READ: if ((error = parallel_process_irp_read(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_read failed with error %d!", error); + WLog_ERR(TAG, "parallel_process_irp_read failed with error %"PRIu32"!", error); return error; } @@ -279,7 +279,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_WRITE: if ((error = parallel_process_irp_write(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_write failed with error %d!", error); + WLog_ERR(TAG, "parallel_process_irp_write failed with error %"PRIu32"!", error); return error; } @@ -288,7 +288,7 @@ static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = parallel_process_irp_device_control(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp_device_control failed with error %d!", + WLog_ERR(TAG, "parallel_process_irp_device_control failed with error %"PRIu32"!", error); return error; } @@ -334,7 +334,7 @@ static void* parallel_thread_func(void* arg) if ((error = parallel_process_irp(parallel, irp))) { - WLog_ERR(TAG, "parallel_process_irp failed with error %d!", error); + WLog_ERR(TAG, "parallel_process_irp failed with error %"PRIu32"!", error); break; } } @@ -379,7 +379,7 @@ static UINT parallel_free(DEVICE* device) && (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -461,7 +461,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) parallel))) { - WLog_ERR(TAG, "RegisterDevice failed with error %u!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index 6d1b3e1ae..741b9ae04 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -153,7 +153,7 @@ static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) if (error) { - WLog_ERR(TAG, "printjob->Write failed with error %u!", error); + WLog_ERR(TAG, "printjob->Write failed with error %"PRIu32"!", error); return error; } @@ -188,7 +188,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_CREATE: if ((error = printer_process_irp_create(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_create failed with error %u!", error); + WLog_ERR(TAG, "printer_process_irp_create failed with error %"PRIu32"!", error); return error; } @@ -197,7 +197,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_CLOSE: if ((error = printer_process_irp_close(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_close failed with error %u!", error); + WLog_ERR(TAG, "printer_process_irp_close failed with error %"PRIu32"!", error); return error; } @@ -206,7 +206,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_WRITE: if ((error = printer_process_irp_write(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_write failed with error %u!", error); + WLog_ERR(TAG, "printer_process_irp_write failed with error %"PRIu32"!", error); return error; } @@ -215,7 +215,7 @@ static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = printer_process_irp_device_control(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp_device_control failed with error %u!", + WLog_ERR(TAG, "printer_process_irp_device_control failed with error %"PRIu32"!", error); return error; } @@ -245,7 +245,7 @@ static void* printer_thread_func(void* arg) if (rc == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -266,7 +266,7 @@ static void* printer_thread_func(void* arg) if ((error = printer_process_irp(printer_dev, irp))) { - WLog_ERR(TAG, "printer_process_irp failed with error %d!", error); + WLog_ERR(TAG, "printer_process_irp failed with error %"PRIu32"!", error); break; } } @@ -307,7 +307,7 @@ static UINT printer_free(DEVICE* device) if (WaitForSingleObject(printer_dev->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); return error; } @@ -441,7 +441,7 @@ UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) printer_dev))) { - WLog_ERR(TAG, "RegisterDevice failed with error %d!", error); + WLog_ERR(TAG, "RegisterDevice failed with error %"PRIu32"!", error); goto error_out; } @@ -514,7 +514,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if ((error = printer_register(pEntryPoints, printer))) { - WLog_ERR(TAG, "printer_register failed with error %u!", error); + WLog_ERR(TAG, "printer_register failed with error %"PRIu32"!", error); return error; } } @@ -528,7 +528,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if ((error = printer_register(pEntryPoints, printer))) { - WLog_ERR(TAG, "printer_register failed with error %u!", error); + WLog_ERR(TAG, "printer_register failed with error %"PRIu32"!", error); free(printers); return error; } diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index 2025e35f3..38db6acd7 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -62,7 +62,7 @@ static UINT rail_send(railPlugin* rail, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -179,14 +179,14 @@ static UINT rail_send_client_sysparam(RailClientContext* context, if ((error = rail_write_client_sysparam_order(s, sysparam))) { - WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %"PRIu32"!", error); Stream_Free(s, TRUE); return error; } if ((error = rail_send_pdu(rail, s, RDP_RAIL_ORDER_SYSPARAM))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %u!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); } Stream_Free(s, TRUE); @@ -209,7 +209,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -220,7 +220,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -231,7 +231,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -242,7 +242,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -253,7 +253,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -264,7 +264,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -275,7 +275,7 @@ static UINT rail_client_system_param(RailClientContext* context, if ((error = rail_send_client_sysparam(context, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam failed with error %"PRIu32"!", error); return error; } } @@ -558,7 +558,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO case CHANNEL_EVENT_DATA_RECEIVED: if ((error = rail_virtual_channel_event_data_received(rail, pData, dataLength, totalLength, dataFlags))) - WLog_ERR(TAG, "rail_virtual_channel_event_data_received failed with error %u!", + WLog_ERR(TAG, "rail_virtual_channel_event_data_received failed with error %"PRIu32"!", error); break; @@ -610,7 +610,7 @@ static void* rail_virtual_channel_client_thread(void* arg) if ((error = rail_order_recv(rail, data))) { - WLog_ERR(TAG, "rail_order_recv failed with error %d!", error); + WLog_ERR(TAG, "rail_order_recv failed with error %"PRIu32"!", error); break; } } @@ -638,7 +638,7 @@ static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -677,7 +677,7 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) && (WaitForSingleObject(rail->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); return rc; } @@ -689,7 +689,7 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); return rc; } @@ -727,14 +727,14 @@ static VOID VCAPITYPE rail_virtual_channel_init_event_ex(LPVOID lpUserParam, LPV { case CHANNEL_EVENT_CONNECTED: if ((error = rail_virtual_channel_event_connected(rail, pData, dataLength))) - WLog_ERR(TAG, "rail_virtual_channel_event_connected failed with error %u!", + WLog_ERR(TAG, "rail_virtual_channel_event_connected failed with error %"PRIu32"!", error); break; case CHANNEL_EVENT_DISCONNECTED: if ((error = rail_virtual_channel_event_disconnected(rail))) - WLog_ERR(TAG, "rail_virtual_channel_event_disconnected failed with error %u!", + WLog_ERR(TAG, "rail_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); break; @@ -825,7 +825,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "failed with %s [%08X]", + WLog_ERR(TAG, "failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); goto error_out; } diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index d8729cc0c..adcea2112 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -84,7 +84,7 @@ UINT rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) rail_write_pdu_header(s, orderType, orderLength); Stream_SetPosition(s, orderLength); - WLog_Print(rail->log, WLOG_DEBUG, "Sending %s PDU, length: %d", + WLog_Print(rail->log, WLOG_DEBUG, "Sending %s PDU, length: %"PRIu16"", RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); return rail_send_channel_data(rail, Stream_Buffer(s), orderLength); @@ -268,17 +268,17 @@ UINT rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) Stream_Write_UINT16(s, exec->arguments.length); /* argumentsLength (2 bytes) */ if ((error = rail_write_unicode_string_value(s, &exec->exeOrFile))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %u", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); return error; } if ((error = rail_write_unicode_string_value(s, &exec->workingDir))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %u", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); return error; } if ((error = rail_write_unicode_string_value(s, &exec->arguments))) { - WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %u", error); + WLog_ERR(TAG, "rail_write_unicode_string_value failed with error %"PRIu32"", error); return error; } return error; @@ -408,7 +408,7 @@ UINT rail_recv_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake if ((error = rail_read_handshake_order(s, handshake))) { - WLog_ERR(TAG, "rail_read_handshake_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_handshake_order failed with error %"PRIu32"!", error); return error; } @@ -416,7 +416,7 @@ UINT rail_recv_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake { IFCALLRET(context->ServerHandshake, error, context, handshake); if (error) - WLog_ERR(TAG, "context.ServerHandshake failed with error %u", error); + WLog_ERR(TAG, "context.ServerHandshake failed with error %"PRIu32"", error); } return error; @@ -434,7 +434,7 @@ UINT rail_recv_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* han if ((error = rail_read_handshake_ex_order(s, handshakeEx))) { - WLog_ERR(TAG, "rail_read_handshake_ex_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_handshake_ex_order failed with error %"PRIu32"!", error); return error; } @@ -442,7 +442,7 @@ UINT rail_recv_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* han { IFCALLRET(context->ClientHandshakeEx, error, context, handshakeEx); if (error) - WLog_ERR(TAG, "context.ClientHandshakeEx failed with error %u", error); + WLog_ERR(TAG, "context.ClientHandshakeEx failed with error %"PRIu32"", error); } @@ -463,7 +463,7 @@ UINT rail_recv_exec_result_order(railPlugin* rail, RAIL_EXEC_RESULT_ORDER* execR if ((error = rail_read_server_exec_result_order(s, execResult))) { - WLog_ERR(TAG, "rail_read_server_exec_result_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_server_exec_result_order failed with error %"PRIu32"!", error); return error; } @@ -471,7 +471,7 @@ UINT rail_recv_exec_result_order(railPlugin* rail, RAIL_EXEC_RESULT_ORDER* execR { IFCALLRET(context->ServerExecuteResult, error, context, execResult); if (error) - WLog_ERR(TAG, "context.ServerExecuteResult failed with error %u", error); + WLog_ERR(TAG, "context.ServerExecuteResult failed with error %"PRIu32"", error); } @@ -490,7 +490,7 @@ UINT rail_recv_server_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysp if ((error = rail_read_server_sysparam_order(s, sysparam))) { - WLog_ERR(TAG, "rail_read_server_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_server_sysparam_order failed with error %"PRIu32"!", error); return error; } @@ -498,7 +498,7 @@ UINT rail_recv_server_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysp { IFCALLRET(context->ServerSystemParam, error, context, sysparam); if (error) - WLog_ERR(TAG, "context.ServerSystemParam failed with error %u", error); + WLog_ERR(TAG, "context.ServerSystemParam failed with error %"PRIu32"", error); } return error; @@ -516,7 +516,7 @@ UINT rail_recv_server_minmaxinfo_order(railPlugin* rail, RAIL_MINMAXINFO_ORDER* if ((error = rail_read_server_minmaxinfo_order(s, minMaxInfo))) { - WLog_ERR(TAG, "rail_read_server_minmaxinfo_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_server_minmaxinfo_order failed with error %"PRIu32"!", error); return error; } @@ -524,7 +524,7 @@ UINT rail_recv_server_minmaxinfo_order(railPlugin* rail, RAIL_MINMAXINFO_ORDER* { IFCALLRET(context->ServerMinMaxInfo, error, context, minMaxInfo); if (error) - WLog_ERR(TAG, "context.ServerMinMaxInfo failed with error %u", error); + WLog_ERR(TAG, "context.ServerMinMaxInfo failed with error %"PRIu32"", error); } return error; @@ -542,7 +542,7 @@ UINT rail_recv_server_localmovesize_order(railPlugin* rail, RAIL_LOCALMOVESIZE_O if ((error = rail_read_server_localmovesize_order(s, localMoveSize))) { - WLog_ERR(TAG, "rail_read_server_localmovesize_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_server_localmovesize_order failed with error %"PRIu32"!", error); return error; } @@ -550,7 +550,7 @@ UINT rail_recv_server_localmovesize_order(railPlugin* rail, RAIL_LOCALMOVESIZE_O { IFCALLRET(context->ServerLocalMoveSize, error, context, localMoveSize); if (error) - WLog_ERR(TAG, "context.ServerLocalMoveSize failed with error %u", error); + WLog_ERR(TAG, "context.ServerLocalMoveSize failed with error %"PRIu32"", error); } return error; @@ -568,7 +568,7 @@ UINT rail_recv_server_get_appid_resp_order(railPlugin* rail, RAIL_GET_APPID_RESP if ((error = rail_read_server_get_appid_resp_order(s, getAppIdResp))) { - WLog_ERR(TAG, "rail_read_server_get_appid_resp_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_server_get_appid_resp_order failed with error %"PRIu32"!", error); return error; } @@ -576,7 +576,7 @@ UINT rail_recv_server_get_appid_resp_order(railPlugin* rail, RAIL_GET_APPID_RESP { IFCALLRET(context->ServerGetAppIdResponse, error, context, getAppIdResp); if (error) - WLog_ERR(TAG, "context.ServerGetAppIdResponse failed with error %u", error); + WLog_ERR(TAG, "context.ServerGetAppIdResponse failed with error %"PRIu32"", error); } return error; @@ -594,7 +594,7 @@ UINT rail_recv_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* lan if ((error = rail_read_langbar_info_order(s, langBarInfo))) { - WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %u!", error); + WLog_ERR(TAG, "rail_read_langbar_info_order failed with error %"PRIu32"!", error); return error; } @@ -602,7 +602,7 @@ UINT rail_recv_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* lan { IFCALLRET(context->ServerLanguageBarInfo, error, context, langBarInfo); if (error) - WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %u", error); + WLog_ERR(TAG, "context.ServerLanguageBarInfo failed with error %"PRIu32"", error); } return error; @@ -621,12 +621,12 @@ UINT rail_order_recv(railPlugin* rail, wStream* s) if ((error = rail_read_pdu_header(s, &orderType, &orderLength))) { - WLog_ERR(TAG, "rail_read_pdu_header failed with error %u!", error); + WLog_ERR(TAG, "rail_read_pdu_header failed with error %"PRIu32"!", error); return error; } - WLog_Print(rail->log, WLOG_DEBUG, "Received %s PDU, length:%u", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], (unsigned)orderLength); + WLog_Print(rail->log, WLOG_DEBUG, "Received %s PDU, length:%"PRIu16"", + RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); switch (orderType) { @@ -780,12 +780,12 @@ UINT rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec) if ((error = rail_write_client_exec_order(s, exec))) { - WLog_ERR(TAG, "rail_write_client_exec_order failed with error %u!", error); + WLog_ERR(TAG, "rail_write_client_exec_order failed with error %"PRIu32"!", error); return error; } if ((error = rail_send_pdu(rail, s, RDP_RAIL_ORDER_EXEC))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %u!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); return error; } Stream_Free(s, TRUE); @@ -834,13 +834,13 @@ UINT rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysp if ((error = rail_write_client_sysparam_order(s, sysparam))) { - WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %"PRIu32"!", error); return error; } if ((error = rail_send_pdu(rail, s, RDP_RAIL_ORDER_SYSPARAM))) { - WLog_ERR(TAG, "rail_send_pdu failed with error %u!", error); + WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error); return error; } @@ -862,7 +862,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_HIGH_CONTRAST; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -872,7 +872,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_TASKBAR_POS; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -882,7 +882,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_MOUSE_BUTTON_SWAP; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -892,7 +892,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_KEYBOARD_PREF; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -902,7 +902,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_DRAG_FULL_WINDOWS; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -912,7 +912,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_KEYBOARD_CUES; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } @@ -922,7 +922,7 @@ UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sys sysparam->param = SPI_SET_WORK_AREA; if ((error = rail_send_client_sysparam_order(rail, sysparam))) { - WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %u!", error); + WLog_ERR(TAG, "rail_send_client_sysparam_order failed with error %"PRIu32"!", error); return error; } } diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 2b227d9be..18d20e713 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -252,7 +252,7 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) { // dont end on error, just report ? - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %u!", + WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", error); } @@ -346,7 +346,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) if (rdpdr->hotplug_wnd && !PostMessage(rdpdr->hotplug_wnd, WM_QUIT, 0, 0)) { error = GetLastError(); - WLog_ERR(TAG, "PostMessage failed with error %u", error); + WLog_ERR(TAG, "PostMessage failed with error %"PRIu32"", error); } return error; @@ -451,7 +451,7 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) { - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %u!", + WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", error); goto cleanup; } @@ -529,7 +529,7 @@ static void drive_hotplug_fsevent_callback(ConstFSEventStreamRef streamRef, { if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %u!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); } else rdpdr_send_device_list_announce_request(rdpdr, TRUE); @@ -545,7 +545,7 @@ void first_hotplug(rdpdrPlugin* rdpdr) if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %u!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); } } @@ -590,7 +590,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) if (WaitForSingleObject(rdpdr->hotplugThread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -783,7 +783,7 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) if ((error = rdpdr_send_device_list_remove_request(rdpdr, 1, ids))) { - WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %u!", + WLog_ERR(TAG, "rdpdr_send_device_list_remove_request failed with error %"PRIu32"!", error); goto cleanup; } @@ -848,7 +848,7 @@ static void first_hotplug(rdpdrPlugin* rdpdr) if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %u!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); } } @@ -891,7 +891,7 @@ static void* drive_hotplug_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); goto out; } @@ -903,7 +903,7 @@ static void* drive_hotplug_thread_func(void* arg) /* file /proc/mounts changed, handle this */ if ((error = handle_hotplug(rdpdr))) { - WLog_ERR(TAG, "handle_hotplug failed with error %u!", error); + WLog_ERR(TAG, "handle_hotplug failed with error %"PRIu32"!", error); goto out; } else @@ -944,7 +944,7 @@ static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) if (WaitForSingleObject(rdpdr->hotplugThread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -1006,7 +1006,7 @@ static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) if ((error = devman_load_device_service(rdpdr->devman, device, rdpdr->rdpcontext))) { - WLog_ERR(TAG, "devman_load_device_service failed with error %u!", error); + WLog_ERR(TAG, "devman_load_device_service failed with error %"PRIu32"!", error); return error; } } @@ -1191,7 +1191,7 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, Stream_Write(s, Stream_Buffer(device->data), data_len); count++; - WLog_INFO(TAG, "registered device #%d: %s (type=%d id=%d)", + WLog_INFO(TAG, "registered device #%"PRIu32": %s (type=%"PRIu32" id=%"PRIu32")", count, device->name, device->type, device->id); } } @@ -1218,14 +1218,14 @@ static UINT rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) if (!irp) { - WLog_ERR(TAG, "irp_new failed with %u!", error); + WLog_ERR(TAG, "irp_new failed with %"PRIu32"!", error); return error; } IFCALLRET(irp->device->IRPRequest, error, irp->device, irp); if (error) - WLog_ERR(TAG, "device->IRPRequest failed with error %u", error); + WLog_ERR(TAG, "device->IRPRequest failed with error %"PRIu32"", error); return error; } @@ -1295,19 +1295,19 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if ((error = rdpdr_send_client_announce_reply(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_client_announce_reply failed with error %u", error); + WLog_ERR(TAG, "rdpdr_send_client_announce_reply failed with error %"PRIu32"", error); return error; } if ((error = rdpdr_send_client_name_request(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_client_name_request failed with error %u", error); + WLog_ERR(TAG, "rdpdr_send_client_name_request failed with error %"PRIu32"", error); return error; } if ((error = rdpdr_process_init(rdpdr))) { - WLog_ERR(TAG, "rdpdr_process_init failed with error %u", error); + WLog_ERR(TAG, "rdpdr_process_init failed with error %"PRIu32"", error); return error; } @@ -1319,7 +1319,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if ((error = rdpdr_send_capability_response(rdpdr))) { - WLog_ERR(TAG, "rdpdr_send_capability_response failed with error %u", error); + WLog_ERR(TAG, "rdpdr_send_capability_response failed with error %"PRIu32"", error); return error; } @@ -1331,7 +1331,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) if ((error = rdpdr_send_device_list_announce_request(rdpdr, FALSE))) { - WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %u", + WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %"PRIu32"", error); return error; } @@ -1341,7 +1341,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) case PAKID_CORE_USER_LOGGEDON: if ((error = rdpdr_send_device_list_announce_request(rdpdr, TRUE))) { - WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %u", + WLog_ERR(TAG, "rdpdr_send_device_list_announce_request failed with error %"PRIu32"", error); return error; } @@ -1361,7 +1361,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) case PAKID_CORE_DEVICE_IOREQUEST: if ((error = rdpdr_process_irp(rdpdr, s))) { - WLog_ERR(TAG, "rdpdr_process_irp failed with error %u", error); + WLog_ERR(TAG, "rdpdr_process_irp failed with error %"PRIu32"", error); return error; } @@ -1369,7 +1369,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) break; default: - WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04X", packetId); + WLog_ERR(TAG, "RDPDR_CTYP_CORE unknown PacketId: 0x%04"PRIX16"", packetId); return ERROR_INVALID_DATA; break; } @@ -1387,7 +1387,7 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) Stream_Read_UINT32(s, eventID); WLog_ERR(TAG, - "Ignoring unhandled message PAKID_PRN_CACHE_DATA (EventID: 0x%04X)", eventID); + "Ignoring unhandled message PAKID_PRN_CACHE_DATA (EventID: 0x%08"PRIX32")", eventID); } break; @@ -1396,13 +1396,13 @@ static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) break; default: - WLog_ERR(TAG, "Unknown printing component packetID: 0x%04X", packetId); + WLog_ERR(TAG, "Unknown printing component packetID: 0x%04"PRIX16"", packetId); return ERROR_INVALID_DATA; } } else { - WLog_ERR(TAG, "Unknown message: Component: 0x%04X PacketId: 0x%04X", component, + WLog_ERR(TAG, "Unknown message: Component: 0x%04"PRIX16" PacketId: 0x%04"PRIX16"", component, packetId); return ERROR_INVALID_DATA; } @@ -1435,7 +1435,7 @@ UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -1528,7 +1528,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DW if ((error = rdpdr_virtual_channel_event_data_received(rdpdr, pData, dataLength, totalLength, dataFlags))) WLog_ERR(TAG, - "rdpdr_virtual_channel_event_data_received failed with error %u!", error); + "rdpdr_virtual_channel_event_data_received failed with error %"PRIu32"!", error); break; @@ -1562,7 +1562,7 @@ static void* rdpdr_virtual_channel_client_thread(void* arg) if ((error = rdpdr_process_connect(rdpdr))) { - WLog_ERR(TAG, "rdpdr_process_connect failed with error %u!", error); + WLog_ERR(TAG, "rdpdr_process_connect failed with error %"PRIu32"!", error); if (rdpdr->rdpcontext) setChannelError(rdpdr->rdpcontext, error, @@ -1588,7 +1588,7 @@ static void* rdpdr_virtual_channel_client_thread(void* arg) if ((error = rdpdr_process_receive(rdpdr, data))) { - WLog_ERR(TAG, "rdpdr_process_receive failed with error %u!", error); + WLog_ERR(TAG, "rdpdr_process_receive failed with error %"PRIu32"!", error); if (rdpdr->rdpcontext) setChannelError(rdpdr->rdpcontext, error, @@ -1619,7 +1619,7 @@ static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -1656,7 +1656,7 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) && (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -1667,7 +1667,7 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) if ((error = drive_hotplug_thread_terminate(rdpdr))) { - WLog_ERR(TAG, "drive_hotplug_thread_terminate failed with error %u!", error); + WLog_ERR(TAG, "drive_hotplug_thread_terminate failed with error %"PRIu32"!", error); return error; } @@ -1675,7 +1675,7 @@ static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) if (CHANNEL_RC_OK != error) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", WTSErrorToString(error), error); } @@ -1722,14 +1722,14 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LP case CHANNEL_EVENT_CONNECTED: if ((error = rdpdr_virtual_channel_event_connected(rdpdr, pData, dataLength))) - WLog_ERR(TAG, "rdpdr_virtual_channel_event_connected failed with error %u!", + WLog_ERR(TAG, "rdpdr_virtual_channel_event_connected failed with error %"PRIu32"!", error); break; case CHANNEL_EVENT_DISCONNECTED: if ((error = rdpdr_virtual_channel_event_disconnected(rdpdr))) - WLog_ERR(TAG, "rdpdr_virtual_channel_event_disconnected failed with error %u!", + WLog_ERR(TAG, "rdpdr_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); break; @@ -1739,7 +1739,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_init_event_ex(LPVOID lpUserParam, LP break; default: - WLog_ERR(TAG, "unknown event %d!", event); + WLog_ERR(TAG, "unknown event %"PRIu32"!", event); error = ERROR_INVALID_DATA; break; } @@ -1788,7 +1788,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); free(rdpdr); return FALSE; diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index 1bf112a6f..93d3560ab 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -123,7 +123,7 @@ static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, Stream_Read_UINT16(s, VersionMinor); /* VersionMinor (2 bytes) */ Stream_Read_UINT32(s, ClientId); /* ClientId (4 bytes) */ WLog_DBG(TAG, - "Client Announce Response: VersionMajor: 0x%04X VersionMinor: 0x%04X ClientId: 0x%04X", + "Client Announce Response: VersionMajor: 0x%08"PRIX16" VersionMinor: 0x%04"PRIX16" ClientId: 0x%08"PRIX32"", VersionMajor, VersionMinor, ClientId); context->priv->ClientId = ClientId; return CHANNEL_RC_OK; @@ -152,7 +152,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* if (UnicodeFlag > 1) /* must be 0x00000000 or 0x00000001 */ { - WLog_ERR(TAG, "invalid UnicodeFlag value: 0x%08X", UnicodeFlag); + WLog_ERR(TAG, "invalid UnicodeFlag value: 0x%08"PRIX32"", UnicodeFlag); return ERROR_INVALID_DATA; } @@ -165,7 +165,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* { if ((ComputerNameLen % 2) || ComputerNameLen > 512 || ComputerNameLen < 2) { - WLog_ERR(TAG, "invalid unicode computer name length: %u", ComputerNameLen); + WLog_ERR(TAG, "invalid unicode computer name length: %"PRIu32"", ComputerNameLen); return ERROR_INVALID_DATA; } } @@ -173,7 +173,7 @@ static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* { if (ComputerNameLen > 256 || ComputerNameLen < 1) { - WLog_ERR(TAG, "invalid ascii computer name length: %u", ComputerNameLen); + WLog_ERR(TAG, "invalid ascii computer name length: %"PRIu32"", ComputerNameLen); return ERROR_INVALID_DATA; } } @@ -565,7 +565,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* if ((error = rdpdr_server_write_general_capability_set(context, s))) { WLog_ERR(TAG, - "rdpdr_server_write_general_capability_set failed with error %u!", error); + "rdpdr_server_write_general_capability_set failed with error %"PRIu32"!", error); return error; } @@ -573,7 +573,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* { if ((error = rdpdr_server_write_drive_capability_set(context, s))) { - WLog_ERR(TAG, "rdpdr_server_write_drive_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_write_drive_capability_set failed with error %"PRIu32"!", error); return error; } @@ -583,7 +583,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* { if ((error = rdpdr_server_write_port_capability_set(context, s))) { - WLog_ERR(TAG, "rdpdr_server_write_port_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_write_port_capability_set failed with error %"PRIu32"!", error); return error; } @@ -594,7 +594,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* if ((error = rdpdr_server_write_printer_capability_set(context, s))) { WLog_ERR(TAG, - "rdpdr_server_write_printer_capability_set failed with error %u!", error); + "rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error); return error; } } @@ -604,7 +604,7 @@ static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* if ((error = rdpdr_server_write_smartcard_capability_set(context, s))) { WLog_ERR(TAG, - "rdpdr_server_write_printer_capability_set failed with error %u!", error); + "rdpdr_server_write_printer_capability_set failed with error %"PRIu32"!", error); return error; } } @@ -643,7 +643,7 @@ static UINT rdpdr_server_receive_core_capability_response( { if ((status = rdpdr_server_read_capability_set_header(s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_capability_set_header failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_read_capability_set_header failed with error %"PRIu32"!", status); return status; } @@ -654,7 +654,7 @@ static UINT rdpdr_server_receive_core_capability_response( if ((status = rdpdr_server_read_general_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_general_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_read_general_capability_set failed with error %"PRIu32"!", status); return status; } @@ -665,7 +665,7 @@ static UINT rdpdr_server_receive_core_capability_response( if ((status = rdpdr_server_read_printer_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_printer_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_read_printer_capability_set failed with error %"PRIu32"!", status); return status; } @@ -676,7 +676,7 @@ static UINT rdpdr_server_receive_core_capability_response( if ((status = rdpdr_server_read_port_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_port_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_read_port_capability_set failed with error %"PRIu32"!", status); return status; } @@ -687,7 +687,7 @@ static UINT rdpdr_server_receive_core_capability_response( if ((status = rdpdr_server_read_drive_capability_set(context, s, &capabilityHeader))) { - WLog_ERR(TAG, "rdpdr_server_read_drive_capability_set failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_read_drive_capability_set failed with error %"PRIu32"!", status); return status; } @@ -699,14 +699,14 @@ static UINT rdpdr_server_receive_core_capability_response( &capabilityHeader))) { WLog_ERR(TAG, - "rdpdr_server_read_smartcard_capability_set failed with error %u!", status); + "rdpdr_server_read_smartcard_capability_set failed with error %"PRIu32"!", status); return status; } break; default: - WLog_DBG(TAG, "Unknown capabilityType %d", capabilityHeader.CapabilityType); + WLog_DBG(TAG, "Unknown capabilityType %"PRIu16"", capabilityHeader.CapabilityType); Stream_Seek(s, capabilityHeader.CapabilityLength - RDPDR_CAPABILITY_HEADER_LENGTH); return ERROR_INVALID_DATA; @@ -777,7 +777,7 @@ static UINT rdpdr_server_receive_device_list_announce_request( } Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */ - WLog_DBG(TAG, "DeviceCount: %d", DeviceCount); + WLog_DBG(TAG, "DeviceCount: %"PRIu32"", DeviceCount); for (i = 0; i < DeviceCount; i++) { @@ -801,7 +801,7 @@ static UINT rdpdr_server_receive_device_list_announce_request( } DeviceData = Stream_Pointer(s); - WLog_DBG(TAG, "Device %d Name: %s Id: 0x%04X DataLength: %d", + WLog_DBG(TAG, "Device %d Name: %s Id: 0x%08"PRIX32" DataLength: %"PRIu32"", i, PreferredDosName, DeviceId, DeviceDataLength); switch (DeviceType) @@ -869,7 +869,7 @@ static UINT rdpdr_server_receive_device_list_remove_request( } Stream_Read_UINT32(s, DeviceCount); /* DeviceCount (4 bytes) */ - WLog_DBG(TAG, "DeviceCount: %d", DeviceCount); + WLog_DBG(TAG, "DeviceCount: %"PRIu32"", DeviceCount); for (i = 0; i < DeviceCount; i++) { @@ -880,7 +880,7 @@ static UINT rdpdr_server_receive_device_list_remove_request( } Stream_Read_UINT32(s, DeviceId); /* DeviceId (4 bytes) */ - WLog_DBG(TAG, "Device %d Id: 0x%04X", i, DeviceId); + WLog_DBG(TAG, "Device %d Id: 0x%08"PRIX32"", i, DeviceId); DeviceType = 0; /* TODO: Save the device type on the announce request. */ switch (DeviceType) @@ -949,13 +949,13 @@ static UINT rdpdr_server_receive_device_io_completion(RdpdrServerContext* Stream_Read_UINT32(s, deviceId); Stream_Read_UINT32(s, completionId); Stream_Read_UINT32(s, ioStatus); - WLog_DBG(TAG, "deviceId=%d, completionId=0x%x, ioStatus=0x%x", deviceId, + WLog_DBG(TAG, "deviceId=%"PRIu32", completionId=0x%"PRIx32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); irp = rdpdr_server_dequeue_irp(context, completionId); if (!irp) { - WLog_ERR(TAG, "IRP not found for completionId=0x%x", completionId); + WLog_ERR(TAG, "IRP not found for completionId=0x%"PRIx32"", completionId); return ERROR_INTERNAL_ERROR; } @@ -1009,7 +1009,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { UINT error = CHANNEL_RC_OK; - WLog_DBG(TAG, "RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X", + WLog_DBG(TAG, "RdpdrServerReceivePdu: Component: 0x%04"PRIX16" PacketId: 0x%04"PRIX16"", header->Component, header->PacketId); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s)); @@ -1020,7 +1020,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, case PAKID_CORE_CLIENTID_CONFIRM: if ((error = rdpdr_server_receive_announce_response(context, s, header))) { - WLog_ERR(TAG, "rdpdr_server_receive_announce_response failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_receive_announce_response failed with error %"PRIu32"!", error); return error; } @@ -1030,7 +1030,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, case PAKID_CORE_CLIENT_NAME: if ((error = rdpdr_server_receive_client_name_request(context, s, header))) { - WLog_ERR(TAG, "rdpdr_server_receive_client_name_request failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_receive_client_name_request failed with error %"PRIu32"!", error); return error; } @@ -1038,13 +1038,13 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, if ((error = rdpdr_server_send_core_capability_request(context))) { WLog_ERR(TAG, - "rdpdr_server_send_core_capability_request failed with error %u!", error); + "rdpdr_server_send_core_capability_request failed with error %"PRIu32"!", error); return error; } if ((error = rdpdr_server_send_client_id_confirm(context))) { - WLog_ERR(TAG, "rdpdr_server_send_client_id_confirm failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_send_client_id_confirm failed with error %"PRIu32"!", error); return error; } @@ -1055,14 +1055,14 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, if ((error = rdpdr_server_receive_core_capability_response(context, s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_core_capability_response failed with error %u!", error); + "rdpdr_server_receive_core_capability_response failed with error %"PRIu32"!", error); return error; } if (context->priv->UserLoggedOnPdu) if ((error = rdpdr_server_send_user_logged_on(context))) { - WLog_ERR(TAG, "rdpdr_server_send_user_logged_on failed with error %u!", error); + WLog_ERR(TAG, "rdpdr_server_send_user_logged_on failed with error %"PRIu32"!", error); return error; } @@ -1073,7 +1073,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_list_announce_request failed with error %u!", + "rdpdr_server_receive_device_list_announce_request failed with error %"PRIu32"!", error); return error; } @@ -1090,7 +1090,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, if ((error = rdpdr_server_receive_device_io_completion(context, s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_io_completion failed with error %u!", error); + "rdpdr_server_receive_device_io_completion failed with error %"PRIu32"!", error); return error; } @@ -1101,7 +1101,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, header))) { WLog_ERR(TAG, - "rdpdr_server_receive_device_io_completion failed with error %u!", error); + "rdpdr_server_receive_device_io_completion failed with error %"PRIu32"!", error); return error; } @@ -1127,7 +1127,7 @@ static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, } else { - WLog_WARN(TAG, "Unknown RDPDR_HEADER.Component: 0x%04X", header->Component); + WLog_WARN(TAG, "Unknown RDPDR_HEADER.Component: 0x%04"PRIX16"", header->Component); return ERROR_INVALID_DATA; } @@ -1176,7 +1176,7 @@ static void* rdpdr_server_thread(void* arg) if ((error = rdpdr_server_send_announce_request(context))) { - WLog_ERR(TAG, "rdpdr_server_send_announce_request failed with error %u!", + WLog_ERR(TAG, "rdpdr_server_send_announce_request failed with error %"PRIu32"!", error); goto out_stream; } @@ -1189,7 +1189,7 @@ static void* rdpdr_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); goto out_stream; } @@ -1198,7 +1198,7 @@ static void* rdpdr_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); goto out_stream; } @@ -1226,7 +1226,7 @@ static void* rdpdr_server_thread(void* arg) if ((error = rdpdr_server_receive_pdu(context, s, &header))) { - WLog_ERR(TAG, "rdpdr_server_receive_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpdr_server_receive_pdu failed with error %"PRIu32"!", error); goto out_stream; } } @@ -1295,7 +1295,7 @@ static UINT rdpdr_server_stop(RdpdrServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -1384,7 +1384,7 @@ static UINT rdpdr_server_send_device_create_request( BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceCreateRequest: deviceId=%d, path=%s, desiredAccess=0x%x createOptions=0x%x createDisposition=0x%x", + "RdpdrServerSendDeviceCreateRequest: deviceId=%"PRIu32", path=%s, desiredAccess=0x%"PRIx32" createOptions=0x%"PRIx32" createDisposition=0x%"PRIx32"", deviceId, path, desiredAccess, createOptions, createDisposition); /* Compute the required Unicode size. */ pathLength = (strlen(path) + 1) * sizeof(WCHAR); @@ -1431,7 +1431,7 @@ static UINT rdpdr_server_send_device_close_request( ULONG written; BOOL status; wStream* s; - WLog_DBG(TAG, "RdpdrServerSendDeviceCloseRequest: deviceId=%d, fileId=%d", + WLog_DBG(TAG, "RdpdrServerSendDeviceCloseRequest: deviceId=%"PRIu32", fileId=%"PRIu32"", deviceId, fileId); s = Stream_New(NULL, 128); @@ -1468,7 +1468,7 @@ static UINT rdpdr_server_send_device_read_request( BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceReadRequest: deviceId=%d, fileId=%d, length=%d, offset=%d", + "RdpdrServerSendDeviceReadRequest: deviceId=%"PRIu32", fileId=%"PRIu32", length=%"PRIu32", offset=%"PRIu32"", deviceId, fileId, length, offset); s = Stream_New(NULL, 128); @@ -1509,7 +1509,7 @@ static UINT rdpdr_server_send_device_write_request( BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceWriteRequest: deviceId=%d, fileId=%d, length=%d, offset=%d", + "RdpdrServerSendDeviceWriteRequest: deviceId=%"PRIu32", fileId=%"PRIu32", length=%"PRIu32", offset=%"PRIu32"", deviceId, fileId, length, offset); s = Stream_New(NULL, 64 + length); @@ -1550,7 +1550,7 @@ static UINT rdpdr_server_send_device_query_directory_request( BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceQueryDirectoryRequest: deviceId=%d, fileId=%d, path=%s", + "RdpdrServerSendDeviceQueryDirectoryRequest: deviceId=%"PRIu32", fileId=%"PRIu32", path=%s", deviceId, fileId, path); /* Compute the required Unicode size. */ pathLength = path ? (strlen(path) + 1) * sizeof(WCHAR) : 0; @@ -1602,7 +1602,7 @@ static UINT rdpdr_server_send_device_file_rename_request( BOOL status; wStream* s; WLog_DBG(TAG, - "RdpdrServerSendDeviceFileNameRequest: deviceId=%d, fileId=%d, path=%s", + "RdpdrServerSendDeviceFileNameRequest: deviceId=%"PRIu32", fileId=%"PRIu32", path=%s", deviceId, fileId, path); /* Compute the required Unicode size. */ pathLength = path ? (strlen(path) + 1) * sizeof(WCHAR) : 0; @@ -1665,7 +1665,7 @@ static UINT rdpdr_server_drive_create_directory_callback2( UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveCreateDirectoryCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveCreateDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); /* Invoke the create directory completion routine. */ context->OnDriveCreateDirectoryComplete(context, irp->CallbackData, ioStatus); @@ -1686,7 +1686,7 @@ static UINT rdpdr_server_drive_create_directory_callback1( UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveCreateDirectoryCallback1: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveCreateDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -1776,7 +1776,7 @@ static UINT rdpdr_server_drive_delete_directory_callback2( UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveDeleteDirectoryCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveDeleteDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); /* Invoke the delete directory completion routine. */ context->OnDriveDeleteDirectoryComplete(context, irp->CallbackData, ioStatus); @@ -1797,7 +1797,7 @@ static UINT rdpdr_server_drive_delete_directory_callback1( UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveDeleteDirectoryCallback1: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveDeleteDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -1890,7 +1890,7 @@ static UINT rdpdr_server_drive_query_directory_callback2( UINT32 length; FILE_DIRECTORY_INFORMATION fdi; WLog_DBG(TAG, - "RdpdrServerDriveQueryDirectoryCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveQueryDirectoryCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 4) @@ -1906,7 +1906,7 @@ static UINT rdpdr_server_drive_query_directory_callback2( if ((error = rdpdr_server_read_file_directory_information(s, &fdi))) { WLog_ERR(TAG, - "rdpdr_server_read_file_directory_information failed with error %u!", error); + "rdpdr_server_read_file_directory_information failed with error %"PRIu32"!", error); return error; } } @@ -1964,7 +1964,7 @@ static UINT rdpdr_server_drive_query_directory_callback1( { UINT32 fileId; WLog_DBG(TAG, - "RdpdrServerDriveQueryDirectoryCallback1: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveQueryDirectoryCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -2057,7 +2057,7 @@ static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveOpenFileCallback: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveOpenFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2130,7 +2130,7 @@ static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, UINT32 length; char* buffer = NULL; WLog_DBG(TAG, - "RdpdrServerDriveReadFileCallback: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveReadFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 4) @@ -2212,7 +2212,7 @@ static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, { UINT32 length; WLog_DBG(TAG, - "RdpdrServerDriveWriteFileCallback: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveWriteFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2287,7 +2287,7 @@ static UINT rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveCloseFileCallback: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveCloseFileCallback: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); /* Invoke the close file completion routine. */ context->OnDriveCloseFileComplete(context, irp->CallbackData, ioStatus); @@ -2345,7 +2345,7 @@ static UINT rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveDeleteFileCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveDeleteFileCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); /* Invoke the delete file completion routine. */ context->OnDriveDeleteFileComplete(context, irp->CallbackData, ioStatus); @@ -2366,7 +2366,7 @@ static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveDeleteFileCallback1: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveDeleteFileCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) @@ -2456,7 +2456,7 @@ static UINT rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* UINT32 ioStatus) { WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback3: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveRenameFileCallback3: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); /* Destroy the IRP. */ rdpdr_server_irp_free(irp); @@ -2474,7 +2474,7 @@ static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* { UINT32 length; WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveRenameFileCallback2: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (Stream_GetRemainingLength(s) < 5) @@ -2516,7 +2516,7 @@ static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* UINT32 fileId; UINT8 information; WLog_DBG(TAG, - "RdpdrServerDriveRenameFileCallback1: deviceId=%d, completionId=%d, ioStatus=0x%x", + "RdpdrServerDriveRenameFileCallback1: deviceId=%"PRIu32", completionId=%"PRIu32", ioStatus=0x%"PRIx32"", deviceId, completionId, ioStatus); if (ioStatus != STATUS_SUCCESS) diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 559ab77d4..72de9e05a 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -196,7 +196,7 @@ static void* rdpei_schedule_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -207,7 +207,7 @@ static void* rdpei_schedule_thread(void* arg) if ((error = rdpei_add_frame(context))) { - WLog_ERR(TAG, "rdpei_add_frame failed with error %u!", error); + WLog_ERR(TAG, "rdpei_add_frame failed with error %"PRIu32"!", error); break; } @@ -215,7 +215,7 @@ static void* rdpei_schedule_thread(void* arg) { if ((error = rdpei_send_frame(context))) { - WLog_ERR(TAG, "rdpei_send_frame failed with error %u!", error); + WLog_ERR(TAG, "rdpei_send_frame failed with error %"PRIu32"!", error); break; } } @@ -252,7 +252,7 @@ UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, status = callback->channel->Write(callback->channel, (UINT32) Stream_Length(s), Stream_Buffer(s), NULL); #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "rdpei_send_pdu: eventId: %d (%s) length: %d status: %d", + WLog_DBG(TAG, "rdpei_send_pdu: eventId: %"PRIu16" (%s) length: %"PRIu32" status: %"PRIu32"", eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength, status); #endif return status; @@ -325,8 +325,8 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) int rectSize = 2; RDPINPUT_CONTACT_DATA* contact; #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "contactCount: %d", frame->contactCount); - WLog_DBG(TAG, "frameOffset: 0x%08X", (UINT32) frame->frameOffset); + WLog_DBG(TAG, "contactCount: %"PRIu32"", frame->contactCount); + WLog_DBG(TAG, "frameOffset: 0x%016"PRIX64"", frame->frameOffset); #endif rdpei_write_2byte_unsigned(s, frame->contactCount); /* contactCount (TWO_BYTE_UNSIGNED_INTEGER) */ @@ -352,11 +352,11 @@ UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) contact->contactRectRight = contact->x + rectSize; contact->contactRectBottom = contact->y + rectSize; #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "contact[%d].contactId: %d", index, contact->contactId); - WLog_DBG(TAG, "contact[%d].fieldsPresent: %d", index, contact->fieldsPresent); - WLog_DBG(TAG, "contact[%d].x: %d", index, contact->x); - WLog_DBG(TAG, "contact[%d].y: %d", index, contact->y); - WLog_DBG(TAG, "contact[%d].contactFlags: 0x%04X", index, contact->contactFlags); + WLog_DBG(TAG, "contact[%"PRIu32"].contactId: %"PRIu32"", index, contact->contactId); + WLog_DBG(TAG, "contact[%"PRIu32"].fieldsPresent: %"PRIu32"", index, contact->fieldsPresent); + WLog_DBG(TAG, "contact[%"PRIu32"].x: %"PRId32"", index, contact->x); + WLog_DBG(TAG, "contact[%"PRIu32"].y: %"PRId32"", index, contact->y); + WLog_DBG(TAG, "contact[%"PRIu32"].contactFlags: 0x%08"PRIX32"", index, contact->contactFlags); rdpei_print_contact_flags(contact->contactFlags); #endif Stream_Write_UINT8(s, contact->contactId); /* contactId (1 byte) */ @@ -426,7 +426,7 @@ UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, if ((status = rdpei_write_touch_frame(s, frame))) { - WLog_ERR(TAG, "rdpei_write_touch_frame failed with error %u!", status); + WLog_ERR(TAG, "rdpei_write_touch_frame failed with error %"PRIu32"!", status); Stream_Free(s, TRUE); return status; } @@ -451,7 +451,7 @@ UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) if (protocolVersion != RDPINPUT_PROTOCOL_V10) { - WLog_ERR(TAG, "Unknown [MS-RDPEI] protocolVersion: 0x%08X", protocolVersion); + WLog_ERR(TAG, "Unknown [MS-RDPEI] protocolVersion: 0x%08"PRIX32"", protocolVersion); return -1; } @@ -471,7 +471,7 @@ UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) IFCALLRET(rdpei->SuspendTouch, error, rdpei); if (error) - WLog_ERR(TAG, "rdpei->SuspendTouch failed with error %u!", error); + WLog_ERR(TAG, "rdpei->SuspendTouch failed with error %"PRIu32"!", error); return error; } @@ -488,7 +488,7 @@ UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) IFCALLRET(rdpei->ResumeTouch, error, rdpei); if (error) - WLog_ERR(TAG, "rdpei->ResumeTouch failed with error %u!", error); + WLog_ERR(TAG, "rdpei->ResumeTouch failed with error %"PRIu32"!", error); return error; } @@ -506,7 +506,7 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) Stream_Read_UINT16(s, eventId); /* eventId (2 bytes) */ Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */ #ifdef WITH_DEBUG_RDPEI - WLog_DBG(TAG, "rdpei_recv_pdu: eventId: %d (%s) length: %d", + WLog_DBG(TAG, "rdpei_recv_pdu: eventId: %"PRIu16" (%s) length: %"PRIu32"", eventId, RDPEI_EVENTID_STRINGS[eventId], pduLength); #endif @@ -515,13 +515,13 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_SC_READY: if ((error = rdpei_recv_sc_ready_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_sc_ready_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpei_recv_sc_ready_pdu failed with error %"PRIu32"!", error); return error; } if ((error = rdpei_send_cs_ready_pdu(callback))) { - WLog_ERR(TAG, "rdpei_send_cs_ready_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpei_send_cs_ready_pdu failed with error %"PRIu32"!", error); return error; } @@ -530,7 +530,7 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_SUSPEND_TOUCH: if ((error = rdpei_recv_suspend_touch_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_suspend_touch_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpei_recv_suspend_touch_pdu failed with error %"PRIu32"!", error); return error; } @@ -539,7 +539,7 @@ UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) case EVENTID_RESUME_TOUCH: if ((error = rdpei_recv_resume_touch_pdu(callback, s))) { - WLog_ERR(TAG, "rdpei_recv_resume_touch_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpei_recv_resume_touch_pdu failed with error %"PRIu32"!", error); return error; } @@ -634,7 +634,7 @@ static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, if ((error = pChannelMgr->CreateListener(pChannelMgr, RDPEI_DVC_CHANNEL_NAME, 0, (IWTSListenerCallback*) rdpei->listener_callback, &(rdpei->listener)))) { - WLog_ERR(TAG, "ChannelMgr->CreateListener failed with error %u!", error); + WLog_ERR(TAG, "ChannelMgr->CreateListener failed with error %"PRIu32"!", error); goto error_out; } @@ -687,7 +687,7 @@ static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) if (WaitForSingleObject(rdpei->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -737,7 +737,7 @@ UINT rdpei_send_frame(RdpeiClientContext* context) if ((error = rdpei_send_touch_event_pdu(callback, &rdpei->frame))) { - WLog_ERR(TAG, "rdpei_send_touch_event_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpei_send_touch_event_pdu failed with error %"PRIu32"!", error); return error; } @@ -901,7 +901,7 @@ UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, { if ((error = context->TouchUpdate(context, externalId, x, y, &tempvalue))) { - WLog_ERR(TAG, "context->TouchUpdate failed with error %u!", error); + WLog_ERR(TAG, "context->TouchUpdate failed with error %"PRIu32"!", error); return error; } } @@ -913,7 +913,7 @@ UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, if ((error = context->AddContact(context, &contact))) { - WLog_ERR(TAG, "context->AddContact failed with error %u!", error); + WLog_ERR(TAG, "context->AddContact failed with error %"PRIu32"!", error); return error; } @@ -998,7 +998,7 @@ UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) if ((error = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpei", (IWTSPlugin*) rdpei))) { - WLog_ERR(TAG, "EntryPoints->RegisterPlugin failed with error %u!", error); + WLog_ERR(TAG, "EntryPoints->RegisterPlugin failed with error %"PRIu32"!", error); error = CHANNEL_RC_NO_MEMORY; goto error_out; } diff --git a/channels/rdpei/server/rdpei_main.c b/channels/rdpei/server/rdpei_main.c index 7e774d35a..a4755844f 100644 --- a/channels/rdpei/server/rdpei_main.c +++ b/channels/rdpei/server/rdpei_main.c @@ -112,7 +112,7 @@ UINT rdpei_server_init(RdpeiServerContext *context) if (!WTSVirtualChannelQuery(priv->channelHandle, WTSVirtualEventHandle, &buffer, &bytesReturned) || (bytesReturned != sizeof(HANDLE))) { - WLog_ERR(TAG, "WTSVirtualChannelQuery failed or invalid invalid returned size(%d)!", bytesReturned); + WLog_ERR(TAG, "WTSVirtualChannelQuery failed or invalid invalid returned size(%"PRIu32")!", bytesReturned); if (buffer) WTSFreeMemory(buffer); goto out_close; @@ -179,13 +179,13 @@ static UINT read_cs_ready_message(RdpeiServerContext *context, wStream *s) case RDPINPUT_PROTOCOL_V101: break; default: - WLog_ERR(TAG, "unhandled RPDEI protocol version 0x%x", context->clientVersion); + WLog_ERR(TAG, "unhandled RPDEI protocol version 0x%"PRIx32"", context->clientVersion); break; } IFCALLRET(context->onClientReady, error, context); if (error) - WLog_ERR(TAG, "context->onClientReady failed with error %u", error); + WLog_ERR(TAG, "context->onClientReady failed with error %"PRIu32"", error); return error; } @@ -271,7 +271,7 @@ static UINT read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_T { if ((error = read_touch_contact_data(context, s, contact))) { - WLog_ERR(TAG, "read_touch_contact_data failed with error %u!", error); + WLog_ERR(TAG, "read_touch_contact_data failed with error %"PRIu32"!", error); frame->contactCount = i; touch_frame_reset(frame); return error; @@ -311,7 +311,7 @@ static UINT read_touch_event(RdpeiServerContext *context, wStream *s) { if ((error = read_touch_frame(context, s, frame))) { - WLog_ERR(TAG, "read_touch_contact_data failed with error %u!", error); + WLog_ERR(TAG, "read_touch_contact_data failed with error %"PRIu32"!", error); event->frameCount = i; goto out_cleanup; } @@ -320,7 +320,7 @@ static UINT read_touch_event(RdpeiServerContext *context, wStream *s) IFCALLRET(context->onTouchEvent, error, context, event); if (error) - WLog_ERR(TAG, "context->onTouchEvent failed with error %u", error); + WLog_ERR(TAG, "context->onTouchEvent failed with error %"PRIu32"", error); out_cleanup: touch_event_reset(event); @@ -347,7 +347,7 @@ static UINT read_dismiss_hovering_contact(RdpeiServerContext *context, wStream * IFCALLRET(context->onTouchReleased, error, context, contactId); if (error) - WLog_ERR(TAG, "context->onTouchReleased failed with error %u", error); + WLog_ERR(TAG, "context->onTouchReleased failed with error %"PRIu32"", error); return error; } @@ -391,7 +391,7 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { if (pduLen < RDPINPUT_HEADER_LENGTH) { - WLog_ERR(TAG, "invalid pduLength %d", pduLen); + WLog_ERR(TAG, "invalid pduLength %"PRIu32"", pduLen); return ERROR_INVALID_DATA; } priv->expectedBytes = pduLen - RDPINPUT_HEADER_LENGTH; @@ -414,13 +414,13 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { case EVENTID_CS_READY: if (priv->automataState != STATE_WAITING_CLIENT_READY) { - WLog_ERR(TAG, "not expecting a CS_READY packet in this state(%d)", (int)priv->automataState); + WLog_ERR(TAG, "not expecting a CS_READY packet in this state(%d)", priv->automataState); return ERROR_INVALID_STATE; } if ((error = read_cs_ready_message(context, s))) { - WLog_ERR(TAG, "read_cs_ready_message failed with error %u", error); + WLog_ERR(TAG, "read_cs_ready_message failed with error %"PRIu32"", error); return error; } break; @@ -428,19 +428,19 @@ UINT rdpei_server_handle_messages(RdpeiServerContext *context) { case EVENTID_TOUCH: if ((error = read_touch_event(context, s))) { - WLog_ERR(TAG, "read_touch_event failed with error %u", error); + WLog_ERR(TAG, "read_touch_event failed with error %"PRIu32"", error); return error; } break; case EVENTID_DISMISS_HOVERING_CONTACT: if ((error = read_dismiss_hovering_contact(context, s))) { - WLog_ERR(TAG, "read_dismiss_hovering_contact failed with error %u", error); + WLog_ERR(TAG, "read_dismiss_hovering_contact failed with error %"PRIu32"", error); return error; } break; default: - WLog_ERR(TAG, "unexpected message type 0x%x", priv->currentMsgType); + WLog_ERR(TAG, "unexpected message type 0x%"PRIx16"", priv->currentMsgType); } Stream_SetPosition(s, 0); @@ -462,7 +462,7 @@ UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) if (priv->automataState != STATE_INITIAL) { - WLog_ERR(TAG, "called from unexpected state %d", (int)priv->automataState); + WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); return ERROR_INVALID_STATE; } @@ -507,7 +507,7 @@ UINT rdpei_server_suspend(RdpeiServerContext *context) case STATE_WAITING_FRAME: break; default: - WLog_ERR(TAG, "called from unexpected state %d", (int)priv->automataState); + WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); return ERROR_INVALID_STATE; } @@ -551,7 +551,7 @@ UINT rdpei_server_resume(RdpeiServerContext *context) case STATE_SUSPENDED: break; default: - WLog_ERR(TAG, "called from unexpected state %d", (int)priv->automataState); + WLog_ERR(TAG, "called from unexpected state %d", priv->automataState); return ERROR_INVALID_STATE; } diff --git a/channels/rdpgfx/client/rdpgfx_codec.c b/channels/rdpgfx/client/rdpgfx_codec.c index 2f096e85d..74cce39d8 100644 --- a/channels/rdpgfx/client/rdpgfx_codec.c +++ b/channels/rdpgfx/client/rdpgfx_codec.c @@ -81,17 +81,17 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, goto error_out; } - WLog_DBG(TAG, "H264_METABLOCK: numRegionRects: %d", (int) meta->numRegionRects); + WLog_DBG(TAG, "H264_METABLOCK: numRegionRects: %"PRIu32"", meta->numRegionRects); for (index = 0; index < meta->numRegionRects; index++) { regionRect = &(meta->regionRects[index]); if ((error = rdpgfx_read_rect16(s, regionRect))) { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); goto error_out; } - WLog_DBG(TAG, "regionRects[%d]: left: %d top: %d right: %d bottom: %d", + WLog_DBG(TAG, "regionRects[%"PRIu32"]: left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16"", index, regionRect->left, regionRect->top, regionRect->right, regionRect->bottom); } @@ -111,7 +111,7 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, quantQualityVal->qp = quantQualityVal->qpVal & 0x3F; quantQualityVal->r = (quantQualityVal->qpVal >> 6) & 1; quantQualityVal->p = (quantQualityVal->qpVal >> 7) & 1; - WLog_DBG(TAG, "quantQualityVals[%d]: qp: %d r: %d p: %d qualityVal: %d", + WLog_DBG(TAG, "quantQualityVals[%"PRIu32"]: qp: %"PRIu8" r: %"PRIu8" p: %"PRIu8" qualityVal: %"PRIu8"", index, quantQualityVal->qp, quantQualityVal->r, quantQualityVal->p, quantQualityVal->qualityVal); } @@ -146,7 +146,7 @@ static UINT rdpgfx_decode_AVC420(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.meta)))) { - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); return error; } @@ -161,7 +161,7 @@ static UINT rdpgfx_decode_AVC420(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd { IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); } free(h264.meta.regionRects); @@ -205,7 +205,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd pos1 = Stream_GetPosition(s); if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.bitstream[0].meta)))) { - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); return error; } pos2 = Stream_GetPosition(s); @@ -223,7 +223,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd if ((error = rdpgfx_read_h264_metablock(gfx, s, &(h264.bitstream[1].meta)))) { - WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_h264_metablock failed with error %"PRIu32"!", error); return error; } @@ -244,7 +244,7 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd { IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); } free(h264.bitstream[0].meta.regionRects); @@ -270,7 +270,7 @@ UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) case RDPGFX_CODECID_AVC420: if ((error = rdpgfx_decode_AVC420(gfx, cmd))) { - WLog_ERR(TAG, "rdpgfx_decode_AVC420 failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_decode_AVC420 failed with error %"PRIu32"", error); return error; } break; @@ -278,7 +278,7 @@ UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) case RDPGFX_CODECID_AVC444: if ((error = rdpgfx_decode_AVC444(gfx, cmd))) { - WLog_ERR(TAG, "rdpgfx_decode_AVC444 failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_decode_AVC444 failed with error %"PRIu32"", error); return error; } break; @@ -288,7 +288,7 @@ UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { IFCALLRET(context->SurfaceCommand, error, context, cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); } break; } diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index 703dce959..363cce5db 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -108,7 +108,7 @@ static UINT rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) header.pduLength = RDPGFX_HEADER_SIZE + 2 + (pdu.capsSetCount * RDPGFX_CAPSET_SIZE); - WLog_DBG(TAG, "SendCapsAdvertisePdu %d", pdu.capsSetCount); + WLog_DBG(TAG, "SendCapsAdvertisePdu %"PRIu16"", pdu.capsSetCount); s = Stream_New(NULL, header.pduLength); if (!s) @@ -119,7 +119,7 @@ static UINT rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) if ((error = rdpgfx_write_header(s, &header))) { - WLog_ERR(TAG, "rdpgfx_write_header failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_header failed with error %"PRIu32"!", error); return error; } @@ -163,7 +163,7 @@ static UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, Stream_Read_UINT32(s, capsSet.version); /* version (4 bytes) */ Stream_Read_UINT32(s, capsDataLength); /* capsDataLength (4 bytes) */ Stream_Read_UINT32(s, capsSet.flags); /* capsData (4 bytes) */ - WLog_DBG(TAG, "RecvCapsConfirmPdu: version: 0x%04X flags: 0x%04X", + WLog_DBG(TAG, "RecvCapsConfirmPdu: version: 0x%08"PRIX32" flags: 0x%08"PRIX32"", capsSet.version, capsSet.flags); return CHANNEL_RC_OK; } @@ -182,7 +182,7 @@ static UINT rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, header.flags = 0; header.cmdId = RDPGFX_CMDID_FRAMEACKNOWLEDGE; header.pduLength = RDPGFX_HEADER_SIZE + 12; - WLog_DBG(TAG, "SendFrameAcknowledgePdu: %d", pdu->frameId); + WLog_DBG(TAG, "SendFrameAcknowledgePdu: %"PRIu32"", pdu->frameId); s = Stream_New(NULL, header.pduLength); if (!s) @@ -193,7 +193,7 @@ static UINT rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_write_header(s, &header))) { - WLog_ERR(TAG, "rdpgfx_write_header failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_header failed with error %"PRIu32"!", error); return error; } @@ -269,7 +269,7 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Seek(s, pad); /* pad (total size is 340 bytes) */ - WLog_DBG(TAG, "RecvResetGraphicsPdu: width: %d height: %d count: %d", + WLog_DBG(TAG, "RecvResetGraphicsPdu: width: %"PRIu32" height: %"PRIu32" count: %"PRIu32"", pdu.width, pdu.height, pdu.monitorCount); if (context) @@ -277,7 +277,7 @@ static UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->ResetGraphics, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->ResetGraphics failed with error %u", error); + WLog_ERR(TAG, "context->ResetGraphics failed with error %"PRIu32"", error); } free(pdu.monitorDefArray); @@ -304,14 +304,14 @@ static UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT16(s, pdu.cacheSlot); /* cacheSlot (2 bytes) */ - WLog_DBG(TAG, "RecvEvictCacheEntryPdu: cacheSlot: %d", pdu.cacheSlot); + WLog_DBG(TAG, "RecvEvictCacheEntryPdu: cacheSlot: %"PRIu16"", pdu.cacheSlot); if (context) { IFCALLRET(context->EvictCacheEntry, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->EvictCacheEntry failed with error %u", error); + WLog_ERR(TAG, "context->EvictCacheEntry failed with error %"PRIu32"", error); } return error; @@ -358,7 +358,7 @@ static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback Stream_Read_UINT16(s, pdu.cacheSlots[index]); /* cacheSlot (2 bytes) */ } - WLog_DBG(TAG, "RecvCacheImportReplyPdu: importedEntriesCount: %d", + WLog_DBG(TAG, "RecvCacheImportReplyPdu: importedEntriesCount: %"PRIu16"", pdu.importedEntriesCount); if (context) @@ -366,7 +366,7 @@ static UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback IFCALLRET(context->CacheImportReply, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CacheImportReply failed with error %u", error); + WLog_ERR(TAG, "context->CacheImportReply failed with error %"PRIu32"", error); } free(pdu.cacheSlots); @@ -397,7 +397,7 @@ static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, Stream_Read_UINT16(s, pdu.height); /* height (2 bytes) */ Stream_Read_UINT8(s, pdu.pixelFormat); /* RDPGFX_PIXELFORMAT (1 byte) */ WLog_DBG(TAG, - "RecvCreateSurfacePdu: surfaceId: %d width: %d height: %d pixelFormat: 0x%02X", + "RecvCreateSurfacePdu: surfaceId: %"PRIu16" width: %"PRIu16" height: %"PRIu16" pixelFormat: 0x%02"PRIX8"", pdu.surfaceId, pdu.width, pdu.height, pdu.pixelFormat); if (context) @@ -405,7 +405,7 @@ static UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->CreateSurface, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CreateSurface failed with error %u", error); + WLog_ERR(TAG, "context->CreateSurface failed with error %"PRIu32"", error); } return error; @@ -431,14 +431,14 @@ static UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ - WLog_DBG(TAG, "RecvDeleteSurfacePdu: surfaceId: %d", pdu.surfaceId); + WLog_DBG(TAG, "RecvDeleteSurfacePdu: surfaceId: %"PRIu16"", pdu.surfaceId); if (context) { IFCALLRET(context->DeleteSurface, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->DeleteSurface failed with error %u", error); + WLog_ERR(TAG, "context->DeleteSurface failed with error %"PRIu32"", error); } return error; @@ -465,7 +465,7 @@ static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, Stream_Read_UINT32(s, pdu.timestamp); /* timestamp (4 bytes) */ Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ - WLog_DBG(TAG, "RecvStartFramePdu: frameId: %d timestamp: 0x%04X", + WLog_DBG(TAG, "RecvStartFramePdu: frameId: %"PRIu32" timestamp: 0x%08"PRIX32"", pdu.frameId, pdu.timestamp); if (context) @@ -473,7 +473,7 @@ static UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->StartFrame, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->StartFrame failed with error %u", error); + WLog_ERR(TAG, "context->StartFrame failed with error %"PRIu32"", error); } gfx->UnacknowledgedFrames++; @@ -501,7 +501,7 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, } Stream_Read_UINT32(s, pdu.frameId); /* frameId (4 bytes) */ - WLog_DBG(TAG, "RecvEndFramePdu: frameId: %lu", (unsigned long) pdu.frameId); + WLog_DBG(TAG, "RecvEndFramePdu: frameId: %"PRIu32"", pdu.frameId); if (context) { @@ -509,7 +509,7 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if (error) { - WLog_ERR(TAG, "context->EndFrame failed with error %u", error); + WLog_ERR(TAG, "context->EndFrame failed with error %"PRIu32"", error); return error; } } @@ -525,14 +525,14 @@ static UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if (gfx->TotalDecodedFrames == 1) if ((error = rdpgfx_send_frame_acknowledge_pdu(callback, &ack))) - WLog_ERR(TAG, "rdpgfx_send_frame_acknowledge_pdu failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"", error); } else { ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE; if ((error = rdpgfx_send_frame_acknowledge_pdu(callback, &ack))) - WLog_ERR(TAG, "rdpgfx_send_frame_acknowledge_pdu failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"", error); } return error; @@ -563,7 +563,7 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_read_rect16(s, &(pdu.destRect)))) /* destRect (8 bytes) */ { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"", error); return error; } @@ -578,13 +578,14 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, pdu.bitmapData = Stream_Pointer(s); Stream_Seek(s, pdu.bitmapDataLength); WLog_DBG(TAG, - "RecvWireToSurface1Pdu: surfaceId: %lu codecId: %s (0x%04lX) pixelFormat: 0x%04lX " - "destRect: left: %lu top: %lu right: %lu bottom: %lu bitmapDataLength: %lu", - (unsigned long) pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), - (unsigned long) pdu.codecId, (unsigned long) pdu.pixelFormat, - (unsigned long) pdu.destRect.left, (unsigned long) pdu.destRect.top, - (unsigned long) pdu.destRect.right, (unsigned long) pdu.destRect.bottom, - (unsigned long) pdu.bitmapDataLength); + "RecvWireToSurface1Pdu: surfaceId: %"PRIu16" codecId: %s (0x%04"PRIX16") pixelFormat: 0x%02"PRIX8" " + "destRect: left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16" bitmapDataLength: %"PRIu32"", + pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), + pdu.codecId, pdu.pixelFormat, + pdu.destRect.left, pdu.destRect.top, + pdu.destRect.right, pdu.destRect.bottom, + pdu.bitmapDataLength); + cmd.surfaceId = pdu.surfaceId; cmd.codecId = pdu.codecId; cmd.contextId = 0; @@ -611,9 +612,10 @@ static UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, cmd.height = cmd.bottom - cmd.top; cmd.length = pdu.bitmapDataLength; cmd.data = pdu.bitmapData; + cmd.extra = NULL; if ((error = rdpgfx_decode(gfx, &cmd))) - WLog_ERR(TAG, "rdpgfx_decode failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_decode failed with error %"PRIu32"!", error); return error; } @@ -645,9 +647,9 @@ static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, Stream_Read_UINT32(s, pdu.bitmapDataLength); /* bitmapDataLength (4 bytes) */ pdu.bitmapData = Stream_Pointer(s); Stream_Seek(s, pdu.bitmapDataLength); - WLog_DBG(TAG, "RecvWireToSurface2Pdu: surfaceId: %d codecId: %s (0x%04X) " - "codecContextId: %d pixelFormat: 0x%04X bitmapDataLength: %d", - (int) pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), pdu.codecId, + WLog_DBG(TAG, "RecvWireToSurface2Pdu: surfaceId: %"PRIu16" codecId: %s (0x%04"PRIX16") " + "codecContextId: %"PRIu32" pixelFormat: 0x%02"PRIX8" bitmapDataLength: %"PRIu32"", + pdu.surfaceId, rdpgfx_get_codec_id_string(pdu.codecId), pdu.codecId, pdu.codecContextId, pdu.pixelFormat, pdu.bitmapDataLength); cmd.surfaceId = pdu.surfaceId; cmd.codecId = pdu.codecId; @@ -661,13 +663,14 @@ static UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, cmd.height = 0; cmd.length = pdu.bitmapDataLength; cmd.data = pdu.bitmapData; + cmd.extra = NULL; if (context) { IFCALLRET(context->SurfaceCommand, error, context, &cmd); if (error) - WLog_ERR(TAG, "context->SurfaceCommand failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceCommand failed with error %"PRIu32"", error); } return error; @@ -694,7 +697,7 @@ static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */ Stream_Read_UINT32(s, pdu.codecContextId); /* codecContextId (4 bytes) */ - WLog_DBG(TAG, "RecvDeleteEncodingContextPdu: surfaceId: %d codecContextId: %d", + WLog_DBG(TAG, "RecvDeleteEncodingContextPdu: surfaceId: %"PRIu16" codecContextId: %"PRIu32"", pdu.surfaceId, pdu.codecContextId); if (context) @@ -702,7 +705,7 @@ static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* IFCALLRET(context->DeleteEncodingContext, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->DeleteEncodingContext failed with error %u", error); + WLog_ERR(TAG, "context->DeleteEncodingContext failed with error %"PRIu32"", error); } return error; @@ -733,7 +736,7 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea if ((error = rdpgfx_read_color32(s, &(pdu.fillPixel)))) /* fillPixel (4 bytes) */ { - WLog_ERR(TAG, "rdpgfx_read_color32 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_color32 failed with error %"PRIu32"!", error); return error; } @@ -759,13 +762,13 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea if ((error = rdpgfx_read_rect16(s, fillRect))) { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); free(pdu.fillRects); return error; } } - WLog_DBG(TAG, "RecvSolidFillPdu: surfaceId: %d fillRectCount: %d", + WLog_DBG(TAG, "RecvSolidFillPdu: surfaceId: %"PRIu16" fillRectCount: %"PRIu16"", pdu.surfaceId, pdu.fillRectCount); if (context) @@ -773,7 +776,7 @@ static UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea IFCALLRET(context->SolidFill, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->SolidFill failed with error %u", error); + WLog_ERR(TAG, "context->SolidFill failed with error %"PRIu32"", error); } free(pdu.fillRects); @@ -806,7 +809,7 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* if ((error = rdpgfx_read_rect16(s, &(pdu.rectSrc)))) /* rectSrc (8 bytes ) */ { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); return error; } @@ -833,14 +836,14 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* if ((error = rdpgfx_read_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_read_point16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_point16 failed with error %"PRIu32"!", error); free(pdu.destPts); return error; } } - WLog_DBG(TAG, "RecvSurfaceToSurfacePdu: surfaceIdSrc: %d surfaceIdDest: %d " - "left: %d top: %d right: %d bottom: %d destPtsCount: %d", + WLog_DBG(TAG, "RecvSurfaceToSurfacePdu: surfaceIdSrc: %"PRIu16" surfaceIdDest: %"PRIu16" " + "left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16" destPtsCount: %"PRIu16"", pdu.surfaceIdSrc, pdu.surfaceIdDest, pdu.rectSrc.left, pdu.rectSrc.top, pdu.rectSrc.right, pdu.rectSrc.bottom, pdu.destPtsCount); @@ -850,7 +853,7 @@ static UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* IFCALLRET(context->SurfaceToSurface, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->SurfaceToSurface failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceToSurface failed with error %"PRIu32"", error); } free(pdu.destPts); @@ -882,14 +885,14 @@ static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_read_rect16(s, &(pdu.rectSrc)))) /* rectSrc (8 bytes ) */ { - WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_rect16 failed with error %"PRIu32"!", error); return error; } WLog_DBG(TAG, - "RecvSurfaceToCachePdu: surfaceId: %d cacheKey: 0x%08X cacheSlot: %d " - "left: %d top: %d right: %d bottom: %d", - pdu.surfaceId, (int) pdu.cacheKey, pdu.cacheSlot, + "RecvSurfaceToCachePdu: surfaceId: %"PRIu16" cacheKey: 0x%016"PRIX64" cacheSlot: %"PRIu16" " + "left: %"PRIu16" top: %"PRIu16" right: %"PRIu16" bottom: %"PRIu16"", + pdu.surfaceId, pdu.cacheKey, pdu.cacheSlot, pdu.rectSrc.left, pdu.rectSrc.top, pdu.rectSrc.right, pdu.rectSrc.bottom); @@ -898,7 +901,7 @@ static UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, IFCALLRET(context->SurfaceToCache, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->SurfaceToCache failed with error %u", error); + WLog_ERR(TAG, "context->SurfaceToCache failed with error %"PRIu32"", error); } return error; @@ -950,22 +953,22 @@ static UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, if ((error = rdpgfx_read_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_read_point16 failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_read_point16 failed with error %"PRIu32"", error); free(pdu.destPts); return error; } } WLog_DBG(TAG, - "RdpGfxRecvCacheToSurfacePdu: cacheSlot: %d surfaceId: %d destPtsCount: %d", - pdu.cacheSlot, (int) pdu.surfaceId, pdu.destPtsCount); + "RdpGfxRecvCacheToSurfacePdu: cacheSlot: %"PRIu16" surfaceId: %"PRIu16" destPtsCount: %"PRIu16"", + pdu.cacheSlot, pdu.surfaceId, pdu.destPtsCount); if (context) { IFCALLRET(context->CacheToSurface, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CacheToSurface failed with error %u", error); + WLog_ERR(TAG, "context->CacheToSurface failed with error %"PRIu32"", error); } free(pdu.destPts); @@ -996,15 +999,15 @@ static UINT rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* Stream_Read_UINT32(s, pdu.outputOriginX); /* outputOriginX (4 bytes) */ Stream_Read_UINT32(s, pdu.outputOriginY); /* outputOriginY (4 bytes) */ WLog_DBG(TAG, - "RecvMapSurfaceToOutputPdu: surfaceId: %d outputOriginX: %d outputOriginY: %d", - (int) pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY); + "RecvMapSurfaceToOutputPdu: surfaceId: %"PRIu16" outputOriginX: %"PRIu32" outputOriginY: %"PRIu32"", + pdu.surfaceId, pdu.outputOriginX, pdu.outputOriginY); if (context) { IFCALLRET(context->MapSurfaceToOutput, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->MapSurfaceToOutput failed with error %u", error); + WLog_ERR(TAG, "context->MapSurfaceToOutput failed with error %"PRIu32"", error); } return error; @@ -1034,15 +1037,15 @@ static UINT rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callb Stream_Read_UINT32(s, pdu.mappedWidth); /* mappedWidth (4 bytes) */ Stream_Read_UINT32(s, pdu.mappedHeight); /* mappedHeight (4 bytes) */ WLog_DBG(TAG, - "RecvMapSurfaceToWindowPdu: surfaceId: %d windowId: 0x%04X mappedWidth: %d mappedHeight: %d", - pdu.surfaceId, (int) pdu.windowId, pdu.mappedWidth, pdu.mappedHeight); + "RecvMapSurfaceToWindowPdu: surfaceId: %"PRIu16" windowId: 0x%016"PRIX64" mappedWidth: %"PRIu32" mappedHeight: %"PRIu32"", + pdu.surfaceId, pdu.windowId, pdu.mappedWidth, pdu.mappedHeight); if (context && context->MapSurfaceToWindow) { IFCALLRET(context->MapSurfaceToWindow, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->MapSurfaceToWindow failed with error %u", error); + WLog_ERR(TAG, "context->MapSurfaceToWindow failed with error %"PRIu32"", error); } return error; @@ -1062,12 +1065,12 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) if ((error = rdpgfx_read_header(s, &header))) { - WLog_ERR(TAG, "rdpgfx_read_header failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_header failed with error %"PRIu32"!", error); return error; } #if 1 - WLog_DBG(TAG, "cmdId: %s (0x%04X) flags: 0x%04X pduLength: %d", + WLog_DBG(TAG, "cmdId: %s (0x%04"PRIX16") flags: 0x%04"PRIX16" pduLength: %"PRIu32"", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, header.flags, header.pduLength); #endif @@ -1076,110 +1079,110 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { case RDPGFX_CMDID_WIRETOSURFACE_1: if ((error = rdpgfx_recv_wire_to_surface_1_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_wire_to_surface_1_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_wire_to_surface_1_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_WIRETOSURFACE_2: if ((error = rdpgfx_recv_wire_to_surface_2_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_wire_to_surface_2_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_wire_to_surface_2_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_DELETEENCODINGCONTEXT: if ((error = rdpgfx_recv_delete_encoding_context_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_delete_encoding_context_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_delete_encoding_context_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_SOLIDFILL: if ((error = rdpgfx_recv_solid_fill_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_solid_fill_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_solid_fill_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_SURFACETOSURFACE: if ((error = rdpgfx_recv_surface_to_surface_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_surface_to_surface_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_surface_to_surface_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_SURFACETOCACHE: if ((error = rdpgfx_recv_surface_to_cache_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_surface_to_cache_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_surface_to_cache_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CACHETOSURFACE: if ((error = rdpgfx_recv_cache_to_surface_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_cache_to_surface_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_cache_to_surface_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_EVICTCACHEENTRY: if ((error = rdpgfx_recv_evict_cache_entry_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_evict_cache_entry_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_evict_cache_entry_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CREATESURFACE: if ((error = rdpgfx_recv_create_surface_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_create_surface_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_create_surface_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_DELETESURFACE: if ((error = rdpgfx_recv_delete_surface_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_delete_surface_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_delete_surface_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_STARTFRAME: if ((error = rdpgfx_recv_start_frame_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_start_frame_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_start_frame_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_ENDFRAME: if ((error = rdpgfx_recv_end_frame_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_end_frame_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_end_frame_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_RESETGRAPHICS: if ((error = rdpgfx_recv_reset_graphics_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_reset_graphics_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_reset_graphics_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_MAPSURFACETOOUTPUT: if ((error = rdpgfx_recv_map_surface_to_output_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_map_surface_to_output_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_map_surface_to_output_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CACHEIMPORTREPLY: if ((error = rdpgfx_recv_cache_import_reply_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_cache_import_reply_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_cache_import_reply_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CAPSCONFIRM: if ((error = rdpgfx_recv_caps_confirm_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_caps_confirm_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_caps_confirm_pdu failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_MAPSURFACETOWINDOW: if ((error = rdpgfx_recv_map_surface_to_window_pdu(callback, s))) - WLog_ERR(TAG, "rdpgfx_recv_map_surface_to_window_pdu failed with error %u!", + WLog_ERR(TAG, "rdpgfx_recv_map_surface_to_window_pdu failed with error %"PRIu32"!", error); break; @@ -1191,7 +1194,7 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) if (error) { - WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04X)", + WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04"PRIX16")", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId); return error; } @@ -1200,7 +1203,7 @@ static UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) if (end != (beg + header.pduLength)) { - WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %d", + WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %"PRIu32"", end, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } @@ -1240,11 +1243,11 @@ static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* return CHANNEL_RC_NO_MEMORY; } - while (((size_t) Stream_GetPosition(s)) < Stream_Length(s)) + while (Stream_GetPosition(s) < Stream_Length(s)) { if ((error = rdpgfx_recv_pdu(callback, s))) { - WLog_ERR(TAG, "rdpgfx_recv_pdu failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_recv_pdu failed with error %"PRIu32"!", error); break; } } @@ -1429,7 +1432,7 @@ static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) if (error) { - WLog_ERR(TAG, "context->DeleteSurface failed with error %u", error); + WLog_ERR(TAG, "context->DeleteSurface failed with error %"PRIu32"", error); free(pKeys); free(context); free(gfx); @@ -1454,7 +1457,7 @@ static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) if (error) { - WLog_ERR(TAG, "context->EvictCacheEntry failed with error %u", error); + WLog_ERR(TAG, "context->EvictCacheEntry failed with error %"PRIu32"", error); free(context); free(gfx); return error; diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index ca4c673e0..78ec17634 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -130,7 +130,7 @@ static UINT rdpgfx_server_packet_send(RdpgfxServerContext* context, wStream* s) if (written < Stream_GetPosition(fs)) { - WLog_WARN(TAG, "Unexpected bytes written: %lu/%lu", + WLog_WARN(TAG, "Unexpected bytes written: %"PRIu32"/%"PRIuz"", written, Stream_GetPosition(fs)); } @@ -168,7 +168,7 @@ static wStream* rdpgfx_server_single_packet_new(UINT16 cmdId, UINT32 dataLen) if ((error = rdpgfx_server_packet_init_header(s, cmdId, pduLength))) { - WLog_ERR(TAG, "Failed to init header with error %u!", error); + WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); goto error; } @@ -233,8 +233,8 @@ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context, /* Check monitorCount. This ensures total size within 340 bytes) */ if (pdu->monitorCount >= 16) { - WLog_ERR(TAG, "Monitor count MUST be less than or equal to 16: %lu", - (unsigned long) pdu->monitorCount); + WLog_ERR(TAG, "Monitor count MUST be less than or equal to 16: %"PRIu32"", + pdu->monitorCount); return ERROR_INVALID_DATA; } @@ -516,7 +516,7 @@ static UINT rdpgfx_write_h264_metablock(wStream* s, RDPGFX_H264_METABLOCK* meta) if ((error = rdpgfx_write_rect16(s, regionRect))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); return error; } } @@ -547,7 +547,7 @@ static INLINE UINT rdpgfx_write_h264_avc420(wStream* s, if ((error = rdpgfx_write_h264_metablock(s, &(havc420->meta)))) { - WLog_ERR(TAG, "rdpgfx_write_h264_metablock failed with error %u!", + WLog_ERR(TAG, "rdpgfx_write_h264_metablock failed with error %"PRIu32"!", error); return error; } @@ -748,7 +748,7 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %u!", error); + WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); goto error; } @@ -764,7 +764,7 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %u!", error); + WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); goto error; } @@ -787,7 +787,7 @@ static UINT rdpgfx_send_surface_frame_command(RdpgfxServerContext* context, if (error != CHANNEL_RC_OK) { - WLog_ERR(TAG, "Failed to init header with error %u!", error); + WLog_ERR(TAG, "Failed to init header with error %"PRIu32"!", error); goto error; } @@ -850,7 +850,7 @@ static UINT rdpgfx_send_solid_fill_pdu(RdpgfxServerContext* context, /* fillPixel (4 bytes) */ if ((error = rdpgfx_write_color32(s, &(pdu->fillPixel)))) { - WLog_ERR(TAG, "rdpgfx_write_color32 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_color32 failed with error %"PRIu32"!", error); goto error; } @@ -862,7 +862,7 @@ static UINT rdpgfx_send_solid_fill_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_rect16(s, fillRect))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); goto error; } } @@ -900,7 +900,7 @@ static UINT rdpgfx_send_surface_to_surface_pdu(RdpgfxServerContext* context, /* rectSrc (8 bytes ) */ if ((error = rdpgfx_write_rect16(s, &(pdu->rectSrc)))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); goto error; } @@ -912,7 +912,7 @@ static UINT rdpgfx_send_surface_to_surface_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %"PRIu32"!", error); goto error; } } @@ -948,7 +948,7 @@ static UINT rdpgfx_send_surface_to_cache_pdu(RdpgfxServerContext* context, /* rectSrc (8 bytes ) */ if ((error = rdpgfx_write_rect16(s, &(pdu->rectSrc)))) { - WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %"PRIu32"!", error); goto error; } @@ -989,7 +989,7 @@ static UINT rdpgfx_send_cache_to_surface_pdu(RdpgfxServerContext* context, if ((error = rdpgfx_write_point16(s, destPt))) { - WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %u", error); + WLog_ERR(TAG, "rdpgfx_write_point16 failed with error %"PRIu32"", error); goto error; } } @@ -1075,7 +1075,7 @@ static UINT rdpgfx_recv_frame_acknowledge_pdu(RdpgfxServerContext* context, IFCALLRET(context->FrameAcknowledge, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->FrameAcknowledge failed with error %u", + WLog_ERR(TAG, "context->FrameAcknowledge failed with error %"PRIu32"", error); } @@ -1107,7 +1107,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, if (pdu.cacheEntriesCount <= 0) { /* According to the latest spec, capsSetCount <= 3 */ - WLog_ERR(TAG, "Invalid cacheEntriesCount: %u", pdu.cacheEntriesCount); + WLog_ERR(TAG, "Invalid cacheEntriesCount: %"PRIu16"", pdu.cacheEntriesCount); return ERROR_INVALID_DATA; } @@ -1140,7 +1140,7 @@ static UINT rdpgfx_recv_cache_import_offer_pdu(RdpgfxServerContext* context, IFCALLRET(context->CacheImportOffer, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CacheImportOffer failed with error %u", + WLog_ERR(TAG, "context->CacheImportOffer failed with error %"PRIu32"", error); } @@ -1191,7 +1191,7 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, if (capsDataLength != 4) { - WLog_ERR(TAG, "capsDataLength does not equal to 4: %u", + WLog_ERR(TAG, "capsDataLength does not equal to 4: %"PRIu32"", capsDataLength); free(capsSets); return ERROR_INVALID_DATA; @@ -1205,7 +1205,7 @@ static UINT rdpgfx_recv_caps_advertise_pdu(RdpgfxServerContext* context, IFCALLRET(context->CapsAdvertise, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->CapsAdvertise failed with error %u", error); + WLog_ERR(TAG, "context->CapsAdvertise failed with error %"PRIu32"", error); } free(capsSets); @@ -1239,7 +1239,7 @@ static UINT rdpgfx_recv_qoe_frame_acknowledge_pdu(RdpgfxServerContext* context, IFCALLRET(context->QoeFrameAcknowledge, error, context, &pdu); if (error) - WLog_ERR(TAG, "context->QoeFrameAcknowledge failed with error %u", + WLog_ERR(TAG, "context->QoeFrameAcknowledge failed with error %"PRIu32"", error); } @@ -1260,11 +1260,11 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if ((error = rdpgfx_read_header(s, &header))) { - WLog_ERR(TAG, "rdpgfx_read_header failed with error %u!", error); + WLog_ERR(TAG, "rdpgfx_read_header failed with error %"PRIu32"!", error); return error; } - WLog_DBG(TAG, "cmdId: %s (0x%04X) flags: 0x%04X pduLength: %d", + WLog_DBG(TAG, "cmdId: %s (0x%04"PRIX16") flags: 0x%04"PRIX16" pduLength: %"PRIu32"", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId, header.flags, header.pduLength); @@ -1273,28 +1273,28 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) case RDPGFX_CMDID_FRAMEACKNOWLEDGE: if ((error = rdpgfx_recv_frame_acknowledge_pdu(context, s))) WLog_ERR(TAG, "rdpgfx_recv_frame_acknowledge_pdu " - "failed with error %u!", error); + "failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CACHEIMPORTOFFER: if ((error = rdpgfx_recv_cache_import_offer_pdu(context, s))) WLog_ERR(TAG, "rdpgfx_recv_cache_import_offer_pdu " - "failed with error %u!", error); + "failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_CAPSADVERTISE: if ((error = rdpgfx_recv_caps_advertise_pdu(context, s))) WLog_ERR(TAG, "rdpgfx_recv_caps_advertise_pdu " - "failed with error %u!", error); + "failed with error %"PRIu32"!", error); break; case RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE: if ((error = rdpgfx_recv_qoe_frame_acknowledge_pdu(context, s))) WLog_ERR(TAG, "rdpgfx_recv_qoe_frame_acknowledge_pdu " - "failed with error %u!", error); + "failed with error %"PRIu32"!", error); break; @@ -1305,7 +1305,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if (error) { - WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04X)", + WLog_ERR(TAG, "Error while parsing GFX cmdId: %s (0x%04"PRIX16")", rdpgfx_get_cmd_id_string(header.cmdId), header.cmdId); return error; } @@ -1314,7 +1314,7 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) if (end != (beg + header.pduLength)) { - WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %d", + WLog_ERR(TAG, "Unexpected gfx pdu end: Actual: %d, Expected: %"PRIu32"", end, (beg + header.pduLength)); Stream_SetPosition(s, (beg + header.pduLength)); } @@ -1347,7 +1347,7 @@ static void* rdpgfx_server_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); break; } @@ -1357,7 +1357,7 @@ static void* rdpgfx_server_thread_func(void* arg) if ((error = rdpgfx_server_handle_messages(context))) { - WLog_ERR(TAG, "rdpgfx_server_handle_messages failed with error %u", + WLog_ERR(TAG, "rdpgfx_server_handle_messages failed with error %"PRIu32"", error); break; } @@ -1407,8 +1407,8 @@ static BOOL rdpgfx_server_open(RdpgfxServerContext* context) &buffer, &BytesReturned) || (BytesReturned != sizeof(HANDLE))) { - WLog_ERR(TAG, "WTSVirtualChannelQuery failed " - "or invalid returned size(%d)", + WLog_ERR(TAG, "WTSVirtualChannelQuery failed " + "or invalid returned size(%"PRIu32")", BytesReturned); if (buffer) @@ -1474,8 +1474,8 @@ static BOOL rdpgfx_server_close(RdpgfxServerContext* context) if (WaitForSingleObject(priv->thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu", - (unsigned long)GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", + GetLastError()); return FALSE; } @@ -1651,12 +1651,12 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context) Stream_SetLength(s, BytesReturned); Stream_SetPosition(s, 0); - while (((size_t) Stream_GetPosition(s)) < Stream_Length(s)) + while (Stream_GetPosition(s) < Stream_Length(s)) { if ((ret = rdpgfx_server_receive_pdu(context, s))) { WLog_ERR(TAG, "rdpgfx_server_receive_pdu " - "failed with error %u!", ret); + "failed with error %"PRIu32"!", ret); return ret; } } diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index 49c766d4f..9ab422259 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -131,8 +131,8 @@ static int rdpsnd_alsa_set_hw_params(rdpsndAlsaPlugin* alsa) if (alsa->period_size > buffer_size_max) { - WLog_ERR(TAG, "Warning: requested sound buffer size %d, got %d instead\n", - (int) alsa->buffer_size, (int) buffer_size_max); + WLog_ERR(TAG, "Warning: requested sound buffer size %lu, got %lu instead\n", + alsa->buffer_size, buffer_size_max); alsa->period_size = (buffer_size_max / 8); } @@ -686,7 +686,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS p { if ((error = rdpsnd_alsa_parse_addin_args((rdpsndDevicePlugin *) alsa, args))) { - WLog_ERR(TAG, "rdpsnd_alsa_parse_addin_args failed with error %u", error); + WLog_ERR(TAG, "rdpsnd_alsa_parse_addin_args failed with error %"PRIu32"", error); goto error_parse_args; } } diff --git a/channels/rdpsnd/client/opensles/opensl_io.c b/channels/rdpsnd/client/opensles/opensl_io.c index 033232f4a..191caecc1 100644 --- a/channels/rdpsnd/client/opensles/opensl_io.c +++ b/channels/rdpsnd/client/opensles/opensl_io.c @@ -42,20 +42,20 @@ static SLresult openSLCreateEngine(OPENSL_STREAM* p) SLresult result; // create engine result = slCreateEngine(&(p->engineObject), 0, NULL, 0, NULL, NULL); - DEBUG_SND("engineObject=%p", p->engineObject); + DEBUG_SND("engineObject=%p", (void*) p->engineObject); if (result != SL_RESULT_SUCCESS) goto engine_end; // realize the engine result = (*p->engineObject)->Realize(p->engineObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%d", result); + DEBUG_SND("Realize=%"PRIu32"", result); if (result != SL_RESULT_SUCCESS) goto engine_end; // get the engine interface, which is needed in order to create other objects result = (*p->engineObject)->GetInterface(p->engineObject, SL_IID_ENGINE, &(p->engineEngine)); - DEBUG_SND("engineEngine=%p", p->engineEngine); + DEBUG_SND("engineEngine=%p", (void*) p->engineEngine); if (result != SL_RESULT_SUCCESS) goto engine_end; @@ -139,14 +139,14 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) const SLboolean req[] = {SL_BOOLEAN_FALSE}; result = (*p->engineEngine)->CreateOutputMix(p->engineEngine, &(p->outputMixObject), 1, ids, req); - DEBUG_SND("engineEngine=%p", p->engineEngine); + DEBUG_SND("engineEngine=%p", (void*) p->engineEngine); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; // realize the output mix result = (*p->outputMixObject)->Realize(p->outputMixObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%d", result); + DEBUG_SND("Realize=%"PRIu32"", result); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -170,14 +170,14 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) const SLboolean req1[] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE}; result = (*p->engineEngine)->CreateAudioPlayer(p->engineEngine, &(p->bqPlayerObject), &audioSrc, &audioSnk, 2, ids1, req1); - DEBUG_SND("bqPlayerObject=%p", p->bqPlayerObject); + DEBUG_SND("bqPlayerObject=%p", (void*) p->bqPlayerObject); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; // realize the player result = (*p->bqPlayerObject)->Realize(p->bqPlayerObject, SL_BOOLEAN_FALSE); - DEBUG_SND("Realize=%d", result); + DEBUG_SND("Realize=%"PRIu32"", result); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -185,7 +185,7 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) // get the play interface result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_PLAY, &(p->bqPlayerPlay)); - DEBUG_SND("bqPlayerPlay=%p", p->bqPlayerPlay); + DEBUG_SND("bqPlayerPlay=%p", (void*) p->bqPlayerPlay); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -193,7 +193,7 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) // get the volume interface result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_VOLUME, &(p->bqPlayerVolume)); - DEBUG_SND("bqPlayerVolume=%p", p->bqPlayerVolume); + DEBUG_SND("bqPlayerVolume=%p", (void*) p->bqPlayerVolume); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -202,7 +202,7 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) result = (*p->bqPlayerObject)->GetInterface(p->bqPlayerObject, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &(p->bqPlayerBufferQueue)); - DEBUG_SND("bqPlayerBufferQueue=%p", p->bqPlayerBufferQueue); + DEBUG_SND("bqPlayerBufferQueue=%p", (void*) p->bqPlayerBufferQueue); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -210,7 +210,7 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) // register callback on the buffer queue result = (*p->bqPlayerBufferQueue)->RegisterCallback(p->bqPlayerBufferQueue, bqPlayerCallback, p); - DEBUG_SND("bqPlayerCallback=%p", p->bqPlayerCallback); + DEBUG_SND("bqPlayerCallback=%p", (void*) p->bqPlayerCallback); assert(!result); if (result != SL_RESULT_SUCCESS) goto end_openaudio; @@ -218,7 +218,7 @@ static SLresult openSLPlayOpen(OPENSL_STREAM* p) // set the player's state to playing result = (*p->bqPlayerPlay)->SetPlayState(p->bqPlayerPlay, SL_PLAYSTATE_PLAYING); - DEBUG_SND("SetPlayState=%d", result); + DEBUG_SND("SetPlayState=%"PRIu32"", result); assert(!result); end_openaudio: assert(!result); diff --git a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c index bbc5de28d..234685523 100644 --- a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c +++ b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c @@ -68,7 +68,7 @@ static int rdpsnd_opensles_volume_to_millibel(unsigned short level, int max) const int min = SL_MILLIBEL_MIN; const int step = max - min; const int rc = (level * step / 0xFFFF) + min; - DEBUG_SND("level=%d, min=%d, max=%d, step=%d, result=%d", + DEBUG_SND("level=%hu, min=%d, max=%d, step=%d, result=%d", level, min, max, step, rc); return rc; } @@ -106,7 +106,7 @@ static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, static int rdpsnd_opensles_set_params(rdpsndopenslesPlugin* opensles) { - DEBUG_SND("opensles=%p", opensles); + DEBUG_SND("opensles=%p", (void*) opensles); if (!rdpsnd_opensles_check_handle(opensles)) return 0; @@ -124,11 +124,11 @@ static BOOL rdpsnd_opensles_set_format(rdpsndDevicePlugin* device, { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; rdpsnd_opensles_check_handle(opensles); - DEBUG_SND("opensles=%p format=%p, latency=%d", opensles, format, latency); + DEBUG_SND("opensles=%p format=%p, latency=%d", (void*) opensles, (void*) format, latency); if (format) { - DEBUG_SND("format=%d, cbsize=%d, samples=%d, bits=%d, channels=%d, align=%d", + DEBUG_SND("format=%"PRIu16", cbsize=%"PRIu16", samples=%"PRIu32", bits=%"PRIu16", channels=%"PRIu16", align=%"PRIu16"", format->wFormatTag, format->cbSize, format->nSamplesPerSec, format->wBitsPerSample, format->nChannels, format->nBlockAlign); opensles->rate = format->nSamplesPerSec; @@ -146,8 +146,8 @@ static BOOL rdpsnd_opensles_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, int latency) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p format=%p, latency=%d, rate=%d", - opensles, format, latency, opensles->rate); + DEBUG_SND("opensles=%p format=%p, latency=%d, rate=%"PRIu32"", + (void*) opensles, (void*) format, latency, opensles->rate); if (rdpsnd_opensles_check_handle(opensles)) return TRUE; @@ -168,7 +168,7 @@ static BOOL rdpsnd_opensles_open(rdpsndDevicePlugin* device, static void rdpsnd_opensles_close(rdpsndDevicePlugin* device) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", opensles); + DEBUG_SND("opensles=%p", (void*) opensles); if (!rdpsnd_opensles_check_handle(opensles)) return; @@ -180,7 +180,7 @@ static void rdpsnd_opensles_close(rdpsndDevicePlugin* device) static void rdpsnd_opensles_free(rdpsndDevicePlugin* device) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", opensles); + DEBUG_SND("opensles=%p", (void*) opensles); assert(opensles); assert(opensles->device_name); free(opensles->device_name); @@ -192,7 +192,7 @@ static void rdpsnd_opensles_free(rdpsndDevicePlugin* device) static BOOL rdpsnd_opensles_format_supported(rdpsndDevicePlugin* device, AUDIO_FORMAT* format) { - DEBUG_SND("format=%d, cbsize=%d, samples=%d, bits=%d, channels=%d, align=%d", + DEBUG_SND("format=%"PRIu16", cbsize=%"PRIu16", samples=%"PRIu32", bits=%"PRIu16", channels=%"PRIu16", align=%"PRIu16"", format->wFormatTag, format->cbSize, format->nSamplesPerSec, format->wBitsPerSample, format->nChannels, format->nBlockAlign); assert(device); @@ -235,7 +235,7 @@ static BOOL rdpsnd_opensles_format_supported(rdpsndDevicePlugin* device, static UINT32 rdpsnd_opensles_get_volume(rdpsndDevicePlugin* device) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p", opensles); + DEBUG_SND("opensles=%p", (void*) opensles); assert(opensles); if (opensles->stream) @@ -259,7 +259,7 @@ static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, UINT32 value) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p, value=%d", opensles, value); + DEBUG_SND("opensles=%p, value=%"PRIu32"", (void*) opensles, value); assert(opensles); opensles->volume = value; @@ -293,15 +293,16 @@ static void rdpsnd_opensles_play(rdpsndDevicePlugin* device, } src; int ret; rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; - DEBUG_SND("opensles=%p, data=%p, size=%d", opensles, data, size); + DEBUG_SND("opensles=%p, data=%p, size=%d", (void*) opensles, (void*) data, size); if (!rdpsnd_opensles_check_handle(opensles)) return; if (opensles->format == WAVE_FORMAT_ADPCM) { - DEBUG_SND("dsp_context=%p, channels=%d, block_size=%d", - opensles->dsp_context, opensles->channels, opensles->block_size); + DEBUG_SND("dsp_context=%p, channels=%"PRIu32", block_size=%d", + (void*) opensles->dsp_context, opensles->channels, opensles->block_size); + opensles->dsp_context->decode_ms_adpcm(opensles->dsp_context, data, size, opensles->channels, opensles->block_size); size = opensles->dsp_context->adpcm_size; @@ -309,8 +310,9 @@ static void rdpsnd_opensles_play(rdpsndDevicePlugin* device, } else if (opensles->format == WAVE_FORMAT_DVI_ADPCM) { - DEBUG_SND("dsp_context=%p, channels=%d, block_size=%d", - opensles->dsp_context, opensles->channels, opensles->block_size); + DEBUG_SND("dsp_context=%p, channels=%"PRIu32", block_size=%d", + (void*) opensles->dsp_context, opensles->channels, opensles->block_size); + opensles->dsp_context->decode_ima_adpcm(opensles->dsp_context, data, size, opensles->channels, opensles->block_size); size = opensles->dsp_context->adpcm_size; @@ -321,7 +323,7 @@ static void rdpsnd_opensles_play(rdpsndDevicePlugin* device, src.b = data; } - DEBUG_SND("size=%d, src=%p", size, src.b); + DEBUG_SND("size=%d, src=%p", size, (void*) src.b); assert(0 == size % 2); assert(size > 0); assert(src.b); @@ -335,7 +337,7 @@ static void rdpsnd_opensles_start(rdpsndDevicePlugin* device) { rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; rdpsnd_opensles_check_handle(opensles); - DEBUG_SND("opensles=%p", opensles); + DEBUG_SND("opensles=%p", (void*) opensles); } static COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] = @@ -356,7 +358,7 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device; assert(opensles); assert(args); - DEBUG_SND("opensles=%p, args=%p", opensles, args); + DEBUG_SND("opensles=%p, args=%p", (void*) opensles, (void*) args); flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; status = CommandLineParseArgumentsA(args->argc, (const char**) args->argv, @@ -406,7 +408,7 @@ UINT freerdp_rdpsnd_client_subsystem_entry( ADDIN_ARGV* args; rdpsndopenslesPlugin* opensles; UINT error; - DEBUG_SND("pEntryPoints=%p", pEntryPoints); + DEBUG_SND("pEntryPoints=%p", (void*) pEntryPoints); opensles = (rdpsndopenslesPlugin*) calloc(1, sizeof(rdpsndopenslesPlugin)); if (!opensles) diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 5be9cab66..1fdaf6910 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -121,7 +121,7 @@ static void* rdpsnd_schedule_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -130,7 +130,7 @@ static void* rdpsnd_schedule_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -142,7 +142,7 @@ static void* rdpsnd_schedule_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -205,7 +205,7 @@ static UINT rdpsnd_send_quality_mode_pdu(rdpsndPlugin* rdpsnd) Stream_Write_UINT16(pdu, 4); /* BodySize */ Stream_Write_UINT16(pdu, rdpsnd->wQualityMode); /* wQualityMode */ Stream_Write_UINT16(pdu, 0); /* Reserved */ - WLog_Print(rdpsnd->log, WLOG_DEBUG, "QualityMode: %d", rdpsnd->wQualityMode); + WLog_Print(rdpsnd->log, WLOG_DEBUG, "QualityMode: %"PRIu16"", rdpsnd->wQualityMode); return rdpsnd_virtual_channel_write(rdpsnd, pdu); } @@ -457,7 +457,7 @@ static UINT rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, Stream_Write_UINT16(pdu, wTimeStamp); Stream_Write_UINT16(pdu, wPackSize); WLog_Print(rdpsnd->log, WLOG_DEBUG, - "Training Response: wTimeStamp: %d wPackSize: %d", + "Training Response: wTimeStamp: %"PRIu16" wPackSize: %"PRIu16"", wTimeStamp, wPackSize); return rdpsnd_virtual_channel_write(rdpsnd, pdu); } @@ -478,7 +478,7 @@ static UINT rdpsnd_recv_training_pdu(rdpsndPlugin* rdpsnd, wStream* s) Stream_Read_UINT16(s, wTimeStamp); Stream_Read_UINT16(s, wPackSize); WLog_Print(rdpsnd->log, WLOG_DEBUG, - "Training Request: wTimeStamp: %d wPackSize: %d", + "Training Request: wTimeStamp: %"PRIu16" wPackSize: %"PRIu16"", wTimeStamp, wPackSize); return rdpsnd_send_training_confirm_pdu(rdpsnd, wTimeStamp, wPackSize); } @@ -505,7 +505,7 @@ static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, Stream_Read(s, rdpsnd->waveData, 4); rdpsnd->waveDataSize = BodySize - 8; format = &rdpsnd->ClientFormats[wFormatNo]; - WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveInfo: cBlockNo: %d wFormatNo: %d", + WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveInfo: cBlockNo: %"PRIu8" wFormatNo: %"PRIu16"", rdpsnd->cBlockNo, wFormatNo); if (!rdpsnd->isOpen) @@ -570,7 +570,7 @@ static UINT rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, static UINT rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave) { WLog_Print(rdpsnd->log, WLOG_DEBUG, - "WaveConfirm: cBlockNo: %d wTimeStamp: %d wTimeDiff: %d", + "WaveConfirm: cBlockNo: %"PRIu8" wTimeStamp: %"PRIu16" wTimeDiff: %d", wave->cBlockNo, wave->wTimeStampB, wave->wTimeStampB - wave->wTimeStampA); return rdpsnd_send_wave_confirm_pdu(rdpsnd, wave->wTimeStampB, wave->cBlockNo); } @@ -635,7 +635,7 @@ static UINT rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s) wave->AutoConfirm = TRUE; format = &rdpsnd->ClientFormats[rdpsnd->wCurrentFormatNo]; wave->wAudioLength = rdpsnd_compute_audio_time_length(format, size); - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Wave: cBlockNo: %d wTimeStamp: %d", + WLog_Print(rdpsnd->log, WLOG_DEBUG, "Wave: cBlockNo: %"PRIu8" wTimeStamp: %"PRIu16"", wave->cBlockNo, wave->wTimeStampA); if (!rdpsnd->device) @@ -702,7 +702,7 @@ static UINT rdpsnd_recv_volume_pdu(rdpsndPlugin* rdpsnd, wStream* s) return ERROR_BAD_LENGTH; Stream_Read_UINT32(s, dwVolume); - WLog_Print(rdpsnd->log, WLOG_DEBUG, "Volume: 0x%04X", dwVolume); + WLog_Print(rdpsnd->log, WLOG_DEBUG, "Volume: 0x%08"PRIX32"", dwVolume); if (rdpsnd->device && rdpsnd->device->SetVolume && !rdpsnd->device->SetVolume(rdpsnd->device, dwVolume)) @@ -741,7 +741,7 @@ static UINT rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) Stream_Seek_UINT8(s); /* bPad */ Stream_Read_UINT16(s, BodySize); - //WLog_ERR(TAG, "msgType %d BodySize %d", msgType, BodySize); + //WLog_ERR(TAG, "msgType %"PRIu8" BodySize %"PRIu16"", msgType, BodySize); switch (msgType) { @@ -766,7 +766,7 @@ static UINT rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) break; default: - WLog_ERR(TAG, "unknown msgType %d", msgType); + WLog_ERR(TAG, "unknown msgType %"PRIu8"", msgType); break; } @@ -811,7 +811,7 @@ static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, entryPoints.args = args; if ((error = entry(&entryPoints))) - WLog_ERR(TAG, "%s entry returns error %u", name, error); + WLog_ERR(TAG, "%s entry returns error %"PRIu32"", name, error); WLog_INFO(TAG, "Loaded %s backend for rdpsnd", name); return error; @@ -955,7 +955,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) if ((status = rdpsnd_load_device_plugin(rdpsnd, rdpsnd->subsystem, args))) { - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", rdpsnd->subsystem, status); return status; } @@ -970,7 +970,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = ""; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -983,7 +983,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = ""; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -996,7 +996,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = ""; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -1009,7 +1009,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = "default"; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -1022,7 +1022,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = ""; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -1035,7 +1035,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = "default"; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -1048,7 +1048,7 @@ static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) device_name = ""; if ((status = rdpsnd_load_device_plugin(rdpsnd, subsystem_name, args))) - WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %u", + WLog_ERR(TAG, "unable to load the %s subsystem plugin because of error %"PRIu32"", subsystem_name, status); } @@ -1103,7 +1103,7 @@ static void rdpsnd_process_disconnect(rdpsndPlugin* rdpsnd) if (WaitForSingleObject(rdpsnd->ScheduleThread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); return; } @@ -1134,7 +1134,7 @@ UINT rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -1221,7 +1221,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D if ((error = rdpsnd_virtual_channel_event_data_received(rdpsnd, pData, dataLength, totalLength, dataFlags))) WLog_ERR(TAG, - "rdpsnd_virtual_channel_event_data_received failed with error %u", error); + "rdpsnd_virtual_channel_event_data_received failed with error %"PRIu32"", error); break; @@ -1308,7 +1308,7 @@ static UINT rdpsnd_virtual_channel_event_connected(rdpsndPlugin* rdpsnd, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -1349,7 +1349,7 @@ static UINT rdpsnd_virtual_channel_event_disconnected(rdpsndPlugin* rdpsnd) if (WaitForSingleObject(rdpsnd->thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -1359,7 +1359,7 @@ static UINT rdpsnd_virtual_channel_event_disconnected(rdpsndPlugin* rdpsnd) if (CHANNEL_RC_OK != error) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", WTSErrorToString(error), error); return error; } @@ -1424,7 +1424,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L { case CHANNEL_EVENT_CONNECTED: if ((error = rdpsnd_virtual_channel_event_connected(plugin, pData, dataLength))) - WLog_ERR(TAG, "rdpsnd_virtual_channel_event_connected failed with error %u!", + WLog_ERR(TAG, "rdpsnd_virtual_channel_event_connected failed with error %"PRIu32"!", error); break; @@ -1432,7 +1432,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L case CHANNEL_EVENT_DISCONNECTED: if ((error = rdpsnd_virtual_channel_event_disconnected(plugin))) WLog_ERR(TAG, - "rdpsnd_virtual_channel_event_disconnected failed with error %u!", error); + "rdpsnd_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); break; @@ -1440,7 +1440,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_init_event_ex(LPVOID lpUserParam, L if (plugin->thread != NULL) if ((error = rdpsnd_virtual_channel_event_disconnected(plugin))) WLog_ERR(TAG, - "rdpsnd_virtual_channel_event_disconnected failed with error %u!", error); + "rdpsnd_virtual_channel_event_disconnected failed with error %"PRIu32"!", error); rdpsnd_virtual_channel_event_terminated(plugin); plugin = NULL; @@ -1506,7 +1506,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); free(rdpsnd); return FALSE; diff --git a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c index aa9367fee..9c24c43d5 100644 --- a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c +++ b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c @@ -128,7 +128,7 @@ static void CALLBACK rdpsnd_winmm_callback_function(HWAVEOUT hwo, UINT uMsg, DWO if (!wave) return; - WLog_DBG(TAG, "MM_WOM_DONE: dwBufferLength: %d cBlockNo: %d", + WLog_DBG(TAG, "MM_WOM_DONE: dwBufferLength: %"PRIu32" cBlockNo: %"PRIu8"", lpWaveHdr->dwBufferLength, wave->cBlockNo); wave->wLocalTimeB = GetTickCount(); wTimeDelta = wave->wLocalTimeB - wave->wLocalTimeA; @@ -161,7 +161,7 @@ static BOOL rdpsnd_winmm_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, if (mmResult != MMSYSERR_NOERROR) { - WLog_ERR(TAG, "waveOutOpen failed: %d", mmResult); + WLog_ERR(TAG, "waveOutOpen failed: %"PRIu32"", mmResult); return FALSE; } @@ -169,7 +169,7 @@ static BOOL rdpsnd_winmm_open(rdpsndDevicePlugin* device, AUDIO_FORMAT* format, if (mmResult != MMSYSERR_NOERROR) { - WLog_ERR(TAG, "waveOutSetVolume failed: %d", mmResult); + WLog_ERR(TAG, "waveOutSetVolume failed: %"PRIu32"", mmResult); return FALSE; } @@ -189,7 +189,7 @@ static void rdpsnd_winmm_close(rdpsndDevicePlugin* device) if (mmResult != MMSYSERR_NOERROR) { - WLog_ERR(TAG, "waveOutClose failure: %d", mmResult); + WLog_ERR(TAG, "waveOutClose failure: %"PRIu32"", mmResult); } winmm->hWaveOut = NULL; @@ -322,7 +322,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) if (mmResult != MMSYSERR_NOERROR) { - WLog_ERR(TAG, "waveOutPrepareHeader failure: %d", mmResult); + WLog_ERR(TAG, "waveOutPrepareHeader failure: %"PRIu32"", mmResult); return; } @@ -330,7 +330,7 @@ void rdpsnd_winmm_wave_play(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) if (mmResult != MMSYSERR_NOERROR) { - WLog_ERR(TAG, "waveOutWrite failure: %d", mmResult); + WLog_ERR(TAG, "waveOutWrite failure: %"PRIu32"", mmResult); waveOutUnprepareHeader(winmm->hWaveOut, lpWaveHdr, sizeof(WAVEHDR)); free(lpWaveHdr); return; diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 4a8d682ca..844a485ee 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -115,7 +115,7 @@ static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, IFCALLRET(context->ConfirmBlock, error, context, confirmBlockNum, timestamp); if (error) - WLog_ERR(TAG, "context->ConfirmBlock failed with error %u", error); + WLog_ERR(TAG, "context->ConfirmBlock failed with error %"PRIu32"", error); return error; } @@ -138,7 +138,7 @@ static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, Stream_Read_UINT16(s, quality); Stream_Seek_UINT16(s); // reserved - WLog_DBG(TAG, "Client requested sound quality: %#0X", quality); + WLog_DBG(TAG, "Client requested sound quality: 0x%04"PRIX16"", quality); return CHANNEL_RC_OK; } @@ -253,7 +253,7 @@ static void* rdpsnd_server_thread(void* arg) if ((error = rdpsnd_server_send_formats(context, context->priv->rdpsnd_pdu))) { - WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %u", error); + WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %"PRIu32"", error); goto out; } @@ -264,7 +264,7 @@ static void* rdpsnd_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -273,7 +273,7 @@ static void* rdpsnd_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -282,7 +282,7 @@ static void* rdpsnd_server_thread(void* arg) if ((error = rdpsnd_server_handle_messages(context))) { - WLog_ERR(TAG, "rdpsnd_server_handle_messages failed with error %u", error); + WLog_ERR(TAG, "rdpsnd_server_handle_messages failed with error %"PRIu32"", error); break; } } @@ -555,7 +555,7 @@ static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, { if ((error = rdpsnd_server_send_audio_pdu(context, wTimestamp))) { - WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %u", error); + WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %"PRIu32"", error); break; } } @@ -616,7 +616,7 @@ static UINT rdpsnd_server_close(RdpsndServerContext* context) } else if ((error = rdpsnd_server_send_audio_pdu(context, 0))) { - WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %u", error); + WLog_ERR(TAG, "rdpsnd_server_send_audio_pdu failed with error %"PRIu32"", error); } } @@ -663,7 +663,7 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) &bytesReturned) || (bytesReturned != sizeof(HANDLE))) { WLog_ERR(TAG, - "error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%d)", + "error during WTSVirtualChannelQuery(WTSVirtualEventHandle) or invalid returned size(%"PRIu32")", bytesReturned); if (buffer) @@ -742,7 +742,7 @@ static UINT rdpsnd_server_stop(RdpsndServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -912,7 +912,7 @@ UINT rdpsnd_server_handle_messages(RdpsndServerContext* context) /* when here we have the header + the body */ #ifdef WITH_DEBUG_SND - WLog_DBG(TAG, "message type %d", priv->msgType); + WLog_DBG(TAG, "message type %"PRIu8"", priv->msgType); #endif priv->expectedBytes = 4; priv->waitingHeader = TRUE; @@ -942,7 +942,7 @@ UINT rdpsnd_server_handle_messages(RdpsndServerContext* context) break; default: - WLog_ERR(TAG, "UNKNOWN MESSAGE TYPE!! (%#0X)", priv->msgType); + WLog_ERR(TAG, "UNKNOWN MESSAGE TYPE!! (0x%02"PRIX8")", priv->msgType); ret = ERROR_INVALID_DATA; break; } diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index c19ccb649..c59f671a7 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -61,7 +61,7 @@ static UINT remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s) Stream_Buffer(s), (UINT32) Stream_Length(s), s); if (status != CHANNEL_RC_OK) - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; @@ -293,7 +293,7 @@ static UINT remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); if (error != CHANNEL_RC_OK) Stream_Free(s, TRUE); @@ -319,7 +319,7 @@ static UINT remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s, Stream_Read_UINT32(s, result); /* result (4 bytes) */ *pResult = result; - //WLog_DBG(TAG, "RemdeskRecvResult: 0x%04X", result); + //WLog_DBG(TAG, "RemdeskRecvResult: 0x%08"PRIX32"", result); return CHANNEL_RC_OK; } @@ -341,7 +341,7 @@ static UINT remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %u", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"", error); return error; } @@ -384,7 +384,7 @@ static UINT remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); out: free(raConnectionStringW); @@ -436,7 +436,7 @@ static UINT remdesk_send_ctl_remote_control_desktop_pdu(remdeskPlugin* remdesk) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); out: free(raConnectionStringW); @@ -463,7 +463,7 @@ static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %u!", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"!", error); return error; } @@ -493,7 +493,7 @@ static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(remdesk, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); out: free(expertBlobW); @@ -517,7 +517,7 @@ static UINT remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) if ((error = remdesk_generate_expert_blob(remdesk))) { - WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %u!", error); + WLog_ERR(TAG, "remdesk_generate_expert_blob failed with error %"PRIu32"!", error); return error; } @@ -559,7 +559,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */ - //WLog_DBG(TAG, "msgType: %d", msgType); + //WLog_DBG(TAG, "msgType: %"PRIu32"", msgType); switch (msgType) { @@ -568,7 +568,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_RESULT: if ((error = remdesk_recv_ctl_result_pdu(remdesk, s, header, &result))) - WLog_ERR(TAG, "remdesk_recv_ctl_result_pdu failed with error %u", error); + WLog_ERR(TAG, "remdesk_recv_ctl_result_pdu failed with error %"PRIu32"", error); break; @@ -577,7 +577,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_SERVER_ANNOUNCE: if ((error = remdesk_recv_ctl_server_announce_pdu(remdesk, s, header))) - WLog_ERR(TAG, "remdesk_recv_ctl_server_announce_pdu failed with error %u", + WLog_ERR(TAG, "remdesk_recv_ctl_server_announce_pdu failed with error %"PRIu32"", error); break; @@ -588,7 +588,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, case REMDESK_CTL_VERSIONINFO: if ((error = remdesk_recv_ctl_version_info_pdu(remdesk, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %u", error); + WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %"PRIu32"", error); break; } @@ -596,20 +596,20 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, { if ((error = remdesk_send_ctl_version_info_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %u", error); + WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %"PRIu32"", error); break; } if ((error = remdesk_send_ctl_authenticate_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_authenticate_pdu failed with error %u", error); + WLog_ERR(TAG, "remdesk_send_ctl_authenticate_pdu failed with error %"PRIu32"", error); break; } if ((error = remdesk_send_ctl_remote_control_desktop_pdu(remdesk))) { WLog_ERR(TAG, - "remdesk_send_ctl_remote_control_desktop_pdu failed with error %u", error); + "remdesk_send_ctl_remote_control_desktop_pdu failed with error %"PRIu32"", error); break; } } @@ -617,14 +617,14 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, { if ((error = remdesk_send_ctl_expert_on_vista_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_expert_on_vista_pdu failed with error %u", + WLog_ERR(TAG, "remdesk_send_ctl_expert_on_vista_pdu failed with error %"PRIu32"", error); break; } if ((error = remdesk_send_ctl_verify_password_pdu(remdesk))) { - WLog_ERR(TAG, "remdesk_send_ctl_verify_password_pdu failed with error %u", + WLog_ERR(TAG, "remdesk_send_ctl_verify_password_pdu failed with error %"PRIu32"", error); break; } @@ -651,7 +651,7 @@ static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, break; default: - WLog_ERR(TAG, "unknown msgType: %d", msgType); + WLog_ERR(TAG, "unknown msgType: %"PRIu32"", msgType); error = ERROR_INVALID_DATA; break; } @@ -669,13 +669,13 @@ static UINT remdesk_process_receive(remdeskPlugin* remdesk, wStream* s) UINT status; REMDESK_CHANNEL_HEADER header; #if 0 - WLog_DBG(TAG, "RemdeskReceive: %d", Stream_GetRemainingLength(s)); + WLog_DBG(TAG, "RemdeskReceive: %"PRIuz"", Stream_GetRemainingLength(s)); winpr_HexDump(Stream_Pointer(s), Stream_GetRemainingLength(s)); #endif if ((status = remdesk_read_channel_header(s, &header))) { - WLog_ERR(TAG, "remdesk_read_channel_header failed with error %u", status); + WLog_ERR(TAG, "remdesk_read_channel_header failed with error %"PRIu32"", status); return status; } @@ -733,7 +733,7 @@ static UINT remdesk_send(remdeskPlugin* remdesk, wStream* s) if (status != CHANNEL_RC_OK) { Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); } @@ -820,7 +820,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event_ex(LPVOID lpUserParam, if ((error = remdesk_virtual_channel_event_data_received(remdesk, pData, dataLength, totalLength, dataFlags))) WLog_ERR(TAG, - "remdesk_virtual_channel_event_data_received failed with error %u!", error); + "remdesk_virtual_channel_event_data_received failed with error %"PRIu32"!", error); break; @@ -832,7 +832,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event_ex(LPVOID lpUserParam, break; default: - WLog_ERR(TAG, "unhandled event %u!", event); + WLog_ERR(TAG, "unhandled event %"PRIu32"!", event); error = ERROR_INTERNAL_ERROR; } @@ -874,7 +874,7 @@ static void* remdesk_virtual_channel_client_thread(void* arg) if ((error = remdesk_process_receive(remdesk, data))) { - WLog_ERR(TAG, "remdesk_process_receive failed with error %u!", error); + WLog_ERR(TAG, "remdesk_process_receive failed with error %"PRIu32"!", error); break; } } @@ -904,7 +904,7 @@ static UINT remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, if (status != CHANNEL_RC_OK) { - WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelOpenEx failed with %s [%08"PRIX32"]", WTSErrorToString(status), status); return status; } @@ -949,7 +949,7 @@ static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) && (WaitForSingleObject(remdesk->thread, INFINITE) == WAIT_FAILED)) { rc = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", rc); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", rc); return rc; } @@ -961,7 +961,7 @@ static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); } @@ -1000,7 +1000,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_CONNECTED: if ((error = remdesk_virtual_channel_event_connected(remdesk, pData, dataLength))) - WLog_ERR(TAG, "remdesk_virtual_channel_event_connected failed with error %u", + WLog_ERR(TAG, "remdesk_virtual_channel_event_connected failed with error %"PRIu32"", error); break; @@ -1008,7 +1008,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DISCONNECTED: if ((error = remdesk_virtual_channel_event_disconnected(remdesk))) WLog_ERR(TAG, - "remdesk_virtual_channel_event_disconnected failed with error %u", error); + "remdesk_virtual_channel_event_disconnected failed with error %"PRIu32"", error); break; @@ -1079,7 +1079,7 @@ BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints, PVOID p if (CHANNEL_RC_OK != rc) { - WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08X]", + WLog_ERR(TAG, "pVirtualChannelInitEx failed with %s [%08"PRIX32"]", WTSErrorToString(rc), rc); goto error_out; } diff --git a/channels/remdesk/server/remdesk_main.c b/channels/remdesk/server/remdesk_main.c index 8ee8dc309..fd0087384 100644 --- a/channels/remdesk/server/remdesk_main.c +++ b/channels/remdesk/server/remdesk_main.c @@ -135,7 +135,7 @@ static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) if ((error = remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*) ctlHeader))) { - WLog_ERR(TAG, "remdesk_write_channel_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_write_channel_header failed with error %"PRIu32"!", error); return error; } @@ -173,7 +173,7 @@ static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_RESULT, 4))) { - WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %"PRIu32"!", error); return error; } @@ -187,7 +187,7 @@ static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, if ((error = remdesk_write_ctl_header(s, &(pdu.ctlHeader)))) { - WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %"PRIu32"!", error); goto out; } @@ -195,7 +195,7 @@ static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(context, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); out: Stream_Free(s, TRUE); @@ -216,7 +216,7 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERSIONINFO, 8))) { - WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_prepare_ctl_header failed with error %"PRIu32"!", error); return error; } @@ -232,7 +232,7 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) if ((error = remdesk_write_ctl_header(s, &(pdu.ctlHeader)))) { - WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_write_ctl_header failed with error %"PRIu32"!", error); goto out; } @@ -241,7 +241,7 @@ static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) Stream_SealLength(s); if ((error = remdesk_virtual_channel_write(context, s))) - WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %u!", error); + WLog_ERR(TAG, "remdesk_virtual_channel_write failed with error %"PRIu32"!", error); out: Stream_Free(s, TRUE); @@ -317,7 +317,7 @@ static UINT remdesk_recv_ctl_remote_control_desktop_pdu( free(pdu.raConnectionString); if ((error = remdesk_send_ctl_result_pdu(context, 0))) - WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %u!", error); + WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %"PRIu32"!", error); return error; } @@ -433,7 +433,7 @@ static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, WLog_INFO(TAG, "ExpertBlob: %s", pdu.expertBlob); if ((error = remdesk_send_ctl_result_pdu(context, 0))) - WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %u!", error); + WLog_ERR(TAG, "remdesk_send_ctl_result_pdu failed with error %"PRIu32"!", error); return error; } @@ -456,7 +456,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, } Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */ - WLog_INFO(TAG, "msgType: %d", msgType); + WLog_INFO(TAG, "msgType: %"PRIu32"", msgType); switch (msgType) { @@ -464,7 +464,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, if ((error = remdesk_recv_ctl_remote_control_desktop_pdu(context, s, header))) { WLog_ERR(TAG, - "remdesk_recv_ctl_remote_control_desktop_pdu failed with error %u!", error); + "remdesk_recv_ctl_remote_control_desktop_pdu failed with error %"PRIu32"!", error); return error; } @@ -473,7 +473,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_AUTHENTICATE: if ((error = remdesk_recv_ctl_authenticate_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_authenticate_pdu failed with error %u!", + WLog_ERR(TAG, "remdesk_recv_ctl_authenticate_pdu failed with error %"PRIu32"!", error); return error; } @@ -486,7 +486,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_VERSIONINFO: if ((error = remdesk_recv_ctl_version_info_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %u!", + WLog_ERR(TAG, "remdesk_recv_ctl_version_info_pdu failed with error %"PRIu32"!", error); return error; } @@ -499,7 +499,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, case REMDESK_CTL_VERIFY_PASSWORD: if ((error = remdesk_recv_ctl_verify_password_pdu(context, s, header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_verify_password_pdu failed with error %u!", + WLog_ERR(TAG, "remdesk_recv_ctl_verify_password_pdu failed with error %"PRIu32"!", error); return error; } @@ -519,7 +519,7 @@ static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, break; default: - WLog_ERR(TAG, "remdesk_recv_control_pdu: unknown msgType: %d", msgType); + WLog_ERR(TAG, "remdesk_recv_control_pdu: unknown msgType: %"PRIu32"", msgType); error = ERROR_INVALID_DATA; break; } @@ -538,13 +538,13 @@ static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, UINT error = CHANNEL_RC_OK; REMDESK_CHANNEL_HEADER header; #if 0 - WLog_INFO(TAG, "RemdeskReceive: %d", Stream_GetRemainingLength(s)); + WLog_INFO(TAG, "RemdeskReceive: %"PRIuz"", Stream_GetRemainingLength(s)); winpr_HexDump(Stream_Pointer(s), Stream_GetRemainingLength(s)); #endif if ((error = remdesk_read_channel_header(s, &header))) { - WLog_ERR(TAG, "remdesk_read_channel_header failed with error %u!", error); + WLog_ERR(TAG, "remdesk_read_channel_header failed with error %"PRIu32"!", error); return error; } @@ -552,7 +552,7 @@ static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, { if ((error = remdesk_recv_ctl_pdu(context, s, &header))) { - WLog_ERR(TAG, "remdesk_recv_ctl_pdu failed with error %u!", error); + WLog_ERR(TAG, "remdesk_recv_ctl_pdu failed with error %"PRIu32"!", error); return error; } } @@ -626,7 +626,7 @@ static void* remdesk_server_thread(void* arg) if ((error = remdesk_send_ctl_version_info_pdu(context))) { - WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %u!", + WLog_ERR(TAG, "remdesk_send_ctl_version_info_pdu failed with error %"PRIu32"!", error); goto out; } @@ -638,7 +638,7 @@ static void* remdesk_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"", error); break; } @@ -647,7 +647,7 @@ static void* remdesk_server_thread(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"", error); break; } @@ -684,7 +684,7 @@ static void* remdesk_server_thread(void* arg) if ((error = remdesk_server_receive_pdu(context, s))) { - WLog_ERR(TAG, "remdesk_server_receive_pdu failed with error %u!", error); + WLog_ERR(TAG, "remdesk_server_receive_pdu failed with error %"PRIu32"!", error); break; } @@ -751,7 +751,7 @@ static UINT remdesk_server_stop(RemdeskServerContext* context) if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index af5ad8d0e..9016c5734 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -119,7 +119,7 @@ static UINT32 _GetLastErrorToIoStatus(SERIAL_DEVICE* serial) /* no default */ } - WLog_Print(serial->log, WLOG_DEBUG, "unexpected last-error: 0x%lx", + WLog_Print(serial->log, WLOG_DEBUG, "unexpected last-error: 0x%08"PRIX32"", GetLastError()); return STATUS_UNSUCCESSFUL; } @@ -157,7 +157,7 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) * */ WLog_Print(serial->log, WLOG_DEBUG, - "DesiredAccess: 0x%lX, SharedAccess: 0x%lX, CreateDisposition: 0x%lX", + "DesiredAccess: 0x%"PRIX32", SharedAccess: 0x%"PRIX32", CreateDisposition: 0x%"PRIX32"", DesiredAccess, SharedAccess, CreateDisposition); /* FIXME: As of today only the flags below are supported by CommCreateFileA: */ DesiredAccess = GENERIC_READ | GENERIC_WRITE; @@ -174,7 +174,7 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) if (!serial->hComm || (serial->hComm == INVALID_HANDLE_VALUE)) { - WLog_Print(serial->log, WLOG_WARN, "CreateFile failure: %s last-error: 0x%lX\n", + WLog_Print(serial->log, WLOG_WARN, "CreateFile failure: %s last-error: 0x%08"PRIX32"", serial->device.name, GetLastError()); irp->IoStatus = STATUS_UNSUCCESSFUL; goto error_handle; @@ -194,7 +194,7 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) irp->FileId = irp->devman->id_sequence++; /* FIXME: why not ((WINPR_COMM*)hComm)->fd? */ irp->IoStatus = STATUS_SUCCESS; - WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %d, FileId: %d) created.", + WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %"PRIu32", FileId: %"PRIu32") created.", serial->device.name, irp->device->id, irp->FileId); error_handle: Stream_Write_UINT32(irp->output, irp->FileId); /* FileId (4 bytes) */ @@ -207,13 +207,13 @@ static void serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp) if (!CloseHandle(serial->hComm)) { - WLog_Print(serial->log, WLOG_WARN, "CloseHandle failure: %s (%d) closed.", + WLog_Print(serial->log, WLOG_WARN, "CloseHandle failure: %s (%"PRIu32") closed.", serial->device.name, irp->device->id); irp->IoStatus = STATUS_UNSUCCESSFUL; goto error_handle; } - WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %d, FileId: %d) closed.", + WLog_Print(serial->log, WLOG_DEBUG, "%s (DeviceId: %"PRIu32", FileId: %"PRIu32") closed.", serial->device.name, irp->device->id, irp->FileId); serial->hComm = NULL; irp->IoStatus = STATUS_SUCCESS; @@ -246,7 +246,7 @@ static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) /* MS-RDPESP 3.2.5.1.4: If the Offset field is not set to 0, the value MUST be ignored * assert(Offset == 0); */ - WLog_Print(serial->log, WLOG_DEBUG, "reading %d bytes from %s", Length, + WLog_Print(serial->log, WLOG_DEBUG, "reading %"PRIu32" bytes from %s", Length, serial->device.name); /* FIXME: CommReadFile to be replaced by ReadFile */ @@ -257,12 +257,12 @@ static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) else { WLog_Print(serial->log, WLOG_DEBUG, - "read failure to %s, nbRead=%ld, last-error: 0x%lX", serial->device.name, + "read failure to %s, nbRead=%"PRIu32", last-error: 0x%08"PRIX32"", serial->device.name, nbRead, GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } - WLog_Print(serial->log, WLOG_DEBUG, "%lu bytes read from %s", nbRead, + WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" bytes read from %s", nbRead, serial->device.name); error_handle: Stream_Write_UINT32(irp->output, nbRead); /* Length (4 bytes) */ @@ -297,7 +297,7 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp) * Using a serial printer, noticed though this field could be * set. */ - WLog_Print(serial->log, WLOG_DEBUG, "writing %d bytes to %s", Length, + WLog_Print(serial->log, WLOG_DEBUG, "writing %"PRIu32" bytes to %s", Length, serial->device.name); /* FIXME: CommWriteFile to be replaced by WriteFile */ @@ -309,12 +309,12 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp) else { WLog_Print(serial->log, WLOG_DEBUG, - "write failure to %s, nbWritten=%ld, last-error: 0x%lX", serial->device.name, + "write failure to %s, nbWritten=%"PRIu32", last-error: 0x%08"PRIX32"", serial->device.name, nbWritten, GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } - WLog_Print(serial->log, WLOG_DEBUG, "%lu bytes written to %s", (unsigned long) nbWritten, + WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" bytes written to %s", nbWritten, serial->device.name); Stream_Write_UINT32(irp->output, nbWritten); /* Length (4 bytes) */ Stream_Write_UINT8(irp->output, 0); /* Padding (1 byte) */ @@ -358,20 +358,20 @@ static UINT serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp) Stream_Read(irp->input, InputBuffer, InputBufferLength); WLog_Print(serial->log, WLOG_DEBUG, - "CommDeviceIoControl: CompletionId=%d, IoControlCode=[0x%X] %s", + "CommDeviceIoControl: CompletionId=%"PRIu32", IoControlCode=[0x%"PRIX32"] %s", irp->CompletionId, IoControlCode, _comm_serial_ioctl_name(IoControlCode)); /* FIXME: CommDeviceIoControl to be replaced by DeviceIoControl() */ if (CommDeviceIoControl(serial->hComm, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, &BytesReturned, NULL)) { - /* WLog_Print(serial->log, WLOG_DEBUG, "CommDeviceIoControl: CompletionId=%d, IoControlCode=[0x%X] %s done", irp->CompletionId, IoControlCode, _comm_serial_ioctl_name(IoControlCode)); */ + /* WLog_Print(serial->log, WLOG_DEBUG, "CommDeviceIoControl: CompletionId=%"PRIu32", IoControlCode=[0x%"PRIX32"] %s done", irp->CompletionId, IoControlCode, _comm_serial_ioctl_name(IoControlCode)); */ irp->IoStatus = STATUS_SUCCESS; } else { WLog_Print(serial->log, WLOG_DEBUG, - "CommDeviceIoControl failure: IoControlCode=[0x%X] %s, last-error: 0x%lX", + "CommDeviceIoControl failure: IoControlCode=[0x%"PRIX32"] %s, last-error: 0x%08"PRIX32"", IoControlCode, _comm_serial_ioctl_name(IoControlCode), GetLastError()); irp->IoStatus = _GetLastErrorToIoStatus(serial); } @@ -419,7 +419,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) { UINT error = CHANNEL_RC_OK; WLog_Print(serial->log, WLOG_DEBUG, - "IRP MajorFunction: 0x%04X MinorFunction: 0x%04X\n", + "IRP MajorFunction: 0x%08"PRIX32" MinorFunction: 0x%08"PRIX32"\n", irp->MajorFunction, irp->MinorFunction); switch (irp->MajorFunction) @@ -434,7 +434,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) case IRP_MJ_READ: if ((error = serial_process_irp_read(serial, irp))) - WLog_ERR(TAG, "serial_process_irp_read failed with error %u!", error); + WLog_ERR(TAG, "serial_process_irp_read failed with error %"PRIu32"!", error); break; @@ -444,7 +444,7 @@ static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) case IRP_MJ_DEVICE_CONTROL: if ((error = serial_process_irp_device_control(serial, irp))) - WLog_ERR(TAG, "serial_process_irp_device_control failed with error %u!", + WLog_ERR(TAG, "serial_process_irp_device_control failed with error %"PRIu32"!", error); break; @@ -466,7 +466,7 @@ static void* irp_thread_func(void* arg) /* blocks until the end of the request */ if ((error = serial_process_irp(data->serial, data->irp))) { - WLog_ERR(TAG, "serial_process_irp failed with error %u", error); + WLog_ERR(TAG, "serial_process_irp failed with error %"PRIu32"", error); goto error_out; } @@ -528,7 +528,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) if (waitResult == WAIT_OBJECT_0) { /* terminating thread */ - /* WLog_Print(serial->log, WLOG_DEBUG, "IRP thread with CompletionId=%d naturally died", id); */ + /* WLog_Print(serial->log, WLOG_DEBUG, "IRP thread with CompletionId=%"PRIuz" naturally died", id); */ CloseHandle(irpThread); ListDictionary_Remove(serial->IrpThreads, (void*)id); serial->IrpThreadToBeTerminatedCount--; @@ -537,7 +537,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) { /* unexpected thread state */ WLog_Print(serial->log, WLOG_WARN, - "WaitForSingleObject, got an unexpected result=0x%lX\n", waitResult); + "WaitForSingleObject, got an unexpected result=0x%"PRIX32"\n", waitResult); assert(FALSE); } @@ -546,7 +546,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) if (serial->IrpThreadToBeTerminatedCount > 0) { - WLog_Print(serial->log, WLOG_DEBUG, "%d IRP thread(s) not yet terminated", + WLog_Print(serial->log, WLOG_DEBUG, "%"PRIu32" IRP thread(s) not yet terminated", serial->IrpThreadToBeTerminatedCount); Sleep(1); /* 1 ms */ } @@ -570,7 +570,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp) { /* Thread still alived <=> Request still pending */ WLog_Print(serial->log, WLOG_DEBUG, - "IRP recall: IRP with the CompletionId=%d not yet completed!", + "IRP recall: IRP with the CompletionId=%"PRIu32" not yet completed!", irp->CompletionId); assert(FALSE); /* unimplemented */ /* TODO: asserts that previousIrpThread handles well @@ -665,7 +665,7 @@ static void terminate_pending_irp_threads(SERIAL_DEVICE* serial) } CloseHandle(irpThread); - WLog_Print(serial->log, WLOG_DEBUG, "IRP thread terminated, CompletionId %d", + WLog_Print(serial->log, WLOG_DEBUG, "IRP thread terminated, CompletionId %"PRIuz"", id); } @@ -760,7 +760,7 @@ static UINT serial_free(DEVICE* device) if (WaitForSingleObject(serial->MainThread, INFINITE) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -922,7 +922,7 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) if ((error = pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) serial))) { - WLog_ERR(TAG, "EntryPoints->RegisterDevice failed with error %u!", error); + WLog_ERR(TAG, "EntryPoints->RegisterDevice failed with error %"PRIu32"!", error); goto error_out; } diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index 0fcdd435f..535fa1852 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -56,7 +56,7 @@ void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext) if (waitStatus == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -65,7 +65,7 @@ void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext) if (waitStatus == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -87,7 +87,7 @@ void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext) { if ((status = smartcard_irp_device_control_call(smartcard, operation))) { - WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %u", + WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %"PRIu32"", status); break; } @@ -162,7 +162,7 @@ void smartcard_context_free(SMARTCARD_CONTEXT* pContext) if (MessageQueue_PostQuit(pContext->IrpQueue, 0) && (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); CloseHandle(pContext->thread); MessageQueue_Free(pContext->IrpQueue); @@ -237,7 +237,7 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) if (MessageQueue_PostQuit(pContext->IrpQueue, 0) && (WaitForSingleObject(pContext->thread, INFINITE) == WAIT_FAILED)) - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); CloseHandle(pContext->thread); MessageQueue_Free(pContext->IrpQueue); @@ -273,7 +273,7 @@ static UINT smartcard_free(DEVICE* device) && (WaitForSingleObject(smartcard->thread, INFINITE) == WAIT_FAILED)) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } @@ -465,7 +465,7 @@ UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { if ((status = smartcard_irp_device_control_call(smartcard, operation))) { - WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %ld!", + WLog_ERR(TAG, "smartcard_irp_device_control_call failed with error %"PRId32"!", status); return (UINT32)status; } @@ -493,7 +493,7 @@ UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) else { WLog_ERR(TAG, - "Unexpected SmartCard IRP: MajorFunction 0x%08X MinorFunction: 0x%08X", + "Unexpected SmartCard IRP: MajorFunction 0x%08"PRIX32" MinorFunction: 0x%08"PRIX32"", irp->MajorFunction, irp->MinorFunction); irp->IoStatus = (UINT32)STATUS_NOT_SUPPORTED; @@ -528,7 +528,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -537,7 +537,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -559,7 +559,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); goto out; } @@ -577,7 +577,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); goto out; } @@ -587,7 +587,7 @@ static void* smartcard_thread_func(void* arg) if ((error = smartcard_complete_irp(smartcard, irp))) { - WLog_ERR(TAG, "smartcard_complete_irp failed with error %u!", error); + WLog_ERR(TAG, "smartcard_complete_irp failed with error %"PRIu32"!", error); goto out; } } @@ -602,7 +602,7 @@ static void* smartcard_thread_func(void* arg) { if ((error = smartcard_process_irp(smartcard, irp))) { - WLog_ERR(TAG, "smartcard_process_irp failed with error %u!", error); + WLog_ERR(TAG, "smartcard_process_irp failed with error %"PRIu32"!", error); goto out; } } @@ -613,7 +613,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -630,7 +630,7 @@ static void* smartcard_thread_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -646,7 +646,7 @@ static void* smartcard_thread_func(void* arg) goto out; } - WLog_ERR(TAG, "smartcard_complete_irp failed with error %u!", error); + WLog_ERR(TAG, "smartcard_complete_irp failed with error %"PRIu32"!", error); goto out; } } diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 790314e2f..20a18170d 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -202,7 +202,7 @@ static LONG smartcard_EstablishContext_Decode(SMARTCARD_DEVICE* smartcard, SMART if ((status = smartcard_unpack_establish_context_call(smartcard, irp->input, call))) { - WLog_ERR(TAG, "smartcard_unpack_establish_context_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_establish_context_call failed with error %"PRId32"", status); return status; } smartcard_trace_establish_context_call(smartcard, call); @@ -236,7 +236,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, SMARTCA } else { - WLog_ERR(TAG, "SCardEstablishContext failed with error %ld", status); + WLog_ERR(TAG, "SCardEstablishContext failed with error %"PRId32"", status); return status; } @@ -244,7 +244,7 @@ static LONG smartcard_EstablishContext_Call(SMARTCARD_DEVICE* smartcard, SMARTCA smartcard_trace_establish_context_return(smartcard, &ret); if ((status = smartcard_pack_establish_context_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_establish_context_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_establish_context_return failed with error %"PRId32"", status); return status; } @@ -260,7 +260,7 @@ static LONG smartcard_ReleaseContext_Decode(SMARTCARD_DEVICE* smartcard, SMARTCA return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); smartcard_trace_context_call(smartcard, call, "ReleaseContext"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -282,7 +282,7 @@ static LONG smartcard_ReleaseContext_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD } else { - WLog_ERR(TAG, "SCardReleaseContext failed with error %ld", status); + WLog_ERR(TAG, "SCardReleaseContext failed with error %"PRId32"", status); return status; } @@ -299,7 +299,7 @@ static LONG smartcard_IsValidContext_Decode(SMARTCARD_DEVICE* smartcard, SMARTCA return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); smartcard_trace_context_call(smartcard, call, "IsValidContext"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -311,7 +311,7 @@ static LONG smartcard_IsValidContext_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD Long_Return ret; if ((status = ret.ReturnCode = SCardIsValidContext(operation->hContext))) { - WLog_ERR(TAG, "SCardIsValidContext failed with error %ld", status); + WLog_ERR(TAG, "SCardIsValidContext failed with error %"PRId32"", status); return status; } smartcard_trace_long_return(smartcard, &ret, "IsValidContext"); @@ -327,7 +327,7 @@ static LONG smartcard_ListReadersA_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD return STATUS_NO_MEMORY; if ((status = smartcard_unpack_list_readers_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %"PRId32"", status); smartcard_trace_list_readers_call(smartcard, call, FALSE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -356,14 +356,14 @@ static LONG smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O if (status) { - WLog_ERR(TAG, "SCardListReadersA failed with error %ld", status); + WLog_ERR(TAG, "SCardListReadersA failed with error %"PRId32"", status); return status; } smartcard_trace_list_readers_return(smartcard, &ret, FALSE); if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %"PRId32"", status); return status; } @@ -385,7 +385,7 @@ static LONG smartcard_ListReadersW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD return STATUS_NO_MEMORY; if ((status = smartcard_unpack_list_readers_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_list_readers_call failed with error %"PRId32"", status); smartcard_trace_list_readers_call(smartcard, call, TRUE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); @@ -417,7 +417,7 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O if (status) { - WLog_ERR(TAG, "SCardListReadersW failed with error %ld", status); + WLog_ERR(TAG, "SCardListReadersW failed with error %"PRId32"", status); return status; } @@ -425,7 +425,7 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O if ((status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_list_readers_return failed with error %"PRId32"", status); return status; } @@ -448,7 +448,7 @@ static LONG smartcard_GetStatusChangeA_Decode(SMARTCARD_DEVICE* smartcard, SMART if ((status = smartcard_unpack_get_status_change_a_call(smartcard, irp->input, call))) { - WLog_ERR(TAG, "smartcard_unpack_get_status_change_a_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_get_status_change_a_call failed with error %"PRId32"", status); return status; } @@ -492,7 +492,7 @@ static LONG smartcard_GetStatusChangeA_Call(SMARTCARD_DEVICE* smartcard, SMARTCA smartcard_trace_get_status_change_return(smartcard, &ret, FALSE); if ((status = smartcard_pack_get_status_change_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %"PRId32"", status); return status; } @@ -520,7 +520,7 @@ static LONG smartcard_GetStatusChangeW_Decode(SMARTCARD_DEVICE* smartcard, SMART return STATUS_NO_MEMORY; if ((status = smartcard_unpack_get_status_change_w_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_get_status_change_w_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_get_status_change_w_call failed with error %"PRId32"", status); smartcard_trace_get_status_change_w_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -559,7 +559,7 @@ static LONG smartcard_GetStatusChangeW_Call(SMARTCARD_DEVICE* smartcard, SMARTCA smartcard_trace_get_status_change_return(smartcard, &ret, TRUE); if ((status = smartcard_pack_get_status_change_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %"PRId32"", status); return status; } @@ -587,7 +587,7 @@ static LONG smartcard_Cancel_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA return STATUS_NO_MEMORY; if ((status = smartcard_unpack_context_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_context_call failed with error %"PRId32"", status); smartcard_trace_context_call(smartcard, call, "Cancel"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -600,7 +600,7 @@ static LONG smartcard_Cancel_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATI if ((status = ret.ReturnCode = SCardCancel(operation->hContext))) { - WLog_ERR(TAG, "SCardCancel failed with error %ld", status); + WLog_ERR(TAG, "SCardCancel failed with error %"PRId32"", status); return status; } smartcard_trace_long_return(smartcard, &ret, "Cancel"); @@ -616,7 +616,7 @@ static LONG smartcard_ConnectA_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_connect_a_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_connect_a_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_connect_a_call failed with error %"PRId32"", status); smartcard_trace_connect_a_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->Common.hContext)); return status; @@ -644,14 +644,14 @@ static LONG smartcard_ConnectA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA if (status) { - WLog_ERR(TAG, "SCardConnectA failed with error %ld", status); + WLog_ERR(TAG, "SCardConnectA failed with error %"PRId32"", status); return status; } if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status); return status; } @@ -669,7 +669,7 @@ static LONG smartcard_ConnectW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_connect_w_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_connect_w_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_connect_w_call failed with error %"PRId32"", status); smartcard_trace_connect_w_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->Common.hContext)); @@ -699,13 +699,13 @@ static LONG smartcard_ConnectW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA if (status) { - WLog_ERR(TAG, "SCardConnectW failed with error %ld", status); + WLog_ERR(TAG, "SCardConnectW failed with error %"PRId32"", status); return status; } if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status); return status; } @@ -723,7 +723,7 @@ static LONG smartcard_Reconnect_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP return STATUS_NO_MEMORY; if ((status = smartcard_unpack_reconnect_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_reconnect_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_reconnect_call failed with error %"PRId32"", status); smartcard_trace_reconnect_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -740,7 +740,7 @@ static LONG smartcard_Reconnect_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER smartcard_trace_reconnect_return(smartcard, &ret); if ((status = smartcard_pack_reconnect_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_reconnect_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_reconnect_return failed with error %"PRId32"", status); return status; } @@ -756,7 +756,7 @@ static LONG smartcard_Disconnect_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_O return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "Disconnect"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -769,7 +769,7 @@ static LONG smartcard_Disconnect_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE Long_Return ret; if ((status = ret.ReturnCode = SCardDisconnect(operation->hCard, call->dwDisposition))) { - WLog_ERR(TAG, "SCardDisconnect failed with error %ld", status); + WLog_ERR(TAG, "SCardDisconnect failed with error %"PRId32"", status); return status; } smartcard_trace_long_return(smartcard, &ret, "Disconnect"); @@ -786,7 +786,7 @@ static LONG smartcard_BeginTransaction_Decode(SMARTCARD_DEVICE* smartcard, SMART return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "BeginTransaction"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -798,7 +798,7 @@ static LONG smartcard_BeginTransaction_Call(SMARTCARD_DEVICE* smartcard, SMARTCA Long_Return ret; if ((ret.ReturnCode = SCardBeginTransaction(operation->hCard))) { - WLog_ERR(TAG, "SCardBeginTransaction failed with error %ld", ret.ReturnCode); + WLog_ERR(TAG, "SCardBeginTransaction failed with error %"PRId32"", ret.ReturnCode); return ret.ReturnCode; } smartcard_trace_long_return(smartcard, &ret, "BeginTransaction"); @@ -814,7 +814,7 @@ static LONG smartcard_EndTransaction_Decode(SMARTCARD_DEVICE* smartcard, SMARTCA return STATUS_NO_MEMORY; if ((status = smartcard_unpack_hcard_and_disposition_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_hcard_and_disposition_call failed with error %"PRId32"", status); smartcard_trace_hcard_and_disposition_call(smartcard, call, "EndTransaction"); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -826,7 +826,7 @@ static LONG smartcard_EndTransaction_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD Long_Return ret; if ((ret.ReturnCode = SCardEndTransaction(operation->hCard, call->dwDisposition))) { - WLog_ERR(TAG, "SCardEndTransaction failed with error %ld", ret.ReturnCode); + WLog_ERR(TAG, "SCardEndTransaction failed with error %"PRId32"", ret.ReturnCode); return ret.ReturnCode; } smartcard_trace_long_return(smartcard, &ret, "EndTransaction"); @@ -842,7 +842,7 @@ static LONG smartcard_State_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT return STATUS_NO_MEMORY; if ((status = smartcard_unpack_state_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_state_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_state_call failed with error %"PRId32"", status); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); return status; @@ -857,7 +857,7 @@ static LONG smartcard_State_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATIO ret.ReturnCode = SCardState(operation->hCard, &ret.dwState, &ret.dwProtocol, (BYTE*) &ret.rgAtr, &ret.cbAtrLen); if ((status = smartcard_pack_state_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_state_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_state_return failed with error %"PRId32"", status); return status; } @@ -873,7 +873,7 @@ static LONG smartcard_StatusA_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_status_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %"PRId32"", status); smartcard_trace_status_call(smartcard, call, FALSE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -904,7 +904,7 @@ static LONG smartcard_StatusA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT smartcard_trace_status_return(smartcard, &ret, FALSE); if ((status = smartcard_pack_status_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_status_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_status_return failed with error %"PRId32"", status); return status; } @@ -923,7 +923,7 @@ static LONG smartcard_StatusW_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_status_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_status_call failed with error %"PRId32"", status); smartcard_trace_status_call(smartcard, call, TRUE); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -950,7 +950,7 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT smartcard_trace_status_return(smartcard, &ret, TRUE); if ((status = smartcard_pack_status_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_status_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_status_return failed with error %"PRId32"", status); return status; } @@ -969,7 +969,7 @@ static LONG smartcard_Transmit_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPE return STATUS_NO_MEMORY; if ((status = smartcard_unpack_transmit_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_transmit_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_transmit_call failed with error %"PRId32"", status); smartcard_trace_transmit_call(smartcard, call); @@ -1007,7 +1007,7 @@ static LONG smartcard_Transmit_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA smartcard_trace_transmit_return(smartcard, &ret); if ((status = smartcard_pack_transmit_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_transmit_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_transmit_return failed with error %"PRId32"", status); return status; } @@ -1028,7 +1028,7 @@ static LONG smartcard_Control_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER return STATUS_NO_MEMORY; if ((status = smartcard_unpack_control_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_control_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_control_call failed with error %"PRId32"", status); smartcard_trace_control_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -1053,7 +1053,7 @@ static LONG smartcard_Control_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT smartcard_trace_control_return(smartcard, &ret); if ((status = smartcard_pack_control_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_control_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_control_return failed with error %"PRId32"", status); return status; } @@ -1072,7 +1072,7 @@ static LONG smartcard_GetAttrib_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP return STATUS_NO_MEMORY; if ((status = smartcard_unpack_get_attrib_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_get_attrib_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_get_attrib_call failed with error %"PRId32"", status); smartcard_trace_get_attrib_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); operation->hCard = smartcard_scard_handle_native_from_redir(smartcard, &(call->hCard)); @@ -1113,7 +1113,7 @@ static LONG smartcard_GetAttrib_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER if (ret.ReturnCode) { - WLog_WARN(TAG, "SCardGetAttrib: %s (0x%08X) cbAttrLen: %d", + WLog_WARN(TAG, "SCardGetAttrib: %s (0x%08"PRIX32") cbAttrLen: %"PRIu32"", SCardGetAttributeString(call->dwAttrId), call->dwAttrId, call->cbAttrLen); Stream_Zero(irp->output, 256); @@ -1123,7 +1123,7 @@ static LONG smartcard_GetAttrib_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPER if ((status = smartcard_pack_get_attrib_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_attrib_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_get_attrib_return failed with error %"PRId32"", status); return status; } @@ -1140,8 +1140,8 @@ static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, SMA if (Stream_GetRemainingLength(irp->input) < 4) { - WLog_WARN(TAG, "AccessStartedEvent is too short: %d", - (int) Stream_GetRemainingLength(irp->input)); + WLog_WARN(TAG, "AccessStartedEvent is too short: %"PRIuz"", + Stream_GetRemainingLength(irp->input)); return SCARD_F_INTERNAL_ERROR; } @@ -1169,7 +1169,7 @@ static LONG smartcard_LocateCardsByATRA_Decode(SMARTCARD_DEVICE* smartcard, SMAR return STATUS_NO_MEMORY; if ((status = smartcard_unpack_locate_cards_by_atr_a_call(smartcard, irp->input, call))) - WLog_ERR(TAG, "smartcard_unpack_locate_cards_by_atr_a_call failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_locate_cards_by_atr_a_call failed with error %"PRId32"", status); smartcard_trace_locate_cards_by_atr_a_call(smartcard, call); operation->hContext = smartcard_scard_context_native_from_redir(smartcard, &(call->hContext)); return status; @@ -1249,7 +1249,7 @@ static LONG smartcard_LocateCardsByATRA_Call(SMARTCARD_DEVICE* smartcard, SMARTC smartcard_trace_get_status_change_return(smartcard, &ret, FALSE); if ((status = smartcard_pack_get_status_change_return(smartcard, irp->output, &ret))) { - WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_get_status_change_return failed with error %"PRId32"", status); return status; } @@ -1287,8 +1287,8 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_ if (Stream_GetRemainingLength(irp->input) < 32) { - WLog_WARN(TAG, "Device Control Request is too short: %lu", - (unsigned long) Stream_GetRemainingLength(irp->input)); + WLog_WARN(TAG, "Device Control Request is too short: %"PRIuz"", + Stream_GetRemainingLength(irp->input)); return SCARD_F_INTERNAL_ERROR; } @@ -1300,13 +1300,13 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_ if (Stream_Length(irp->input) != (Stream_GetPosition(irp->input) + inputBufferLength)) { - WLog_WARN(TAG, "InputBufferLength mismatch: Actual: %lu Expected: %lu", - (unsigned long) Stream_Length(irp->input), - (unsigned long) (Stream_GetPosition(irp->input) + inputBufferLength)); + WLog_WARN(TAG, "InputBufferLength mismatch: Actual: %"PRIuz" Expected: %"PRIuz"", + Stream_Length(irp->input), + Stream_GetPosition(irp->input) + inputBufferLength); return SCARD_F_INTERNAL_ERROR; } - WLog_DBG(TAG, "%s (0x%08X) FileId: %d CompletionId: %d", + WLog_DBG(TAG, "%s (0x%08"PRIX32") FileId: %"PRIu32" CompletionId: %"PRIu32"", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, irp->FileId, irp->CompletionId); @@ -1315,13 +1315,13 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_ { if ((status = smartcard_unpack_common_type_header(smartcard, irp->input))) { - WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %"PRId32"", status); return SCARD_F_INTERNAL_ERROR; } if ((status = smartcard_unpack_private_type_header(smartcard, irp->input))) { - WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_common_type_header failed with error %"PRId32"", status); return SCARD_F_INTERNAL_ERROR; } } @@ -1645,23 +1645,23 @@ LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_ Stream_GetPosition(irp->input) - offset, 8); } - if (((size_t) Stream_GetPosition(irp->input)) < Stream_Length(irp->input)) + if (Stream_GetPosition(irp->input) < Stream_Length(irp->input)) { - UINT32 difference; - difference = (int)(Stream_Length(irp->input) - Stream_GetPosition(irp->input)); - WLog_WARN(TAG, "IRP was not fully parsed %s (0x%08X): Actual: %d, Expected: %d, Difference: %d", + SIZE_T difference; + difference = Stream_Length(irp->input) - Stream_GetPosition(irp->input); + WLog_WARN(TAG, "IRP was not fully parsed %s (0x%08"PRIX32"): Actual: %"PRIuz", Expected: %"PRIuz", Difference: %"PRIuz"", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, - (int) Stream_GetPosition(irp->input), (int) Stream_Length(irp->input), difference); + Stream_GetPosition(irp->input), Stream_Length(irp->input), difference); winpr_HexDump(TAG, WLOG_WARN, Stream_Pointer(irp->input), difference); } - if (((size_t) Stream_GetPosition(irp->input)) > Stream_Length(irp->input)) + if (Stream_GetPosition(irp->input) > Stream_Length(irp->input)) { - UINT32 difference; - difference = (int)(Stream_GetPosition(irp->input) - Stream_Length(irp->input)); - WLog_WARN(TAG, "IRP was parsed beyond its end %s (0x%08X): Actual: %d, Expected: %d, Difference: %d", + SIZE_T difference; + difference = Stream_GetPosition(irp->input) - Stream_Length(irp->input); + WLog_WARN(TAG, "IRP was parsed beyond its end %s (0x%08"PRIX32"): Actual: %"PRIuz", Expected: %"PRIuz", Difference: %"PRIuz"", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, - (int) Stream_GetPosition(irp->input), (int) Stream_Length(irp->input), difference); + Stream_GetPosition(irp->input), Stream_Length(irp->input), difference); } if (status != SCARD_S_SUCCESS) @@ -1921,7 +1921,7 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP if ((result != SCARD_S_SUCCESS) && (result != SCARD_E_TIMEOUT) && (result != SCARD_E_NO_READERS_AVAILABLE) && (result != SCARD_E_NO_SERVICE)) { - WLog_WARN(TAG, "IRP failure: %s (0x%08X), status: %s (0x%08X)", + WLog_WARN(TAG, "IRP failure: %s (0x%08"PRIX32"), status: %s (0x%08"PRIX32")", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, SCardGetErrorString(result), result); } @@ -1933,7 +1933,7 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP /* NTSTATUS error */ irp->IoStatus = (UINT32)result; Stream_SetPosition(irp->output, RDPDR_DEVICE_IO_RESPONSE_LENGTH); - WLog_WARN(TAG, "IRP failure: %s (0x%08X), ntstatus: 0x%08X", + WLog_WARN(TAG, "IRP failure: %s (0x%08"PRIX32"), ntstatus: 0x%08"PRIX32"", smartcard_get_ioctl_string(ioControlCode, TRUE), ioControlCode, result); } @@ -1946,12 +1946,12 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP Stream_Write_UINT32(irp->output, outputBufferLength); /* OutputBufferLength (4 bytes) */ if ((result = smartcard_pack_common_type_header(smartcard, irp->output))) /* CommonTypeHeader (8 bytes) */ { - WLog_ERR(TAG, "smartcard_pack_common_type_header failed with error %ld", result); + WLog_ERR(TAG, "smartcard_pack_common_type_header failed with error %"PRId32"", result); return result; } if ((result = smartcard_pack_private_type_header(smartcard, irp->output, objectBufferLength))) /* PrivateTypeHeader (8 bytes) */ { - WLog_ERR(TAG, "smartcard_pack_private_type_header failed with error %ld", result); + WLog_ERR(TAG, "smartcard_pack_private_type_header failed with error %"PRId32"", result); return result; } diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index 7e968eae0..1faae88d8 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -37,8 +37,8 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "CommonTypeHeader is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "CommonTypeHeader is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -51,25 +51,25 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s if (version != 1) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader Version %d", version); + WLog_WARN(TAG, "Unsupported CommonTypeHeader Version %"PRIu8"", version); return STATUS_INVALID_PARAMETER; } if (endianness != 0x10) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader Endianness %d", endianness); + WLog_WARN(TAG, "Unsupported CommonTypeHeader Endianness %"PRIu8"", endianness); return STATUS_INVALID_PARAMETER; } if (commonHeaderLength != 8) { - WLog_WARN(TAG, "Unsupported CommonTypeHeader CommonHeaderLength %d", commonHeaderLength); + WLog_WARN(TAG, "Unsupported CommonTypeHeader CommonHeaderLength %"PRIu16"", commonHeaderLength); return STATUS_INVALID_PARAMETER; } if (filler != 0xCCCCCCCC) { - WLog_WARN(TAG, "Unexpected CommonTypeHeader Filler 0x%08X", filler); + WLog_WARN(TAG, "Unexpected CommonTypeHeader Filler 0x%08"PRIX32"", filler); return STATUS_INVALID_PARAMETER; } @@ -93,8 +93,8 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "PrivateTypeHeader is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "PrivateTypeHeader is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -103,14 +103,14 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* if (filler != 0x00000000) { - WLog_WARN(TAG, "Unexpected PrivateTypeHeader Filler 0x%08X", filler); + WLog_WARN(TAG, "Unexpected PrivateTypeHeader Filler 0x%08"PRIX32"", filler); return STATUS_INVALID_PARAMETER; } if (objectBufferLength != Stream_GetRemainingLength(s)) { - WLog_WARN(TAG, "PrivateTypeHeader ObjectBufferLength mismatch: Actual: %lu, Expected: %lu", - (unsigned long) objectBufferLength, (unsigned long)Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "PrivateTypeHeader ObjectBufferLength mismatch: Actual: %"PRIu32", Expected: %"PRIuz"", + objectBufferLength, Stream_GetRemainingLength(s)); return STATUS_INVALID_PARAMETER; } @@ -166,8 +166,8 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca if ((context->cbContext != sizeof(ULONG_PTR)) && (context->cbContext != 0)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT does not match native size: Actual: %lu, Expected: %lu", - (unsigned long) context->cbContext, (unsigned long) sizeof(ULONG_PTR)); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT does not match native size: Actual: %"PRIu32", Expected: %"PRIuz"", + context->cbContext, sizeof(ULONG_PTR)); return 0; } @@ -192,8 +192,8 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard if (handle->cbHandle != sizeof(ULONG_PTR)) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE does not match native size: Actual: %lu, Expected: %lu", - (unsigned long) handle->cbHandle, (unsigned long) sizeof(ULONG_PTR)); + WLog_WARN(TAG, "REDIR_SCARDHANDLE does not match native size: Actual: %"PRIu32", Expected: %"PRIuz"", + handle->cbHandle, sizeof(ULONG_PTR)); return 0; } @@ -218,8 +218,8 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -227,14 +227,14 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* if (Stream_GetRemainingLength(s) < context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), context->cbContext); return STATUS_BUFFER_TOO_SMALL; } if ((context->cbContext != 0) && (context->cbContext != 4) && (context->cbContext != 8)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 0, 4 or 8: %d", context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 0, 4 or 8: %"PRIu32"", context->cbContext); return STATUS_INVALID_PARAMETER; } @@ -242,15 +242,15 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* if (((context->cbContext == 0) && pbContextNdrPtr) || ((context->cbContext != 0) && !pbContextNdrPtr)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT cbContext (%d) pbContextNdrPtr (%d) inconsistency", - (int) context->cbContext, (int) pbContextNdrPtr); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT cbContext (%"PRIu32") pbContextNdrPtr (%"PRIu32") inconsistency", + context->cbContext, pbContextNdrPtr); return STATUS_INVALID_PARAMETER; } if (context->cbContext > Stream_GetRemainingLength(s)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too long: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too long: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), context->cbContext); return STATUS_INVALID_PARAMETER; } @@ -278,8 +278,8 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), 4); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: 4", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -287,21 +287,21 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre if (length != context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length (%d) cbContext (%d) mismatch", + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length (%"PRIu32") cbContext (%"PRIu32") mismatch", length, context->cbContext); return STATUS_INVALID_PARAMETER; } if ((context->cbContext != 0) && (context->cbContext != 4) && (context->cbContext != 8)) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 4 or 8: %d", context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT length is not 4 or 8: %"PRIu32"", context->cbContext); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < context->cbContext) { - WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), context->cbContext); + WLog_WARN(TAG, "REDIR_SCARDCONTEXT is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), context->cbContext); return STATUS_BUFFER_TOO_SMALL; } @@ -333,8 +333,8 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "SCARDHANDLE is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "SCARDHANDLE is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -342,8 +342,8 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s if ((Stream_GetRemainingLength(s) < handle->cbHandle) || (!handle->cbHandle)) { - WLog_WARN(TAG, "SCARDHANDLE is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), handle->cbHandle); + WLog_WARN(TAG, "SCARDHANDLE is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), handle->cbHandle); return STATUS_BUFFER_TOO_SMALL; } @@ -370,8 +370,8 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), 4); + WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %"PRIuz", Expected: 4", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -379,21 +379,21 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea if (length != handle->cbHandle) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE length (%d) cbHandle (%d) mismatch", + WLog_WARN(TAG, "REDIR_SCARDHANDLE length (%"PRIu32") cbHandle (%"PRIu32") mismatch", length, handle->cbHandle); return STATUS_INVALID_PARAMETER; } if ((handle->cbHandle != 4) && (handle->cbHandle != 8)) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE length is not 4 or 8: %d", handle->cbHandle); + WLog_WARN(TAG, "REDIR_SCARDHANDLE length is not 4 or 8: %"PRIu32"", handle->cbHandle); return STATUS_INVALID_PARAMETER; } if ((Stream_GetRemainingLength(s) < handle->cbHandle) || (!handle->cbHandle)) { - WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), handle->cbHandle); + WLog_WARN(TAG, "REDIR_SCARDHANDLE is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), handle->cbHandle); return STATUS_BUFFER_TOO_SMALL; } @@ -417,8 +417,8 @@ LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStrea { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), 4); + WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %"PRIuz", Expected: 4", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -434,7 +434,7 @@ void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, Establi WLog_DBG(TAG, "EstablishContext_Call {"); - WLog_DBG(TAG, "dwScope: %s (0x%08X)", + WLog_DBG(TAG, "dwScope: %s (0x%08"PRIX32")", SCardGetScopeString(call->dwScope), call->dwScope); WLog_DBG(TAG, "}"); @@ -446,12 +446,12 @@ LONG smartcard_pack_establish_context_return(SMARTCARD_DEVICE* smartcard, wStrea if ((status = smartcard_pack_redir_scard_context(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_pack_redir_scard_context_ref(smartcard, s, &(ret->hContext)))) - WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } @@ -465,19 +465,19 @@ void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, Estab WLog_DBG(TAG, "EstablishContext_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); pb = (BYTE*) &(ret->hContext.pbContext); if (ret->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], ret->hContext.cbContext); } @@ -490,12 +490,12 @@ LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } @@ -513,12 +513,12 @@ void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* cal if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -532,7 +532,7 @@ void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, Long_Return* ret, WLog_DBG(TAG, "%s_Return {", name); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); WLog_DBG(TAG, "}"); @@ -548,14 +548,14 @@ LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 16) { - WLog_WARN(TAG, "ListReaders_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ListReaders_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -566,14 +566,14 @@ LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((mszGroupsNdrPtr && !call->cBytes) || (!mszGroupsNdrPtr && call->cBytes)) { - WLog_WARN(TAG, "ListReaders_Call mszGroupsNdrPtr (0x%08X) and cBytes (0x%08X) inconsistency", - (int) mszGroupsNdrPtr, (int) call->cBytes); + WLog_WARN(TAG, "ListReaders_Call mszGroupsNdrPtr (0x%08"PRIX32") and cBytes (0x%08"PRIX32") inconsistency", + mszGroupsNdrPtr, call->cBytes); return STATUS_INVALID_PARAMETER; } @@ -583,15 +583,15 @@ LONG smartcard_unpack_list_readers_call(SMARTCARD_DEVICE* smartcard, wStream* s, if (count != call->cBytes) { - WLog_WARN(TAG, "ListReaders_Call NdrCount (0x%08X) and cBytes (0x%08X) inconsistency", - (int) count, (int) call->cBytes); + WLog_WARN(TAG, "ListReaders_Call NdrCount (0x%08"PRIX32") and cBytes (0x%08"PRIX32") inconsistency", + count, call->cBytes); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cBytes) { - WLog_WARN(TAG, "ListReaders_Call is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), call->cBytes); + WLog_WARN(TAG, "ListReaders_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), call->cBytes); return STATUS_BUFFER_TOO_SMALL; } @@ -628,16 +628,16 @@ void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, ListReaders_ if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "cBytes: %d mszGroups: %s fmszReadersIsNULL: %d cchReaders: 0x%08X", + WLog_DBG(TAG, "cBytes: %"PRIu32" mszGroups: %s fmszReadersIsNULL: %"PRId32" cchReaders: 0x%08"PRIX32"", call->cBytes, mszGroupsA, call->fmszReadersIsNULL, call->cchReaders); WLog_DBG(TAG, "}"); @@ -676,7 +676,7 @@ LONG smartcard_pack_list_readers_return(SMARTCARD_DEVICE* smartcard, wStream* s, if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cBytes, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", error); return error; } } @@ -695,7 +695,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, ListReader WLog_DBG(TAG, "ListReaders%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); if (ret->ReturnCode != SCARD_S_SUCCESS) @@ -732,7 +732,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, ListReader mszA[index] = ','; } - WLog_DBG(TAG, "cBytes: %d msz: %s", ret->cBytes, mszA); + WLog_DBG(TAG, "cBytes: %"PRIu32" msz: %s", ret->cBytes, mszA); WLog_DBG(TAG, "}"); @@ -745,14 +745,14 @@ LONG smartcard_unpack_connect_common(SMARTCARD_DEVICE* smartcard, wStream* s, Co if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "Connect_Common is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Connect_Common is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(common->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } @@ -771,8 +771,8 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "ConnectA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ConnectA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -780,7 +780,7 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if ((status = smartcard_unpack_connect_common(smartcard, s, &(call->Common)))) { - WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %"PRId32"", status); return status; } @@ -803,7 +803,7 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co call->szReader[count] = '\0'; if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->Common.hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } @@ -821,16 +821,16 @@ void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, ConnectA_Call* if (call->Common.hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->Common.hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->Common.hContext.cbContext); } - WLog_DBG(TAG, "szReader: %s dwShareMode: %s (0x%08X) dwPreferredProtocols: %s (0x%08X)", + WLog_DBG(TAG, "szReader: %s dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32")", call->szReader, SCardGetShareModeString(call->Common.dwShareMode), call->Common.dwShareMode, SCardGetProtocolString(call->Common.dwPreferredProtocols), call->Common.dwPreferredProtocols); @@ -846,8 +846,8 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "ConnectW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "ConnectW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -855,7 +855,7 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co if ((status = smartcard_unpack_connect_common(smartcard, s, &(call->Common)))) { - WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_connect_common failed with error %"PRId32"", status); return status; } @@ -878,7 +878,7 @@ LONG smartcard_unpack_connect_w_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co call->szReader[count] = '\0'; if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->Common.hContext)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } @@ -899,16 +899,16 @@ void smartcard_trace_connect_w_call(SMARTCARD_DEVICE* smartcard, ConnectW_Call* if (call->Common.hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->Common.hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->Common.hContext.cbContext); } - WLog_DBG(TAG, "szReader: %s dwShareMode: %s (0x%08X) dwPreferredProtocols: %s (0x%08X)", + WLog_DBG(TAG, "szReader: %s dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32")", szReaderA, SCardGetShareModeString(call->Common.dwShareMode), call->Common.dwShareMode, SCardGetProtocolString(call->Common.dwPreferredProtocols), call->Common.dwPreferredProtocols); @@ -923,13 +923,13 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn if ((status = smartcard_pack_redir_scard_context(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_pack_redir_scard_handle(smartcard, s, &(ret->hCard)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_handle failed with error %"PRId32"", status); return status; } @@ -937,12 +937,12 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn if ((status = smartcard_pack_redir_scard_context_ref(smartcard, s, &(ret->hContext)))) { - WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_pack_redir_scard_handle_ref(smartcard, s, &(ret->hCard)))) - WLog_ERR(TAG, "smartcard_pack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -956,19 +956,19 @@ void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, Connect_Return* WLog_DBG(TAG, "Connect_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); pb = (BYTE*) &(ret->hContext.pbContext); if (ret->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], ret->hContext.cbContext); } @@ -976,16 +976,16 @@ void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, Connect_Return* if (ret->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], ret->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], ret->hCard.cbHandle); } - WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08X)", + WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08"PRIX32")", SCardGetProtocolString(ret->dwActiveProtocol), ret->dwActiveProtocol); WLog_DBG(TAG, "}"); @@ -997,21 +997,21 @@ LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Re if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Reconnect_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Reconnect_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1021,12 +1021,12 @@ LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Re if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -1044,12 +1044,12 @@ void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -1057,16 +1057,16 @@ void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwShareMode: %s (0x%08X) dwPreferredProtocols: %s (0x%08X) dwInitialization: %s (0x%08X)", + WLog_DBG(TAG, "dwShareMode: %s (0x%08"PRIX32") dwPreferredProtocols: %s (0x%08"PRIX32") dwInitialization: %s (0x%08"PRIX32")", SCardGetShareModeString(call->dwShareMode), call->dwShareMode, SCardGetProtocolString(call->dwPreferredProtocols), call->dwPreferredProtocols, SCardGetDispositionString(call->dwInitialization), call->dwInitialization); @@ -1088,10 +1088,10 @@ void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, Reconnect_Ret WLog_DBG(TAG, "Reconnect_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08X)", + WLog_DBG(TAG, "dwActiveProtocol: %s (0x%08"PRIX32")", SCardGetProtocolString(ret->dwActiveProtocol), ret->dwActiveProtocol); WLog_DBG(TAG, "}"); @@ -1103,20 +1103,20 @@ LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "HCardAndDisposition_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "HCardAndDisposition_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1124,12 +1124,12 @@ LONG smartcard_unpack_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -1147,12 +1147,12 @@ void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, HCa if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -1160,16 +1160,16 @@ void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, HCa if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwDisposition: %s (0x%08X)", + WLog_DBG(TAG, "dwDisposition: %s (0x%08"PRIX32")", SCardGetDispositionString(call->dwDisposition), call->dwDisposition); WLog_DBG(TAG, "}"); @@ -1190,14 +1190,14 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1207,14 +1207,14 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1222,8 +1222,8 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (count != call->cReaders) { - WLog_WARN(TAG, "GetStatusChangeA_Call unexpected reader count: Actual: %d, Expected: %d", - (int) count, call->cReaders); + WLog_WARN(TAG, "GetStatusChangeA_Call unexpected reader count: Actual: %"PRIu32", Expected: %"PRIu32"", + count, call->cReaders); return STATUS_INVALID_PARAMETER; } @@ -1243,8 +1243,8 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1262,8 +1262,8 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1273,8 +1273,8 @@ LONG smartcard_unpack_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < count) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1318,32 +1318,32 @@ void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, GetSt if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "dwTimeOut: 0x%08X cReaders: %d", + WLog_DBG(TAG, "dwTimeOut: 0x%08"PRIX32" cReaders: %"PRIu32"", call->dwTimeOut, call->cReaders); for (index = 0; index < call->cReaders; index++) { readerState = &call->rgReaderStates[index]; - WLog_DBG(TAG, "\t[%d]: szReader: %s cbAtr: %d", + WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", index, readerState->szReader, readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); - WLog_DBG(TAG, "\t[%d]: dwCurrentState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%d]: dwEventState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", index, szEventState, readerState->dwEventState); free(szCurrentState); @@ -1368,14 +1368,14 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1385,14 +1385,14 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1414,8 +1414,8 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1433,8 +1433,8 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1444,8 +1444,8 @@ LONG smartcard_unpack_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, wStr if (Stream_GetRemainingLength(s) < (count * 2)) { - WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeW_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1489,16 +1489,16 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, GetSt if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } - WLog_DBG(TAG, "dwTimeOut: 0x%08X cReaders: %d", + WLog_DBG(TAG, "dwTimeOut: 0x%08"PRIX32" cReaders: %"PRIu32"", call->dwTimeOut, call->cReaders); for (index = 0; index < call->cReaders; index++) @@ -1509,16 +1509,16 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, GetSt ConvertFromUnicode(CP_UTF8, 0, readerState->szReader, -1, &szReaderA, 0, NULL, NULL); - WLog_DBG(TAG, "\t[%d]: szReader: %s cbAtr: %d", + WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", index, szReaderA, readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); - WLog_DBG(TAG, "\t[%d]: dwCurrentState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%d]: dwEventState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", index, szEventState, readerState->dwEventState); free(szCurrentState); @@ -1565,10 +1565,10 @@ void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, GetSt WLog_DBG(TAG, "GetStatusChange%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "cReaders: %d", ret->cReaders); + WLog_DBG(TAG, "cReaders: %"PRIu32"", ret->cReaders); for (index = 0; index < ret->cReaders; index++) { @@ -1578,13 +1578,13 @@ void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, GetSt szEventState = SCardGetReaderStateString(rgReaderState->dwEventState); rgbAtr = winpr_BinToHexString((BYTE*) &(rgReaderState->rgbAtr), rgReaderState->cbAtr, FALSE); - WLog_DBG(TAG, "\t[%d]: dwCurrentState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", index, szCurrentState, rgReaderState->dwCurrentState); - WLog_DBG(TAG, "\t[%d]: dwEventState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", index, szEventState, rgReaderState->dwEventState); - WLog_DBG(TAG, "\t[%d]: cbAtr: %d rgbAtr: %s", + WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: %"PRIu32" rgbAtr: %s", index, rgReaderState->cbAtr, rgbAtr); free(szCurrentState); @@ -1601,20 +1601,20 @@ LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_ if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 8) { - WLog_WARN(TAG, "State_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "State_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1623,12 +1623,12 @@ LONG smartcard_unpack_state_call(SMARTCARD_DEVICE* smartcard, wStream* s, State_ if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -1645,7 +1645,7 @@ LONG smartcard_pack_state_return(SMARTCARD_DEVICE* smartcard, wStream* s, State_ Stream_Write(s, ret->rgAtr, ret->cbAtrLen); /* rgAtr */ if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cbAtrLen, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); return status; } @@ -1656,20 +1656,20 @@ LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Statu if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Status_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Status_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1679,12 +1679,12 @@ LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Statu if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -1702,12 +1702,12 @@ void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, Status_Call* call, if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -1715,16 +1715,16 @@ void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, Status_Call* call, if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "fmszReaderNamesIsNULL: %d cchReaderLen: %d cbAtrLen: %d", + WLog_DBG(TAG, "fmszReaderNamesIsNULL: %"PRId32" cchReaderLen: %"PRIu32" cbAtrLen: %"PRIu32"", call->fmszReaderNamesIsNULL, call->cchReaderLen, call->cbAtrLen); WLog_DBG(TAG, "}"); @@ -1754,7 +1754,7 @@ LONG smartcard_pack_status_return(SMARTCARD_DEVICE* smartcard, wStream* s, Statu Stream_Zero(s, ret->cBytes); if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cBytes, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); return status; } @@ -1807,20 +1807,20 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, Status_Return* r WLog_DBG(TAG, "Status%s_Return {", unicode ? "W" : "A"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwState: %s (0x%08X) dwProtocol: %s (0x%08X)", + WLog_DBG(TAG, "dwState: %s (0x%08"PRIX32") dwProtocol: %s (0x%08"PRIX32")", SCardGetCardStateString(ret->dwState), ret->dwState, SCardGetProtocolString(ret->dwProtocol), ret->dwProtocol); if (mszReaderNamesA) { - WLog_DBG(TAG, "cBytes: %d mszReaderNames: %s", + WLog_DBG(TAG, "cBytes: %"PRIu32" mszReaderNames: %s", ret->cBytes, mszReaderNamesA); } - WLog_DBG(TAG, "cbAtrLen: %d pbAtr: %s", ret->cbAtrLen, pbAtr); + WLog_DBG(TAG, "cbAtrLen: %"PRIu32" pbAtr: %s", ret->cbAtrLen, pbAtr); WLog_DBG(TAG, "}"); @@ -1834,20 +1834,20 @@ LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, G if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetAttrib_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetAttrib_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1857,12 +1857,12 @@ LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, G if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -1880,12 +1880,12 @@ void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -1893,16 +1893,16 @@ void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwAttrId: %s (0x%08X) fpbAttrIsNULL: %d cbAttrLen: 0x%08X", + WLog_DBG(TAG, "dwAttrId: %s (0x%08"PRIX32") fpbAttrIsNULL: %"PRId32" cbAttrLen: 0x%08"PRIX32"", SCardGetAttributeString(call->dwAttrId), call->dwAttrId, call->fpbAttrIsNULL, call->cbAttrLen); WLog_DBG(TAG, "}"); @@ -1927,7 +1927,7 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, G Stream_Write(s, ret->pbAttr, ret->cbAttrLen); /* pbAttr */ if ((status = smartcard_pack_write_size_align(smartcard, s, ret->cbAttrLen, 4))) - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld", status); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", status); return status; } @@ -1939,10 +1939,10 @@ void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, GetAttrib_Re WLog_DBG(TAG, "GetAttrib_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "dwAttrId: %s (0x%08X) cbAttrLen: 0x%08X", + WLog_DBG(TAG, "dwAttrId: %s (0x%08"PRIX32") cbAttrLen: 0x%08"PRIX32"", SCardGetAttributeString(dwAttrId), dwAttrId, ret->cbAttrLen); if (dwAttrId == SCARD_ATTR_VENDOR_NAME) @@ -1952,7 +1952,7 @@ void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, GetAttrib_Re else if (dwAttrId == SCARD_ATTR_CURRENT_PROTOCOL_TYPE) { UINT32 dwProtocolType = *((UINT32*) ret->pbAttr); - WLog_DBG(TAG, "dwProtocolType: %s (0x%04X)", + WLog_DBG(TAG, "dwProtocolType: %s (0x%08"PRIX32")", SCardGetProtocolString(dwProtocolType), dwProtocolType); } @@ -1968,20 +1968,20 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 20) { - WLog_WARN(TAG, "Control_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -1993,13 +1993,13 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } @@ -2007,8 +2007,8 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Control_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2016,8 +2016,8 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont if (Stream_GetRemainingLength(s) < length) { - WLog_WARN(TAG, "Control_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Control_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2050,12 +2050,12 @@ void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, Control_Call* cal if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -2063,16 +2063,16 @@ void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, Control_Call* cal if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } - WLog_DBG(TAG, "dwControlCode: 0x%08X cbInBufferSize: %d fpvOutBufferIsNULL: %d cbOutBufferSize: %d", + WLog_DBG(TAG, "dwControlCode: 0x%08"PRIX32" cbInBufferSize: %"PRIu32" fpvOutBufferIsNULL: %"PRId32" cbOutBufferSize: %"PRIu32"", call->dwControlCode, call->cbInBufferSize, call->fpvOutBufferIsNULL, call->cbOutBufferSize); if (call->pvInBuffer) @@ -2107,7 +2107,7 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Cont Stream_Write(s, ret->pvOutBuffer, ret->cbOutBufferSize); /* pvOutBuffer */ if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cbOutBufferSize, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"", error); return error; } } @@ -2122,10 +2122,10 @@ void smartcard_trace_control_return(SMARTCARD_DEVICE* smartcard, Control_Return* WLog_DBG(TAG, "Control_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); - WLog_DBG(TAG, "cbOutBufferSize: %d", ret->cbOutBufferSize); + WLog_DBG(TAG, "cbOutBufferSize: %"PRIu32"", ret->cbOutBufferSize); if (ret->pvOutBuffer) { @@ -2158,20 +2158,20 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 32) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), 32); + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: 32", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2186,27 +2186,27 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (ioSendPci.cbExtraBytes > 1024) { - WLog_WARN(TAG, "Transmit_Call ioSendPci.cbExtraBytes is out of bounds: %d (max: %d)", - (int) ioSendPci.cbExtraBytes, 1024); + WLog_WARN(TAG, "Transmit_Call ioSendPci.cbExtraBytes is out of bounds: %"PRIu32" (max: 1024)", + ioSendPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if (call->cbSendLength > 66560) { - WLog_WARN(TAG, "Transmit_Call cbSendLength is out of bounds: %d (max: %d)", - (int) ioSendPci.cbExtraBytes, 66560); + WLog_WARN(TAG, "Transmit_Call cbSendLength is out of bounds: %"PRIu32" (max: 66560)", + ioSendPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if ((status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_handle_ref failed with error %"PRId32"", status); return status; } @@ -2220,8 +2220,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %d (ioSendPci.pbExtraBytes)", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz" (ioSendPci.pbExtraBytes)", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2229,8 +2229,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (Stream_GetRemainingLength(s) < ioSendPci.cbExtraBytes) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d (ioSendPci.cbExtraBytes)", - (int) Stream_GetRemainingLength(s), (int) ioSendPci.cbExtraBytes); + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (ioSendPci.cbExtraBytes)", + Stream_GetRemainingLength(s), ioSendPci.cbExtraBytes); return STATUS_BUFFER_TOO_SMALL; } @@ -2270,8 +2270,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2279,15 +2279,15 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (length != call->cbSendLength) { - WLog_WARN(TAG, "Transmit_Call unexpected length: Actual: %d, Expected: %d (cbSendLength)", - (int) length, (int) call->cbSendLength); + WLog_WARN(TAG, "Transmit_Call unexpected length: Actual: %"PRIu32", Expected: %"PRIu32" (cbSendLength)", + length, call->cbSendLength); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cbSendLength) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d (cbSendLength)", - (int) Stream_GetRemainingLength(s), (int) call->cbSendLength); + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (cbSendLength)", + Stream_GetRemainingLength(s), call->cbSendLength); return STATUS_BUFFER_TOO_SMALL; } @@ -2308,8 +2308,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), 12); + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: 12", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2327,8 +2327,8 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra { if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "Transmit_Call is too short: %d (ioRecvPci.pbExtraBytes)", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "Transmit_Call is too short: %"PRIuz" (ioRecvPci.pbExtraBytes)", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2336,22 +2336,22 @@ LONG smartcard_unpack_transmit_call(SMARTCARD_DEVICE* smartcard, wStream* s, Tra if (ioRecvPci.cbExtraBytes > 1024) { - WLog_WARN(TAG, "Transmit_Call ioRecvPci.cbExtraBytes is out of bounds: %d (max: %d)", - (int) ioRecvPci.cbExtraBytes, 1024); + WLog_WARN(TAG, "Transmit_Call ioRecvPci.cbExtraBytes is out of bounds: %"PRIu32" (max: 1024)", + ioRecvPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if (length != ioRecvPci.cbExtraBytes) { - WLog_WARN(TAG, "Transmit_Call unexpected length: Actual: %d, Expected: %d (ioRecvPci.cbExtraBytes)", - (int) length, (int) ioRecvPci.cbExtraBytes); + WLog_WARN(TAG, "Transmit_Call unexpected length: Actual: %"PRIu32", Expected: %"PRIu32" (ioRecvPci.cbExtraBytes)", + length, ioRecvPci.cbExtraBytes); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < ioRecvPci.cbExtraBytes) { - WLog_WARN(TAG, "Transmit_Call is too short: Actual: %d, Expected: %d (ioRecvPci.cbExtraBytes)", - (int) Stream_GetRemainingLength(s), (int) ioRecvPci.cbExtraBytes); + WLog_WARN(TAG, "Transmit_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32" (ioRecvPci.cbExtraBytes)", + Stream_GetRemainingLength(s), ioRecvPci.cbExtraBytes); return STATUS_BUFFER_TOO_SMALL; } @@ -2406,12 +2406,12 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -2419,12 +2419,12 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c if (call->hCard.cbHandle > 4) { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hCard.cbHandle); } else { - WLog_DBG(TAG, "hCard: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hCard: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hCard.cbHandle); } @@ -2433,7 +2433,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c cbExtraBytes = (UINT32)(call->pioSendPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); pbExtraBytes = &((BYTE*) call->pioSendPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioSendPci: dwProtocol: %d cbExtraBytes: %d", + WLog_DBG(TAG, "pioSendPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", call->pioSendPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2448,7 +2448,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c WLog_DBG(TAG, "pioSendPci: null"); } - WLog_DBG(TAG, "cbSendLength: %d", call->cbSendLength); + WLog_DBG(TAG, "cbSendLength: %"PRIu32"", call->cbSendLength); if (call->pbSendBuffer) { @@ -2466,7 +2466,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c cbExtraBytes = (UINT32)(call->pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); pbExtraBytes = &((BYTE*) call->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioRecvPci: dwProtocol: %d cbExtraBytes: %d", + WLog_DBG(TAG, "pioRecvPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", call->pioRecvPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2481,7 +2481,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c WLog_DBG(TAG, "pioRecvPci: null"); } - WLog_DBG(TAG, "fpbRecvBufferIsNULL: %d cbRecvLength: %d", + WLog_DBG(TAG, "fpbRecvBufferIsNULL: %"PRId32" cbRecvLength: %"PRIu32"", call->fpbRecvBufferIsNULL, call->cbRecvLength); WLog_DBG(TAG, "}"); @@ -2528,7 +2528,7 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra Stream_Write(s, pbExtraBytes, cbExtraBytes); if ((error = smartcard_pack_write_size_align(smartcard, s, cbExtraBytes, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld!", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"!", error); return error; } } @@ -2546,7 +2546,7 @@ LONG smartcard_pack_transmit_return(SMARTCARD_DEVICE* smartcard, wStream* s, Tra Stream_Write(s, ret->pbRecvBuffer, ret->cbRecvLength); if ((error = smartcard_pack_write_size_align(smartcard, s, ret->cbRecvLength, 4))) { - WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %ld!", error); + WLog_ERR(TAG, "smartcard_pack_write_size_align failed with error %"PRId32"!", error); return error; } } @@ -2564,7 +2564,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Retur WLog_DBG(TAG, "Transmit_Return {"); - WLog_DBG(TAG, "ReturnCode: %s (0x%08X)", + WLog_DBG(TAG, "ReturnCode: %s (0x%08"PRIX32")", SCardGetErrorString(ret->ReturnCode), ret->ReturnCode); if (ret->pioRecvPci) @@ -2572,7 +2572,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Retur cbExtraBytes = (UINT32)(ret->pioRecvPci->cbPciLength - sizeof(SCARD_IO_REQUEST)); pbExtraBytes = &((BYTE*) ret->pioRecvPci)[sizeof(SCARD_IO_REQUEST)]; - WLog_DBG(TAG, "pioRecvPci: dwProtocol: %d cbExtraBytes: %d", + WLog_DBG(TAG, "pioRecvPci: dwProtocol: %"PRIu32" cbExtraBytes: %"PRIu32"", ret->pioRecvPci->dwProtocol, cbExtraBytes); if (cbExtraBytes) @@ -2587,7 +2587,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Retur WLog_DBG(TAG, "pioRecvPci: null"); } - WLog_DBG(TAG, "cbRecvLength: %d", ret->cbRecvLength); + WLog_DBG(TAG, "cbRecvLength: %"PRIu32"", ret->cbRecvLength); if (ret->pbRecvBuffer) { @@ -2619,14 +2619,14 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 16) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2637,21 +2637,21 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if ((status = smartcard_unpack_redir_scard_context_ref(smartcard, s, &(call->hContext)))) { - WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %ld", status); + WLog_ERR(TAG, "smartcard_unpack_redir_scard_context_ref failed with error %"PRId32"", status); return status; } if (Stream_GetRemainingLength(s) < 4) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } if ((rgAtrMasksNdrPtr && !call->cAtrs) || (!rgAtrMasksNdrPtr && call->cAtrs)) { - WLog_WARN(TAG, "LocateCardsByATRA_Call rgAtrMasksNdrPtr (0x%08X) and cAtrs (0x%08X) inconsistency", - (int) rgAtrMasksNdrPtr, (int) call->cAtrs); + WLog_WARN(TAG, "LocateCardsByATRA_Call rgAtrMasksNdrPtr (0x%08"PRIX32") and cAtrs (0x%08"PRIX32") inconsistency", + rgAtrMasksNdrPtr, call->cAtrs); return STATUS_INVALID_PARAMETER; } @@ -2661,15 +2661,15 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (count != call->cAtrs) { - WLog_WARN(TAG, "LocateCardsByATRA_Call NdrCount (0x%08X) and cAtrs (0x%08X) inconsistency", - (int) count, (int) call->cAtrs); + WLog_WARN(TAG, "LocateCardsByATRA_Call NdrCount (0x%08"PRIX32") and cAtrs (0x%08"PRIX32") inconsistency", + count, call->cAtrs); return STATUS_INVALID_PARAMETER; } if (Stream_GetRemainingLength(s) < call->cAtrs) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: Actual: %d, Expected: %d", - (int) Stream_GetRemainingLength(s), call->cAtrs); + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: Actual: %"PRIuz", Expected: %"PRIu32"", + Stream_GetRemainingLength(s), call->cAtrs); return STATUS_BUFFER_TOO_SMALL; } @@ -2692,8 +2692,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (count != call->cReaders) { - WLog_WARN(TAG, "GetStatusChangeA_Call unexpected reader count: Actual: %d, Expected: %d", - (int) count, call->cReaders); + WLog_WARN(TAG, "GetStatusChangeA_Call unexpected reader count: Actual: %"PRIu32", Expected: %"PRIu32"", + count, call->cReaders); return STATUS_INVALID_PARAMETER; } @@ -2713,8 +2713,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (Stream_GetRemainingLength(s) < 52) { - WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "LocateCardsByATRA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2732,8 +2732,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (Stream_GetRemainingLength(s) < 12) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2743,8 +2743,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, wS if (Stream_GetRemainingLength(s) < count) { - WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %d", - (int) Stream_GetRemainingLength(s)); + WLog_WARN(TAG, "GetStatusChangeA_Call is too short: %"PRIuz"", + Stream_GetRemainingLength(s)); return STATUS_BUFFER_TOO_SMALL; } @@ -2789,12 +2789,12 @@ void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, Loc if (call->hContext.cbContext > 4) { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], pb[4], pb[5], pb[6], pb[7], call->hContext.cbContext); } else { - WLog_DBG(TAG, "hContext: 0x%02X%02X%02X%02X (%d)", + WLog_DBG(TAG, "hContext: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8" (%"PRIu32")", pb[0], pb[1], pb[2], pb[3], call->hContext.cbContext); } @@ -2802,28 +2802,28 @@ void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, Loc { readerState = (LPSCARD_READERSTATEA) &call->rgReaderStates[index]; - WLog_DBG(TAG, "\t[%d]: szReader: %s cbAtr: %d", + WLog_DBG(TAG, "\t[%"PRIu32"]: szReader: %s cbAtr: %"PRIu32"", index, readerState->szReader, readerState->cbAtr); szCurrentState = SCardGetReaderStateString(readerState->dwCurrentState); szEventState = SCardGetReaderStateString(readerState->dwEventState); rgbAtr = winpr_BinToHexString((BYTE*) &(readerState->rgbAtr), readerState->cbAtr, FALSE); - WLog_DBG(TAG, "\t[%d]: dwCurrentState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwCurrentState: %s (0x%08"PRIX32")", index, szCurrentState, readerState->dwCurrentState); - WLog_DBG(TAG, "\t[%d]: dwEventState: %s (0x%08X)", + WLog_DBG(TAG, "\t[%"PRIu32"]: dwEventState: %s (0x%08"PRIX32")", index, szEventState, readerState->dwEventState); if (rgbAtr) { - WLog_DBG(TAG, "\t[%d]: cbAtr: %d rgbAtr: %s", + WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: %"PRIu32" rgbAtr: %s", index, readerState->cbAtr, rgbAtr); } else { - WLog_DBG(TAG, "\t[%d]: cbAtr: %d rgbAtr: %s", - index, 0, ""); + WLog_DBG(TAG, "\t[%"PRIu32"]: cbAtr: 0 rgbAtr: n/a", + index); } free(szCurrentState); diff --git a/channels/tsmf/client/alsa/tsmf_alsa.c b/channels/tsmf/client/alsa/tsmf_alsa.c index a5bc72750..02f3941a1 100644 --- a/channels/tsmf/client/alsa/tsmf_alsa.c +++ b/channels/tsmf/client/alsa/tsmf_alsa.c @@ -123,14 +123,14 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice *audio, snd_pcm_sw_params(alsa->out_handle, sw_params); snd_pcm_sw_params_free(sw_params); snd_pcm_prepare(alsa->out_handle); - DEBUG_TSMF("sample_rate %d channels %d bits_per_sample %d", + DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", sample_rate, channels, bits_per_sample); - DEBUG_TSMF("hardware buffer %d frames", (int)frames); + DEBUG_TSMF("hardware buffer %lu frames", frames); if((alsa->actual_rate != alsa->source_rate) || (alsa->actual_channels != alsa->source_channels)) { - DEBUG_TSMF("actual rate %d / channel %d is different " - "from source rate %d / channel %d, resampling required.", + DEBUG_TSMF("actual rate %"PRIu32" / channel %"PRIu32" is different " + "from source rate %"PRIu32" / channel %"PRIu32", resampling required.", alsa->actual_rate, alsa->actual_channels, alsa->source_rate, alsa->source_channels); } @@ -148,7 +148,7 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice *audio, BYTE *data, UINT32 data_size int rbytes_per_frame; int sbytes_per_frame; TSMFAlsaAudioDevice *alsa = (TSMFAlsaAudioDevice *) audio; - DEBUG_TSMF("data_size %d", data_size); + DEBUG_TSMF("data_size %"PRIu32"", data_size); if(alsa->out_handle) { sbytes_per_frame = alsa->source_channels * alsa->bytes_per_sample; @@ -164,7 +164,7 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice *audio, BYTE *data, UINT32 data_size alsa->source_channels, alsa->source_rate, data_size / sbytes_per_frame, alsa->actual_channels, alsa->actual_rate); frames = alsa->dsp_context->resampled_frames; - DEBUG_TSMF("resampled %d frames at %d to %d frames at %d", + DEBUG_TSMF("resampled %"PRIu32" frames at %"PRIu32" to %d frames at %"PRIu32"", data_size / sbytes_per_frame, alsa->source_rate, frames, alsa->actual_rate); data_size = frames * rbytes_per_frame; src = alsa->dsp_context->resampled_buffer; diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c index 7156e8faf..8b5eea5b2 100644 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c @@ -313,12 +313,12 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE *data, UI #endif if (len < 0) { - WLog_ERR(TAG, "data_size %d, avcodec_decode_video failed (%d)", data_size, len); + WLog_ERR(TAG, "data_size %"PRIu32", avcodec_decode_video failed (%d)", data_size, len); ret = FALSE; } else if (!decoded) { - WLog_ERR(TAG, "data_size %d, no frame is decoded.", data_size); + WLog_ERR(TAG, "data_size %"PRIu32", no frame is decoded.", data_size); ret = FALSE; } else @@ -362,11 +362,11 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE *data, UI BYTE *dst; int dst_offset; #if 0 - WLog_DBG(TAG, ("tsmf_ffmpeg_decode_audio: data_size %d", data_size)); + WLog_DBG(TAG, ("tsmf_ffmpeg_decode_audio: data_size %"PRIu32"", data_size)); int i; for(i = 0; i < data_size; i++) { - WLog_DBG(TAG, ("%02X ", data[i])); + WLog_DBG(TAG, ("%02"PRIX8"", data[i])); if (i % 16 == 15) WLog_DBG(TAG, ("\n")); } @@ -452,7 +452,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE *data, UI /* move the aligned decoded data to original place */ memmove(mdecoder->decoded_data, mdecoder->decoded_data + dst_offset, mdecoder->decoded_size); } - DEBUG_TSMF("data_size %d decoded_size %d", + DEBUG_TSMF("data_size %"PRIu32" decoded_size %"PRIu32"", data_size, mdecoder->decoded_size); return TRUE; } diff --git a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c index 1211e8dcb..4399a5169 100644 --- a/channels/tsmf/client/gstreamer/tsmf_gstreamer.c +++ b/channels/tsmf/client/gstreamer/tsmf_gstreamer.c @@ -104,14 +104,14 @@ static void tsmf_gstreamer_need_data(GstAppSrc *src, guint length, gpointer user { TSMFGstreamerDecoder* mdecoder = user_data; (void) mdecoder; - DEBUG_TSMF("%s length=%lu", get_type(mdecoder), length); + DEBUG_TSMF("%s length=%u", get_type(mdecoder), length); } static gboolean tsmf_gstreamer_seek_data(GstAppSrc *src, guint64 offset, gpointer user_data) { TSMFGstreamerDecoder* mdecoder = user_data; (void) mdecoder; - DEBUG_TSMF("%s offset=%llu", get_type(mdecoder), offset); + DEBUG_TSMF("%s offset=%"PRIu64"", get_type(mdecoder), offset); return TRUE; } @@ -127,7 +127,7 @@ static BOOL tsmf_gstreamer_change_volume(ITSMFDecoder* decoder, UINT32 newVolume return TRUE; mdecoder->gstMuted = (BOOL) muted; - DEBUG_TSMF("mute=[%d]", mdecoder->gstMuted); + DEBUG_TSMF("mute=[%"PRId32"]", mdecoder->gstMuted); mdecoder->gstVolume = (double) newVolume / (double) 10000; DEBUG_TSMF("gst_new_vol=[%f]", mdecoder->gstVolume); @@ -499,7 +499,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m if (media_type->ExtraDataSize > 0) { GstBuffer *buffer; - DEBUG_TSMF("Extra data available (%d)", media_type->ExtraDataSize); + DEBUG_TSMF("Extra data available (%"PRIu32")", media_type->ExtraDataSize); buffer = tsmf_get_buffer_from_data(media_type->ExtraData, media_type->ExtraDataSize); if (!buffer) @@ -511,7 +511,7 @@ static BOOL tsmf_gstreamer_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* m gst_caps_set_simple(mdecoder->gst_caps, "codec_data", GST_TYPE_BUFFER, buffer, NULL); } - DEBUG_TSMF("%p format '%s'", mdecoder, gst_caps_to_string(mdecoder->gst_caps)); + DEBUG_TSMF("%p format '%s'", (void*) mdecoder, gst_caps_to_string(mdecoder->gst_caps)); tsmf_platform_set_format(mdecoder); /* Create the pipeline... */ @@ -693,8 +693,8 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN * We don't expect to block here often, since the pipeline should * have more than enough buffering. */ - DEBUG_TSMF("%s. Start:(%lu) End:(%lu) Duration:(%d) Last Start:(%lu)", - get_type(mdecoder), start_time, end_time, (int)duration, + DEBUG_TSMF("%s. Start:(%"PRIu64") End:(%"PRIu64") Duration:(%"PRIu64") Last Start:(%"PRIu64")", + get_type(mdecoder), start_time, end_time, duration, mdecoder->last_sample_start_time); if (mdecoder->shutdown) @@ -722,7 +722,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN if (gst_buf == NULL) { - WLog_ERR(TAG, "tsmf_get_buffer_from_data(%p, %d) failed.", data, data_size); + WLog_ERR(TAG, "tsmf_get_buffer_from_data(%p, %"PRIu32") failed.", (void*) data, data_size); return FALSE; } @@ -752,7 +752,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN if (mdecoder->pipeline_start_time_valid) { - DEBUG_TSMF("%s start time %lu", get_type(mdecoder), start_time); + DEBUG_TSMF("%s start time %"PRIu64"", get_type(mdecoder), start_time); /* Adjusted the condition for a seek to be based on start time only * WMV1 and WMV2 files in particular have bad end time and duration values @@ -768,10 +768,10 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN /* If the start_time is valid and different from the previous start time by more than the seek tolerance, then we have a seek condition */ if (((start_time > maxTime) || (start_time < minTime)) && useTimestamps) { - DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%lu] > last_sample_start_time=[%lu] OR ", start_time, mdecoder->last_sample_start_time); - DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%lu] < last_sample_start_time=[%lu] with", start_time, mdecoder->last_sample_start_time); + DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%"PRIu64"] > last_sample_start_time=[%"PRIu64"] OR ", start_time, mdecoder->last_sample_start_time); + DEBUG_TSMF("tsmf_gstreamer_decodeEx: start_time=[%"PRIu64"] < last_sample_start_time=[%"PRIu64"] with", start_time, mdecoder->last_sample_start_time); DEBUG_TSMF("tsmf_gstreamer_decodeEX: a tolerance of more than [%lu] from the last sample", SEEK_TOLERANCE); - DEBUG_TSMF("tsmf_gstreamer_decodeEX: minTime=[%lu] maxTime=[%lu]", minTime, maxTime); + DEBUG_TSMF("tsmf_gstreamer_decodeEX: minTime=[%"PRIu64"] maxTime=[%"PRIu64"]", minTime, maxTime); mdecoder->seeking = TRUE; @@ -783,7 +783,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN } else { - DEBUG_TSMF("%s start time %lu", get_type(mdecoder), start_time); + DEBUG_TSMF("%s start time %"PRIu64"", get_type(mdecoder), start_time); /* Always set base/start time to 0. Will use seek offset to translate real buffer times * back to 0. This allows the video to be started from anywhere and the ability to handle seeks * without rebuilding the pipeline, etc. since that is costly @@ -834,7 +834,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder* decoder, const BYTE *data, UIN { DEBUG_TSMF("%s: state=%s", get_type(mdecoder), gst_element_state_get_name(GST_STATE(mdecoder->pipe))); - DEBUG_TSMF("%s Paused: %i Shutdown: %i Ready: %i", get_type(mdecoder), mdecoder->paused, mdecoder->shutdown, mdecoder->ready); + DEBUG_TSMF("%s Paused: %"PRIi32" Shutdown: %i Ready: %"PRIi32"", get_type(mdecoder), mdecoder->paused, mdecoder->shutdown, mdecoder->ready); if (!mdecoder->paused && !mdecoder->shutdown && mdecoder->ready) tsmf_gstreamer_pipeline_set_state(mdecoder, GST_STATE_PLAYING); } diff --git a/channels/tsmf/client/oss/tsmf_oss.c b/channels/tsmf/client/oss/tsmf_oss.c index 784ea0ca8..305f0ce46 100644 --- a/channels/tsmf/client/oss/tsmf_oss.c +++ b/channels/tsmf/client/oss/tsmf_oss.c @@ -160,7 +160,7 @@ static BOOL tsmf_oss_set_format(ITSMFAudioDevice* audio, UINT32 sample_rate, UIN if (ioctl(oss->pcm_handle, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) OSS_LOG_ERR("SNDCTL_DSP_SETFRAGMENT failed", errno); - DEBUG_TSMF("sample_rate %d channels %d bits_per_sample %d", + DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", sample_rate, channels, bits_per_sample); return TRUE; } @@ -170,7 +170,7 @@ static BOOL tsmf_oss_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size) int status; UINT32 offset; TSMFOssAudioDevice* oss = (TSMFOssAudioDevice*)audio; - DEBUG_TSMF("tsmf_oss_play: data_size %d", data_size); + DEBUG_TSMF("tsmf_oss_play: data_size %"PRIu32"", data_size); if (oss == NULL || oss->pcm_handle == -1) return FALSE; diff --git a/channels/tsmf/client/pulse/tsmf_pulse.c b/channels/tsmf/client/pulse/tsmf_pulse.c index 5a5a0ef6d..a097e326c 100644 --- a/channels/tsmf/client/pulse/tsmf_pulse.c +++ b/channels/tsmf/client/pulse/tsmf_pulse.c @@ -56,11 +56,11 @@ static void tsmf_pulse_context_state_callback(pa_context *context, void *userdat break; case PA_CONTEXT_FAILED: case PA_CONTEXT_TERMINATED: - DEBUG_TSMF("state %d", (int)state); + DEBUG_TSMF("state %d", state); pa_threaded_mainloop_signal(pulse->mainloop, 0); break; default: - DEBUG_TSMF("state %d", (int)state); + DEBUG_TSMF("state %d", state); break; } } @@ -169,11 +169,11 @@ static void tsmf_pulse_stream_state_callback(pa_stream *stream, void *userdata) break; case PA_STREAM_FAILED: case PA_STREAM_TERMINATED: - DEBUG_TSMF("state %d", (int)state); + DEBUG_TSMF("state %d", state); pa_threaded_mainloop_signal(pulse->mainloop, 0); break; default: - DEBUG_TSMF("state %d", (int)state); + DEBUG_TSMF("state %d", state); break; } } @@ -181,7 +181,7 @@ static void tsmf_pulse_stream_state_callback(pa_stream *stream, void *userdata) static void tsmf_pulse_stream_request_callback(pa_stream *stream, size_t length, void *userdata) { TSMFPulseAudioDevice *pulse = (TSMFPulseAudioDevice *) userdata; - DEBUG_TSMF("%d", (int) length); + DEBUG_TSMF("%"PRIdz"", length); pa_threaded_mainloop_signal(pulse->mainloop, 0); } @@ -267,7 +267,7 @@ static BOOL tsmf_pulse_set_format(ITSMFAudioDevice *audio, UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample) { TSMFPulseAudioDevice *pulse = (TSMFPulseAudioDevice *) audio; - DEBUG_TSMF("sample_rate %d channels %d bits_per_sample %d", + DEBUG_TSMF("sample_rate %"PRIu32" channels %"PRIu32" bits_per_sample %"PRIu32"", sample_rate, channels, bits_per_sample); pulse->sample_spec.rate = sample_rate; pulse->sample_spec.channels = channels; @@ -281,7 +281,7 @@ static BOOL tsmf_pulse_play(ITSMFAudioDevice *audio, BYTE *data, UINT32 data_siz BYTE *src; int len; int ret; - DEBUG_TSMF("data_size %d", data_size); + DEBUG_TSMF("data_size %"PRIu32"", data_size); if(pulse->stream) { pa_threaded_mainloop_lock(pulse->mainloop); diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index b5e5a42cd..0a4f41d83 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -304,7 +304,7 @@ static void tsmf_print_guid(const BYTE* guid) #ifdef WITH_DEBUG_TSMF char guidString[37]; - snprintf(guidString, sizeof(guidString), "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", + snprintf(guidString, sizeof(guidString), "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"-%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6], @@ -600,7 +600,7 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, wStream* s) if (Stream_GetRemainingLength(s) < 4) return FALSE; Stream_Read_UINT32(s, cbFormat); - DEBUG_TSMF("cbFormat %d", cbFormat); + DEBUG_TSMF("cbFormat %"PRIu32"", cbFormat); #ifdef WITH_DEBUG_TSMF winpr_HexDump(TAG, WLOG_DEBUG, Stream_Pointer(s), cbFormat); #endif diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index c118e3f73..f0f38516c 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -52,7 +52,7 @@ UINT tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman) return ERROR_INVALID_DATA; Stream_Read_UINT32(ifman->input, CapabilityValue); - DEBUG_TSMF("server CapabilityValue %d", CapabilityValue); + DEBUG_TSMF("server CapabilityValue %"PRIu32"", CapabilityValue); if (!Stream_EnsureRemainingCapacity(ifman->output, 8)) return ERROR_INVALID_DATA; @@ -106,19 +106,19 @@ UINT tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) return ERROR_INVALID_DATA; Stream_Read_UINT32(ifman->output, v); - DEBUG_TSMF("server protocol version %d", v); + DEBUG_TSMF("server protocol version %"PRIu32"", v); break; case 2: /* Supported platform */ if (Stream_GetRemainingLength(ifman->output) < 4) return ERROR_INVALID_DATA; Stream_Peek_UINT32(ifman->output, v); - DEBUG_TSMF("server supported platform %d", v); + DEBUG_TSMF("server supported platform %"PRIu32"", v); /* Claim that we support both MF and DShow platforms. */ Stream_Write_UINT32(ifman->output, MMREDIR_CAPABILITY_PLATFORM_MF | MMREDIR_CAPABILITY_PLATFORM_DSHOW); break; default: - WLog_ERR(TAG, "skipping unknown capability type %d", CapabilityType); + WLog_ERR(TAG, "skipping unknown capability type %"PRIu32"", CapabilityType); break; } Stream_SetPosition(ifman->output, pos + cbCapabilityLength); @@ -148,7 +148,7 @@ UINT tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) Stream_Seek_UINT32(ifman->input); /* NoRolloverFlags (4 bytes) */ Stream_Read_UINT32(ifman->input, numMediaType); - DEBUG_TSMF("PlatformCookie %d numMediaType %d", PlatformCookie, numMediaType); + DEBUG_TSMF("PlatformCookie %"PRIu32" numMediaType %"PRIu32"", PlatformCookie, numMediaType); if (!tsmf_codec_check_media_type(ifman->decoder_name, ifman->input)) FormatSupported = 0; @@ -414,9 +414,9 @@ UINT tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman) Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, newVolume); - DEBUG_TSMF("on stream volume: new volume=[%d]", newVolume); + DEBUG_TSMF("on stream volume: new volume=[%"PRIu32"]", newVolume); Stream_Read_UINT32(ifman->input, muted); - DEBUG_TSMF("on stream volume: muted=[%d]", muted); + DEBUG_TSMF("on stream volume: muted=[%"PRIu32"]", muted); if (!tsmf_presentation_volume_changed(presentation, newVolume, muted)) return ERROR_INVALID_OPERATION; @@ -447,9 +447,9 @@ UINT tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman) UINT32 changedChannel; Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, channelVolume); - DEBUG_TSMF("on channel volume: channel volume=[%d]", channelVolume); + DEBUG_TSMF("on channel volume: channel volume=[%"PRIu32"]", channelVolume); Stream_Read_UINT32(ifman->input, changedChannel); - DEBUG_TSMF("on stream volume: changed channel=[%d]", changedChannel); + DEBUG_TSMF("on stream volume: changed channel=[%"PRIu32"]", changedChannel); } ifman->output_pending = TRUE; @@ -508,7 +508,7 @@ UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) Stream_SetPosition(ifman->input, pos + numGeometryInfo); Stream_Read_UINT32(ifman->input, cbVisibleRect); num_rects = cbVisibleRect / 16; - DEBUG_TSMF("numGeometryInfo %d Width %d Height %d Left %d Top %d cbVisibleRect %d num_rects %d", + DEBUG_TSMF("numGeometryInfo %"PRIu32" Width %"PRIu32" Height %"PRIu32" Left %"PRIu32" Top %"PRIu32" cbVisibleRect %"PRIu32" num_rects %d", numGeometryInfo, Width, Height, Left, Top, cbVisibleRect, num_rects); if (num_rects > 0) @@ -527,7 +527,7 @@ UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) Stream_Seek_UINT16(ifman->input); rects[i].width -= rects[i].x; rects[i].height -= rects[i].y; - DEBUG_TSMF("rect %d: %d %d %d %d", i, + DEBUG_TSMF("rect %d: %"PRId16" %"PRId16" %"PRId16" %"PRId16"", i, rects[i].x, rects[i].y, rects[i].width, rects[i].height); } } @@ -597,10 +597,10 @@ UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) if (Stream_GetRemainingLength(ifman->input) < cbData) return ERROR_INVALID_DATA; - DEBUG_TSMF("MessageId %d StreamId %d SampleStartTime %lu SampleEndTime %lu " - "ThrottleDuration %d SampleExtensions %d cbData %d", + DEBUG_TSMF("MessageId %"PRIu32" StreamId %"PRIu32" SampleStartTime %"PRIu64" SampleEndTime %"PRIu64" " + "ThrottleDuration %"PRIu64" SampleExtensions %"PRIu32" cbData %"PRIu32"", ifman->message_id, StreamId, SampleStartTime, SampleEndTime, - (int)ThrottleDuration, SampleExtensions, cbData); + ThrottleDuration, SampleExtensions, cbData); presentation = tsmf_presentation_find_by_id(ifman->presentation_id); @@ -628,7 +628,7 @@ UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) if ((error = tsmf_presentation_sync(presentation))) { - WLog_ERR(TAG, "tsmf_presentation_sync failed with error %u", error); + WLog_ERR(TAG, "tsmf_presentation_sync failed with error %"PRIu32"", error); return error; } ifman->output_pending = TRUE; @@ -653,7 +653,7 @@ UINT tsmf_ifman_on_flush(TSMF_IFMAN* ifman) Stream_Seek(ifman->input, 16); Stream_Read_UINT32(ifman->input, StreamId); - DEBUG_TSMF("StreamId %d", StreamId); + DEBUG_TSMF("StreamId %"PRIu32"", StreamId); presentation = tsmf_presentation_find_by_id(ifman->presentation_id); if (!presentation) @@ -706,7 +706,7 @@ UINT tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman) tsmf_stream_end(stream, ifman->message_id, ifman->channel_callback); } - DEBUG_TSMF("StreamId %d", StreamId); + DEBUG_TSMF("StreamId %"PRIu32"", StreamId); ifman->output_pending = TRUE; diff --git a/channels/tsmf/client/tsmf_main.c b/channels/tsmf/client/tsmf_main.c index 3a04afb02..27ccf1005 100644 --- a/channels/tsmf/client/tsmf_main.c +++ b/channels/tsmf/client/tsmf_main.c @@ -59,7 +59,7 @@ BOOL tsmf_send_eos_response(IWTSVirtualChannelCallback* pChannelCallback, UINT32 Stream_Write_UINT32(s, callback->stream_id); /* StreamId */ Stream_Write_UINT32(s, TSMM_CLIENT_EVENT_ENDOFSTREAM); /* EventId */ Stream_Write_UINT32(s, 0); /* cbData */ - DEBUG_TSMF("EOS response size %i", Stream_GetPosition(s)); + DEBUG_TSMF("EOS response size %"PRIuz"", Stream_GetPosition(s)); status = callback->channel->Write(callback->channel, Stream_GetPosition(s), Stream_Buffer(s), NULL); if (status) @@ -90,13 +90,13 @@ BOOL tsmf_playback_ack(IWTSVirtualChannelCallback *pChannelCallback, Stream_Write_UINT64(s, duration); /* DataDuration */ Stream_Write_UINT64(s, data_size); /* cbData */ - DEBUG_TSMF("ACK response size %d", (int) Stream_GetPosition(s)); + DEBUG_TSMF("ACK response size %"PRIuz"", Stream_GetPosition(s)); if (!callback || !callback->channel || !callback->channel->Write) { - WLog_ERR(TAG, "callback=%p, channel=%p, write=%p", callback, - callback ? callback->channel : NULL, - (callback && callback->channel) ? callback->channel->Write : NULL); + WLog_ERR(TAG, "callback=%p, channel=%p, write=%p", (void*) callback, + (void*) (callback ? callback->channel : NULL), + (void*) (callback && callback->channel ? callback->channel->Write : NULL)); } else { @@ -135,7 +135,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, /* 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */ if (cbSize < 12) { - WLog_ERR(TAG, "invalid size. cbSize=%d", cbSize); + WLog_ERR(TAG, "invalid size. cbSize=%"PRIu32"", cbSize); return ERROR_INVALID_DATA; } @@ -148,7 +148,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, Stream_Read_UINT32(input, MessageId); /* MessageId (4 bytes) */ Stream_Read_UINT32(input, FunctionId); /* FunctionId (4 bytes) */ - DEBUG_TSMF("cbSize=%d InterfaceId=0x%X MessageId=0x%X FunctionId=0x%X", + DEBUG_TSMF("cbSize=%"PRIu32" InterfaceId=0x%"PRIX32" MessageId=0x%"PRIX32" FunctionId=0x%"PRIX32"", cbSize, InterfaceId, MessageId, FunctionId); ZeroMemory(&ifman, sizeof(TSMF_IFMAN)); @@ -165,7 +165,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, ifman.output_pending = FALSE; ifman.output_interface_id = InterfaceId; - //fprintf(stderr, "InterfaceId: 0x%04X MessageId: 0x%04X FunctionId: 0x%04X\n", InterfaceId, MessageId, FunctionId); + //fprintf(stderr, "InterfaceId: 0x%08"PRIX32" MessageId: 0x%08"PRIX32" FunctionId: 0x%08"PRIX32"\n", InterfaceId, MessageId, FunctionId); switch (InterfaceId) { @@ -196,7 +196,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, CopyMemory(callback->presentation_id, Stream_Pointer(input), GUID_SIZE); Stream_Seek(input, GUID_SIZE); Stream_Read_UINT32(input, callback->stream_id); - DEBUG_TSMF("SET_CHANNEL_PARAMS StreamId=%d", callback->stream_id); + DEBUG_TSMF("SET_CHANNEL_PARAMS StreamId=%"PRIu32"", callback->stream_id); ifman.output_pending = TRUE; processed = TRUE; break; @@ -305,7 +305,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (error) { - WLog_ERR(TAG, "ifman data received processing error %d", error); + WLog_ERR(TAG, "ifman data received processing error %"PRIu32"", error); } if (!processed) @@ -327,7 +327,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (!processed) { - WLog_ERR(TAG, "Unknown InterfaceId: 0x%04X MessageId: 0x%04X FunctionId: 0x%04X\n", InterfaceId, MessageId, FunctionId); + WLog_ERR(TAG, "Unknown InterfaceId: 0x%08"PRIX32" MessageId: 0x%08"PRIX32" FunctionId: 0x%08"PRIX32"\n", InterfaceId, MessageId, FunctionId); /* When a request is not implemented we return empty response indicating error */ } @@ -346,7 +346,7 @@ static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, if (error) { - WLog_ERR(TAG, "response error %d", error); + WLog_ERR(TAG, "response error %"PRIu32"", error); } } diff --git a/channels/tsmf/client/tsmf_media.c b/channels/tsmf/client/tsmf_media.c index 7c53defa7..4e5483e5d 100644 --- a/channels/tsmf/client/tsmf_media.c +++ b/channels/tsmf/client/tsmf_media.c @@ -386,7 +386,7 @@ static char* guid_to_string(const BYTE* guid, char* str, size_t len) return NULL; for (i = 0; i < GUID_SIZE && len > 2 * i; i++) - sprintf_s(str + (2 * i), len - 2 * i, "%02X", guid[i]); + sprintf_s(str + (2 * i), len - 2 * i, "%02"PRIX8"", guid[i]); return str; } @@ -430,8 +430,8 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) sample->channel_callback; TsmfClientContext* tsmf = (TsmfClientContext*) callback->plugin->pInterface; - DEBUG_TSMF("MessageId %d EndTime %d data_size %d consumed.", - sample->sample_id, (int) sample->end_time, sample->data_size); + DEBUG_TSMF("MessageId %"PRIu32" EndTime %"PRIu64" data_size %"PRIu32" consumed.", + sample->sample_id, sample->end_time, sample->data_size); if (sample->data) { @@ -467,7 +467,7 @@ static BOOL tsmf_sample_playback_video(TSMF_SAMPLE* sample) sprintf_s(buf, sizeof(buf), "/tmp/FreeRDP_Frame_%d.ppm", frame_id); fp = fopen(buf, "wb"); fwrite("P5\n", 1, 3, fp); - sprintf_s(buf, sizeof(buf), "%d %d\n", sample->stream->width, + sprintf_s(buf, sizeof(buf), "%"PRIu32" %"PRIu32"\n", sample->stream->width, sample->stream->height); fwrite(buf, 1, strlen(buf), fp); fwrite("255\n", 1, 4, fp); @@ -496,8 +496,8 @@ static BOOL tsmf_sample_playback_audio(TSMF_SAMPLE* sample) UINT64 latency = 0; TSMF_STREAM* stream = sample->stream; BOOL ret; - DEBUG_TSMF("MessageId %d EndTime %d consumed.", - sample->sample_id, (int)sample->end_time); + DEBUG_TSMF("MessageId %"PRIu32" EndTime %"PRIu64" consumed.", + sample->sample_id, sample->end_time); if (stream->audio && sample->data) { @@ -638,7 +638,7 @@ static BOOL tsmf_sample_playback(TSMF_SAMPLE* sample) if (ret && (width != stream->width || height != stream->height)) { - DEBUG_TSMF("video dimension changed to %d x %d", width, height); + DEBUG_TSMF("video dimension changed to %"PRIu32" x %"PRIu32"", width, height); stream->width = width; stream->height = height; } @@ -717,7 +717,7 @@ static void* tsmf_stream_ack_func(void* arg) HANDLE hdl[2]; TSMF_STREAM* stream = (TSMF_STREAM*) arg; UINT error = CHANNEL_RC_OK; - DEBUG_TSMF("in %d", stream->stream_id); + DEBUG_TSMF("in %"PRIu32"", stream->stream_id); hdl[0] = stream->stopEvent; hdl[1] = Queue_Event(stream->sample_ack_list); @@ -729,7 +729,7 @@ static void* tsmf_stream_ack_func(void* arg) if (ev == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -792,7 +792,7 @@ static void* tsmf_stream_ack_func(void* arg) setChannelError(stream->rdpcontext, error, "tsmf_stream_ack_func reported an error"); - DEBUG_TSMF("out %d", stream->stream_id); + DEBUG_TSMF("out %"PRIu32"", stream->stream_id); ExitThread(0); return NULL; } @@ -805,7 +805,7 @@ static void* tsmf_stream_playback_func(void* arg) TSMF_PRESENTATION* presentation = stream->presentation; UINT error = CHANNEL_RC_OK; DWORD status; - DEBUG_TSMF("in %d", stream->stream_id); + DEBUG_TSMF("in %"PRIu32"", stream->stream_id); if (stream->major_type == TSMF_MAJOR_TYPE_AUDIO && stream->sample_rate && stream->channels && stream->bits_per_sample) @@ -839,7 +839,7 @@ static void* tsmf_stream_playback_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %u!", error); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", error); break; } @@ -848,7 +848,7 @@ static void* tsmf_stream_playback_func(void* arg) if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); break; } @@ -882,7 +882,7 @@ static void* tsmf_stream_playback_func(void* arg) setChannelError(stream->rdpcontext, error, "tsmf_stream_playback_func reported an error"); - DEBUG_TSMF("out %d", stream->stream_id); + DEBUG_TSMF("out %"PRIu32"", stream->stream_id); ExitThread(0); return NULL; } @@ -1056,7 +1056,7 @@ UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation) if (WaitForSingleObject(stream->ready, 500) == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %u!", error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return error; } } @@ -1188,7 +1188,7 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id, if (stream) { - WLog_ERR(TAG, "duplicated stream id %d!", stream_id); + WLog_ERR(TAG, "duplicated stream id %"PRIu32"!", stream_id); return NULL; } @@ -1252,13 +1252,13 @@ error_add: SetEvent(stream->stopEvent); if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED) - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); error_ack_thread: SetEvent(stream->stopEvent); if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED) - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); error_play_thread: Queue_Free(stream->sample_ack_list); @@ -1323,7 +1323,7 @@ BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s) if (mediatype.MajorType == TSMF_MAJOR_TYPE_VIDEO) { - DEBUG_TSMF("video width %d height %d bit_rate %d frame_rate %f codec_data %d", + DEBUG_TSMF("video width %"PRIu32" height %"PRIu32" bit_rate %"PRIu32" frame_rate %f codec_data %"PRIu32"", mediatype.Width, mediatype.Height, mediatype.BitRate, (double) mediatype.SamplesPerSecond.Numerator / (double) mediatype.SamplesPerSecond.Denominator, @@ -1333,7 +1333,7 @@ BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s) } else if (mediatype.MajorType == TSMF_MAJOR_TYPE_AUDIO) { - DEBUG_TSMF("audio channel %d sample_rate %d bits_per_sample %d codec_data %d", + DEBUG_TSMF("audio channel %"PRIu32" sample_rate %"PRIu32" bits_per_sample %"PRIu32" codec_data %"PRIu32"", mediatype.Channels, mediatype.SamplesPerSecond.Numerator, mediatype.BitsPerSample, mediatype.ExtraDataSize); @@ -1392,7 +1392,7 @@ void _tsmf_stream_free(TSMF_STREAM* stream) { if (WaitForSingleObject(stream->play_thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); return; } @@ -1404,7 +1404,7 @@ void _tsmf_stream_free(TSMF_STREAM* stream) { if (WaitForSingleObject(stream->ack_thread, INFINITE) == WAIT_FAILED) { - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) GetLastError()); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", GetLastError()); return; } diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index 765b36068..3c0c03499 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -165,7 +165,7 @@ static int urbdrc_process_cancel_request(BYTE* data, UINT32 data_sizem, IUDEVMAN data_read_UINT32(data + 0, CancelId); /** RequestId */ - WLog_DBG(TAG, "urbdrc_process_cancel_request: id 0x%x", CancelId); + WLog_DBG(TAG, "urbdrc_process_cancel_request: id 0x%"PRIx32"", CancelId); pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice); @@ -192,7 +192,7 @@ static int urbdrc_process_retract_device_request(BYTE* data, UINT32 data_sizem, break; default: - WLog_DBG(TAG, "urbdrc_process_retract_device_request: Unknown Reason %d", Reason); + WLog_DBG(TAG, "urbdrc_process_retract_device_request: Unknown Reason %"PRIu32"", Reason); return -1; break; } @@ -261,7 +261,7 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da OutputBufferSize = 4; } - WLog_DBG(TAG, "PORT STATUS(fake!):0x%02x%02x%02x%02x", + WLog_DBG(TAG, "PORT STATUS(fake!):0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"", OutputBuffer[3], OutputBuffer[2], OutputBuffer[1], OutputBuffer[0]); } @@ -278,7 +278,7 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da break; default: - WLog_DBG(TAG, "urbdrc_process_io_control: unknown IoControlCode 0x%X", IoControlCode); + WLog_DBG(TAG, "urbdrc_process_io_control: unknown IoControlCode 0x%"PRIX32"", IoControlCode); zfree(OutputBuffer); return ERROR_INVALID_OPERATION; break; @@ -325,7 +325,7 @@ static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, data_read_UINT32(data + 0, IoControlCode); - WLog_DBG(TAG, "urbdrc_process_internal_io_control:0x%x", IoControlCode); + WLog_DBG(TAG, "urbdrc_process_internal_io_control:0x%"PRIx32"", IoControlCode); data_read_UINT32(data + 4, InputBufferSize); data_read_UINT32(data + 8, OutputBufferSize); @@ -870,12 +870,14 @@ static int urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, break; } - WLog_DBG(TAG, "urb_isoch_transfer: EndpointAddress: 0x%x, " - "TransferFlags: 0x%x, " "StartFrame: 0x%x, " - "NumberOfPackets: 0x%x, " "OutputBufferSize: 0x%x " - "RequestId: 0x%x", - EndpointAddress, TransferFlags, StartFrame, - NumberOfPackets, OutputBufferSize, RequestId); + WLog_DBG(TAG, "urb_isoch_transfer: EndpointAddress: 0x%"PRIx32", " + "TransferFlags: 0x%"PRIx32", " + "StartFrame: 0x%"PRIx32", " + "NumberOfPackets: 0x%"PRIx32", " + "OutputBufferSize: 0x%"PRIx32" " + "RequestId: 0x%"PRIx32"", + EndpointAddress, TransferFlags, StartFrame, + NumberOfPackets, OutputBufferSize, RequestId); #if ISOCH_FIFO ISOCH_CALLBACK_QUEUE * isoch_queue = NULL; @@ -1203,10 +1205,10 @@ static int urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callbac bmRequestType |= 0x80; WLog_DBG(TAG, "urb_control_vendor_or_class_request: " - "RequestId 0x%x TransferFlags: 0x%x ReqTypeReservedBits: 0x%x " - "Request:0x%x Value: 0x%x Index: 0x%x OutputBufferSize: 0x%x bmRequestType: 0x%x!!", - RequestId, TransferFlags, ReqTypeReservedBits, Request, Value, - Index, OutputBufferSize, bmRequestType); + "RequestId 0x%"PRIx32" TransferFlags: 0x%"PRIx32" ReqTypeReservedBits: 0x%"PRIx8" " + "Request:0x%"PRIx8" Value: 0x%"PRIx16" Index: 0x%"PRIx16" OutputBufferSize: 0x%"PRIx32" bmRequestType: 0x%"PRIx8"!!", + RequestId, TransferFlags, ReqTypeReservedBits, Request, Value, + Index, OutputBufferSize, bmRequestType); ret = pdev->control_transfer( pdev, RequestId, 0, 0, bmRequestType, @@ -1308,11 +1310,12 @@ static int urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback, break; } - WLog_DBG(TAG, "Ms descriptor arg: Recipient:0x%x, " - "InterfaceNumber:0x%x, Ms_PageIndex:0x%x, " - "Ms_featureDescIndex:0x%x, OutputBufferSize:0x%x", - Recipient, InterfaceNumber, Ms_PageIndex, - Ms_featureDescIndex, OutputBufferSize); + WLog_DBG(TAG, "Ms descriptor arg: Recipient:0x%"PRIx8", " + "InterfaceNumber:0x%"PRIx8", Ms_PageIndex:0x%"PRIx8", " + "Ms_featureDescIndex:0x%"PRIx16", OutputBufferSize:0x%"PRIx32"", + Recipient, InterfaceNumber, Ms_PageIndex, + Ms_featureDescIndex, OutputBufferSize); + /** get ms string */ ret = pdev->os_feature_descriptor_request( pdev, RequestId, Recipient, @@ -1390,7 +1393,7 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, switch (action){ case PIPE_CANCEL: - WLog_DBG(TAG, "urb_pipe_request: PIPE_CANCEL 0x%x ", EndpointAddress); + WLog_DBG(TAG, "urb_pipe_request: PIPE_CANCEL 0x%"PRIx32"", EndpointAddress); ret = pdev->control_pipe_request( pdev, RequestId, EndpointAddress, @@ -1404,7 +1407,7 @@ static int urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data, break; case PIPE_RESET: - WLog_DBG(TAG, "urb_pipe_request: PIPE_RESET ep 0x%x ", EndpointAddress); + WLog_DBG(TAG, "urb_pipe_request: PIPE_RESET ep 0x%"PRIx32"", EndpointAddress); ret = pdev->control_pipe_request( pdev, RequestId, EndpointAddress, @@ -1722,7 +1725,7 @@ static int urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE bmRequest = 0x01; /* REQUEST_CLEAR_FEATURE */ break; default: - WLog_ERR(TAG, "urb_control_feature_request: Error Command %x", command); + WLog_ERR(TAG, "urb_control_feature_request: Error Command 0x%02"PRIx8"", command); zfree(out_data); return -1; } @@ -2294,7 +2297,7 @@ static int urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK * callback, B URB_CONTROL_TRANSFER_EXTERNAL); break; default: - WLog_DBG(TAG, "URB_Func: %x is not found!", URB_Function); + WLog_DBG(TAG, "URB_Func: %"PRIx16" is not found!", URB_Function); break; } @@ -2336,7 +2339,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) { case CANCEL_REQUEST: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>CANCEL_REQUEST<<0x%X", FunctionId); + " >>CANCEL_REQUEST<<0x%"PRIX32"", FunctionId); error = urbdrc_process_cancel_request( pBuffer + 8, cbSize - 8, @@ -2345,7 +2348,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case REGISTER_REQUEST_CALLBACK: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>REGISTER_REQUEST_CALLBACK<<0x%X", FunctionId); + " >>REGISTER_REQUEST_CALLBACK<<0x%"PRIX32"", FunctionId); error = urbdrc_process_register_request_callback( callback, pBuffer + 8, @@ -2355,7 +2358,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case IO_CONTROL: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>IO_CONTROL<<0x%X", FunctionId); + " >>IO_CONTROL<<0x%"PRIX32"", FunctionId); error = urbdrc_process_io_control( callback, pBuffer + 8, @@ -2365,7 +2368,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case INTERNAL_IO_CONTROL: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>INTERNAL_IO_CONTROL<<0x%X", FunctionId); + " >>INTERNAL_IO_CONTROL<<0x%"PRIX32"", FunctionId); error = urbdrc_process_internal_io_control( callback, pBuffer + 8, @@ -2375,7 +2378,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case QUERY_DEVICE_TEXT: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>QUERY_DEVICE_TEXT<<0x%X", FunctionId); + " >>QUERY_DEVICE_TEXT<<0x%"PRIX32"", FunctionId); error = urbdrc_process_query_device_text( callback, pBuffer + 8, @@ -2386,7 +2389,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case TRANSFER_IN_REQUEST: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>TRANSFER_IN_REQUEST<<0x%X", FunctionId); + " >>TRANSFER_IN_REQUEST<<0x%"PRIX32"", FunctionId); error = urbdrc_process_transfer_request( callback, pBuffer + 8, @@ -2398,7 +2401,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case TRANSFER_OUT_REQUEST: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>TRANSFER_OUT_REQUEST<<0x%X", FunctionId); + " >>TRANSFER_OUT_REQUEST<<0x%"PRIX32"", FunctionId); error = urbdrc_process_transfer_request( callback, pBuffer + 8, @@ -2410,7 +2413,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; case RETRACT_DEVICE: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " >>RETRACT_DEVICE<<0x%X", FunctionId); + " >>RETRACT_DEVICE<<0x%"PRIX32"", FunctionId); error = urbdrc_process_retract_device_request( pBuffer + 8, cbSize - 8, @@ -2419,7 +2422,7 @@ void* urbdrc_process_udev_data_transfer(void* arg) break; default: WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:" - " unknown FunctionId 0x%X", FunctionId); + " unknown FunctionId 0x%"PRIX32"", FunctionId); error = -1; break; } diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index b7d17b2e5..c2f1c11e8 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -203,7 +203,7 @@ static void func_iso_callback(struct libusb_transfer *transfer) } else { - //WLog_ERR(TAG, "actual length %d ", act_len); + //WLog_ERR(TAG, "actual length %"PRIu32"", act_len); //exit(EXIT_FAILURE); } } @@ -527,7 +527,7 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb error = 0; WLog_DBG(TAG, " Port: %d", pdev->port_number); /* gen device path */ - sprintf(pdev->path, "ugen%d.%d", bus_number, dev_number); + sprintf(pdev->path, "ugen%"PRIu16".%"PRIu16"", bus_number, dev_number); WLog_DBG(TAG, " DevPath: %s", pdev->path); break; } @@ -540,7 +540,7 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb if ((bus_number != libusb_get_bus_number(libusb_list[i])) || (1 != libusb_get_device_address(libusb_list[i]))) /* Root hub allways first on bus. */ continue; - WLog_DBG(TAG, " Open hub: %d", bus_number); + WLog_DBG(TAG, " Open hub: %"PRIu16"", bus_number); error = libusb_open(libusb_list[i], &pdev->hub_handle); if (error < 0) WLog_ERR(TAG,"libusb_open error: %i - %s", error, libusb_strerror(error)); @@ -745,8 +745,8 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id LibusbConfig = pdev->LibusbConfig; if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces) { - WLog_ERR(TAG, "Select Configuration: Libusb NumberInterfaces(%d) is different " - "with MsConfig NumberInterfaces(%d)", + WLog_ERR(TAG, "Select Configuration: Libusb NumberInterfaces(%"PRIu8") is different " + "with MsConfig NumberInterfaces(%"PRIu32")", LibusbConfig->bNumInterfaces, MsConfig->NumInterfaces); } @@ -983,7 +983,7 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType if (ret <= 0 || ret < 4){ WLog_DBG(TAG,"libusb_get_string_descriptor: " - "ERROR num %d, iProduct: %d!", ret, devDescriptor->iProduct); + "ERROR num %d, iProduct: %"PRIu8"!", ret, devDescriptor->iProduct); memcpy(Buffer, strDesc, strlen(strDesc)); Buffer[strlen(strDesc)] = '\0'; *BufferSize = (strlen((char *)Buffer)) * 2; @@ -1002,7 +1002,7 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType case DeviceTextLocationInformation: bus_number = libusb_get_bus_number(pdev->libusb_dev); device_address = libusb_get_device_address(pdev->libusb_dev); - sprintf(deviceLocation, "Port_#%04d.Hub_#%04d", device_address, bus_number); + sprintf(deviceLocation, "Port_#%04"PRIu8".Hub_#%04"PRIu8"", device_address, bus_number); for(i=0;ibmAttributes) & 0x3; - WLog_DBG(TAG,"urb_bulk_or_interrupt_transfer: ep:0x%x " - "transfer_type %d flag:%d OutputBufferSize:0x%x", - EndpointAddress, transfer_type, TransferFlags, *BufferSize); + WLog_DBG(TAG,"urb_bulk_or_interrupt_transfer: ep:0x%"PRIx32" " + "transfer_type %"PRIu32" flag:%"PRIu32" OutputBufferSize:0x%"PRIx32"", + EndpointAddress, transfer_type, TransferFlags, *BufferSize); switch (transfer_type) { @@ -1468,7 +1468,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request default: WLog_DBG(TAG,"urb_bulk_or_interrupt_transfer:" - " other transfer type 0x%X", transfer_type); + " other transfer type 0x%"PRIX32"", transfer_type); return -1; break; } @@ -1554,12 +1554,12 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, UINT32 Request *BufferSize = transfer->actual_length; } - WLog_DBG(TAG,"bulk or interrupt Transfer data size : 0x%x", *BufferSize); + WLog_DBG(TAG,"bulk or interrupt Transfer data size : 0x%"PRIx32"", *BufferSize); if (request) { if(pdev->request_queue->unregister_request(pdev->request_queue, RequestId)) - WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%x", RequestId); + WLog_ERR(TAG, "request_queue_unregister_request: not fount request 0x%"PRIx32"", RequestId); } libusb_free_transfer(transfer); @@ -1655,7 +1655,7 @@ cancel_retry: if (!request) continue; - WLog_DBG(TAG,"CancelId:0x%x RequestId:0x%x endpoint 0x%x!!", + WLog_DBG(TAG,"CancelId:0x%"PRIx32" RequestId:0x%x endpoint 0x%x!!", RequestId, request->RequestId, request->endpoint); if ((request && request->RequestId) == (RequestId && retry_times <= 10)) @@ -1797,8 +1797,8 @@ static IUDEVICE* udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number) /* get the first interface and first altsetting */ interface_temp = config_temp->interface[0].altsetting[0]; - WLog_DBG(TAG,"Regist Device: Vid: 0x%04X Pid: 0x%04X" - " InterfaceClass = 0x%X", + WLog_DBG(TAG,"Regist Device: Vid: 0x%04"PRIX16" Pid: 0x%04"PRIX16"" + " InterfaceClass = 0x%02"PRIX8"", pdev->devDescriptor->idVendor, pdev->devDescriptor->idProduct, interface_temp.bInterfaceClass); @@ -1883,7 +1883,7 @@ int udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE*** devArray) ssize_t i, total_device; int status, num = 0; - WLog_INFO(TAG, "VID: 0x%04X, PID: 0x%04X", idVendor, idProduct); + WLog_INFO(TAG, "VID: 0x%04"PRIX16", PID: 0x%04"PRIX16"", idVendor, idProduct); array = (UDEVICE**) malloc(16 * sizeof(UDEVICE*)); diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index cfa5ff1d0..311c27849 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -390,7 +390,7 @@ static IUDEVICE* udevman_get_udevice_by_UsbDevice(IUDEVMAN* idevman, UINT32 UsbD return (IUDEVICE*) pdev; } - WLog_ERR(TAG, "0x%x ERROR!!", UsbDevice); + WLog_ERR(TAG, "0x%"PRIx32" ERROR!!", UsbDevice); return NULL; } diff --git a/channels/urbdrc/client/searchman.c b/channels/urbdrc/client/searchman.c index e16a38ac6..9c6310a6a 100644 --- a/channels/urbdrc/client/searchman.c +++ b/channels/urbdrc/client/searchman.c @@ -166,8 +166,8 @@ static void searchman_list_show(USB_SEARCHMAN* self) { usb = self->get_next(self); WLog_DBG(TAG, " USB %d: ", num++); - WLog_DBG(TAG, " idVendor: 0x%04X", usb->idVendor); - WLog_DBG(TAG, " idProduct: 0x%04X", usb->idProduct); + WLog_DBG(TAG, " idVendor: 0x%04"PRIX16"", usb->idVendor); + WLog_DBG(TAG, " idProduct: 0x%04"PRIX16"", usb->idProduct); } WLog_DBG(TAG, "================= END ==============="); diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index 41f17200b..5410488b0 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -58,10 +58,10 @@ static int func_hardware_id_format(IUDEVICE* pdev, char(*HardwareIds)[DEVICE_HAR idProduct = (UINT16)pdev->query_device_descriptor(pdev, ID_PRODUCT); bcdDevice = (UINT16)pdev->query_device_descriptor(pdev, BCD_DEVICE); - sprintf_s(str, sizeof(str), "USB\\VID_%04X&PID_%04X", idVendor, idProduct); + sprintf_s(str, sizeof(str), "USB\\VID_%04"PRIX16"&PID_%04"PRIX16"", idVendor, idProduct); strcpy(HardwareIds[1], str); - sprintf_s(str, sizeof(str), "%s&REV_%04X", HardwareIds[1], bcdDevice); + sprintf_s(str, sizeof(str), "%s&REV_%04"PRIX16"", HardwareIds[1], bcdDevice); strcpy(HardwareIds[0], str); return 0; @@ -78,11 +78,11 @@ static int func_compat_id_format(IUDEVICE* pdev, char (*CompatibilityIds)[DEVICE if(!(pdev->isCompositeDevice(pdev))) { - sprintf_s(str, sizeof(str),"USB\\Class_%02X", bDeviceClass); + sprintf_s(str, sizeof(str),"USB\\Class_%02"PRIX8"", bDeviceClass); strcpy(CompatibilityIds[2], str); - sprintf_s(str, sizeof(str),"%s&SubClass_%02X", CompatibilityIds[2], bDeviceSubClass); + sprintf_s(str, sizeof(str),"%s&SubClass_%02"PRIX8"", CompatibilityIds[2], bDeviceSubClass); strcpy(CompatibilityIds[1], str); - sprintf_s(str, sizeof(str),"%s&Prot_%02X", CompatibilityIds[1], bDeviceProtocol); + sprintf_s(str, sizeof(str),"%s&Prot_%02"PRIX8"", CompatibilityIds[1], bDeviceProtocol); strcpy(CompatibilityIds[0], str); } else @@ -162,11 +162,11 @@ static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) p = path; ZeroMemory(containerId, sizeof(containerId)); - sprintf_s((char*)containerId, sizeof(containerId), "%04X%04X%s", idVendor, idProduct, p); + sprintf_s((char*)containerId, sizeof(containerId), "%04"PRIX16"%04"PRIX16"%s", idVendor, idProduct, p); /* format */ sprintf_s(strContainerId, DEVICE_CONTAINER_STR_SIZE, - "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + "{%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"}", containerId[0], containerId[1],containerId[2], containerId[3], containerId[4], containerId[5], containerId[6], containerId[7], containerId[8], containerId[9], containerId[10], containerId[11], @@ -184,7 +184,7 @@ static int func_instance_id_generate(IUDEVICE* pdev, char* strInstanceId) /* format */ sprintf_s(strInstanceId, DEVICE_INSTANCE_STR_SIZE, - "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + "%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"-%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"", instanceId[0], instanceId[1],instanceId[2], instanceId[3], instanceId[4], instanceId[5], instanceId[6], instanceId[7], instanceId[8], instanceId[9], instanceId[10], instanceId[11], @@ -471,7 +471,7 @@ static UINT urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char break; default: - WLog_ERR(TAG, "unknown FunctionId 0x%X", FunctionId); + WLog_ERR(TAG, "unknown FunctionId 0x%"PRIX32"", FunctionId); error = ERROR_NOT_FOUND; break; } @@ -568,7 +568,7 @@ static void *urbdrc_search_usb_device(void *arg) { if (status == WAIT_FAILED) { error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) error); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", error); return 0; } @@ -667,7 +667,7 @@ static void *urbdrc_search_usb_device(void *arg) { if (sdev->idVendor == idVendor && sdev->idProduct == idProduct) { - WLog_VRB(TAG, "Searchman Found Device: %04x:%04x", + WLog_VRB(TAG, "Searchman Found Device: %04"PRIx16":%04"PRIx16"", sdev->idVendor, sdev->idProduct); found = 1; break; @@ -767,10 +767,11 @@ static void* urbdrc_search_usb_device(void* arg) HANDLE mon_fd; int numobj, timeout; int busnum, devnum; - int success = 0, error, on_close = 0, found = 0; + int success = 0, on_close = 0, found = 0; WLog_VRB(TAG, ""); channel_mgr = urbdrc->listener_callback->channel_mgr; - DWORD status; + DWORD status; + DWORD dwError; /* init usb monitor */ struct udev* udev; @@ -812,36 +813,36 @@ static void* urbdrc_search_usb_device(void* arg) status = WaitForMultipleObjects(numobj, listobj, FALSE, INFINITE); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + goto out; + } - status = WaitForSingleObject(searchman->term_event, 0); + status = WaitForSingleObject(searchman->term_event, 0); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + goto out; + } - if (status == WAIT_OBJECT_0) - { - sem_post(&searchman->sem_term); - goto out; - } + if (status == WAIT_OBJECT_0) + { + sem_post(&searchman->sem_term); + goto out; + } - status = WaitForSingleObject(mon_fd, 0); + status = WaitForSingleObject(mon_fd, 0); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + goto out; + } if (status == WAIT_OBJECT_0) @@ -882,7 +883,7 @@ static void* urbdrc_search_usb_device(void* arg) if (sdev->idVendor == idVendor && sdev->idProduct == idProduct) { - WLog_VRB(TAG, "Searchman Find Device: %04x:%04x ", + WLog_VRB(TAG, "Searchman Find Device: %04"PRIx16":%04"PRIx16"", sdev->idVendor, sdev->idProduct); found = 1; break; @@ -920,30 +921,30 @@ static void* urbdrc_search_usb_device(void* arg) status = WaitForMultipleObjects(numobj, listobj, FALSE, timeout); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + goto out; + } - status = WaitForSingleObject(searchman->term_event, 0); + status = WaitForSingleObject(searchman->term_event, 0); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + goto out; + } - if (status == WAIT_OBJECT_0) + if (status == WAIT_OBJECT_0) { CloseHandle(mon_fd); sem_post(&searchman->sem_term); return 0; } - error = urdbrc_send_virtual_channel_add(dvc_channel, 0); + urdbrc_send_virtual_channel_add(dvc_channel, 0); if (found == 1) searchman->remove(searchman, sdev->idVendor, sdev->idProduct); @@ -992,23 +993,23 @@ static void* urbdrc_search_usb_device(void* arg) status = WaitForMultipleObjects(numobj, listobj, FALSE, timeout); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForMultipleObjects failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForMultipleObjects failed with error %"PRIu32"!", dwError); + goto out; + } - status = WaitForSingleObject(searchman->term_event, 0); + status = WaitForSingleObject(searchman->term_event, 0); - if (status == WAIT_FAILED) - { - error = GetLastError(); - WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", (unsigned long) error); - goto out; - } + if (status == WAIT_FAILED) + { + dwError = GetLastError(); + WLog_ERR(TAG, "WaitForSingleObject failed with error %"PRIu32"!", dwError); + goto out; + } - if (status == WAIT_OBJECT_0) + if (status == WAIT_OBJECT_0) { CloseHandle(mon_fd); sem_post(&searchman->sem_term); @@ -1115,7 +1116,7 @@ void* urbdrc_new_device_create(void* arg) break; default: - WLog_ERR(TAG, "vchannel_status unknown value %d", + WLog_ERR(TAG, "vchannel_status unknown value %"PRIu32"", urbdrc->vchannel_status); break; } @@ -1183,7 +1184,7 @@ static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callbac break; default: - WLog_VRB(TAG, "unknown FunctionId 0x%X", FunctionId); + WLog_VRB(TAG, "unknown FunctionId 0x%"PRIX32"", FunctionId); error = 1; break; } @@ -1223,7 +1224,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback data_read_UINT32(pBuffer + 0, InterfaceTemp); InterfaceId = (InterfaceTemp & 0x0fffffff); Mask = ((InterfaceTemp & 0xf0000000)>>30); - WLog_VRB(TAG, "Size=%d InterfaceId=0x%X Mask=0x%X", cbSize, InterfaceId, Mask); + WLog_VRB(TAG, "Size=%"PRIu32" InterfaceId=0x%"PRIX32" Mask=0x%"PRIX32"", cbSize, InterfaceId, Mask); switch (InterfaceId) { @@ -1236,7 +1237,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback break; default: - WLog_VRB(TAG, "InterfaceId 0x%X Start matching devices list", InterfaceId); + WLog_VRB(TAG, "InterfaceId 0x%"PRIX32" Start matching devices list", InterfaceId); pthread_t thread; TRANSFER_DATA* transfer_data; @@ -1272,7 +1273,7 @@ static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback error = pthread_create(&thread, 0, urbdrc_process_udev_data_transfer, transfer_data); if (error != 0) { - WLog_ERR(TAG, "Create Data Transfer Thread got error = %d", error); + WLog_ERR(TAG, "Create Data Transfer Thread got error = %"PRIu32"", error); free(transfer_data->pBuffer); free(transfer_data); return ERROR_INVALID_OPERATION; @@ -1301,7 +1302,7 @@ static UINT urbdrc_on_close(IWTSVirtualChannelCallback * pChannelCallback) int found = 0; ChannelId = callback->channel_mgr->GetChannelId(callback->channel); - WLog_INFO(TAG, "urbdrc_on_close: channel id %d", ChannelId); + WLog_INFO(TAG, "urbdrc_on_close: channel id %"PRIu32"", ChannelId); udevman->loading_lock(udevman); udevman->rewind(udevman); diff --git a/ci/cmake-preloads/config-linux-all.txt b/ci/cmake-preloads/config-linux-all.txt index 0dff3a0f9..daeb28210 100644 --- a/ci/cmake-preloads/config-linux-all.txt +++ b/ci/cmake-preloads/config-linux-all.txt @@ -25,9 +25,9 @@ set (WITH_DEBUG_LICENSE OFF CACHE BOOL "enable debug") set (WITH_DEBUG_NEGO OFF CACHE BOOL "enable debug") set (WITH_DEBUG_NLA OFF CACHE BOOL "enable debug") set (WITH_DEBUG_NTLM OFF CACHE BOOL "enable debug") -set (WITH_DEBUG_ORDERS OFF CACHE BOOL "enable debug") set (WITH_DEBUG_RAIL OFF CACHE BOOL "enable debug") set (WITH_DEBUG_RDP OFF CACHE BOOL "enable debug") +set (WITH_DEBUG_RDPEI OFF CACHE BOOL "enable debug") set (WITH_DEBUG_REDIR OFF CACHE BOOL "enable debug") set (WITH_DEBUG_RFX OFF CACHE BOOL "enable debug") set (WITH_DEBUG_SCARD OFF CACHE BOOL "enable debug") diff --git a/client/Android/android_freerdp.c b/client/Android/android_freerdp.c index ea2185175..6464d6b25 100644 --- a/client/Android/android_freerdp.c +++ b/client/Android/android_freerdp.c @@ -67,7 +67,7 @@ static void android_OnChannelConnectedEventHandler( if (!context || !e) { WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, e); + __FUNCTION__, (void*) context, (void*) e); return; } @@ -102,7 +102,7 @@ static void android_OnChannelDisconnectedEventHandler( if (!context || !e) { WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, e); + __FUNCTION__, (void*) context, (void*) e); return; } @@ -551,7 +551,7 @@ static int android_freerdp_run(freerdp* instance) const rdpSettings* settings = instance->context->settings; rdpContext* context = instance->context; BOOL async_input = settings->AsyncInput; - WLog_DBG(TAG, "AsyncInput=%d", settings->AsyncInput); + WLog_DBG(TAG, "AsyncInput=%"PRIu8"", settings->AsyncInput); if (async_input) { @@ -588,8 +588,7 @@ static int android_freerdp_run(freerdp* instance) if ((status == WAIT_FAILED)) { - WLog_ERR(TAG, "WaitForMultipleObjects failed with %u [%08lX]", - (unsigned)status, GetLastError()); + WLog_ERR(TAG, "WaitForMultipleObjects failed with %"PRIu32" [%08lX]", status, GetLastError()); break; } @@ -661,7 +660,7 @@ static void* android_thread_func(void* param) goto fail; fail: - WLog_DBG(TAG, "Session ended with %08lX", status); + WLog_DBG(TAG, "Session ended with %08"PRIX32"", status); if (status == CHANNEL_RC_OK) freerdp_callback("OnDisconnected", "(J)V", (jlong)instance); @@ -738,7 +737,7 @@ static jlong JNICALL jni_freerdp_new(JNIEnv* env, jclass cls, jobject context) if (!contextClass || !fileClass) { WLog_FATAL(TAG, "Failed to load class references %s=%p, %s=%p", - JAVA_CONTEXT_CLASS, contextClass, JAVA_FILE_CLASS, fileClass); + JAVA_CONTEXT_CLASS, (void*) contextClass, JAVA_FILE_CLASS, (void*) fileClass); return (jlong)NULL; } @@ -866,7 +865,7 @@ static jboolean JNICALL jni_freerdp_connect(JNIEnv* env, jclass cls, if (!inst || !inst->context) { WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - env, cls, instance); + (void*) env, (void*) cls, instance); return JNI_FALSE; } @@ -892,7 +891,7 @@ static jboolean JNICALL jni_freerdp_disconnect(JNIEnv* env, jclass cls, if (!inst || !inst->context || !cls || !env) { WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - env, cls, instance); + (void*) env, (void*) cls, instance); return JNI_FALSE; } @@ -929,7 +928,7 @@ static jboolean JNICALL jni_freerdp_update_graphics( if (!env || !cls || !inst) { WLog_FATAL(TAG, "%s(env=%p, cls=%p, instance=%d", __FUNCTION__, - env, cls, instance); + (void*) env, (void*) cls, instance); return JNI_FALSE; } @@ -1004,7 +1003,7 @@ static jboolean JNICALL jni_freerdp_send_key_event( return JNI_FALSE; } - WLog_DBG(TAG, "send_key_event: %d, %d", (int)scancode, flags); + WLog_DBG(TAG, "send_key_event: %"PRIu32", %d", scancode, flags); return JNI_TRUE; } diff --git a/client/DirectFB/dfreerdp.c b/client/DirectFB/dfreerdp.c index 0a867d8a2..5207dc7fb 100644 --- a/client/DirectFB/dfreerdp.c +++ b/client/DirectFB/dfreerdp.c @@ -273,7 +273,7 @@ static void df_process_channel_event(rdpChannels* channels, freerdp* instance) break; default: - WLog_ERR(TAG, "df_process_channel_event: unknown event type %d", + WLog_ERR(TAG, "df_process_channel_event: unknown event type %"PRIu32"", GetMessageType(event->id)); break; } diff --git a/client/Sample/freerdp.c b/client/Sample/freerdp.c index 2c5f006d2..cb9310e5d 100644 --- a/client/Sample/freerdp.c +++ b/client/Sample/freerdp.c @@ -138,8 +138,8 @@ static void* tf_client_thread_proc(freerdp* instance) if (status == WAIT_FAILED) { - WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %lu", __FUNCTION__, - (unsigned long) status); + WLog_ERR(TAG, "%s: WaitForMultipleObjects failed with %"PRIu32"", __FUNCTION__, + status); break; } diff --git a/client/Windows/wf_client.c b/client/Windows/wf_client.c index 5cca741a1..5e0478bfc 100644 --- a/client/Windows/wf_client.c +++ b/client/Windows/wf_client.c @@ -263,7 +263,7 @@ static BOOL wf_pre_connect(freerdp* instance) if ((settings->DesktopWidth < 64) || (settings->DesktopHeight < 64) || (settings->DesktopWidth > 4096) || (settings->DesktopHeight > 4096)) { - WLog_ERR(TAG, "invalid dimensions %d %d", settings->DesktopWidth, + WLog_ERR(TAG, "invalid dimensions %lu %lu", settings->DesktopWidth, settings->DesktopHeight); return FALSE; } @@ -335,7 +335,7 @@ static BOOL wf_post_connect(freerdp* instance) _snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S", settings->ServerHostname); else - _snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S:%d", + _snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S:%u", settings->ServerHostname, settings->ServerPort); if (settings->EmbeddedWindow) @@ -425,7 +425,7 @@ static BOOL wf_authenticate_raw(freerdp* instance, const char* title, if (status != NO_ERROR) { - WLog_ERR(TAG, "CredUIPromptForCredentials unexpected status: 0x%08X", status); + WLog_ERR(TAG, "CredUIPromptForCredentials unexpected status: 0x%08lX", status); return FALSE; } @@ -569,7 +569,7 @@ static BOOL wf_auto_reconnect(freerdp* instance) return FALSE; /* Attempt the next reconnect */ - WLog_INFO(TAG, "Attempting reconnect (%u of %u)", num_retries, max_retries); + WLog_INFO(TAG, "Attempting reconnect (%lu of %lu)", num_retries, max_retries); if (freerdp_reconnect(instance)) { @@ -678,7 +678,7 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam) if (MsgWaitForMultipleObjects(nCount, handles, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED) { - WLog_ERR(TAG, "wfreerdp_run: WaitForMultipleObjects failed: 0x%04X", + WLog_ERR(TAG, "wfreerdp_run: WaitForMultipleObjects failed: 0x%08lX", GetLastError()); break; } diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index 07487e7f4..8d1cfd94b 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -1660,8 +1660,7 @@ static BOOL wf_cliprdr_get_file_contents(WCHAR* file_name, BYTE* buffer, if (!ReadFile(hFile, buffer, nRequested, &nGet, NULL)) { - DWORD err = GetLastError(); - DEBUG_CLIPRDR("ReadFile failed with 0x%x.", err); + DEBUG_CLIPRDR("ReadFile failed with 0x%08lX.", GetLastError()); goto error; } diff --git a/client/Windows/wf_event.c b/client/Windows/wf_event.c index c2dfadd09..288a60e12 100644 --- a/client/Windows/wf_event.c +++ b/client/Windows/wf_event.c @@ -86,8 +86,8 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam) input = wfc->context.input; rdp_scancode = MAKE_RDP_SCANCODE((BYTE) p->scanCode, p->flags & LLKHF_EXTENDED); - DEBUG_KBD("keydown %d scanCode %04X flags %02X vkCode %02X", - (wParam == WM_KEYDOWN), (BYTE) p->scanCode, p->flags, p->vkCode); + DEBUG_KBD("keydown %d scanCode 0x%08lX flags 0x%08lX vkCode 0x%08lX", + (wParam == WM_KEYDOWN), p->scanCode, p->flags, p->vkCode); if (wfc->fs_toggle && ((p->vkCode == VK_RETURN) || (p->vkCode == VK_CANCEL)) && diff --git a/client/Windows/wf_rail.c b/client/Windows/wf_rail.c index db27b0573..dd9473363 100644 --- a/client/Windows/wf_rail.c +++ b/client/Windows/wf_rail.c @@ -143,20 +143,20 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* windowState) { if (orderInfo->fieldFlags & WINDOW_ORDER_STATE_NEW) - WLog_INFO(TAG, "WindowCreate: WindowId: 0x%04X", orderInfo->windowId); + WLog_INFO(TAG, "WindowCreate: WindowId: 0x%08X", orderInfo->windowId); else - WLog_INFO(TAG, "WindowUpdate: WindowId: 0x%04X", orderInfo->windowId); + WLog_INFO(TAG, "WindowUpdate: WindowId: 0x%08X", orderInfo->windowId); WLog_INFO(TAG, "{"); if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_OWNER) { - WLog_INFO(TAG, "\tOwnerWindowId: 0x%04X", windowState->ownerWindowId); + WLog_INFO(TAG, "\tOwnerWindowId: 0x%08X", windowState->ownerWindowId); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_STYLE) { - WLog_INFO(TAG, "\tStyle: 0x%04X ExtendedStyle: 0x%04X", + WLog_INFO(TAG, "\tStyle: 0x%08X ExtendedStyle: 0x%08X", windowState->style, windowState->extendedStyle); PrintWindowStyles(windowState->style); PrintExtendedWindowStyles(windowState->extendedStyle); @@ -164,7 +164,7 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_SHOW) { - WLog_INFO(TAG, "\tShowState: %d", windowState->showState); + WLog_INFO(TAG, "\tShowState: %u", windowState->showState); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE) @@ -172,7 +172,7 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, char* title = NULL; ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) windowState->titleInfo.string, windowState->titleInfo.length / 2, &title, 0, NULL, NULL); - WLog_INFO(TAG, "\tTitleInfo: %s (length = %d)", title, + WLog_INFO(TAG, "\tTitleInfo: %s (length = %hu)", title, windowState->titleInfo.length); free(title); } @@ -185,18 +185,18 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) { - WLog_INFO(TAG, "\tClientAreaWidth: %d ClientAreaHeight: %d", + WLog_INFO(TAG, "\tClientAreaWidth: %u ClientAreaHeight: %u", windowState->clientAreaWidth, windowState->clientAreaHeight); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT) { - WLog_INFO(TAG, "\tRPContent: %d", windowState->RPContent); + WLog_INFO(TAG, "\tRPContent: %u", windowState->RPContent); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT) { - WLog_INFO(TAG, "\tRootParentHandle: 0x%04X", windowState->rootParentHandle); + WLog_INFO(TAG, "\tRootParentHandle: 0x%08X", windowState->rootParentHandle); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_OFFSET) @@ -213,7 +213,7 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_SIZE) { - WLog_INFO(TAG, "\tWindowWidth: %d WindowHeight: %d", + WLog_INFO(TAG, "\tWindowWidth: %u WindowHeight: %u", windowState->windowWidth, windowState->windowHeight); } @@ -221,12 +221,12 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, { UINT32 index; RECTANGLE_16* rect; - WLog_INFO(TAG, "\tnumWindowRects: %d", windowState->numWindowRects); + WLog_INFO(TAG, "\tnumWindowRects: %u", windowState->numWindowRects); for (index = 0; index < windowState->numWindowRects; index++) { rect = &windowState->windowRects[index]; - WLog_INFO(TAG, "\twindowRect[%d]: left: %d top: %d right: %d bottom: %d", + WLog_INFO(TAG, "\twindowRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", index, rect->left, rect->top, rect->right, rect->bottom); } } @@ -241,12 +241,12 @@ void PrintRailWindowState(WINDOW_ORDER_INFO* orderInfo, { UINT32 index; RECTANGLE_16* rect; - WLog_INFO(TAG, "\tnumVisibilityRects: %d", windowState->numVisibilityRects); + WLog_INFO(TAG, "\tnumVisibilityRects: %u", windowState->numVisibilityRects); for (index = 0; index < windowState->numVisibilityRects; index++) { rect = &windowState->visibilityRects[index]; - WLog_INFO(TAG, "\tvisibilityRect[%d]: left: %d top: %d right: %d bottom: %d", + WLog_INFO(TAG, "\tvisibilityRect[%u]: left: %hu top: %hu right: %hu bottom: %hu", index, rect->left, rect->top, rect->right, rect->bottom); } } @@ -260,17 +260,17 @@ static void PrintRailIconInfo(WINDOW_ORDER_INFO* orderInfo, ICON_INFO* iconInfo) WLog_INFO(TAG, "{"); WLog_INFO(TAG, "\tbigIcon: %s", (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ICON_BIG) ? "true" : "false"); - WLog_INFO(TAG, "\tcacheEntry; 0x%04X", iconInfo->cacheEntry); - WLog_INFO(TAG, "\tcacheId: 0x%04X", iconInfo->cacheId); - WLog_INFO(TAG, "\tbpp: %d", iconInfo->bpp); - WLog_INFO(TAG, "\twidth: %d", iconInfo->width); - WLog_INFO(TAG, "\theight: %d", iconInfo->height); - WLog_INFO(TAG, "\tcbColorTable: %d", iconInfo->cbColorTable); - WLog_INFO(TAG, "\tcbBitsMask: %d", iconInfo->cbBitsMask); - WLog_INFO(TAG, "\tcbBitsColor: %d", iconInfo->cbBitsColor); - WLog_INFO(TAG, "\tcolorTable: %p", iconInfo->colorTable); - WLog_INFO(TAG, "\tbitsMask: %p", iconInfo->bitsMask); - WLog_INFO(TAG, "\tbitsColor: %p", iconInfo->bitsColor); + WLog_INFO(TAG, "\tcacheEntry; 0x%08X", iconInfo->cacheEntry); + WLog_INFO(TAG, "\tcacheId: 0x%08X", iconInfo->cacheId); + WLog_INFO(TAG, "\tbpp: %u", iconInfo->bpp); + WLog_INFO(TAG, "\twidth: %u", iconInfo->width); + WLog_INFO(TAG, "\theight: %u", iconInfo->height); + WLog_INFO(TAG, "\tcbColorTable: %u", iconInfo->cbColorTable); + WLog_INFO(TAG, "\tcbBitsMask: %u", iconInfo->cbBitsMask); + WLog_INFO(TAG, "\tcbBitsColor: %u", iconInfo->cbBitsColor); + WLog_INFO(TAG, "\tcolorTable: %p", (void*) iconInfo->colorTable); + WLog_INFO(TAG, "\tbitsMask: %p", (void*) iconInfo->bitsMask); + WLog_INFO(TAG, "\tbitsColor: %p", (void*) iconInfo->bitsColor); WLog_INFO(TAG, "}"); } @@ -845,7 +845,7 @@ void wf_rail_register_update_callbacks(rdpUpdate* update) static UINT wf_rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) { - WLog_DBG(TAG, "RailServerExecuteResult: 0x%04X", execResult->rawResult); + WLog_DBG(TAG, "RailServerExecuteResult: 0x%08X", execResult->rawResult); return CHANNEL_RC_OK; } diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index a032f6e35..f125b2d45 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1416,7 +1416,7 @@ static BOOL xf_auto_reconnect(freerdp* instance) } /* Attempt the next reconnect */ - WLog_INFO(TAG, "Attempting reconnect (%u of %u)", numRetries, maxRetries); + WLog_INFO(TAG, "Attempting reconnect (%"PRIu32" of %"PRIu32")", numRetries, maxRetries); if (freerdp_reconnect(instance)) return TRUE; @@ -1458,7 +1458,7 @@ static void* xf_client_thread(void* param) /* --authonly ? */ if (instance->settings->AuthenticationOnly) { - WLog_ERR(TAG, "Authentication only, exit status %d", !status); + WLog_ERR(TAG, "Authentication only, exit status %"PRId32"", !status); if (!status) { @@ -1476,7 +1476,7 @@ static void* xf_client_thread(void* param) if (!status) { - WLog_ERR(TAG, "Freerdp connect error exit status %d", !status); + WLog_ERR(TAG, "Freerdp connect error exit status %"PRId32"", !status); exit_code = freerdp_error_info(instance); if (freerdp_get_last_error(instance->context) == diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index d62ddd4c3..37a0c311c 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -346,7 +346,7 @@ static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, if (*numFormats > MAX_CLIPBOARD_FORMATS) { - WLog_ERR(TAG, "unexpectedly large number of formats: %u", *numFormats); + WLog_ERR(TAG, "unexpectedly large number of formats: %"PRIu32"", *numFormats); goto error; } @@ -373,7 +373,7 @@ static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list(BYTE* data, if (formatNameLength == Stream_GetRemainingLength(s)) { - WLog_ERR(TAG, "missing terminating null byte, %zu bytes left to read", + WLog_ERR(TAG, "missing terminating null byte, %"PRIuz" bytes left to read", formatNameLength); goto error; } @@ -428,7 +428,7 @@ static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats(xfClipboard* clipboard, { WLog_ERR(TAG, "failed to retrieve raw format list: data=%p, length=%lu, format=%d, type=%lu (expected=%lu)", - data, length, format, (unsigned long) type, (unsigned long) clipboard->raw_format_list_atom); + (void*) data, length, format, (unsigned long) type, (unsigned long) clipboard->raw_format_list_atom); } if (data) @@ -1036,7 +1036,7 @@ UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard) { if (!(formats = (CLIPRDR_FORMAT*) calloc(numFormats, sizeof(CLIPRDR_FORMAT)))) { - WLog_ERR(TAG, "failed to allocate %d CLIPRDR_FORMAT structs", numFormats); + WLog_ERR(TAG, "failed to allocate %"PRIu32" CLIPRDR_FORMAT structs", numFormats); return CHANNEL_RC_NO_MEMORY; } } diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c index a211e6b9a..20570df6f 100644 --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -163,8 +163,8 @@ static BOOL xf_event_execute_action_script(xfContext* xfc, XEvent* event) if (!match) return FALSE; - sprintf_s(command, sizeof(command), "%s xevent %s %d", - xfc->actionScript, xeventName, (int) xfc->window->handle); + sprintf_s(command, sizeof(command), "%s xevent %s %lu", + xfc->actionScript, xeventName, (unsigned long) xfc->window->handle); actionScript = popen(command, "r"); if (!actionScript) @@ -976,8 +976,8 @@ BOOL xf_event_process(freerdp* instance, XEvent* event) xf_event_execute_action_script(xfc, event); if (event->type != MotionNotify) - DEBUG_X11("%s Event(%d): wnd=0x%04X", X11_EVENT_STRINGS[event->type], - event->type, (UINT32) event->xany.window); + DEBUG_X11("%s Event(%d): wnd=0x%08lX", X11_EVENT_STRINGS[event->type], + event->type, (unsigned long) event->xany.window); switch (event->type) { diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index 753d453bd..283e93f65 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -210,7 +210,7 @@ static BOOL xf_set_rop3(xfContext* xfc, UINT32 rop3) if (function < 0) { - WLog_ERR(TAG, "Unsupported ROP3: 0x%08X", rop3); + WLog_ERR(TAG, "Unsupported ROP3: 0x%08"PRIX32"", rop3); XSetFunction(xfc->display, xfc->gc, GXclear); return FALSE; } @@ -391,7 +391,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) break; default: - WLog_ERR(TAG, "unimplemented brush style:%d", brush->style); + WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style); goto fail; } @@ -704,7 +704,7 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) break; default: - WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style); + WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style); goto fail; } @@ -773,7 +773,7 @@ static BOOL xf_gdi_polygon_sc(rdpContext* context, break; default: - WLog_ERR(TAG, "PolygonSC unknown fillMode: %d", polygon_sc->fillMode); + WLog_ERR(TAG, "PolygonSC unknown fillMode: %"PRIu32"", polygon_sc->fillMode); break; } @@ -844,7 +844,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, break; default: - WLog_ERR(TAG, "PolygonCB unknown fillMode: %d", polygon_cb->fillMode); + WLog_ERR(TAG, "PolygonCB unknown fillMode: %"PRIu32"", polygon_cb->fillMode); break; } @@ -885,7 +885,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, } else { - WLog_ERR(TAG, "PolygonCB unimplemented brush style:%d", brush->style); + WLog_ERR(TAG, "PolygonCB unimplemented brush style:%"PRIu32"", brush->style); } XSetFunction(xfc->display, xfc->gc, GXcopy); @@ -1050,7 +1050,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, break; default: - WLog_ERR(TAG, "Unsupported codecID %d", cmd->codecID); + WLog_ERR(TAG, "Unsupported codecID %"PRIu32"", cmd->codecID); ret = TRUE; goto fail; } diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c index 7a668ba08..1d48186d3 100644 --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -207,7 +207,7 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BYTE keycode) if (rdp_scancode == RDP_SCANCODE_UNKNOWN) { - WLog_ERR(TAG, "Unknown key with X keycode 0x%02x", keycode); + WLog_ERR(TAG, "Unknown key with X keycode 0x%02"PRIx8"", keycode); } else if (rdp_scancode == RDP_SCANCODE_PAUSE && !xf_keyboard_key_pressed(xfc, XK_Control_L) diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index f40ba98db..73895c574 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -64,7 +64,7 @@ int xf_list_monitors(xfContext* xfc) for (i = 0; i < nmonitors; i++) { - printf(" %s [%d] %dx%d\t+%d+%d\n", + printf(" %s [%d] %hdx%hd\t+%hd+%hd\n", (i == 0) ? "*" : " ", i, screen[i].width, screen[i].height, screen[i].x_org, screen[i].y_org); @@ -87,8 +87,8 @@ int xf_list_monitors(xfContext* xfc) } screen = ScreenOfDisplay(display, DefaultScreen(display)); - printf(" * [0] %dx%d\t+%d+%d\n", WidthOfScreen(screen), - HeightOfScreen(screen), 0, 0); + printf(" * [0] %dx%d\t+0+0\n", WidthOfScreen(screen), + HeightOfScreen(screen)); XCloseDisplay(display); #endif return 0; diff --git a/client/X11/xf_tsmf.c b/client/X11/xf_tsmf.c index a47bf132b..58fa79423 100644 --- a/client/X11/xf_tsmf.c +++ b/client/X11/xf_tsmf.c @@ -186,7 +186,7 @@ int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAME_EVENT } else { - WLog_DBG(TAG, "pixel format 0x%X not supported by hardware.", pixfmt); + WLog_DBG(TAG, "pixel format 0x%"PRIX32" not supported by hardware.", pixfmt); free(xrects); return -1003; } @@ -359,7 +359,7 @@ int xf_tsmf_xv_init(xfContext* xfc, TsmfClientContext* tsmf) for (i = 0; i < num_adaptors; i++) { - WLog_DBG(TAG, "adapter port %ld-%ld (%s)", ai[i].base_id, + WLog_DBG(TAG, "adapter port %lu-%lu (%s)", ai[i].base_id, ai[i].base_id + ai[i].num_ports - 1, ai[i].name); if (xv->xv_port == 0 && i == num_adaptors - 1) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 1c7a51a24..496994e45 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -129,8 +129,7 @@ void xf_SendClientEvent(xfContext* xfc, Window window, Atom atom, xevent.xclient.data.l[i] = va_arg(argp, int); } - DEBUG_X11("Send ClientMessage Event: wnd=0x%04X", - (unsigned int) xevent.xclient.window); + DEBUG_X11("Send ClientMessage Event: wnd=0x%04lX", (unsigned long) xevent.xclient.window); XSendEvent(xfc->display, RootWindowOfScreen(xfc->screen), False, SubstructureRedirectMask | SubstructureNotifyMask, &xevent); XSync(xfc->display, False); @@ -654,7 +653,7 @@ int xf_AppWindowInit(xfContext* xfc, xfAppWindow* appWindow) else { class = malloc(sizeof("RAIL:00000000")); - sprintf_s(class, sizeof("RAIL:00000000"), "RAIL:%08X", appWindow->windowId); + sprintf_s(class, sizeof("RAIL:00000000"), "RAIL:%08"PRIX32"", appWindow->windowId); class_hints->res_class = class; } diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 59359c863..8228b4c46 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1362,7 +1362,7 @@ int freerdp_client_settings_command_line_status_print(rdpSettings* settings, printf("\nKeyboard Layouts\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08X\t%s\n", (int) layouts[i].code, layouts[i].name); + printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); free(layouts); layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_VARIANT); @@ -1370,7 +1370,7 @@ int freerdp_client_settings_command_line_status_print(rdpSettings* settings, printf("\nKeyboard Layout Variants\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08X\t%s\n", (int) layouts[i].code, layouts[i].name); + printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); free(layouts); layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_IME); @@ -1378,7 +1378,7 @@ int freerdp_client_settings_command_line_status_print(rdpSettings* settings, printf("\nKeyboard Input Method Editors (IMEs)\n"); for (i = 0; layouts[i].code; i++) - printf("0x%08X\t%s\n", (int) layouts[i].code, layouts[i].name); + printf("0x%08"PRIX32"\t%s\n", layouts[i].code, layouts[i].name); free(layouts); printf("\n"); @@ -1497,7 +1497,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, settings->ServerPort = atoi(&p2[2]); } - printf("hostname %s port %d\n", settings->ServerHostname, settings->ServerPort); + printf("hostname %s port %"PRIu32"\n", settings->ServerHostname, settings->ServerPort); } } CommandLineSwitchCase(arg, "spn-class") diff --git a/client/common/compatibility.c b/client/common/compatibility.c index 1ec279091..89c6417dc 100644 --- a/client/common/compatibility.c +++ b/client/common/compatibility.c @@ -539,7 +539,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe } free(str); - WLog_WARN(TAG, "-g %s -> /size:%s or /w:%d /h:%d", arg->Value, arg->Value, + WLog_WARN(TAG, "-g %s -> /size:%s or /w:%"PRIu32" /h:%"PRIu32"", arg->Value, arg->Value, settings->DesktopWidth, settings->DesktopHeight); } CommandLineSwitchCase(arg, "k") @@ -799,7 +799,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe WLog_WARN(TAG, "%s -> /v:%s", settings->ServerHostname, settings->ServerHostname); if (settings->ServerPort != 3389) - WLog_WARN(TAG, " /port:%d", settings->ServerPort); + WLog_WARN(TAG, " /port:%"PRIu32"", settings->ServerPort); WLog_WARN(TAG, ""); return 1; diff --git a/client/common/test/TestClientRdpFile.c b/client/common/test/TestClientRdpFile.c index ce15e6942..f952d18b9 100644 --- a/client/common/test/TestClientRdpFile.c +++ b/client/common/test/TestClientRdpFile.c @@ -280,19 +280,19 @@ int TestClientRdpFile(int argc, char* argv[]) if (file->UseMultiMon != 0) { - printf("UseMultiMon mismatch: Actual: %d, Expected: %d\n", file->UseMultiMon, 0); + printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", file->UseMultiMon); return -1; } if (file->ScreenModeId != 2) { - printf("ScreenModeId mismatch: Actual: %d, Expected: %d\n", file->ScreenModeId, 2); + printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: 2\n", file->ScreenModeId); return -1; } if (file->GatewayProfileUsageMethod != 1) { - printf("GatewayProfileUsageMethod mismatch: Actual: %d, Expected: %d\n", file->GatewayProfileUsageMethod, 1); + printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n", file->GatewayProfileUsageMethod); return -1; } @@ -312,19 +312,19 @@ int TestClientRdpFile(int argc, char* argv[]) if (file->UseMultiMon != 0) { - printf("UseMultiMon mismatch: Actual: %d, Expected: %d\n", file->UseMultiMon, 0); + printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", file->UseMultiMon); return -1; } if (file->ScreenModeId != 2) { - printf("ScreenModeId mismatch: Actual: %d, Expected: %d\n", file->ScreenModeId, 2); + printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: 2\n", file->ScreenModeId); return -1; } if (file->GatewayProfileUsageMethod != 1) { - printf("GatewayProfileUsageMethod mismatch: Actual: %d, Expected: %d\n", file->GatewayProfileUsageMethod, 1); + printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n", file->GatewayProfileUsageMethod); return -1; } @@ -369,7 +369,7 @@ int TestClientRdpFile(int argc, char* argv[]) } else if (line->flags & RDP_FILE_LINE_FLAG_TYPE_INTEGER) { - printf("line %02d: name: %s value: %d, %s\n", + printf("line %02d: name: %s value: %"PRIu32", %s\n", line->index, line->name, line->iValue, (line->flags & RDP_FILE_LINE_FLAG_STANDARD) ? "standard" : "non-standard"); } diff --git a/client/iOS/FreeRDP/ios_freerdp.m b/client/iOS/FreeRDP/ios_freerdp.m index deb4fcf91..a2d01e894 100644 --- a/client/iOS/FreeRDP/ios_freerdp.m +++ b/client/iOS/FreeRDP/ios_freerdp.m @@ -35,7 +35,7 @@ static void ios_OnChannelConnectedEventHandler( if (!context || !e) { WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, e); + __FUNCTION__, (void*) context, (void*) e); return; } @@ -66,7 +66,7 @@ static void ios_OnChannelDisconnectedEventHandler( if (!context || !e) { WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p", - __FUNCTION__, context, e); + __FUNCTION__, (void*) context, (void*) e); return; } diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index 070f948b1..af181c845 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -110,6 +110,7 @@ option(WITH_DEBUG_NTLM "Print NTLM debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDPEI "Print input virtual channel debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_REDIR "Redirection debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_RFX "Print RemoteFX debug messages." ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_SCARD "Print smartcard debug messages" ${DEFAULT_DEBUG_OPTION}) diff --git a/config.h.in b/config.h.in index 450bc272e..568bcebdd 100644 --- a/config.h.in +++ b/config.h.in @@ -68,7 +68,6 @@ #cmakedefine WITH_DEBUG_NLA #cmakedefine WITH_DEBUG_NTLM #cmakedefine WITH_DEBUG_TSG -#cmakedefine WITH_DEBUG_ORDERS #cmakedefine WITH_DEBUG_RAIL #cmakedefine WITH_DEBUG_RDP #cmakedefine WITH_DEBUG_REDIR diff --git a/libfreerdp/cache/bitmap.c b/libfreerdp/cache/bitmap.c index b90d1c8aa..41fdefa49 100644 --- a/libfreerdp/cache/bitmap.c +++ b/libfreerdp/cache/bitmap.c @@ -236,7 +236,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, if (id > bitmapCache->maxCells) { - WLog_ERR(TAG, "get invalid bitmap cell id: %d", id); + WLog_ERR(TAG, "get invalid bitmap cell id: %"PRIu32"", id); return NULL; } @@ -246,7 +246,7 @@ rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id, } else if (index > bitmapCache->cells[id].number) { - WLog_ERR(TAG, "get invalid bitmap index %d in cell id: %d", index, id); + WLog_ERR(TAG, "get invalid bitmap index %"PRIu32" in cell id: %"PRIu32"", index, id); return NULL; } @@ -259,7 +259,7 @@ BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, { if (id > bitmapCache->maxCells) { - WLog_ERR(TAG, "put invalid bitmap cell id: %d", id); + WLog_ERR(TAG, "put invalid bitmap cell id: %"PRIu32"", id); return FALSE; } @@ -269,7 +269,7 @@ BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index, } else if (index > bitmapCache->cells[id].number) { - WLog_ERR(TAG, "put invalid bitmap index %d in cell id: %d", index, id); + WLog_ERR(TAG, "put invalid bitmap index %"PRIu32" in cell id: %"PRIu32"", index, id); return FALSE; } diff --git a/libfreerdp/cache/brush.c b/libfreerdp/cache/brush.c index a5f3741d6..1048c770e 100644 --- a/libfreerdp/cache/brush.c +++ b/libfreerdp/cache/brush.c @@ -116,7 +116,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) { if (index >= brushCache->maxMonoEntries) { - WLog_ERR(TAG, "invalid brush (%d bpp) index: 0x%04X", *bpp, index); + WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", *bpp, index); return NULL; } @@ -127,7 +127,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) { if (index >= brushCache->maxEntries) { - WLog_ERR(TAG, "invalid brush (%d bpp) index: 0x%04X", *bpp, index); + WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", *bpp, index); return NULL; } @@ -137,7 +137,7 @@ void* brush_cache_get(rdpBrushCache* brushCache, UINT32 index, UINT32* bpp) if (entry == NULL) { - WLog_ERR(TAG, "invalid brush (%d bpp) at index: 0x%04X", *bpp, index); + WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) at index: 0x%08"PRIX32"", *bpp, index); return NULL; } @@ -150,7 +150,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3 { if (index >= brushCache->maxMonoEntries) { - WLog_ERR(TAG, "invalid brush (%d bpp) index: 0x%04X", bpp, index); + WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", bpp, index); free(entry); return; } @@ -164,7 +164,7 @@ void brush_cache_put(rdpBrushCache* brushCache, UINT32 index, void* entry, UINT3 { if (index >= brushCache->maxEntries) { - WLog_ERR(TAG, "invalid brush (%d bpp) index: 0x%04X", bpp, index); + WLog_ERR(TAG, "invalid brush (%"PRIu32" bpp) index: 0x%08"PRIX32"", bpp, index); free(entry); return; } diff --git a/libfreerdp/cache/glyph.c b/libfreerdp/cache/glyph.c index 15e2717f4..cf0f3d80d 100644 --- a/libfreerdp/cache/glyph.c +++ b/libfreerdp/cache/glyph.c @@ -577,25 +577,25 @@ static BOOL update_gdi_cache_glyph_v2(rdpContext* context, rdpGlyph* glyph_cache_get(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index) { rdpGlyph* glyph; - WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheGet: id: %d index: %d", id, + WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCacheGet: id: %"PRIu32" index: %"PRIu32"", id, index); if (id > 9) { - WLog_ERR(TAG, "invalid glyph cache id: %d", id); + WLog_ERR(TAG, "invalid glyph cache id: %"PRIu32"", id); return NULL; } if (index > glyphCache->glyphCache[id].number) { - WLog_ERR(TAG, "index %d out of range for cache id: %d", index, id); + WLog_ERR(TAG, "index %"PRIu32" out of range for cache id: %"PRIu32"", index, id); return NULL; } glyph = glyphCache->glyphCache[id].entries[index]; if (!glyph) - WLog_ERR(TAG, "no glyph found at cache index: %d in cache id: %d", index, id); + WLog_ERR(TAG, "no glyph found at cache index: %"PRIu32" in cache id: %"PRIu32"", index, id); return glyph; } @@ -607,17 +607,17 @@ BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, if (id > 9) { - WLog_ERR(TAG, "invalid glyph cache id: %d", id); + WLog_ERR(TAG, "invalid glyph cache id: %"PRIu32"", id); return FALSE; } if (index > glyphCache->glyphCache[id].number) { - WLog_ERR(TAG, "invalid glyph cache index: %d in cache id: %d", index, id); + WLog_ERR(TAG, "invalid glyph cache index: %"PRIu32" in cache id: %"PRIu32"", index, id); return FALSE; } - WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCachePut: id: %d index: %d", id, + WLog_Print(glyphCache->log, WLOG_DEBUG, "GlyphCachePut: id: %"PRIu32" index: %"PRIu32"", id, index); prevGlyph = glyphCache->glyphCache[id].entries[index]; @@ -635,17 +635,17 @@ const void* glyph_cache_fragment_get(rdpGlyphCache* glyphCache, UINT32 index, if (index > 255) { - WLog_ERR(TAG, "invalid glyph cache fragment index: %d", index); + WLog_ERR(TAG, "invalid glyph cache fragment index: %"PRIu32"", index); return NULL; } fragment = glyphCache->fragCache.entries[index].fragment; *size = (BYTE) glyphCache->fragCache.entries[index].size; WLog_Print(glyphCache->log, WLOG_DEBUG, - "GlyphCacheFragmentGet: index: %d size: %d", index, *size); + "GlyphCacheFragmentGet: index: %"PRIu32" size: %"PRIu32"", index, *size); if (!fragment) - WLog_ERR(TAG, "invalid glyph fragment at index:%d", index); + WLog_ERR(TAG, "invalid glyph fragment at index:%"PRIu32"", index); return fragment; } @@ -658,7 +658,7 @@ BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, if (index > 255) { - WLog_ERR(TAG, "invalid glyph cache fragment index: %d", index); + WLog_ERR(TAG, "invalid glyph cache fragment index: %"PRIu32"", index); return FALSE; } @@ -668,7 +668,7 @@ BOOL glyph_cache_fragment_put(rdpGlyphCache* glyphCache, UINT32 index, return FALSE; WLog_Print(glyphCache->log, WLOG_DEBUG, - "GlyphCacheFragmentPut: index: %d size: %d", index, size); + "GlyphCacheFragmentPut: index: %"PRIu32" size: %"PRIu32"", index, size); CopyMemory(copy, fragment, size); prevFragment = glyphCache->fragCache.entries[index].fragment; glyphCache->fragCache.entries[index].fragment = copy; diff --git a/libfreerdp/cache/nine_grid.c b/libfreerdp/cache/nine_grid.c index fd3bf7d7e..8dde7c1d6 100644 --- a/libfreerdp/cache/nine_grid.c +++ b/libfreerdp/cache/nine_grid.c @@ -70,7 +70,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index) if (index >= nine_grid->maxEntries) { - WLog_ERR(TAG, "invalid NineGrid index: 0x%04X", index); + WLog_ERR(TAG, "invalid NineGrid index: 0x%08"PRIX32"", index); return NULL; } @@ -78,7 +78,7 @@ void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index) if (entry == NULL) { - WLog_ERR(TAG, "invalid NineGrid at index: 0x%04X", index); + WLog_ERR(TAG, "invalid NineGrid at index: 0x%08"PRIX32"", index); return NULL; } @@ -89,7 +89,7 @@ void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry) { if (index >= nine_grid->maxEntries) { - WLog_ERR(TAG, "invalid NineGrid index: 0x%04X", index); + WLog_ERR(TAG, "invalid NineGrid index: 0x%08"PRIX32"", index); return; } diff --git a/libfreerdp/cache/offscreen.c b/libfreerdp/cache/offscreen.c index 2321f7f09..dacc1d996 100644 --- a/libfreerdp/cache/offscreen.c +++ b/libfreerdp/cache/offscreen.c @@ -101,7 +101,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index) if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%04X", index); + WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08"PRIX32"", index); return NULL; } @@ -109,7 +109,7 @@ rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreenCache, UINT32 index) if (!bitmap) { - WLog_ERR(TAG, "invalid offscreen bitmap at index: 0x%04X", index); + WLog_ERR(TAG, "invalid offscreen bitmap at index: 0x%08"PRIX32"", index); return NULL; } @@ -121,7 +121,7 @@ void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, { if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%04X", index); + WLog_ERR(TAG, "invalid offscreen bitmap index: 0x%08"PRIX32"", index); return; } @@ -135,7 +135,7 @@ void offscreen_cache_delete(rdpOffscreenCache* offscreenCache, UINT32 index) if (index >= offscreenCache->maxEntries) { - WLog_ERR(TAG, "invalid offscreen bitmap index (delete): 0x%04X", index); + WLog_ERR(TAG, "invalid offscreen bitmap index (delete): 0x%08"PRIX32"", index); return; } diff --git a/libfreerdp/cache/palette.c b/libfreerdp/cache/palette.c index c12f30311..7b093150f 100644 --- a/libfreerdp/cache/palette.c +++ b/libfreerdp/cache/palette.c @@ -54,7 +54,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index) if (index >= paletteCache->maxEntries) { - WLog_ERR(TAG, "invalid color table index: 0x%04X", index); + WLog_ERR(TAG, "invalid color table index: 0x%08"PRIX32"", index); return NULL; } @@ -62,7 +62,7 @@ void* palette_cache_get(rdpPaletteCache* paletteCache, UINT32 index) if (!entry) { - WLog_ERR(TAG, "invalid color table at index: 0x%04X", index); + WLog_ERR(TAG, "invalid color table at index: 0x%08"PRIX32"", index); return NULL; } @@ -73,7 +73,7 @@ void palette_cache_put(rdpPaletteCache* paletteCache, UINT32 index, void* entry) { if (index >= paletteCache->maxEntries) { - WLog_ERR(TAG, "invalid color table index: 0x%04X", index); + WLog_ERR(TAG, "invalid color table index: 0x%08"PRIX32"", index); free(entry); return; } diff --git a/libfreerdp/cache/pointer.c b/libfreerdp/cache/pointer.c index b15ebb744..50c2e2fda 100644 --- a/libfreerdp/cache/pointer.c +++ b/libfreerdp/cache/pointer.c @@ -96,7 +96,7 @@ static BOOL update_pointer_system(rdpContext* context, break; default: - WLog_ERR(TAG, "Unknown system pointer type (0x%08X)", pointer_system->type); + WLog_ERR(TAG, "Unknown system pointer type (0x%08"PRIX32")", pointer_system->type); } return TRUE; @@ -237,7 +237,7 @@ const rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, if (index >= pointer_cache->cacheSize) { - WLog_ERR(TAG, "invalid pointer index:%d", index); + WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index); return NULL; } @@ -252,7 +252,7 @@ BOOL pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, if (index >= pointer_cache->cacheSize) { - WLog_ERR(TAG, "invalid pointer index:%d", index); + WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index); return FALSE; } diff --git a/libfreerdp/codec/audio.c b/libfreerdp/codec/audio.c index 068f2f541..2303e03a4 100644 --- a/libfreerdp/codec/audio.c +++ b/libfreerdp/codec/audio.c @@ -65,7 +65,7 @@ UINT32 rdpsnd_compute_audio_time_length(AUDIO_FORMAT* format, int size) } else { - WLog_ERR(TAG, "rdpsnd_compute_audio_time_length: unknown format %d", format->wFormatTag); + WLog_ERR(TAG, "rdpsnd_compute_audio_time_length: unknown format %"PRIu16"", format->wFormatTag); } } @@ -115,8 +115,8 @@ char* rdpsnd_get_audio_tag_string(UINT16 wFormatTag) void rdpsnd_print_audio_format(AUDIO_FORMAT* format) { - WLog_INFO(TAG, "%s:\t wFormatTag: 0x%04X nChannels: %d nSamplesPerSec: %d nAvgBytesPerSec: %d " - "nBlockAlign: %d wBitsPerSample: %d cbSize: %d", + WLog_INFO(TAG, "%s:\t wFormatTag: 0x%04"PRIX16" nChannels: %"PRIu16" nSamplesPerSec: %"PRIu32" " + "nAvgBytesPerSec: %"PRIu32" nBlockAlign: %"PRIu16" wBitsPerSample: %"PRIu16" cbSize: %"PRIu16"", rdpsnd_get_audio_tag_string(format->wFormatTag), format->wFormatTag, format->nChannels, format->nSamplesPerSec, format->nAvgBytesPerSec, format->nBlockAlign, format->wBitsPerSample, format->cbSize); @@ -129,7 +129,7 @@ void rdpsnd_print_audio_formats(AUDIO_FORMAT* formats, UINT16 count) if (formats) { - WLog_INFO(TAG, "AUDIO_FORMATS (%d) ={", count); + WLog_INFO(TAG, "AUDIO_FORMATS (%"PRIu16") ={", count); for (index = 0; index < (int) count; index++) { diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index e2a6d3c0f..14656a222 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -104,7 +104,7 @@ static BOOL clear_decompress_nscodec(NSC_CONTEXT* nsc, UINT32 width, if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } @@ -138,7 +138,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } @@ -148,7 +148,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (paletteCount > 127) { - WLog_ERR(TAG, "paletteCount %lu", paletteCount); + WLog_ERR(TAG, "paletteCount %"PRIu8"", paletteCount); return FALSE; } @@ -173,8 +173,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -189,8 +188,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, { if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -201,8 +199,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, { if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 4); + WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -213,13 +210,13 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (startIndex >= paletteCount) { - WLog_ERR(TAG, "startIndex %lu > paletteCount %lu]", startIndex, paletteCount); + WLog_ERR(TAG, "startIndex %"PRIu8" > paletteCount %"PRIu8"]", startIndex, paletteCount); return FALSE; } if (stopIndex >= paletteCount) { - WLog_ERR(TAG, "stopIndex %lu > paletteCount %lu]", stopIndex, paletteCount); + WLog_ERR(TAG, "stopIndex %"PRIu8" > paletteCount %"PRIu8"]", stopIndex, paletteCount); return FALSE; } @@ -227,7 +224,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (suiteIndex > 127) { - WLog_ERR(TAG, "suiteIndex %lu > %lu]", suiteIndex, 127); + WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127]", suiteIndex); return FALSE; } @@ -235,7 +232,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if ((pixelIndex + runLengthFactor) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %lu + runLengthFactor %lu > pixelCount %lu", + WLog_ERR(TAG, "pixelIndex %"PRIu32" + runLengthFactor %"PRIu32" > pixelCount %"PRIu32"", pixelIndex, runLengthFactor, pixelCount); return FALSE; @@ -260,7 +257,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if ((pixelIndex + (suiteDepth + 1)) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %lu + suiteDepth %lu + 1 > pixelCount %lu", + WLog_ERR(TAG, "pixelIndex %"PRIu32" + suiteDepth %"PRIu8" + 1 > pixelCount %"PRIu32"", pixelIndex, suiteDepth, pixelCount); return FALSE; @@ -274,7 +271,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (suiteIndex > 127) { - WLog_ERR(TAG, "suiteIndex %lu > %lu", suiteIndex, 127); + WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127", suiteIndex); return FALSE; } @@ -297,7 +294,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, if (pixelIndex != pixelCount) { - WLog_ERR(TAG, "pixelIndex %lu != pixelCount %lu", pixelIndex, pixelCount); + WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount); return FALSE; } @@ -322,7 +319,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < residualByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), residualByteCount); return FALSE; } @@ -340,8 +337,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 4); + WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -356,8 +352,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, { if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -368,8 +363,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, { if (Stream_GetRemainingLength(s) < 4) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 4); + WLog_ERR(TAG, "stream short %"PRIuz" [4 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -380,7 +374,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if ((pixelIndex + runLengthFactor) > pixelCount) { - WLog_ERR(TAG, "pixelIndex %lu + runLengthFactor %lu > pixelCount %lu", + WLog_ERR(TAG, "pixelIndex %"PRIu32" + runLengthFactor %"PRIu32" > pixelCount %"PRIu32"", pixelIndex, runLengthFactor, pixelCount); return FALSE; @@ -399,7 +393,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, if (pixelIndex != pixelCount) { - WLog_ERR(TAG, "pixelIndex %lu != pixelCount %lu", pixelIndex, pixelCount); + WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount); return FALSE; } @@ -425,7 +419,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < subcodecByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), subcodecByteCount); return FALSE; } @@ -439,8 +433,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < 13) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 13); + WLog_ERR(TAG, "stream short %"PRIuz" [13 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -454,7 +447,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (Stream_GetRemainingLength(s) < bitmapDataByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), bitmapDataByteCount); return FALSE; } @@ -464,13 +457,13 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (width > nWidth) { - WLog_ERR(TAG, "width %lu > nWidth %lu", width, nWidth); + WLog_ERR(TAG, "width %"PRIu16" > nWidth %"PRIu32"", width, nWidth); return FALSE; } if (height > nHeight) { - WLog_ERR(TAG, "height %lu > nHeight %lu", height, nHeight); + WLog_ERR(TAG, "height %"PRIu16" > nHeight %"PRIu32"", height, nHeight); return FALSE; } @@ -482,7 +475,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (!clear->TempBuffer) { - WLog_ERR(TAG, "clear->TempBuffer realloc failed for %lu bytes", + WLog_ERR(TAG, "clear->TempBuffer realloc failed for %"PRIu32" bytes", clear->TempSize); return FALSE; } @@ -497,7 +490,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, if (bitmapDataByteCount != nSrcSize) { - WLog_ERR(TAG, "bitmapDataByteCount %lu != nSrcSize %lu", bitmapDataByteCount, + WLog_ERR(TAG, "bitmapDataByteCount %"PRIu32" != nSrcSize %"PRIu32"", bitmapDataByteCount, nSrcSize); return FALSE; } @@ -534,7 +527,7 @@ static BOOL clear_decompress_subcodecs_data(CLEAR_CONTEXT* clear, wStream* s, break; default: - WLog_ERR(TAG, "Unknown subcodec ID %lu", subcodecId); + WLog_ERR(TAG, "Unknown subcodec ID %"PRIu8"", subcodecId); return FALSE; } @@ -558,7 +551,7 @@ static BOOL resize_vbar_entry(CLEAR_CONTEXT* clear, CLEAR_VBAR_ENTRY* vBarEntry) if (!tmp) { - WLog_ERR(TAG, "vBarEntry->pixels realloc %lu failed", vBarEntry->count * bpp); + WLog_ERR(TAG, "vBarEntry->pixels realloc %"PRIu32" failed", vBarEntry->count * bpp); return FALSE; } @@ -568,8 +561,8 @@ static BOOL resize_vbar_entry(CLEAR_CONTEXT* clear, CLEAR_VBAR_ENTRY* vBarEntry) if (!vBarEntry->pixels && vBarEntry->size) { - WLog_ERR(TAG, "!vBarEntry->pixels %lu && vBarEntry->size %lu", - vBarEntry->pixels, vBarEntry->size); + WLog_ERR(TAG, "vBarEntry->pixels is NULL but vBarEntry->size is %"PRIu32"", + vBarEntry->size); return FALSE; } @@ -590,8 +583,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < bandsByteCount) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 11); + WLog_ERR(TAG, "stream short %"PRIuz" [11 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -615,8 +607,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 11) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 11); + WLog_ERR(TAG, "stream short %"PRIuz" [11 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -632,13 +623,13 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (xEnd < xStart) { - WLog_ERR(TAG, "xEnd %lu < xStart %lu", xEnd, xStart); + WLog_ERR(TAG, "xEnd %"PRIu16" < xStart %"PRIu16"", xEnd, xStart); return FALSE; } if (yEnd < yStart) { - WLog_ERR(TAG, "yEnd %lu < yStart %lu", yEnd, yStart); + WLog_ERR(TAG, "yEnd %"PRIu16" < yStart %"PRIu16"", yEnd, yStart); return FALSE; } @@ -654,8 +645,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -665,7 +655,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarHeight > 52) { - WLog_ERR(TAG, "vBarHeight > 52", vBarHeight); + WLog_ERR(TAG, "vBarHeight (%"PRIu32") > 52", vBarHeight); return FALSE; } @@ -676,14 +666,13 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (!vBarShortEntry) { - WLog_ERR(TAG, "missing vBarShortEntry %lu", vBarIndex); + WLog_ERR(TAG, "missing vBarShortEntry %"PRIu16"", vBarIndex); return FALSE; } if (Stream_GetRemainingLength(s) < 1) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 1); + WLog_ERR(TAG, "stream short %"PRIuz" [1 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -699,7 +688,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarYOff < vBarYOn) { - WLog_ERR(TAG, "vBarYOff %lu < vBarYOn %lu", vBarYOff, vBarYOn); + WLog_ERR(TAG, "vBarYOff %"PRIu16" < vBarYOn %"PRIu16"", vBarYOff, vBarYOn); return FALSE; } @@ -707,13 +696,13 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarShortPixelCount > 52) { - WLog_ERR(TAG, "vBarShortPixelCount %lu > 52", vBarShortPixelCount); + WLog_ERR(TAG, "vBarShortPixelCount %"PRIu32" > 52", vBarShortPixelCount); return FALSE; } if (Stream_GetRemainingLength(s) < (vBarShortPixelCount * 3)) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), + WLog_ERR(TAG, "stream short %"PRIuz" [%"PRIu32" expected]", Stream_GetRemainingLength(s), (vBarShortPixelCount * 3)); return FALSE; } @@ -721,7 +710,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (clear->ShortVBarStorageCursor >= CLEARCODEC_VBAR_SHORT_SIZE) { WLog_ERR(TAG, - "clear->ShortVBarStorageCursor %lu >= CLEARCODEC_VBAR_SHORT_SIZE %lu", + "clear->ShortVBarStorageCursor %"PRIu32" >= CLEARCODEC_VBAR_SHORT_SIZE (%"PRIu32")", clear->ShortVBarStorageCursor, CLEARCODEC_VBAR_SHORT_SIZE); return FALSE; } @@ -759,7 +748,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, } else { - WLog_ERR(TAG, "invalid vBarHeader %08lX", vBarHeader); + WLog_ERR(TAG, "invalid vBarHeader 0x%04"PRIX16"", vBarHeader); return FALSE; /* invalid vBarHeader */ } @@ -771,7 +760,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (clear->VBarStorageCursor >= CLEARCODEC_VBAR_SIZE) { - WLog_ERR(TAG, "clear->VBarStorageCursor %lu >= CLEARCODEC_VBAR_SIZE %lu", + WLog_ERR(TAG, "clear->VBarStorageCursor %"PRIu32" >= CLEARCODEC_VBAR_SIZE %"PRIu32"", clear->VBarStorageCursor, CLEARCODEC_VBAR_SIZE); return FALSE; @@ -842,7 +831,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, if (vBarEntry->count != vBarHeight) { - WLog_ERR(TAG, "vBarEntry->count %lu != vBarHeight %lu", vBarEntry->count, + WLog_ERR(TAG, "vBarEntry->count %"PRIu32" != vBarHeight %"PRIu32"", vBarEntry->count, vBarHeight); return FALSE; } @@ -894,7 +883,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if ((glyphFlags & CLEARCODEC_FLAG_GLYPH_HIT) && !(glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX)) { - WLog_ERR(TAG, "Invalid glyph flags %08X", glyphFlags); + WLog_ERR(TAG, "Invalid glyph flags %08"PRIX32"", glyphFlags); return FALSE; } @@ -903,14 +892,13 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if ((nWidth * nHeight) > (1024 * 1024)) { - WLog_ERR(TAG, "glyph too large: %ux%u", nWidth, nHeight); + WLog_ERR(TAG, "glyph too large: %"PRIu32"x%"PRIu32"", nWidth, nHeight); return FALSE; } if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), - 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); return FALSE; } @@ -918,7 +906,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (glyphIndex >= 4000) { - WLog_ERR(TAG, "Invalid glyphIndex %u", glyphIndex); + WLog_ERR(TAG, "Invalid glyphIndex %"PRIu16"", glyphIndex); return FALSE; } @@ -930,7 +918,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (!glyphEntry) { - WLog_ERR(TAG, "clear->GlyphCache[%lu]=NULL", glyphIndex); + WLog_ERR(TAG, "clear->GlyphCache[%"PRIu16"]=NULL", glyphIndex); return FALSE; } @@ -938,13 +926,13 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (!glyphData) { - WLog_ERR(TAG, "clear->GlyphCache[%lu]->pixels=NULL", glyphIndex); + WLog_ERR(TAG, "clear->GlyphCache[%"PRIu16"]->pixels=NULL", glyphIndex); return FALSE; } if ((nWidth * nHeight) > glyphEntry->count) { - WLog_ERR(TAG, "(nWidth %lu * nHeight %lu) > glyphEntry->count %lu", nWidth, nHeight, + WLog_ERR(TAG, "(nWidth %"PRIu32" * nHeight %"PRIu32") > glyphEntry->count %"PRIu32"", nWidth, nHeight, glyphEntry->count); return FALSE; } @@ -970,7 +958,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* clear, if (!tmp) { - WLog_ERR(TAG, "glyphEntry->pixels realloc %lu failed!", glyphEntry->size * bpp); + WLog_ERR(TAG, "glyphEntry->pixels realloc %"PRIu32" failed!", glyphEntry->size * bpp); return FALSE; } @@ -1034,7 +1022,7 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (Stream_GetRemainingLength(s) < 2) { - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), 2); + WLog_ERR(TAG, "stream short %"PRIuz" [2 expected]", Stream_GetRemainingLength(s)); goto fail; } @@ -1049,9 +1037,9 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if (seqNumber != clear->seqNumber) { - WLog_ERR(TAG, "Sequence number unexpected %u - %u", + WLog_ERR(TAG, "Sequence number unexpected %"PRIu8" - %"PRIu32"", seqNumber, clear->seqNumber); - WLog_ERR(TAG, "seqNumber %lu != clear->seqNumber %lu", seqNumber, clear->seqNumber); + WLog_ERR(TAG, "seqNumber %"PRIu8" != clear->seqNumber %"PRIu32"", seqNumber, clear->seqNumber); goto fail; } @@ -1080,7 +1068,7 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, if ((glyphFlags & mask) == mask) goto finish; - WLog_ERR(TAG, "stream short %lu [%lu expected]", Stream_GetRemainingLength(s), 12); + WLog_ERR(TAG, "stream short %"PRIuz" [12 expected]", Stream_GetRemainingLength(s)); goto fail; } @@ -1139,7 +1127,7 @@ fail: int clear_compress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize) { - WLog_ERR(TAG, "TODO: %s not implemented!"); + WLog_ERR(TAG, "TODO: %s not implemented!", __FUNCTION__); return 1; } BOOL clear_context_reset(CLEAR_CONTEXT* clear) diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 6c8d8ae24..f88282ffe 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -269,7 +269,7 @@ BOOL freerdp_image_copy_from_pointer_data( if (xorBpp == 8 && !palette) { - WLog_ERR(TAG, "null palette in conversion from %d bpp to %d bpp", + WLog_ERR(TAG, "null palette in conversion from %"PRIu32" bpp to %"PRIu32" bpp", xorBpp, dstBitsPerPixel); return FALSE; } @@ -378,7 +378,7 @@ BOOL freerdp_image_copy_from_pointer_data( } default: - WLog_ERR(TAG, "failed to convert from %d bpp to %d bpp", + WLog_ERR(TAG, "failed to convert from %"PRIu32" bpp to %"PRIu32" bpp", xorBpp, dstBitsPerPixel); return FALSE; } diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index 26b592dff..2222575c9 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -226,7 +226,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_ERR(TAG, "MFCreateSample failure: 0x%04X", hr); + WLog_ERR(TAG, "MFCreateSample failure: 0x%08"PRIX32"", hr); goto error; } @@ -235,7 +235,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_ERR(TAG, "GetOutputStreamInfo failure: 0x%04X", hr); + WLog_ERR(TAG, "GetOutputStreamInfo failure: 0x%08"PRIX32"", hr); goto error; } @@ -243,7 +243,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%04X", hr); + WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr); goto error; } @@ -251,7 +251,7 @@ static HRESULT mf_create_output_sample(H264_CONTEXT_MF* sys) if (FAILED(hr)) { - WLog_ERR(TAG, "AddBuffer failure: 0x%04X", hr); + WLog_ERR(TAG, "AddBuffer failure: 0x%08"PRIX32"", hr); goto error; } @@ -279,7 +279,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%04X", hr); + WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr); goto error; } @@ -288,7 +288,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "Lock failure: 0x%04X", hr); + WLog_ERR(TAG, "Lock failure: 0x%08"PRIX32"", hr); goto error; } @@ -297,7 +297,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "SetCurrentLength failure: 0x%04X", hr); + WLog_ERR(TAG, "SetCurrentLength failure: 0x%08"PRIX32"", hr); goto error; } @@ -305,7 +305,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "Unlock failure: 0x%04X", hr); + WLog_ERR(TAG, "Unlock failure: 0x%08"PRIX32"", hr); goto error; } @@ -313,7 +313,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "MFCreateSample failure: 0x%04X", hr); + WLog_ERR(TAG, "MFCreateSample failure: 0x%08"PRIX32"", hr); goto error; } @@ -321,7 +321,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "AddBuffer failure: 0x%04X", hr); + WLog_ERR(TAG, "AddBuffer failure: 0x%08"PRIX32"", hr); goto error; } @@ -330,7 +330,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "ProcessInput failure: 0x%04X", hr); + WLog_ERR(TAG, "ProcessInput failure: 0x%08"PRIX32"", hr); goto error; } @@ -338,7 +338,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "mf_create_output_sample failure: 0x%04X", hr); + WLog_ERR(TAG, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); goto error; } @@ -367,7 +367,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "mf_find_output_type failure: 0x%04X", hr); + WLog_ERR(TAG, "mf_find_output_type failure: 0x%08"PRIX32"", hr); goto error; } @@ -376,7 +376,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "SetOutputType failure: 0x%04X", hr); + WLog_ERR(TAG, "SetOutputType failure: 0x%08"PRIX32"", hr); goto error; } @@ -384,7 +384,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "mf_create_output_sample failure: 0x%04X", hr); + WLog_ERR(TAG, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); goto error; } @@ -393,7 +393,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "GetUINT64(MF_MT_FRAME_SIZE) failure: 0x%04X", hr); + WLog_ERR(TAG, "GetUINT64(MF_MT_FRAME_SIZE) failure: 0x%08"PRIX32"", hr); goto error; } @@ -404,7 +404,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "GetUINT32(MF_MT_DEFAULT_STRIDE) failure: 0x%04X", hr); + WLog_ERR(TAG, "GetUINT32(MF_MT_DEFAULT_STRIDE) failure: 0x%08"PRIX32"", hr); goto error; } @@ -426,7 +426,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, } else if (FAILED(hr)) { - WLog_ERR(TAG, "ProcessOutput failure: 0x%04X", hr); + WLog_ERR(TAG, "ProcessOutput failure: 0x%08"PRIX32"", hr); goto error; } else @@ -440,7 +440,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "GetBufferCount failure: 0x%04X", hr); + WLog_ERR(TAG, "GetBufferCount failure: 0x%08"PRIX32"", hr); goto error; } @@ -449,7 +449,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "GetBufferByIndex failure: 0x%04X", hr); + WLog_ERR(TAG, "GetBufferByIndex failure: 0x%08"PRIX32"", hr); goto error; } @@ -458,7 +458,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "Lock failure: 0x%04X", hr); + WLog_ERR(TAG, "Lock failure: 0x%08"PRIX32"", hr); goto error; } @@ -472,7 +472,7 @@ static int mf_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, if (FAILED(hr)) { - WLog_ERR(TAG, "Unlock failure: 0x%04X", hr); + WLog_ERR(TAG, "Unlock failure: 0x%08"PRIX32"", hr); goto error; } @@ -592,7 +592,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "MFStartup failure: 0x%04X", hr); + WLog_ERR(TAG, "MFStartup failure: 0x%08"PRIX32"", hr); goto error; } @@ -601,7 +601,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "CoCreateInstance(CLSID_CMSH264DecoderMFT) failure: 0x%04X", hr); + WLog_ERR(TAG, "CoCreateInstance(CLSID_CMSH264DecoderMFT) failure: 0x%08"PRIX32"", hr); goto error; } @@ -610,7 +610,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "QueryInterface(IID_ICodecAPI) failure: 0x%04X", hr); + WLog_ERR(TAG, "QueryInterface(IID_ICodecAPI) failure: 0x%08"PRIX32"", hr); goto error; } @@ -621,7 +621,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "SetValue(CODECAPI_AVLowLatencyMode) failure: 0x%04X", hr); + WLog_ERR(TAG, "SetValue(CODECAPI_AVLowLatencyMode) failure: 0x%08"PRIX32"", hr); goto error; } @@ -629,7 +629,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "MFCreateMediaType failure: 0x%04X", hr); + WLog_ERR(TAG, "MFCreateMediaType failure: 0x%08"PRIX32"", hr); goto error; } @@ -638,7 +638,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "SetGUID(MF_MT_MAJOR_TYPE) failure: 0x%04X", hr); + WLog_ERR(TAG, "SetGUID(MF_MT_MAJOR_TYPE) failure: 0x%08"PRIX32"", hr); goto error; } @@ -647,7 +647,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "SetGUID(MF_MT_SUBTYPE) failure: 0x%04X", hr); + WLog_ERR(TAG, "SetGUID(MF_MT_SUBTYPE) failure: 0x%08"PRIX32"", hr); goto error; } @@ -655,7 +655,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "SetInputType failure: 0x%04X", hr); + WLog_ERR(TAG, "SetInputType failure: 0x%08"PRIX32"", hr); goto error; } @@ -663,7 +663,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "mf_find_output_type failure: 0x%04X", hr); + WLog_ERR(TAG, "mf_find_output_type failure: 0x%08"PRIX32"", hr); goto error; } @@ -672,7 +672,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "SetOutputType failure: 0x%04X", hr); + WLog_ERR(TAG, "SetOutputType failure: 0x%08"PRIX32"", hr); goto error; } @@ -680,7 +680,7 @@ static BOOL mf_init(H264_CONTEXT* h264) if (FAILED(hr)) { - WLog_ERR(TAG, "mf_create_output_sample failure: 0x%04X", hr); + WLog_ERR(TAG, "mf_create_output_sample failure: 0x%08"PRIX32"", hr); goto error; } } @@ -886,7 +886,7 @@ static int openh264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, } else { - WLog_WARN(TAG, "DecodeFrame2 state: 0x%02X iBufferStatus: %d", state, + WLog_WARN(TAG, "DecodeFrame2 state: 0x%04X iBufferStatus: %d", state, sBufferInfo.iBufferStatus); return -2002; } @@ -912,7 +912,7 @@ static int openh264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, #if 0 WLog_INFO(TAG, "h264_decompress: state=%u, pYUVData=[%p,%p,%p], bufferStatus=%d, width=%d, height=%d, format=%d, stride=[%d,%d]", - state, pYUVData[0], pYUVData[1], pYUVData[2], sBufferInfo.iBufferStatus, + state, (void*) pYUVData[0], (void*) pYUVData[1], (void*) pYUVData[2], sBufferInfo.iBufferStatus, pSystemBuffer->iWidth, pSystemBuffer->iHeight, pSystemBuffer->iFormat, pSystemBuffer->iStride[0], pSystemBuffer->iStride[1]); #endif @@ -1307,9 +1307,9 @@ static int libavcodec_decompress(H264_CONTEXT* h264, BYTE* pSrcData, WLog_INFO(TAG, "libavcodec_decompress: frame decoded (status=%d, gotFrame=%d, width=%d, height=%d, Y=[%p,%d], U=[%p,%d], V=[%p,%d])", status, gotFrame, sys->videoFrame->width, sys->videoFrame->height, - sys->videoFrame->data[0], sys->videoFrame->linesize[0], - sys->videoFrame->data[1], sys->videoFrame->linesize[1], - sys->videoFrame->data[2], sys->videoFrame->linesize[2]); + (void*) sys->videoFrame->data[0], sys->videoFrame->linesize[0], + (void*) sys->videoFrame->data[1], sys->videoFrame->linesize[1], + (void*) sys->videoFrame->data[2], sys->videoFrame->linesize[2]); #endif if (gotFrame) @@ -1832,7 +1832,7 @@ INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op, } WLog_INFO(TAG, - "luma=%llu [avg=%lf] chroma=%llu [avg=%lf] combined=%llu [avg=%lf]", + "luma=%"PRIu64" [avg=%lf] chroma=%"PRIu64" [avg=%lf] combined=%"PRIu64" [avg=%lf]", op1, op1sum, op2, op2sum, op3, op3sum); #endif diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index cbac0dad6..3be3b9e70 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -302,7 +302,7 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, break; default: - WLog_ERR(TAG, "Invalid color depth %d", bpp); + WLog_ERR(TAG, "Invalid color depth %"PRIu32"", bpp); return FALSE; } @@ -367,7 +367,7 @@ BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, if ((nWidth > 64) || (nHeight > 64)) { WLog_ERR(TAG, - "interleaved_compress: width (%d) or height (%d) is greater than 64", nWidth, + "interleaved_compress: width (%"PRIu32") or height (%"PRIu32") is greater than 64", nWidth, nHeight); return FALSE; } diff --git a/libfreerdp/codec/mppc.c b/libfreerdp/codec/mppc.c index ab0d480cb..0062e9e9e 100644 --- a/libfreerdp/codec/mppc.c +++ b/libfreerdp/codec/mppc.c @@ -422,7 +422,7 @@ int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** p } #ifdef DEBUG_MPPC - WLog_DBG(TAG, "<%d,%d>", (int) CopyOffset, (int) LengthOfMatch); + WLog_DBG(TAG, "<%"PRIu32",%"PRIu32">", CopyOffset, LengthOfMatch); #endif if ((HistoryPtr + LengthOfMatch - 1) > HistoryBufferEnd) @@ -542,7 +542,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD accumulator = Sym1; #ifdef DEBUG_MPPC - WLog_DBG(TAG, "%c", accumulator); + WLog_DBG(TAG, "%"PRIu32"", accumulator); #endif if (accumulator < 0x80) @@ -576,7 +576,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD } #ifdef DEBUG_MPPC - WLog_DBG(TAG, "<%d,%d>", (int) CopyOffset, (int) LengthOfMatch); + WLog_DBG(TAG, "<%"PRIu32",%"PRIu32">", CopyOffset, LengthOfMatch); #endif /* Encode CopyOffset */ @@ -751,7 +751,7 @@ int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppD accumulator = *pSrcPtr; #ifdef DEBUG_MPPC - WLog_DBG(TAG, "%c", accumulator); + WLog_DBG(TAG, "%"PRIu32"", accumulator); #endif if (accumulator < 0x80) diff --git a/libfreerdp/codec/ncrush.c b/libfreerdp/codec/ncrush.c index 637e97058..d841c2717 100644 --- a/libfreerdp/codec/ncrush.c +++ b/libfreerdp/codec/ncrush.c @@ -1850,8 +1850,8 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BY if (HistoryPtr >= HistoryBufferEnd) { - WLog_ERR(TAG, "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)", - HistoryPtr, HistoryBufferEnd); + WLog_ERR(TAG, "ncrush_decompress error: HistoryPtr (%p) >= HistoryBufferEnd (%p)", + (void*) HistoryPtr, (void*) HistoryBufferEnd); return -1003; } diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index 683d3a0bc..daafc96b9 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -332,7 +332,7 @@ BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar, rle = (FormatHeader & PLANAR_FORMAT_HEADER_RLE) ? TRUE : FALSE; alpha = (FormatHeader & PLANAR_FORMAT_HEADER_NA) ? FALSE : TRUE; - //WLog_INFO(TAG, "CLL: %d CS: %d RLE: %d ALPHA: %d", cll, cs, rle, alpha); + //WLog_INFO(TAG, "CLL: %"PRIu32" CS: %"PRIu8" RLE: %"PRIu8" ALPHA: %"PRIu8"", cll, cs, rle, alpha); if (!cll && cs) return FALSE; /* Chroma subsampling requires YCoCg */ @@ -1104,7 +1104,7 @@ BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, offset += dstSizes[2]; context->rlePlanes[3] = &context->rlePlanesBuffer[offset]; offset += dstSizes[3]; - //WLog_DBG(TAG, "R: [%d/%d] G: [%d/%d] B: [%d/%d]", + //WLog_DBG(TAG, "R: [%"PRIu32"/%"PRIu32"] G: [%"PRIu32"/%"PRIu32"] B: [%"PRIu32"/%"PRIu32"]", // dstSizes[1], planeSize, dstSizes[2], planeSize, dstSizes[3], planeSize); } } diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 09a7c4d8b..f3b80db81 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -292,7 +292,7 @@ static void progressive_rfx_quant_print(RFX_COMPONENT_CODEC_QUANT* q, const char* name) { fprintf(stderr, - "%s: HL1: %d LH1: %d HH1: %d HL2: %d LH2: %d HH2: %d HL3: %d LH3: %d HH3: %d LL3: %d\n", + "%s: HL1: %"PRIu8" LH1: %"PRIu8" HH1: %"PRIu8" HL2: %"PRIu8" LH2: %"PRIu8" HH2: %"PRIu8" HL3: %"PRIu8" LH3: %"PRIu8" HH3: %"PRIu8" LL3: %"PRIu8"\n", name, q->HL1, q->LH1, q->HH1, q->HL2, q->LH2, q->HH2, q->HL3, q->LH3, q->HH3, q->LL3); } @@ -755,7 +755,7 @@ static int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progressive, tile->pass = 1; diff = tile->flags & RFX_TILE_DIFFERENCE; WLog_DBG(TAG, - "ProgressiveTile%s: quantIdx Y: %d Cb: %d Cr: %d xIdx: %d yIdx: %d flags: 0x%02X quality: %d yLen: %d cbLen: %d crLen: %d tailLen: %d", + "ProgressiveTile%s: quantIdx Y: %"PRIu8" Cb: %"PRIu8" Cr: %"PRIu8" xIdx: %"PRIu16" yIdx: %"PRIu16" flags: 0x%02"PRIX8" quality: %"PRIu8" yLen: %"PRIu16" cbLen: %"PRIu16" crLen: %"PRIu16" tailLen: %"PRIu16"", (tile->blockType == PROGRESSIVE_WBT_TILE_FIRST) ? "First" : "Simple", tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, tile->flags, tile->quality, tile->yLen, @@ -1115,7 +1115,7 @@ static int progressive_rfx_upgrade_component(PROGRESSIVE_CONTEXT* progressive, if (srlLen) pSrlLen = (int)((((float) aSrlLen) / ((float) srlLen)) * 100.0f); - WLog_INFO(TAG, "RAW: %d/%d %d%% (%d/%d:%d)\tSRL: %d/%d %d%% (%d/%d:%d)", + WLog_INFO(TAG, "RAW: %"PRIu32"/%"PRIu32" %d%% (%"PRIu32"/%"PRIu32":%"PRIu32")\tSRL: %"PRIu32"/%"PRIu32" %d%% (%"PRIu32"/%"PRIu32":%"PRIu32")", aRawLen, rawLen, pRawLen, state.raw->position, rawLen * 8, (rawLen * 8) - state.raw->position, aSrlLen, srlLen, pSrlLen, state.srl->position, srlLen * 8, @@ -1161,7 +1161,7 @@ static int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progressive, const primitives_t* prims = primitives_get(); tile->pass++; WLog_DBG(TAG, - "ProgressiveTileUpgrade: pass: %d quantIdx Y: %d Cb: %d Cr: %d xIdx: %d yIdx: %d quality: %d ySrlLen: %d yRawLen: %d cbSrlLen: %d cbRawLen: %d crSrlLen: %d crRawLen: %d", + "ProgressiveTileUpgrade: pass: %"PRIu16" quantIdx Y: %"PRIu8" Cb: %"PRIu8" Cr: %"PRIu8" xIdx: %"PRIu16" yIdx: %"PRIu16" quality: %"PRIu8" ySrlLen: %"PRIu16" yRawLen: %"PRIu16" cbSrlLen: %"PRIu16" cbRawLen: %"PRIu16" crSrlLen: %"PRIu16" crRawLen: %"PRIu16"", tile->pass, tile->quantIdxY, tile->quantIdxCb, tile->quantIdxCr, tile->xIdx, tile->yIdx, tile->quality, tile->ySrlLen, tile->yRawLen, tile->cbSrlLen, tile->cbRawLen, tile->crSrlLen, tile->crRawLen); @@ -1523,7 +1523,7 @@ static int progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive, if (count != region->numTiles) { - WLog_WARN(TAG, "numTiles inconsistency: actual: %d, expected: %d\n", count, + WLog_WARN(TAG, "numTiles inconsistency: actual: %"PRIu32", expected: %"PRIu16"\n", count, region->numTiles); } @@ -1643,7 +1643,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, frameBegin.regionCount = (UINT32) * ((UINT16*) &block[boffset + 4]); /* regionCount (2 bytes) */ boffset += 6; - WLog_DBG(TAG, "ProgressiveFrameBegin: frameIndex: %d regionCount: %d", + WLog_DBG(TAG, "ProgressiveFrameBegin: frameIndex: %"PRIu32" regionCount: %"PRIu16"", frameBegin.frameIndex, frameBegin.regionCount); /** * If the number of elements specified by the regionCount field is @@ -1677,7 +1677,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (context.tileSize != 64) return -1010; - WLog_DBG(TAG, "ProgressiveContext: flags: 0x%02X", context.flags); + WLog_DBG(TAG, "ProgressiveContext: flags: 0x%02"PRIX8"", context.flags); if (!(context.flags & RFX_SUBBAND_DIFFING)) { @@ -1811,7 +1811,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, return -1; WLog_DBG(TAG, - "ProgressiveRegion: numRects: %d numTiles: %d tileDataSize: %d flags: 0x%02X numQuant: %d numProgQuant: %d", + "ProgressiveRegion: numRects: %"PRIu16" numTiles: %"PRIu16" tileDataSize: %"PRIu32" flags: 0x%02"PRIX8" numQuant: %"PRIu8" numProgQuant: %"PRIu8"", region->numRects, region->numTiles, region->tileDataSize, region->flags, region->numQuant, region->numProgQuant); @@ -1845,7 +1845,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, if (idxBottom > boxBottom) boxBottom = idxBottom; - WLog_DBG(TAG, "rect[%d]: x: %d y: %d w: %d h: %d", + WLog_DBG(TAG, "rect[%"PRIu16"]: x: %"PRIu16" y: %"PRIu16" w: %"PRIu16" h: %"PRIu16"", index, rect->x, rect->y, rect->width, rect->height); } diff --git a/libfreerdp/codec/region.c b/libfreerdp/codec/region.c index 8e9b6c5ac..7c3298095 100644 --- a/libfreerdp/codec/region.c +++ b/libfreerdp/codec/region.c @@ -236,7 +236,7 @@ void region16_print(const REGION16 *region) int currentBandY = -1; rects = region16_rects(region, &nbRects); - WLog_DBG(TAG, "nrects=%d", nbRects); + WLog_DBG(TAG, "nrects=%"PRIu32"", nbRects); for (i = 0; i < nbRects; i++, rects++) { @@ -246,7 +246,7 @@ void region16_print(const REGION16 *region) WLog_DBG(TAG, "band %d: ", currentBandY); } - WLog_DBG(TAG, "(%d,%d-%d,%d)", rects->left, rects->top, rects->right, rects->bottom); + WLog_DBG(TAG, "(%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16")", rects->left, rects->top, rects->right, rects->bottom); } } diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 92b99014c..56834570d 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -433,7 +433,7 @@ static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s) if (magic != WF_MAGIC) { - WLog_ERR(TAG, "invalid magic number 0x%X", magic); + WLog_ERR(TAG, "invalid magic number 0x%08"PRIX32"", magic); return FALSE; } @@ -442,11 +442,11 @@ static BOOL rfx_process_message_sync(RFX_CONTEXT* context, wStream* s) if (context->version != WF_VERSION_1_0) { - WLog_ERR(TAG, "invalid version number 0x%04X", context->version); + WLog_ERR(TAG, "invalid version number 0x%08"PRIX32"", context->version); return FALSE; } - WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%X", context->version); + WLog_Print(context->priv->log, WLOG_DEBUG, "version 0x%08"PRIX32"", context->version); context->decodedHeaderBlocks |= _RFX_DECODED_SYNC; return TRUE; } @@ -470,24 +470,24 @@ static BOOL rfx_process_message_codec_versions(RFX_CONTEXT* context, wStream* s) if (numCodecs != 1) { - WLog_ERR(TAG, "%s: numCodes is 0x%02X (must be 0x01)", __FUNCTION__, numCodecs); + WLog_ERR(TAG, "%s: numCodes is 0x%02"PRIX8" (must be 0x01)", __FUNCTION__, numCodecs); return FALSE; } if (context->codec_id != 0x01) { - WLog_ERR(TAG, "%s: invalid codec id (0x%02X)", __FUNCTION__, context->codec_id); + WLog_ERR(TAG, "%s: invalid codec id (0x%02"PRIX32")", __FUNCTION__, context->codec_id); return FALSE; } if (context->codec_version != WF_VERSION_1_0) { - WLog_ERR(TAG, "%s: invalid codec version (0x%04X)", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid codec version (0x%08"PRIX32")", __FUNCTION__, context->codec_version); return FALSE; } - WLog_Print(context->priv->log, WLOG_DEBUG, "id %d version 0x%X.", + WLog_Print(context->priv->log, WLOG_DEBUG, "id %"PRIu32" version 0x%"PRIX32".", context->codec_id, context->codec_version); context->decodedHeaderBlocks |= _RFX_DECODED_VERSIONS; return TRUE; @@ -519,7 +519,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) if (Stream_GetRemainingLength(s) < (size_t)(numChannels * 5)) { - WLog_ERR(TAG, "RfxMessageChannels packet too small for numChannels=%d", + WLog_ERR(TAG, "RfxMessageChannels packet too small for numChannels=%"PRIu8"", numChannels); return FALSE; } @@ -529,7 +529,7 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) if (channelId != 0x00) { - WLog_ERR(TAG, "channelId:0x%02X, expected:0x00", channelId); + WLog_ERR(TAG, "channelId:0x%02"PRIX8", expected:0x00", channelId); return FALSE; } @@ -538,14 +538,14 @@ static BOOL rfx_process_message_channels(RFX_CONTEXT* context, wStream* s) if (!context->width || !context->height) { - WLog_ERR(TAG, "%s: invalid channel with/height: %ux%u", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid channel with/height: %"PRIu16"x%"PRIu16"", __FUNCTION__, context->width, context->height); return FALSE; } /* Now, only the first monitor can be used, therefore the other channels will be ignored. */ Stream_Seek(s, 5 * (numChannels - 1)); - WLog_Print(context->priv->log, WLOG_DEBUG, "numChannels %d id %d, %dx%d.", + WLog_Print(context->priv->log, WLOG_DEBUG, "numChannels %"PRIu8" id %"PRIu8", %"PRIu16"x%"PRIu16".", numChannels, channelId, context->width, context->height); context->decodedHeaderBlocks |= _RFX_DECODED_CHANNELS; return TRUE; @@ -569,7 +569,7 @@ static BOOL rfx_process_message_context(RFX_CONTEXT* context, wStream* s) tileSize); /* tileSize (2 bytes), must be set to CT_TILE_64x64 (0x0040) */ Stream_Read_UINT16(s, properties); /* properties (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "ctxId %d tileSize %d properties 0x%X.", + "ctxId %"PRIu8" tileSize %"PRIu16" properties 0x%04"PRIX16".", ctxId, tileSize, properties); context->properties = properties; context->flags = (properties & 0x0007); @@ -628,7 +628,7 @@ static BOOL rfx_process_message_frame_begin(RFX_CONTEXT* context, frameIdx); /* frameIdx (4 bytes), if codec is in video mode, must be ignored */ Stream_Read_UINT16(s, numRegions); /* numRegions (2 bytes) */ WLog_Print(context->priv->log, WLOG_DEBUG, - "RFX_FRAME_BEGIN: frameIdx: %d numRegions: %d", frameIdx, numRegions); + "RFX_FRAME_BEGIN: frameIdx: %"PRIu32" numRegions: %"PRIu16"", frameIdx, numRegions); return TRUE; } @@ -691,7 +691,7 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, if (Stream_GetRemainingLength(s) < (size_t)(8 * message->numRects)) { - WLog_ERR(TAG, "%s: packet too small for num_rects=%d", __FUNCTION__, + WLog_ERR(TAG, "%s: packet too small for num_rects=%"PRIu16"", __FUNCTION__, message->numRects); return FALSE; } @@ -708,7 +708,7 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, Stream_Read_UINT16(s, rect->y); /* y (2 bytes) */ Stream_Read_UINT16(s, rect->width); /* width (2 bytes) */ Stream_Read_UINT16(s, rect->height); /* height (2 bytes) */ - WLog_Print(context->priv->log, WLOG_DEBUG, "rect %d (x,y=%d,%d w,h=%d %d).", i, + WLog_Print(context->priv->log, WLOG_DEBUG, "rect %d (x,y=%"PRIu16",%"PRIu16" w,h=%"PRIu16" %"PRIu16").", i, rect->x, rect->y, rect->width, rect->height); } @@ -726,13 +726,13 @@ static BOOL rfx_process_message_region(RFX_CONTEXT* context, if (regionType != CBT_REGION) { - WLog_ERR(TAG, "%s: invalid region type 0x%04X", __FUNCTION__, regionType); + WLog_ERR(TAG, "%s: invalid region type 0x%04"PRIX16"", __FUNCTION__, regionType); return TRUE; } if (numTileSets != 0x0001) { - WLog_ERR(TAG, "%s: invalid number of tilesets (%u)", __FUNCTION__, numTileSets); + WLog_ERR(TAG, "%s: invalid number of tilesets (%"PRIu16")", __FUNCTION__, numTileSets); return FALSE; } @@ -824,7 +824,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, /* quantVals */ if (Stream_GetRemainingLength(s) < (size_t)(context->numQuant * 5)) { - WLog_ERR(TAG, "RfxMessageTileSet packet too small for num_quants=%d", + WLog_ERR(TAG, "RfxMessageTileSet packet too small for num_quants=%"PRIu8"", context->numQuant); return FALSE; } @@ -848,7 +848,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, *quants++ = (quant & 0x0F); *quants++ = (quant >> 4); WLog_Print(context->priv->log, WLOG_DEBUG, - "quant %d (%d %d %d %d %d %d %d %d %d %d).", + "quant %d (%"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32" %"PRIu32").", i, context->quants[i * 10], context->quants[i * 10 + 1], context->quants[i * 10 + 2], context->quants[i * 10 + 3], context->quants[i * 10 + 4], context->quants[i * 10 + 5], @@ -900,7 +900,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, /* RFX_TILE */ if (Stream_GetRemainingLength(s) < 6) { - WLog_ERR(TAG, "RfxMessageTileSet packet too small to read tile %d/%d", i, + WLog_ERR(TAG, "RfxMessageTileSet packet too small to read tile %d/%"PRIu16"", i, message->numTiles); rc = FALSE; break; @@ -913,7 +913,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, if (Stream_GetRemainingLength(s) < blockLen - 6) { WLog_ERR(TAG, - "RfxMessageTileSet not enough bytes to read tile %d/%d with blocklen=%d", + "RfxMessageTileSet not enough bytes to read tile %d/%"PRIu16" with blocklen=%"PRIu32"", i, message->numTiles, blockLen); rc = FALSE; break; @@ -923,7 +923,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, if (blockType != CBT_TILE) { - WLog_ERR(TAG, "unknown block type 0x%X, expected CBT_TILE (0xCAC3).", + WLog_ERR(TAG, "unknown block type 0x%"PRIX32", expected CBT_TILE (0xCAC3).", blockType); rc = FALSE; break; @@ -1027,7 +1027,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* RFX_BLOCKT */ Stream_Read_UINT16(s, blockType); /* blockType (2 bytes) */ Stream_Read_UINT32(s, blockLen); /* blockLen (4 bytes) */ - WLog_Print(context->priv->log, WLOG_DEBUG, "blockType 0x%X blockLen %d", + WLog_Print(context->priv->log, WLOG_DEBUG, "blockType 0x%"PRIX32" blockLen %"PRIu32"", blockType, blockLen); if (blockLen == 0) @@ -1038,7 +1038,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, if (Stream_GetRemainingLength(s) < blockLen - 6) { - WLog_ERR(TAG, "%s: packet too small for blocklen=%d", __FUNCTION__, blockLen); + WLog_ERR(TAG, "%s: packet too small for blocklen=%"PRIu32"", __FUNCTION__, blockLen); goto fail; } @@ -1066,7 +1066,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, if (codecId != 0x01) { - WLog_ERR(TAG, "%s: invalid codecId 0x%02X", __FUNCTION__, codecId); + WLog_ERR(TAG, "%s: invalid codecId 0x%02"PRIX8"", __FUNCTION__, codecId); goto fail; } @@ -1075,7 +1075,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* If the blockType is set to WBT_CONTEXT, then channelId MUST be set to 0xFF.*/ if (channelId != 0xFF) { - WLog_ERR(TAG, "%s: invalid channelId 0x%02X for blockType 0x%04X", __FUNCTION__, + WLog_ERR(TAG, "%s: invalid channelId 0x%02"PRIX8" for blockType 0x%08"PRIX32"", __FUNCTION__, channelId, blockType); goto fail; } @@ -1085,7 +1085,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, /* For all other values of blockType, channelId MUST be set to 0x00. */ if (channelId != 0x00) { - WLog_ERR(TAG, "%s: invalid channelId 0x%02X for blockType WBT_CONTEXT", + WLog_ERR(TAG, "%s: invalid channelId 0x%02"PRIX8" for blockType WBT_CONTEXT", __FUNCTION__, channelId); goto fail; } @@ -1139,7 +1139,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, break; default: - WLog_ERR(TAG, "%s: unknown blockType 0x%X", __FUNCTION__, blockType); + WLog_ERR(TAG, "%s: unknown blockType 0x%"PRIX32"", __FUNCTION__, blockType); goto fail; } @@ -1780,7 +1780,7 @@ static BOOL rfx_write_message_tileset(RFX_CONTEXT* context, wStream* s, #ifdef WITH_DEBUG_RFX WLog_Print(context->priv->log, WLOG_DEBUG, - "numQuant: %d numTiles: %d tilesDataSize: %d", + "numQuant: %"PRIu16" numTiles: %"PRIu16" tilesDataSize: %"PRIu32"", message->numQuant, message->numTiles, message->tilesDataSize); #endif return TRUE; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecClear.c b/libfreerdp/codec/test/TestFreeRDPCodecClear.c index ad1603373..87aff4c6f 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecClear.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecClear.c @@ -51,7 +51,7 @@ static BOOL test_ClearDecompressExample(UINT32 nr, const BYTE* pSrcData, status = clear_decompress(clear, pSrcData, SrcSize, 128, 128, pDstData, PIXEL_FORMAT_XRGB32, 0, 1, 1, 128, 128, NULL); - printf("clear_decompress example %lu status: %d\n", (unsigned long) nr, status); + printf("clear_decompress example %"PRIu32" status: %d\n", nr, status); fflush(stdout); clear_context_free(clear); #if 0 @@ -60,7 +60,7 @@ static BOOL test_ClearDecompressExample(UINT32 nr, const BYTE* pSrcData, return FALSE; #else - fprintf(stderr, "%s: TODO Test %lu not working!!!\n", __FUNCTION__, (unsigned long) nr); + fprintf(stderr, "%s: TODO Test %"PRIu32" not working!!!\n", __FUNCTION__, nr); #endif return TRUE; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c index fb8abb935..354f1d33e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c @@ -755,11 +755,11 @@ int test_MppcCompressBellsRdp5() DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("Flags: 0x%04X DstSize: %d\n", Flags, DstSize); + printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp5: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -795,11 +795,11 @@ int test_MppcCompressBellsRdp4() DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp4: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -833,11 +833,11 @@ int test_MppcDecompressBellsRdp5() Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -867,11 +867,11 @@ int test_MppcDecompressBellsRdp4() Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 0; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -903,11 +903,11 @@ int test_MppcCompressIslandRdp5() DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("Flags: 0x%04X DstSize: %d\n", Flags, DstSize); + printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressIslandRdp5: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -943,11 +943,11 @@ int test_MppcCompressBufferRdp5() DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBufferRdp5: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -977,11 +977,11 @@ int test_MppcDecompressBufferRdp5() Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA); status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c index 48e529287..bb5d2605b 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c @@ -29,11 +29,11 @@ int test_NCrushCompressBells() DstSize = sizeof(OutputBuffer); ZeroMemory(OutputBuffer, sizeof(OutputBuffer)); status = ncrush_compress(ncrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("status: %d Flags: 0x%04X DstSize: %d\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("NCrushCompressBells: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("NCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); printf("Expected\n"); @@ -71,11 +71,11 @@ int test_NCrushDecompressBells() Flags = PACKET_COMPRESSED | 2; expectedSize = sizeof(TEST_BELLS_DATA) - 1; status = ncrush_decompress(ncrush, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("Flags: 0x%04X DstSize: %d\n", Flags, DstSize); + printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("NCrushDecompressBells: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("NCrushDecompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c index 6f4f38f5a..5fff49c8e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c @@ -2983,7 +2983,7 @@ static BOOL RunTestPlanar(BITMAP_PLANAR_CONTEXT* planar, const BYTE* srcBitmap, decompressedBitmap, dstFormat, 0, 0, 0, width, height, FALSE)) { - printf("failed to decompress experimental bitmap 01: width: %d height: %d\n", + printf("failed to decompress experimental bitmap 01: width: %"PRIu32" height: %"PRIu32"\n", width, height); goto fail; } diff --git a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c index 59650b1d2..c831c1d64 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c @@ -62,11 +62,11 @@ int test_XCrushCompressBells() DstSize = sizeof(OutputBuffer); ZeroMemory(OutputBuffer, sizeof(OutputBuffer)); status = xcrush_compress(xcrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("status: %d Flags: 0x%04X DstSize: %d\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("XCrushCompressBells: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); printf("Expected\n"); @@ -107,11 +107,11 @@ int test_XCrushCompressIsland() DstSize = sizeof(OutputBuffer); ZeroMemory(OutputBuffer, sizeof(OutputBuffer)); status = xcrush_compress(xcrush, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("status: %d Flags: 0x%04X DstSize: %d\n", status, Flags, DstSize); + printf("status: %d Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", status, Flags, DstSize); if (DstSize != expectedSize) { - printf("XCrushCompressIsland: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); printf("Expected\n"); diff --git a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c index ec71287c6..e860062ce 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c @@ -41,11 +41,11 @@ int test_ZGfxCompressFox() Flags = 0; expectedSize = sizeof(TEST_FOX_DATA_SINGLE) - 1; status = zgfx_compress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxCompressFox: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("test_ZGfxCompressFox: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -80,11 +80,11 @@ int test_ZGfxDecompressFoxSingle() Flags = 0; expectedSize = sizeof(TEST_FOX_DATA) - 1; status = zgfx_decompress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -119,11 +119,11 @@ int test_ZGfxDecompressFoxMultipart() Flags = 0; expectedSize = sizeof(TEST_FOX_DATA) - 1; status = zgfx_decompress(zgfx, pSrcData, SrcSize, &pDstData, &DstSize, Flags); - printf("flags: 0x%04X size: %d\n", Flags, DstSize); + printf("flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } @@ -164,15 +164,15 @@ int test_ZGfxCompressConsistent() pSrcData = (BYTE*) BigBuffer; Flags = 0; status = zgfx_compress(zgfx, pSrcData, SrcSize, &pDstData2, &DstSize2, &Flags); - printf("Compress: flags: 0x%04X size: %d\n", Flags, DstSize2); + printf("Compress: flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize2); /* Decompress */ status = zgfx_decompress(zgfx, pDstData2, DstSize2, &pDstData, &DstSize, Flags); - printf("Decompress: flags: 0x%04X size: %d\n", Flags, DstSize); + printf("Decompress: flags: 0x%08"PRIX32" size: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %d, Expected: %d\n", DstSize, expectedSize); + printf("test_ZGfxDecompressFoxSingle: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); return -1; } diff --git a/libfreerdp/codec/test/TestFreeRDPRegion.c b/libfreerdp/codec/test/TestFreeRDPRegion.c index 70d7e77fc..552c25427 100644 --- a/libfreerdp/codec/test/TestFreeRDPRegion.c +++ b/libfreerdp/codec/test/TestFreeRDPRegion.c @@ -30,7 +30,7 @@ static BOOL compareRectangles(const RECTANGLE_16 *src1, const RECTANGLE_16 *src2 { if (memcmp(src1, src2, sizeof(RECTANGLE_16))) { - fprintf(stderr, "expecting rect %d (%d,%d-%d,%d) and have (%d,%d-%d,%d)\n", + fprintf(stderr, "expecting rect %d (%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16") and have (%"PRIu16",%"PRIu16"-%"PRIu16",%"PRIu16")\n", i, src2->left, src2->top, src2->right, src2->bottom, src1->left, src1->top, src1->right, src1->bottom ); @@ -710,7 +710,7 @@ static int test_norbert2_case(void) { } if (nbRects != 1) { - fprintf(stderr, "%s: Error 3 - expected nbRects == 1 but got %d\n", __FUNCTION__, nbRects); + fprintf(stderr, "%s: Error 3 - expected nbRects == 1 but got %"PRIu32"\n", __FUNCTION__, nbRects); goto out; } @@ -730,7 +730,7 @@ static int test_norbert2_case(void) { } if (nbRects != 2) { - fprintf(stderr, "%s: Error 7 - expected nbRects == 2 but got %d\n", __FUNCTION__, nbRects); + fprintf(stderr, "%s: Error 7 - expected nbRects == 2 but got %"PRIu32"\n", __FUNCTION__, nbRects); goto out; } diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 9b2416244..a19a553aa 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -400,7 +400,7 @@ out_parallel_name_error: } - WLog_ERR(TAG, "unknown device type %d", device->Type); + WLog_ERR(TAG, "unknown device type %"PRIu32"", device->Type); return NULL; } @@ -1678,7 +1678,7 @@ int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param) break; default: - WLog_ERR(TAG, "freerdp_set_param_bool: unknown id %d (param = %d)", id, param); + WLog_ERR(TAG, "freerdp_set_param_bool: unknown id %d (param = %"PRId32")", id, param); return -1; } @@ -2301,7 +2301,7 @@ int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param) break; default: - WLog_ERR(TAG, "freerdp_set_param_uint32: unknown id %d (param = %u)", id, param); + WLog_ERR(TAG, "freerdp_set_param_uint32: unknown id %d (param = %"PRIu32")", id, param); return -1; } @@ -2333,7 +2333,7 @@ int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param) break; default: - WLog_ERR(TAG, "freerdp_set_param_uint64: unknown id %d (param = %u)", id, (UINT32) param); + WLog_ERR(TAG, "freerdp_set_param_uint64: unknown id %d (param = %"PRIu64")", id, param); return -1; } diff --git a/libfreerdp/common/test/TestCommonAssistance.c b/libfreerdp/common/test/TestCommonAssistance.c index 7c8d977f1..e95e7ce69 100644 --- a/libfreerdp/common/test/TestCommonAssistance.c +++ b/libfreerdp/common/test/TestCommonAssistance.c @@ -99,16 +99,16 @@ int test_msrsc_incident_file_type1() printf("Username: %s\n", file->Username); printf("LHTicket: %s\n", file->LHTicket); printf("RCTicket: %s\n", file->RCTicket); - printf("RCTicketEncrypted: %d\n", file->RCTicketEncrypted); + printf("RCTicketEncrypted: %"PRId32"\n", file->RCTicketEncrypted); printf("PassStub: %s\n", file->PassStub); - printf("DtStart: %d\n", file->DtStart); - printf("DtLength: %d\n", file->DtLength); - printf("LowSpeed: %d\n", file->LowSpeed); + printf("DtStart: %"PRIu32"\n", file->DtStart); + printf("DtLength: %"PRIu32"\n", file->DtLength); + printf("LowSpeed: %"PRId32"\n", file->LowSpeed); printf("RASessionId: %s\n", file->RASessionId); printf("RASpecificParams: %s\n", file->RASpecificParams); printf("MachineAddress: %s\n", file->MachineAddress); - printf("MachinePort: %d\n", (int) file->MachinePort); + printf("MachinePort: %"PRIu32"\n", file->MachinePort); status = freerdp_assistance_decrypt(file, TEST_MSRC_INCIDENT_PASSWORD_TYPE1); @@ -153,16 +153,16 @@ int test_msrsc_incident_file_type2() printf("Username: %s\n", file->Username); printf("LHTicket: %s\n", file->LHTicket); printf("RCTicket: %s\n", file->RCTicket); - printf("RCTicketEncrypted: %d\n", file->RCTicketEncrypted); + printf("RCTicketEncrypted: %"PRId32"\n", file->RCTicketEncrypted); printf("PassStub: %s\n", file->PassStub); - printf("DtStart: %d\n", file->DtStart); - printf("DtLength: %d\n", file->DtLength); - printf("LowSpeed: %d\n", file->LowSpeed); + printf("DtStart: %"PRIu32"\n", file->DtStart); + printf("DtLength: %"PRIu32"\n", file->DtLength); + printf("LowSpeed: %"PRId32"\n", file->LowSpeed); printf("RASessionId: %s\n", file->RASessionId); printf("RASpecificParams: %s\n", file->RASpecificParams); printf("MachineAddress: %s\n", file->MachineAddress); - printf("MachinePort: %d\n", (int) file->MachinePort); + printf("MachinePort: %"PRIu32"\n", file->MachinePort); status = freerdp_assistance_decrypt(file, TEST_MSRC_INCIDENT_PASSWORD_TYPE2); diff --git a/libfreerdp/core/autodetect.c b/libfreerdp/core/autodetect.c index 009e61526..a6ae9487b 100644 --- a/libfreerdp/core/autodetect.c +++ b/libfreerdp/core/autodetect.c @@ -151,7 +151,7 @@ BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 paylo if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Payload PDU -> payloadLength=%u", payloadLength); + WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Payload PDU -> payloadLength=%"PRIu16"", payloadLength); /* 4-bytes aligned */ payloadLength &= ~3; @@ -199,7 +199,7 @@ static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 p if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Stop PDU -> payloadLength=%u", payloadLength); + WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Stop PDU -> payloadLength=%"PRIu16"", payloadLength); /* 4-bytes aligned */ payloadLength &= ~3; @@ -268,7 +268,7 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 respon if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Results PDU -> timeDelta=%u, byteCount=%u", timeDelta, rdp->autodetect->bandwidthMeasureByteCount); + WLog_VRB(AUTODETECT_TAG, "sending Bandwidth Measure Results PDU -> timeDelta=%"PRIu32", byteCount=%"PRIu32"", timeDelta, rdp->autodetect->bandwidthMeasureByteCount); Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ @@ -331,7 +331,7 @@ BOOL autodetect_send_netchar_sync(rdpRdp* rdp, UINT16 sequenceNumber) if (!s) return FALSE; - WLog_VRB(AUTODETECT_TAG, "sending Network Characteristics Sync PDU -> bandwidth=%u, rtt=%u", rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); + WLog_VRB(AUTODETECT_TAG, "sending Network Characteristics Sync PDU -> bandwidth=%"PRIu32", rtt=%"PRIu32"", rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */ Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */ @@ -377,7 +377,7 @@ static BOOL autodetect_recv_bandwidth_measure_start(rdpRdp* rdp, wStream* s, AUT if (autodetectReqPdu->headerLength != 0x06) return FALSE; - WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Start PDU - time=%lu", (unsigned long) GetTickCountPrecise()); + WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Start PDU - time=%"PRIu32"", GetTickCountPrecise()); /* Initialize bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureStartTime = GetTickCountPrecise(); @@ -404,7 +404,7 @@ static BOOL autodetect_recv_bandwidth_measure_payload(rdpRdp* rdp, wStream* s, A Stream_Read_UINT16(s, payloadLength); /* payloadLength (2 bytes) */ - WLog_DBG(AUTODETECT_TAG, "received Bandwidth Measure Payload PDU -> payloadLength=%u", payloadLength); + WLog_DBG(AUTODETECT_TAG, "received Bandwidth Measure Payload PDU -> payloadLength=%"PRIu16"", payloadLength); /* Add the payload length to the bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureByteCount += payloadLength; @@ -435,7 +435,7 @@ static BOOL autodetect_recv_bandwidth_measure_stop(rdpRdp* rdp, wStream* s, AUTO payloadLength = 0; } - WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Stop PDU -> payloadLength=%u", payloadLength); + WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Stop PDU -> payloadLength=%"PRIu16"", payloadLength); /* Add the payload length to the bandwidth measurement parameters */ rdp->autodetect->bandwidthMeasureByteCount += payloadLength; @@ -507,7 +507,7 @@ static BOOL autodetect_recv_netchar_result(rdpRdp* rdp, wStream* s, AUTODETECT_R break; } - WLog_VRB(AUTODETECT_TAG, "received Network Characteristics Result PDU -> baseRTT=%u, bandwidth=%u, averageRTT=%u", rdp->autodetect->netCharBaseRTT, rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); + WLog_VRB(AUTODETECT_TAG, "received Network Characteristics Result PDU -> baseRTT=%"PRIu32", bandwidth=%"PRIu32", averageRTT=%"PRIu32"", rdp->autodetect->netCharBaseRTT, rdp->autodetect->netCharBandwidth, rdp->autodetect->netCharAverageRTT); IFCALLRET(rdp->autodetect->NetworkCharacteristicsResult, success, rdp->context, autodetectReqPdu->sequenceNumber); @@ -528,7 +528,7 @@ int rdp_recv_autodetect_request_packet(rdpRdp* rdp, wStream* s) Stream_Read_UINT16(s, autodetectReqPdu.requestType); /* requestType (2 bytes) */ WLog_VRB(AUTODETECT_TAG, - "rdp_recv_autodetect_request_packet: headerLength=%u, headerTypeId=%u, sequenceNumber=%u, requestType=%04x", + "rdp_recv_autodetect_request_packet: headerLength=%"PRIu8", headerTypeId=%"PRIu8", sequenceNumber=%"PRIu16", requestType=%04"PRIx16"", autodetectReqPdu.headerLength, autodetectReqPdu.headerTypeId, autodetectReqPdu.sequenceNumber, autodetectReqPdu.requestType); @@ -590,7 +590,7 @@ int rdp_recv_autodetect_response_packet(rdpRdp* rdp, wStream* s) Stream_Read_UINT16(s, autodetectRspPdu.responseType); /* responseType (2 bytes) */ WLog_VRB(AUTODETECT_TAG, - "rdp_recv_autodetect_response_packet: headerLength=%u, headerTypeId=%u, sequenceNumber=%u, requestType=%04x", + "rdp_recv_autodetect_response_packet: headerLength=%"PRIu8", headerTypeId=%"PRIu8", sequenceNumber=%"PRIu16", requestType=%04"PRIx16"", autodetectRspPdu.headerLength, autodetectRspPdu.headerTypeId, autodetectRspPdu.sequenceNumber, autodetectRspPdu.responseType); diff --git a/libfreerdp/core/bulk.c b/libfreerdp/core/bulk.c index 0974d7cf6..074d1d2ff 100644 --- a/libfreerdp/core/bulk.c +++ b/libfreerdp/core/bulk.c @@ -87,13 +87,13 @@ int bulk_compress_validate(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** if (_DstSize != SrcSize) { - WLog_DBG(TAG, "compression/decompression size mismatch: Actual: %d, Expected: %d", _DstSize, SrcSize); + WLog_DBG(TAG, "compression/decompression size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"", _DstSize, SrcSize); return -1; } if (memcmp(_pDstData, pSrcData, SrcSize) != 0) { - WLog_DBG(TAG, "compression/decompression input/output mismatch! flags: 0x%04X", _Flags); + WLog_DBG(TAG, "compression/decompression input/output mismatch! flags: 0x%08"PRIX32"", _Flags); #if 1 WLog_DBG(TAG, "Actual:"); winpr_HexDump(TAG, WLOG_DEBUG, _pDstData, SrcSize); @@ -159,11 +159,11 @@ int bulk_decompress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstD CompressionRatio = metrics_write_bytes(metrics, UncompressedBytes, CompressedBytes); #ifdef WITH_BULK_DEBUG { - WLog_DBG(TAG, "Decompress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)", + WLog_DBG(TAG, "Decompress Type: %"PRIu32" Flags: %s (0x%08"PRIX32") Compression Ratio: %f (%"PRIu32" / %"PRIu32"), Total: %f (%"PRIu64" / %"PRIu64")", type, bulk_get_compression_flags_string(flags), flags, CompressionRatio, CompressedBytes, UncompressedBytes, - metrics->TotalCompressionRatio, (UINT32) metrics->TotalCompressedBytes, - (UINT32) metrics->TotalUncompressedBytes); + metrics->TotalCompressionRatio, metrics->TotalCompressedBytes, + metrics->TotalUncompressedBytes); } #endif } @@ -222,11 +222,11 @@ int bulk_compress(rdpBulk* bulk, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstDat CompressionRatio = metrics_write_bytes(metrics, UncompressedBytes, CompressedBytes); #ifdef WITH_BULK_DEBUG { - WLog_DBG(TAG, "Compress Type: %d Flags: %s (0x%04X) Compression Ratio: %f (%d / %d), Total: %f (%u / %u)", + WLog_DBG(TAG, "Compress Type: %"PRIu32" Flags: %s (0x%08"PRIX32") Compression Ratio: %f (%"PRIu32" / %"PRIu32"), Total: %f (%"PRIu64" / %"PRIu64")", bulk->CompressionLevel, bulk_get_compression_flags_string(*pFlags), *pFlags, CompressionRatio, CompressedBytes, UncompressedBytes, - metrics->TotalCompressionRatio, (UINT32) metrics->TotalCompressedBytes, - (UINT32) metrics->TotalUncompressedBytes); + metrics->TotalCompressionRatio, metrics->TotalCompressedBytes, + metrics->TotalUncompressedBytes); } #endif } diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index 640cc7b0e..37119910c 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -283,7 +283,7 @@ static BOOL rdp_print_general_capability_set(wStream* s, UINT16 length) if (length < 24) return FALSE; - WLog_INFO(TAG, "GeneralCapabilitySet (length %d):", length); + WLog_INFO(TAG, "GeneralCapabilitySet (length %"PRIu16"):", length); Stream_Read_UINT16(s, osMajorType); /* osMajorType (2 bytes) */ Stream_Read_UINT16(s, osMinorType); /* osMinorType (2 bytes) */ Stream_Read_UINT16(s, protocolVersion); /* protocolVersion (2 bytes) */ @@ -299,17 +299,17 @@ static BOOL rdp_print_general_capability_set(wStream* s, UINT16 length) Stream_Read_UINT8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */ Stream_Read_UINT8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */ - WLog_INFO(TAG, "\tosMajorType: 0x%04X", osMajorType); - WLog_INFO(TAG, "\tosMinorType: 0x%04X", osMinorType); - WLog_INFO(TAG, "\tprotocolVersion: 0x%04X", protocolVersion); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04X", pad2OctetsA); - WLog_INFO(TAG, "\tgeneralCompressionTypes: 0x%04X", generalCompressionTypes); - WLog_INFO(TAG, "\textraFlags: 0x%04X", extraFlags); - WLog_INFO(TAG, "\tupdateCapabilityFlag: 0x%04X", updateCapabilityFlag); - WLog_INFO(TAG, "\tremoteUnshareFlag: 0x%04X", remoteUnshareFlag); - WLog_INFO(TAG, "\tgeneralCompressionLevel: 0x%04X", generalCompressionLevel); - WLog_INFO(TAG, "\trefreshRectSupport: 0x%02X", refreshRectSupport); - WLog_INFO(TAG, "\tsuppressOutputSupport: 0x%02X", suppressOutputSupport); + WLog_INFO(TAG, "\tosMajorType: 0x%04"PRIX16"", osMajorType); + WLog_INFO(TAG, "\tosMinorType: 0x%04"PRIX16"", osMinorType); + WLog_INFO(TAG, "\tprotocolVersion: 0x%04"PRIX16"", protocolVersion); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); + WLog_INFO(TAG, "\tgeneralCompressionTypes: 0x%04"PRIX16"", generalCompressionTypes); + WLog_INFO(TAG, "\textraFlags: 0x%04"PRIX16"", extraFlags); + WLog_INFO(TAG, "\tupdateCapabilityFlag: 0x%04"PRIX16"", updateCapabilityFlag); + WLog_INFO(TAG, "\tremoteUnshareFlag: 0x%04"PRIX16"", remoteUnshareFlag); + WLog_INFO(TAG, "\tgeneralCompressionLevel: 0x%04"PRIX16"", generalCompressionLevel); + WLog_INFO(TAG, "\trefreshRectSupport: 0x%02"PRIX8"", refreshRectSupport); + WLog_INFO(TAG, "\tsuppressOutputSupport: 0x%02"PRIX8"", suppressOutputSupport); return TRUE; } @@ -454,7 +454,7 @@ static BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length) BYTE drawingFlags; UINT16 multipleRectangleSupport; UINT16 pad2OctetsB; - WLog_INFO(TAG, "BitmapCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCapabilitySet (length %"PRIu16"):", length); if (length < 28) return FALSE; @@ -477,19 +477,19 @@ static BOOL rdp_print_bitmap_capability_set(wStream* s, UINT16 length) Stream_Read_UINT16(s, multipleRectangleSupport); /* multipleRectangleSupport (2 bytes) */ Stream_Read_UINT16(s, pad2OctetsB); /* pad2OctetsB (2 bytes) */ - WLog_INFO(TAG, "\tpreferredBitsPerPixel: 0x%04X", preferredBitsPerPixel); - WLog_INFO(TAG, "\treceive1BitPerPixel: 0x%04X", receive1BitPerPixel); - WLog_INFO(TAG, "\treceive4BitsPerPixel: 0x%04X", receive4BitsPerPixel); - WLog_INFO(TAG, "\treceive8BitsPerPixel: 0x%04X", receive8BitsPerPixel); - WLog_INFO(TAG, "\tdesktopWidth: 0x%04X", desktopWidth); - WLog_INFO(TAG, "\tdesktopHeight: 0x%04X", desktopHeight); - WLog_INFO(TAG, "\tpad2Octets: 0x%04X", pad2Octets); - WLog_INFO(TAG, "\tdesktopResizeFlag: 0x%04X", desktopResizeFlag); - WLog_INFO(TAG, "\tbitmapCompressionFlag: 0x%04X", bitmapCompressionFlag); - WLog_INFO(TAG, "\thighColorFlags: 0x%02X", highColorFlags); - WLog_INFO(TAG, "\tdrawingFlags: 0x%02X", drawingFlags); - WLog_INFO(TAG, "\tmultipleRectangleSupport: 0x%04X", multipleRectangleSupport); - WLog_INFO(TAG, "\tpad2OctetsB: 0x%04X", pad2OctetsB); + WLog_INFO(TAG, "\tpreferredBitsPerPixel: 0x%04"PRIX16"", preferredBitsPerPixel); + WLog_INFO(TAG, "\treceive1BitPerPixel: 0x%04"PRIX16"", receive1BitPerPixel); + WLog_INFO(TAG, "\treceive4BitsPerPixel: 0x%04"PRIX16"", receive4BitsPerPixel); + WLog_INFO(TAG, "\treceive8BitsPerPixel: 0x%04"PRIX16"", receive8BitsPerPixel); + WLog_INFO(TAG, "\tdesktopWidth: 0x%04"PRIX16"", desktopWidth); + WLog_INFO(TAG, "\tdesktopHeight: 0x%04"PRIX16"", desktopHeight); + WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); + WLog_INFO(TAG, "\tdesktopResizeFlag: 0x%04"PRIX16"", desktopResizeFlag); + WLog_INFO(TAG, "\tbitmapCompressionFlag: 0x%04"PRIX16"", bitmapCompressionFlag); + WLog_INFO(TAG, "\thighColorFlags: 0x%02"PRIX8"", highColorFlags); + WLog_INFO(TAG, "\tdrawingFlags: 0x%02"PRIX8"", drawingFlags); + WLog_INFO(TAG, "\tmultipleRectangleSupport: 0x%04"PRIX16"", multipleRectangleSupport); + WLog_INFO(TAG, "\tpad2OctetsB: 0x%04"PRIX16"", pad2OctetsB); return TRUE; } @@ -637,7 +637,7 @@ static BOOL rdp_print_order_capability_set(wStream* s, UINT16 length) UINT16 pad2OctetsD; UINT16 textANSICodePage; UINT16 pad2OctetsE; - WLog_INFO(TAG, "OrderCapabilitySet (length %d):", length); + WLog_INFO(TAG, "OrderCapabilitySet (length %"PRIu16"):", length); if (length < 88) return FALSE; @@ -661,59 +661,59 @@ static BOOL rdp_print_order_capability_set(wStream* s, UINT16 length) Stream_Read_UINT16(s, pad2OctetsD); /* pad2OctetsD (2 bytes) */ Stream_Read_UINT16(s, textANSICodePage); /* textANSICodePage (2 bytes) */ Stream_Read_UINT16(s, pad2OctetsE); /* pad2OctetsE (2 bytes) */ - WLog_INFO(TAG, "\tpad4OctetsA: 0x%08X", pad4OctetsA); - WLog_INFO(TAG, "\tdesktopSaveXGranularity: 0x%04X", desktopSaveXGranularity); - WLog_INFO(TAG, "\tdesktopSaveYGranularity: 0x%04X", desktopSaveYGranularity); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04X", pad2OctetsA); - WLog_INFO(TAG, "\tmaximumOrderLevel: 0x%04X", maximumOrderLevel); - WLog_INFO(TAG, "\tnumberFonts: 0x%04X", numberFonts); - WLog_INFO(TAG, "\torderFlags: 0x%04X", orderFlags); + WLog_INFO(TAG, "\tpad4OctetsA: 0x%08"PRIX32"", pad4OctetsA); + WLog_INFO(TAG, "\tdesktopSaveXGranularity: 0x%04"PRIX16"", desktopSaveXGranularity); + WLog_INFO(TAG, "\tdesktopSaveYGranularity: 0x%04"PRIX16"", desktopSaveYGranularity); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); + WLog_INFO(TAG, "\tmaximumOrderLevel: 0x%04"PRIX16"", maximumOrderLevel); + WLog_INFO(TAG, "\tnumberFonts: 0x%04"PRIX16"", numberFonts); + WLog_INFO(TAG, "\torderFlags: 0x%04"PRIX16"", orderFlags); WLog_INFO(TAG, "\torderSupport:"); - WLog_INFO(TAG, "\t\tDSTBLT: %d", orderSupport[NEG_DSTBLT_INDEX]); - WLog_INFO(TAG, "\t\tPATBLT: %d", orderSupport[NEG_PATBLT_INDEX]); - WLog_INFO(TAG, "\t\tSCRBLT: %d", orderSupport[NEG_SCRBLT_INDEX]); - WLog_INFO(TAG, "\t\tMEMBLT: %d", orderSupport[NEG_MEMBLT_INDEX]); - WLog_INFO(TAG, "\t\tMEM3BLT: %d", orderSupport[NEG_MEM3BLT_INDEX]); - WLog_INFO(TAG, "\t\tATEXTOUT: %d", orderSupport[NEG_ATEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tAEXTTEXTOUT: %d", orderSupport[NEG_AEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tDRAWNINEGRID: %d", orderSupport[NEG_DRAWNINEGRID_INDEX]); - WLog_INFO(TAG, "\t\tLINETO: %d", orderSupport[NEG_LINETO_INDEX]); - WLog_INFO(TAG, "\t\tMULTI_DRAWNINEGRID: %d", + WLog_INFO(TAG, "\t\tDSTBLT: %"PRIu8"", orderSupport[NEG_DSTBLT_INDEX]); + WLog_INFO(TAG, "\t\tPATBLT: %"PRIu8"", orderSupport[NEG_PATBLT_INDEX]); + WLog_INFO(TAG, "\t\tSCRBLT: %"PRIu8"", orderSupport[NEG_SCRBLT_INDEX]); + WLog_INFO(TAG, "\t\tMEMBLT: %"PRIu8"", orderSupport[NEG_MEMBLT_INDEX]); + WLog_INFO(TAG, "\t\tMEM3BLT: %"PRIu8"", orderSupport[NEG_MEM3BLT_INDEX]); + WLog_INFO(TAG, "\t\tATEXTOUT: %"PRIu8"", orderSupport[NEG_ATEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tAEXTTEXTOUT: %"PRIu8"", orderSupport[NEG_AEXTTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tDRAWNINEGRID: %"PRIu8"", orderSupport[NEG_DRAWNINEGRID_INDEX]); + WLog_INFO(TAG, "\t\tLINETO: %"PRIu8"", orderSupport[NEG_LINETO_INDEX]); + WLog_INFO(TAG, "\t\tMULTI_DRAWNINEGRID: %"PRIu8"", orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX]); - WLog_INFO(TAG, "\t\tOPAQUE_RECT: %d", orderSupport[NEG_OPAQUE_RECT_INDEX]); - WLog_INFO(TAG, "\t\tSAVEBITMAP: %d", orderSupport[NEG_SAVEBITMAP_INDEX]); - WLog_INFO(TAG, "\t\tWTEXTOUT: %d", orderSupport[NEG_WTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tMEMBLT_V2: %d", orderSupport[NEG_MEMBLT_V2_INDEX]); - WLog_INFO(TAG, "\t\tMEM3BLT_V2: %d", orderSupport[NEG_MEM3BLT_V2_INDEX]); - WLog_INFO(TAG, "\t\tMULTIDSTBLT: %d", orderSupport[NEG_MULTIDSTBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTIPATBLT: %d", orderSupport[NEG_MULTIPATBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTISCRBLT: %d", orderSupport[NEG_MULTISCRBLT_INDEX]); - WLog_INFO(TAG, "\t\tMULTIOPAQUERECT: %d", + WLog_INFO(TAG, "\t\tOPAQUE_RECT: %"PRIu8"", orderSupport[NEG_OPAQUE_RECT_INDEX]); + WLog_INFO(TAG, "\t\tSAVEBITMAP: %"PRIu8"", orderSupport[NEG_SAVEBITMAP_INDEX]); + WLog_INFO(TAG, "\t\tWTEXTOUT: %"PRIu8"", orderSupport[NEG_WTEXTOUT_INDEX]); + WLog_INFO(TAG, "\t\tMEMBLT_V2: %"PRIu8"", orderSupport[NEG_MEMBLT_V2_INDEX]); + WLog_INFO(TAG, "\t\tMEM3BLT_V2: %"PRIu8"", orderSupport[NEG_MEM3BLT_V2_INDEX]); + WLog_INFO(TAG, "\t\tMULTIDSTBLT: %"PRIu8"", orderSupport[NEG_MULTIDSTBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTIPATBLT: %"PRIu8"", orderSupport[NEG_MULTIPATBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTISCRBLT: %"PRIu8"", orderSupport[NEG_MULTISCRBLT_INDEX]); + WLog_INFO(TAG, "\t\tMULTIOPAQUERECT: %"PRIu8"", orderSupport[NEG_MULTIOPAQUERECT_INDEX]); - WLog_INFO(TAG, "\t\tFAST_INDEX: %d", orderSupport[NEG_FAST_INDEX_INDEX]); - WLog_INFO(TAG, "\t\tPOLYGON_SC: %d", orderSupport[NEG_POLYGON_SC_INDEX]); - WLog_INFO(TAG, "\t\tPOLYGON_CB: %d", orderSupport[NEG_POLYGON_CB_INDEX]); - WLog_INFO(TAG, "\t\tPOLYLINE: %d", orderSupport[NEG_POLYLINE_INDEX]); - WLog_INFO(TAG, "\t\tUNUSED23: %d", orderSupport[NEG_UNUSED23_INDEX]); - WLog_INFO(TAG, "\t\tFAST_GLYPH: %d", orderSupport[NEG_FAST_GLYPH_INDEX]); - WLog_INFO(TAG, "\t\tELLIPSE_SC: %d", orderSupport[NEG_ELLIPSE_SC_INDEX]); - WLog_INFO(TAG, "\t\tELLIPSE_CB: %d", orderSupport[NEG_ELLIPSE_CB_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_INDEX: %d", orderSupport[NEG_GLYPH_INDEX_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WEXTTEXTOUT: %d", + WLog_INFO(TAG, "\t\tFAST_INDEX: %"PRIu8"", orderSupport[NEG_FAST_INDEX_INDEX]); + WLog_INFO(TAG, "\t\tPOLYGON_SC: %"PRIu8"", orderSupport[NEG_POLYGON_SC_INDEX]); + WLog_INFO(TAG, "\t\tPOLYGON_CB: %"PRIu8"", orderSupport[NEG_POLYGON_CB_INDEX]); + WLog_INFO(TAG, "\t\tPOLYLINE: %"PRIu8"", orderSupport[NEG_POLYLINE_INDEX]); + WLog_INFO(TAG, "\t\tUNUSED23: %"PRIu8"", orderSupport[NEG_UNUSED23_INDEX]); + WLog_INFO(TAG, "\t\tFAST_GLYPH: %"PRIu8"", orderSupport[NEG_FAST_GLYPH_INDEX]); + WLog_INFO(TAG, "\t\tELLIPSE_SC: %"PRIu8"", orderSupport[NEG_ELLIPSE_SC_INDEX]); + WLog_INFO(TAG, "\t\tELLIPSE_CB: %"PRIu8"", orderSupport[NEG_ELLIPSE_CB_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_INDEX: %"PRIu8"", orderSupport[NEG_GLYPH_INDEX_INDEX]); + WLog_INFO(TAG, "\t\tGLYPH_WEXTTEXTOUT: %"PRIu8"", orderSupport[NEG_GLYPH_WEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WLONGTEXTOUT: %d", + WLog_INFO(TAG, "\t\tGLYPH_WLONGTEXTOUT: %"PRIu8"", orderSupport[NEG_GLYPH_WLONGTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tGLYPH_WLONGEXTTEXTOUT: %d", + WLog_INFO(TAG, "\t\tGLYPH_WLONGEXTTEXTOUT: %"PRIu8"", orderSupport[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX]); - WLog_INFO(TAG, "\t\tUNUSED31: %d", orderSupport[NEG_UNUSED31_INDEX]); - WLog_INFO(TAG, "\ttextFlags: 0x%04X", textFlags); - WLog_INFO(TAG, "\torderSupportExFlags: 0x%04X", orderSupportExFlags); - WLog_INFO(TAG, "\tpad4OctetsB: 0x%08X", pad4OctetsB); - WLog_INFO(TAG, "\tdesktopSaveSize: 0x%08X", desktopSaveSize); - WLog_INFO(TAG, "\tpad2OctetsC: 0x%04X", pad2OctetsC); - WLog_INFO(TAG, "\tpad2OctetsD: 0x%04X", pad2OctetsD); - WLog_INFO(TAG, "\ttextANSICodePage: 0x%04X", textANSICodePage); - WLog_INFO(TAG, "\tpad2OctetsE: 0x%04X", pad2OctetsE); + WLog_INFO(TAG, "\t\tUNUSED31: %"PRIu8"", orderSupport[NEG_UNUSED31_INDEX]); + WLog_INFO(TAG, "\ttextFlags: 0x%04"PRIX16"", textFlags); + WLog_INFO(TAG, "\torderSupportExFlags: 0x%04"PRIX16"", orderSupportExFlags); + WLog_INFO(TAG, "\tpad4OctetsB: 0x%08"PRIX32"", pad4OctetsB); + WLog_INFO(TAG, "\tdesktopSaveSize: 0x%08"PRIX32"", desktopSaveSize); + WLog_INFO(TAG, "\tpad2OctetsC: 0x%04"PRIX16"", pad2OctetsC); + WLog_INFO(TAG, "\tpad2OctetsD: 0x%04"PRIX16"", pad2OctetsD); + WLog_INFO(TAG, "\ttextANSICodePage: 0x%04"PRIX16"", textANSICodePage); + WLog_INFO(TAG, "\tpad2OctetsE: 0x%04"PRIX16"", pad2OctetsE); return TRUE; } @@ -794,7 +794,7 @@ static BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length) UINT16 Cache1MaximumCellSize; UINT16 Cache2Entries; UINT16 Cache2MaximumCellSize; - WLog_INFO(TAG, "BitmapCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCacheCapabilitySet (length %"PRIu16"):", length); if (length < 40) return FALSE; @@ -814,18 +814,18 @@ static BOOL rdp_print_bitmap_cache_capability_set(wStream* s, UINT16 length) Stream_Read_UINT16(s, Cache2Entries); /* Cache2Entries (2 bytes) */ Stream_Read_UINT16(s, Cache2MaximumCellSize); /* Cache2MaximumCellSize (2 bytes) */ - WLog_INFO(TAG, "\tpad1: 0x%08X", pad1); - WLog_INFO(TAG, "\tpad2: 0x%08X", pad2); - WLog_INFO(TAG, "\tpad3: 0x%08X", pad3); - WLog_INFO(TAG, "\tpad4: 0x%08X", pad4); - WLog_INFO(TAG, "\tpad5: 0x%08X", pad5); - WLog_INFO(TAG, "\tpad6: 0x%08X", pad6); - WLog_INFO(TAG, "\tCache0Entries: 0x%04X", Cache0Entries); - WLog_INFO(TAG, "\tCache0MaximumCellSize: 0x%04X", Cache0MaximumCellSize); - WLog_INFO(TAG, "\tCache1Entries: 0x%04X", Cache1Entries); - WLog_INFO(TAG, "\tCache1MaximumCellSize: 0x%04X", Cache1MaximumCellSize); - WLog_INFO(TAG, "\tCache2Entries: 0x%04X", Cache2Entries); - WLog_INFO(TAG, "\tCache2MaximumCellSize: 0x%04X", Cache2MaximumCellSize); + WLog_INFO(TAG, "\tpad1: 0x%08"PRIX32"", pad1); + WLog_INFO(TAG, "\tpad2: 0x%08"PRIX32"", pad2); + WLog_INFO(TAG, "\tpad3: 0x%08"PRIX32"", pad3); + WLog_INFO(TAG, "\tpad4: 0x%08"PRIX32"", pad4); + WLog_INFO(TAG, "\tpad5: 0x%08"PRIX32"", pad5); + WLog_INFO(TAG, "\tpad6: 0x%08"PRIX32"", pad6); + WLog_INFO(TAG, "\tCache0Entries: 0x%04"PRIX16"", Cache0Entries); + WLog_INFO(TAG, "\tCache0MaximumCellSize: 0x%04"PRIX16"", Cache0MaximumCellSize); + WLog_INFO(TAG, "\tCache1Entries: 0x%04"PRIX16"", Cache1Entries); + WLog_INFO(TAG, "\tCache1MaximumCellSize: 0x%04"PRIX16"", Cache1MaximumCellSize); + WLog_INFO(TAG, "\tCache2Entries: 0x%04"PRIX16"", Cache2Entries); + WLog_INFO(TAG, "\tCache2MaximumCellSize: 0x%04"PRIX16"", Cache2MaximumCellSize); return TRUE; } @@ -879,7 +879,7 @@ static BOOL rdp_print_control_capability_set(wStream* s, UINT16 length) UINT16 remoteDetachFlag; UINT16 controlInterest; UINT16 detachInterest; - WLog_INFO(TAG, "ControlCapabilitySet (length %d):", length); + WLog_INFO(TAG, "ControlCapabilitySet (length %"PRIu16"):", length); if (length < 12) return FALSE; @@ -888,10 +888,10 @@ static BOOL rdp_print_control_capability_set(wStream* s, UINT16 length) Stream_Read_UINT16(s, remoteDetachFlag); /* remoteDetachFlag (2 bytes) */ Stream_Read_UINT16(s, controlInterest); /* controlInterest (2 bytes) */ Stream_Read_UINT16(s, detachInterest); /* detachInterest (2 bytes) */ - WLog_INFO(TAG, "\tcontrolFlags: 0x%04X", controlFlags); - WLog_INFO(TAG, "\tremoteDetachFlag: 0x%04X", remoteDetachFlag); - WLog_INFO(TAG, "\tcontrolInterest: 0x%04X", controlInterest); - WLog_INFO(TAG, "\tdetachInterest: 0x%04X", detachInterest); + WLog_INFO(TAG, "\tcontrolFlags: 0x%04"PRIX16"", controlFlags); + WLog_INFO(TAG, "\tremoteDetachFlag: 0x%04"PRIX16"", remoteDetachFlag); + WLog_INFO(TAG, "\tcontrolInterest: 0x%04"PRIX16"", controlInterest); + WLog_INFO(TAG, "\tdetachInterest: 0x%04"PRIX16"", detachInterest); return TRUE; } @@ -947,7 +947,7 @@ static BOOL rdp_print_window_activation_capability_set(wStream* s, UINT16 helpKeyIndexFlag; UINT16 helpExtendedKeyFlag; UINT16 windowManagerKeyFlag; - WLog_INFO(TAG, "WindowActivationCapabilitySet (length %d):", length); + WLog_INFO(TAG, "WindowActivationCapabilitySet (length %"PRIu16"):", length); if (length < 12) return FALSE; @@ -957,10 +957,10 @@ static BOOL rdp_print_window_activation_capability_set(wStream* s, Stream_Read_UINT16(s, helpExtendedKeyFlag); /* helpExtendedKeyFlag (2 bytes) */ Stream_Read_UINT16(s, windowManagerKeyFlag); /* windowManagerKeyFlag (2 bytes) */ - WLog_INFO(TAG, "\thelpKeyFlag: 0x%04X", helpKeyFlag); - WLog_INFO(TAG, "\thelpKeyIndexFlag: 0x%04X", helpKeyIndexFlag); - WLog_INFO(TAG, "\thelpExtendedKeyFlag: 0x%04X", helpExtendedKeyFlag); - WLog_INFO(TAG, "\twindowManagerKeyFlag: 0x%04X", windowManagerKeyFlag); + WLog_INFO(TAG, "\thelpKeyFlag: 0x%04"PRIX16"", helpKeyFlag); + WLog_INFO(TAG, "\thelpKeyIndexFlag: 0x%04"PRIX16"", helpKeyIndexFlag); + WLog_INFO(TAG, "\thelpExtendedKeyFlag: 0x%04"PRIX16"", helpExtendedKeyFlag); + WLog_INFO(TAG, "\twindowManagerKeyFlag: 0x%04"PRIX16"", windowManagerKeyFlag); return TRUE; } @@ -1043,14 +1043,14 @@ static BOOL rdp_print_pointer_capability_set(wStream* s, UINT16 length) if (length < 10) return FALSE; - WLog_INFO(TAG, "PointerCapabilitySet (length %d):", length); + WLog_INFO(TAG, "PointerCapabilitySet (length %"PRIu16"):", length); Stream_Read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ Stream_Read_UINT16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */ Stream_Read_UINT16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */ - WLog_INFO(TAG, "\tcolorPointerFlag: 0x%04X", colorPointerFlag); - WLog_INFO(TAG, "\tcolorPointerCacheSize: 0x%04X", colorPointerCacheSize); - WLog_INFO(TAG, "\tpointerCacheSize: 0x%04X", pointerCacheSize); + WLog_INFO(TAG, "\tcolorPointerFlag: 0x%04"PRIX16"", colorPointerFlag); + WLog_INFO(TAG, "\tcolorPointerCacheSize: 0x%04"PRIX16"", colorPointerCacheSize); + WLog_INFO(TAG, "\tpointerCacheSize: 0x%04"PRIX16"", pointerCacheSize); return TRUE; } @@ -1100,15 +1100,15 @@ static BOOL rdp_print_share_capability_set(wStream* s, UINT16 length) { UINT16 nodeId; UINT16 pad2Octets; - WLog_INFO(TAG, "ShareCapabilitySet (length %d):", length); + WLog_INFO(TAG, "ShareCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT16(s, nodeId); /* nodeId (2 bytes) */ Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tnodeId: 0x%04X", nodeId); - WLog_INFO(TAG, "\tpad2Octets: 0x%04X", pad2Octets); + WLog_INFO(TAG, "\tnodeId: 0x%04"PRIX16"", nodeId); + WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); return TRUE; } @@ -1157,15 +1157,15 @@ static BOOL rdp_print_color_cache_capability_set(wStream* s, UINT16 length) { UINT16 colorTableCacheSize; UINT16 pad2Octets; - WLog_INFO(TAG, "ColorCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "ColorCacheCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT16(s, colorTableCacheSize); /* colorTableCacheSize (2 bytes) */ Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tcolorTableCacheSize: 0x%04X", colorTableCacheSize); - WLog_INFO(TAG, "\tpad2Octets: 0x%04X", pad2Octets); + WLog_INFO(TAG, "\tcolorTableCacheSize: 0x%04"PRIX16"", colorTableCacheSize); + WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); return TRUE; } @@ -1218,15 +1218,15 @@ static BOOL rdp_print_sound_capability_set(wStream* s, UINT16 length) { UINT16 soundFlags; UINT16 pad2OctetsA; - WLog_INFO(TAG, "SoundCapabilitySet (length %d):", length); + WLog_INFO(TAG, "SoundCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */ Stream_Read_UINT16(s, pad2OctetsA); /* pad2OctetsA (2 bytes) */ - WLog_INFO(TAG, "\tsoundFlags: 0x%04X", soundFlags); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04X", pad2OctetsA); + WLog_INFO(TAG, "\tsoundFlags: 0x%04"PRIX16"", soundFlags); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); return TRUE; } @@ -1339,7 +1339,7 @@ static BOOL rdp_print_input_capability_set(wStream* s, UINT16 length) UINT32 keyboardType; UINT32 keyboardSubType; UINT32 keyboardFunctionKey; - WLog_INFO(TAG, "InputCapabilitySet (length %d)", length); + WLog_INFO(TAG, "InputCapabilitySet (length %"PRIu16")", length); if (length < 88) return FALSE; @@ -1351,12 +1351,12 @@ static BOOL rdp_print_input_capability_set(wStream* s, UINT16 length) Stream_Read_UINT32(s, keyboardSubType); /* keyboardSubType (4 bytes) */ Stream_Read_UINT32(s, keyboardFunctionKey); /* keyboardFunctionKeys (4 bytes) */ Stream_Seek(s, 64); /* imeFileName (64 bytes) */ - WLog_INFO(TAG, "\tinputFlags: 0x%04X", inputFlags); - WLog_INFO(TAG, "\tpad2OctetsA: 0x%04X", pad2OctetsA); - WLog_INFO(TAG, "\tkeyboardLayout: 0x%08X", keyboardLayout); - WLog_INFO(TAG, "\tkeyboardType: 0x%08X", keyboardType); - WLog_INFO(TAG, "\tkeyboardSubType: 0x%08X", keyboardSubType); - WLog_INFO(TAG, "\tkeyboardFunctionKey: 0x%08X", keyboardFunctionKey); + WLog_INFO(TAG, "\tinputFlags: 0x%04"PRIX16"", inputFlags); + WLog_INFO(TAG, "\tpad2OctetsA: 0x%04"PRIX16"", pad2OctetsA); + WLog_INFO(TAG, "\tkeyboardLayout: 0x%08"PRIX32"", keyboardLayout); + WLog_INFO(TAG, "\tkeyboardType: 0x%08"PRIX32"", keyboardType); + WLog_INFO(TAG, "\tkeyboardSubType: 0x%08"PRIX32"", keyboardSubType); + WLog_INFO(TAG, "\tkeyboardFunctionKey: 0x%08"PRIX32"", keyboardFunctionKey); return TRUE; } @@ -1405,7 +1405,7 @@ static BOOL rdp_print_font_capability_set(wStream* s, UINT16 length) { UINT16 fontSupportFlags = 0; UINT16 pad2Octets = 0; - WLog_INFO(TAG, "FontCapabilitySet (length %d):", length); + WLog_INFO(TAG, "FontCapabilitySet (length %"PRIu16"):", length); if (length > 4) Stream_Read_UINT16(s, fontSupportFlags); /* fontSupportFlags (2 bytes) */ @@ -1413,8 +1413,8 @@ static BOOL rdp_print_font_capability_set(wStream* s, UINT16 length) if (length > 6) Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tfontSupportFlags: 0x%04X", fontSupportFlags); - WLog_INFO(TAG, "\tpad2Octets: 0x%04X", pad2Octets); + WLog_INFO(TAG, "\tfontSupportFlags: 0x%04"PRIX16"", fontSupportFlags); + WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); return TRUE; } @@ -1459,13 +1459,13 @@ static BOOL rdp_write_brush_capability_set(wStream* s, rdpSettings* settings) static BOOL rdp_print_brush_capability_set(wStream* s, UINT16 length) { UINT32 brushSupportLevel; - WLog_INFO(TAG, "BrushCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BrushCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, brushSupportLevel); /* brushSupportLevel (4 bytes) */ - WLog_INFO(TAG, "\tbrushSupportLevel: 0x%08X", brushSupportLevel); + WLog_INFO(TAG, "\tbrushSupportLevel: 0x%08"PRIX32"", brushSupportLevel); return TRUE; } @@ -1590,7 +1590,7 @@ static BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length) GLYPH_CACHE_DEFINITION fragCache; UINT16 glyphSupportLevel; UINT16 pad2Octets; - WLog_INFO(TAG, "GlyphCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "GlyphCacheCapabilitySet (length %"PRIu16"):", length); if (length < 52) return FALSE; @@ -1609,30 +1609,30 @@ static BOOL rdp_print_glyph_cache_capability_set(wStream* s, UINT16 length) rdp_read_cache_definition(s, &fragCache); /* fragCache (4 bytes) */ Stream_Read_UINT16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */ Stream_Read_UINT16(s, pad2Octets); /* pad2Octets (2 bytes) */ - WLog_INFO(TAG, "\tglyphCache0: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache0: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[0].cacheEntries, glyphCache[0].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache1: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache1: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[1].cacheEntries, glyphCache[1].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache2: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache2: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[2].cacheEntries, glyphCache[2].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache3: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache3: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[3].cacheEntries, glyphCache[3].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache4: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache4: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[4].cacheEntries, glyphCache[4].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache5: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache5: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[5].cacheEntries, glyphCache[5].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache6: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache6: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[6].cacheEntries, glyphCache[6].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache7: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache7: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[7].cacheEntries, glyphCache[7].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache8: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache8: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[8].cacheEntries, glyphCache[8].cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphCache9: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tglyphCache9: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", glyphCache[9].cacheEntries, glyphCache[9].cacheMaximumCellSize); - WLog_INFO(TAG, "\tfragCache: Entries: %d MaximumCellSize: %d", + WLog_INFO(TAG, "\tfragCache: Entries: %"PRIu16" MaximumCellSize: %"PRIu16"", fragCache.cacheEntries, fragCache.cacheMaximumCellSize); - WLog_INFO(TAG, "\tglyphSupportLevel: 0x%04X", glyphSupportLevel); - WLog_INFO(TAG, "\tpad2Octets: 0x%04X", pad2Octets); + WLog_INFO(TAG, "\tglyphSupportLevel: 0x%04"PRIX16"", glyphSupportLevel); + WLog_INFO(TAG, "\tpad2Octets: 0x%04"PRIX16"", pad2Octets); return TRUE; } @@ -1702,7 +1702,7 @@ static BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, UINT32 offscreenSupportLevel; UINT16 offscreenCacheSize; UINT16 offscreenCacheEntries; - WLog_INFO(TAG, "OffscreenBitmapCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "OffscreenBitmapCacheCapabilitySet (length %"PRIu16"):", length); if (length < 12) return FALSE; @@ -1712,9 +1712,9 @@ static BOOL rdp_print_offscreen_bitmap_cache_capability_set(wStream* s, Stream_Read_UINT16(s, offscreenCacheSize); /* offscreenCacheSize (2 bytes) */ Stream_Read_UINT16(s, offscreenCacheEntries); /* offscreenCacheEntries (2 bytes) */ - WLog_INFO(TAG, "\toffscreenSupportLevel: 0x%08X", offscreenSupportLevel); - WLog_INFO(TAG, "\toffscreenCacheSize: 0x%04X", offscreenCacheSize); - WLog_INFO(TAG, "\toffscreenCacheEntries: 0x%04X", offscreenCacheEntries); + WLog_INFO(TAG, "\toffscreenSupportLevel: 0x%08"PRIX32"", offscreenSupportLevel); + WLog_INFO(TAG, "\toffscreenCacheSize: 0x%04"PRIX16"", offscreenCacheSize); + WLog_INFO(TAG, "\toffscreenCacheEntries: 0x%04"PRIX16"", offscreenCacheEntries); return TRUE; } @@ -1773,7 +1773,7 @@ static BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, BYTE cacheVersion; BYTE pad1; UINT16 pad2; - WLog_INFO(TAG, "BitmapCacheHostSupportCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCacheHostSupportCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; @@ -1781,9 +1781,9 @@ static BOOL rdp_print_bitmap_cache_host_support_capability_set(wStream* s, Stream_Read_UINT8(s, cacheVersion); /* cacheVersion (1 byte) */ Stream_Read_UINT8(s, pad1); /* pad1 (1 byte) */ Stream_Read_UINT16(s, pad2); /* pad2 (2 bytes) */ - WLog_INFO(TAG, "\tcacheVersion: 0x%02X", cacheVersion); - WLog_INFO(TAG, "\tpad1: 0x%02X", pad1); - WLog_INFO(TAG, "\tpad2: 0x%04X", pad2); + WLog_INFO(TAG, "\tcacheVersion: 0x%02"PRIX8"", cacheVersion); + WLog_INFO(TAG, "\tpad1: 0x%02"PRIX8"", pad1); + WLog_INFO(TAG, "\tpad2: 0x%04"PRIX16"", pad2); return TRUE; } @@ -1885,7 +1885,7 @@ static BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length) BYTE pad2; BYTE numCellCaches; BITMAP_CACHE_V2_CELL_INFO bitmapCacheV2CellInfo[5]; - WLog_INFO(TAG, "BitmapCacheV2CapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCacheV2CapabilitySet (length %"PRIu16"):", length); if (length < 40) return FALSE; @@ -1904,18 +1904,18 @@ static BOOL rdp_print_bitmap_cache_v2_capability_set(wStream* s, UINT16 length) rdp_read_bitmap_cache_cell_info(s, &bitmapCacheV2CellInfo[4]); /* bitmapCache4CellInfo (4 bytes) */ Stream_Seek(s, 12); /* pad3 (12 bytes) */ - WLog_INFO(TAG, "\tcacheFlags: 0x%04X", cacheFlags); - WLog_INFO(TAG, "\tpad2: 0x%02X", pad2); - WLog_INFO(TAG, "\tnumCellCaches: 0x%02X", numCellCaches); - WLog_INFO(TAG, "\tbitmapCache0CellInfo: numEntries: %d persistent: %d", + WLog_INFO(TAG, "\tcacheFlags: 0x%04"PRIX16"", cacheFlags); + WLog_INFO(TAG, "\tpad2: 0x%02"PRIX8"", pad2); + WLog_INFO(TAG, "\tnumCellCaches: 0x%02"PRIX8"", numCellCaches); + WLog_INFO(TAG, "\tbitmapCache0CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", bitmapCacheV2CellInfo[0].numEntries, bitmapCacheV2CellInfo[0].persistent); - WLog_INFO(TAG, "\tbitmapCache1CellInfo: numEntries: %d persistent: %d", + WLog_INFO(TAG, "\tbitmapCache1CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", bitmapCacheV2CellInfo[1].numEntries, bitmapCacheV2CellInfo[1].persistent); - WLog_INFO(TAG, "\tbitmapCache2CellInfo: numEntries: %d persistent: %d", + WLog_INFO(TAG, "\tbitmapCache2CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", bitmapCacheV2CellInfo[2].numEntries, bitmapCacheV2CellInfo[2].persistent); - WLog_INFO(TAG, "\tbitmapCache3CellInfo: numEntries: %d persistent: %d", + WLog_INFO(TAG, "\tbitmapCache3CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", bitmapCacheV2CellInfo[3].numEntries, bitmapCacheV2CellInfo[3].persistent); - WLog_INFO(TAG, "\tbitmapCache4CellInfo: numEntries: %d persistent: %d", + WLog_INFO(TAG, "\tbitmapCache4CellInfo: numEntries: %"PRIu32" persistent: %"PRId32"", bitmapCacheV2CellInfo[4].numEntries, bitmapCacheV2CellInfo[4].persistent); return TRUE; } @@ -1979,7 +1979,7 @@ static BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length) { UINT32 flags; UINT32 VCChunkSize; - WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %d):", length); + WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; @@ -1991,8 +1991,8 @@ static BOOL rdp_print_virtual_channel_capability_set(wStream* s, UINT16 length) else VCChunkSize = 1600; - WLog_INFO(TAG, "\tflags: 0x%08X", flags); - WLog_INFO(TAG, "\tVCChunkSize: 0x%08X", VCChunkSize); + WLog_INFO(TAG, "\tflags: 0x%08"PRIX32"", flags); + WLog_INFO(TAG, "\tVCChunkSize: 0x%08"PRIX32"", VCChunkSize); return TRUE; } @@ -2089,7 +2089,7 @@ static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT32 drawNineGridSupportLevel; UINT16 DrawNineGridCacheSize; UINT16 DrawNineGridCacheEntries; - WLog_INFO(TAG, "DrawNineGridCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "DrawNineGridCacheCapabilitySet (length %"PRIu16"):", length); if (length < 12) return FALSE; @@ -2181,7 +2181,7 @@ static BOOL rdp_print_draw_gdiplus_cache_capability_set(wStream* s, UINT32 drawGdiPlusSupportLevel; UINT32 GdipVersion; UINT32 drawGdiplusCacheLevel; - WLog_INFO(TAG, "DrawGdiPlusCacheCapabilitySet (length %d):", length); + WLog_INFO(TAG, "DrawGdiPlusCacheCapabilitySet (length %"PRIu16"):", length); if (length < 40) return FALSE; @@ -2257,13 +2257,13 @@ static BOOL rdp_write_remote_programs_capability_set(wStream* s, static BOOL rdp_print_remote_programs_capability_set(wStream* s, UINT16 length) { UINT32 railSupportLevel; - WLog_INFO(TAG, "RemoteProgramsCapabilitySet (length %d):", length); + WLog_INFO(TAG, "RemoteProgramsCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, railSupportLevel); /* railSupportLevel (4 bytes) */ - WLog_INFO(TAG, "\trailSupportLevel: 0x%08X", railSupportLevel); + WLog_INFO(TAG, "\trailSupportLevel: 0x%08"PRIX32"", railSupportLevel); return TRUE; } @@ -2319,7 +2319,7 @@ static BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length) UINT32 wndSupportLevel; BYTE numIconCaches; UINT16 numIconCacheEntries; - WLog_INFO(TAG, "WindowListCapabilitySet (length %d):", length); + WLog_INFO(TAG, "WindowListCapabilitySet (length %"PRIu16"):", length); if (length < 11) return FALSE; @@ -2327,9 +2327,9 @@ static BOOL rdp_print_window_list_capability_set(wStream* s, UINT16 length) Stream_Read_UINT32(s, wndSupportLevel); /* wndSupportLevel (4 bytes) */ Stream_Read_UINT8(s, numIconCaches); /* numIconCaches (1 byte) */ Stream_Read_UINT16(s, numIconCacheEntries); /* numIconCacheEntries (2 bytes) */ - WLog_INFO(TAG, "\twndSupportLevel: 0x%08X", wndSupportLevel); - WLog_INFO(TAG, "\tnumIconCaches: 0x%02X", numIconCaches); - WLog_INFO(TAG, "\tnumIconCacheEntries: 0x%04X", numIconCacheEntries); + WLog_INFO(TAG, "\twndSupportLevel: 0x%08"PRIX32"", wndSupportLevel); + WLog_INFO(TAG, "\tnumIconCaches: 0x%02"PRIX8"", numIconCaches); + WLog_INFO(TAG, "\tnumIconCacheEntries: 0x%04"PRIX16"", numIconCacheEntries); return TRUE; } @@ -2380,14 +2380,14 @@ static BOOL rdp_print_desktop_composition_capability_set(wStream* s, UINT16 length) { UINT16 compDeskSupportLevel; - WLog_INFO(TAG, "DesktopCompositionCapabilitySet (length %d):", length); + WLog_INFO(TAG, "DesktopCompositionCapabilitySet (length %"PRIu16"):", length); if (length < 6) return FALSE; Stream_Read_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */ - WLog_INFO(TAG, "\tcompDeskSupportLevel: 0x%04X", compDeskSupportLevel); + WLog_INFO(TAG, "\tcompDeskSupportLevel: 0x%04"PRIX16"", compDeskSupportLevel); return TRUE; } @@ -2508,13 +2508,13 @@ static BOOL rdp_print_multifragment_update_capability_set(wStream* s, UINT16 length) { UINT32 maxRequestSize; - WLog_INFO(TAG, "MultifragmentUpdateCapabilitySet (length %d):", length); + WLog_INFO(TAG, "MultifragmentUpdateCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, maxRequestSize); /* maxRequestSize (4 bytes) */ - WLog_INFO(TAG, "\tmaxRequestSize: 0x%04X", maxRequestSize); + WLog_INFO(TAG, "\tmaxRequestSize: 0x%08"PRIX32"", maxRequestSize); return TRUE; } @@ -2569,14 +2569,14 @@ static BOOL rdp_write_large_pointer_capability_set(wStream* s, static BOOL rdp_print_large_pointer_capability_set(wStream* s, UINT16 length) { UINT16 largePointerSupportFlags; - WLog_INFO(TAG, "LargePointerCapabilitySet (length %d):", length); + WLog_INFO(TAG, "LargePointerCapabilitySet (length %"PRIu16"):", length); if (length < 6) return FALSE; Stream_Read_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */ - WLog_INFO(TAG, "\tlargePointerSupportFlags: 0x%04X", largePointerSupportFlags); + WLog_INFO(TAG, "\tlargePointerSupportFlags: 0x%04"PRIX16"", largePointerSupportFlags); return TRUE; } @@ -2636,21 +2636,21 @@ static BOOL rdp_print_surface_commands_capability_set(wStream* s, UINT16 length) { UINT32 cmdFlags; UINT32 reserved; - WLog_INFO(TAG, "SurfaceCommandsCapabilitySet (length %d):", length); + WLog_INFO(TAG, "SurfaceCommandsCapabilitySet (length %"PRIu16"):", length); if (length < 12) return FALSE; Stream_Read_UINT32(s, cmdFlags); /* cmdFlags (4 bytes) */ Stream_Read_UINT32(s, reserved); /* reserved (4 bytes) */ - WLog_INFO(TAG, "\tcmdFlags: 0x%08X", cmdFlags); - WLog_INFO(TAG, "\treserved: 0x%08X", reserved); + WLog_INFO(TAG, "\tcmdFlags: 0x%08"PRIX32"", cmdFlags); + WLog_INFO(TAG, "\treserved: 0x%08"PRIX32"", reserved); return TRUE; } static void rdp_print_bitmap_codec_guid(const GUID* guid) { - WLog_INFO(TAG, "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", + WLog_INFO(TAG, "%08"PRIX32"%04"PRIX16"%04"PRIX16"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); @@ -2895,8 +2895,8 @@ static BOOL rdp_read_bitmap_codecs_capability_set(wStream* s, UINT16 length, if (Stream_GetPosition(s) != end) { WLog_ERR(TAG, - "error while reading codec properties: actual offset: %d expected offset: %d", - (int) Stream_GetPosition(s), end); + "error while reading codec properties: actual offset: %"PRIuz" expected offset: %"PRIu32"", + Stream_GetPosition(s), end); Stream_SetPosition(s, end); } @@ -3184,14 +3184,14 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length) BYTE codecId; UINT16 codecPropertiesLength; UINT16 remainingLength; - WLog_INFO(TAG, "BitmapCodecsCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCodecsCapabilitySet (length %"PRIu16"):", length); if (length < 5) return FALSE; Stream_Read_UINT8(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */ remainingLength = length - 5; - WLog_INFO(TAG, "\tbitmapCodecCount: %d", bitmapCodecCount); + WLog_INFO(TAG, "\tbitmapCodecCount: %"PRIu8"", bitmapCodecCount); while (bitmapCodecCount > 0) { @@ -3203,10 +3203,10 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s, UINT16 length) WLog_INFO(TAG, "\tcodecGuid: 0x"); rdp_print_bitmap_codec_guid(&codecGuid); WLog_INFO(TAG, " (%s)", rdp_get_bitmap_codec_guid_name(&codecGuid)); - WLog_INFO(TAG, "\tcodecId: %d", codecId); + WLog_INFO(TAG, "\tcodecId: %"PRIu8"", codecId); Stream_Read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */ - WLog_INFO(TAG, "\tcodecPropertiesLength: %d", codecPropertiesLength); + WLog_INFO(TAG, "\tcodecPropertiesLength: %"PRIu16"", codecPropertiesLength); remainingLength -= 19; if (remainingLength < codecPropertiesLength) @@ -3269,13 +3269,13 @@ static BOOL rdp_print_frame_acknowledge_capability_set(wStream* s, UINT16 length) { UINT32 frameAcknowledge; - WLog_INFO(TAG, "FrameAcknowledgeCapabilitySet (length %d):", length); + WLog_INFO(TAG, "FrameAcknowledgeCapabilitySet (length %"PRIu16"):", length); if (length < 8) return FALSE; Stream_Read_UINT32(s, frameAcknowledge); /* frameAcknowledge (4 bytes) */ - WLog_INFO(TAG, "\tframeAcknowledge: 0x%08X", frameAcknowledge); + WLog_INFO(TAG, "\tframeAcknowledge: 0x%08"PRIX32"", frameAcknowledge); return TRUE; } @@ -3309,13 +3309,13 @@ static BOOL rdp_print_bitmap_cache_v3_codec_id_capability_set(wStream* s, UINT16 length) { BYTE bitmapCacheV3CodecId; - WLog_INFO(TAG, "BitmapCacheV3CodecIdCapabilitySet (length %d):", length); + WLog_INFO(TAG, "BitmapCacheV3CodecIdCapabilitySet (length %"PRIu16"):", length); if (length < 5) return FALSE; Stream_Read_UINT8(s, bitmapCacheV3CodecId); /* bitmapCacheV3CodecId (1 byte) */ - WLog_INFO(TAG, "\tbitmapCacheV3CodecId: 0x%02X", bitmapCacheV3CodecId); + WLog_INFO(TAG, "\tbitmapCacheV3CodecId: 0x%02"PRIX8"", bitmapCacheV3CodecId); return TRUE; } @@ -3516,14 +3516,14 @@ static BOOL rdp_print_capability_sets(wStream* s, UINT16 numberCapabilities, break; default: - WLog_ERR(TAG, "unknown capability type %d", type); + WLog_ERR(TAG, "unknown capability type %"PRIu16"", type); break; } if (Stream_Pointer(s) != em) { - WLog_ERR(TAG, "incorrect offset, type:0x%02X actual:%d expected:%d", - type, (int)(Stream_Pointer(s) - bm), (int)(em - bm)); + WLog_ERR(TAG, "incorrect offset, type:0x%04"PRIX16" actual:%"PRIuz" expected:%"PRIuz"", + type, Stream_Pointer(s) - bm, em - bm); } Stream_SetPointer(s, em); @@ -3556,7 +3556,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, } else { - WLog_WARN(TAG, "not handling capability type %d yet", type); + WLog_WARN(TAG, "not handling capability type %"PRIu16" yet", type); } em = bm + length; @@ -3752,7 +3752,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, break; default: - WLog_ERR(TAG, "capability %s(%d) not expected from client", + WLog_ERR(TAG, "capability %s(%"PRIu16") not expected from client", get_capability_name(type), type); return FALSE; } @@ -3769,7 +3769,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, break; default: - WLog_ERR(TAG, "capability %s(%d) not expected from server", + WLog_ERR(TAG, "capability %s(%"PRIu16") not expected from server", get_capability_name(type), type); return FALSE; } @@ -3778,8 +3778,8 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, if (Stream_Pointer(s) != em) { - WLog_ERR(TAG, "incorrect offset, type:0x%02X actual:%d expected:%d", - type, (int)(Stream_Pointer(s) - bm), (int)(em - bm)); + WLog_ERR(TAG, "incorrect offset, type:0x%04"PRIX16" actual:%"PRIuz" expected:%"PRIuz"", + type, Stream_Pointer(s) - bm, em - bm); } Stream_SetPointer(s, em); @@ -3789,7 +3789,7 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, if (numberCapabilities) { WLog_ERR(TAG, - "strange we haven't read the number of announced capacity sets, read=%d expected=%d", + "strange we haven't read the number of announced capacity sets, read=%d expected=%"PRIu16"", count - numberCapabilities, count); } @@ -3835,7 +3835,7 @@ BOOL rdp_recv_get_active_header(rdpRdp* rdp, wStream* s, UINT16* pChannelId) if ((mcsMessageChannelId == 0) || (*pChannelId != mcsMessageChannelId)) { - WLog_ERR(TAG, "unexpected MCS channel id %04x received", *pChannelId); + WLog_ERR(TAG, "unexpected MCS channel id %04"PRIx16" received", *pChannelId); return FALSE; } } @@ -3880,7 +3880,7 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s) if (pduType != PDU_TYPE_DEMAND_ACTIVE) { if (pduType != PDU_TYPE_SERVER_REDIRECTION) - WLog_ERR(TAG, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04x", + WLog_ERR(TAG, "expected PDU_TYPE_DEMAND_ACTIVE %04x, got %04"PRIx16"", PDU_TYPE_DEMAND_ACTIVE, pduType); return FALSE; diff --git a/libfreerdp/core/certificate.c b/libfreerdp/core/certificate.c index da9269f6c..515a1024d 100644 --- a/libfreerdp/core/certificate.c +++ b/libfreerdp/core/certificate.c @@ -459,10 +459,10 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate { UINT32 dwSigAlgId; UINT32 dwKeyAlgId; - UINT32 wPublicKeyBlobType; - UINT32 wPublicKeyBlobLen; - UINT32 wSignatureBlobType; - UINT32 wSignatureBlobLen; + UINT16 wPublicKeyBlobType; + UINT16 wPublicKeyBlobLen; + UINT16 wSignatureBlobType; + UINT16 wSignatureBlobLen; BYTE* sigdata; int sigdatalen; @@ -476,7 +476,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate if (!((dwSigAlgId == SIGNATURE_ALG_RSA) && (dwKeyAlgId == KEY_EXCHANGE_ALG_RSA))) { - WLog_ERR(TAG, "unsupported signature or key algorithm, dwSigAlgId=%d dwKeyAlgId=%d", + WLog_ERR(TAG, "unsupported signature or key algorithm, dwSigAlgId=%"PRIu32" dwKeyAlgId=%"PRIu32"", dwSigAlgId, dwKeyAlgId); return FALSE; } @@ -485,14 +485,17 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate if (wPublicKeyBlobType != BB_RSA_KEY_BLOB) { - WLog_ERR(TAG, "unsupported public key blob type %d", wPublicKeyBlobType); + WLog_ERR(TAG, "unsupported public key blob type %"PRIu16"", wPublicKeyBlobType); return FALSE; } Stream_Read_UINT16(s, wPublicKeyBlobLen); if (Stream_GetRemainingLength(s) < wPublicKeyBlobLen) + { + WLog_ERR(TAG, "not enough bytes for public key(len=%"PRIu16")", wPublicKeyBlobLen); return FALSE; + } if (!certificate_process_server_public_key(certificate, s, wPublicKeyBlobLen)) { @@ -508,7 +511,7 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB) { - WLog_ERR(TAG, "unsupported blob signature %d", wSignatureBlobType); + WLog_ERR(TAG, "unsupported blob signature %"PRIu16"", wSignatureBlobType); return FALSE; } @@ -516,13 +519,13 @@ BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate if (Stream_GetRemainingLength(s) < wSignatureBlobLen) { - WLog_ERR(TAG, "not enough bytes for signature(len=%d)", wSignatureBlobLen); + WLog_ERR(TAG, "not enough bytes for signature(len=%"PRIu16")", wSignatureBlobLen); return FALSE; } if (wSignatureBlobLen != 72) { - WLog_ERR(TAG, "invalid signature length (got %d, expected %d)", wSignatureBlobLen, 64); + WLog_ERR(TAG, "invalid signature length (got %"PRIu16", expected 72)", wSignatureBlobLen); return FALSE; } @@ -569,7 +572,7 @@ BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, if (Stream_GetRemainingLength(s) < certLength) return FALSE; - DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%d", i + 1, certLength); + DEBUG_CERTIFICATE("X.509 Certificate #%d, length:%"PRIu32"", i + 1, certLength); certificate->x509_cert_chain->array[i].data = (BYTE*) malloc(certLength); if (!certificate->x509_cert_chain->array[i].data) @@ -586,7 +589,7 @@ BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, ret = certificate_read_x509_certificate(&certificate->x509_cert_chain->array[i], &cert_info); - DEBUG_LICENSE("modulus length:%d", (int) cert_info.ModulusLength); + DEBUG_LICENSE("modulus length:%"PRIu32"", cert_info.ModulusLength); free(cert_info.Modulus); @@ -604,7 +607,7 @@ BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, if (!certificate_read_x509_certificate(&certificate->x509_cert_chain->array[i], &certificate->cert_info)) return FALSE; - DEBUG_CERTIFICATE("modulus length:%d", (int) certificate->cert_info.ModulusLength); + DEBUG_CERTIFICATE("modulus length:%"PRIu32"", certificate->cert_info.ModulusLength); } } @@ -648,7 +651,7 @@ BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* serv break; default: - WLog_ERR(TAG, "invalid certificate chain version:%d", dwVersion & CERT_CHAIN_VERSION_MASK); + WLog_ERR(TAG, "invalid certificate chain version:%"PRIu32"", dwVersion & CERT_CHAIN_VERSION_MASK); ret = FALSE; break; } diff --git a/libfreerdp/core/channels.c b/libfreerdp/core/channels.c index 268c55749..63e720d3c 100644 --- a/libfreerdp/core/channels.c +++ b/libfreerdp/core/channels.c @@ -70,7 +70,7 @@ BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, BYTE* data, int size) if (!channel) { - WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %d", channelId); + WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %"PRIu16"", channelId); return FALSE; } diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index b8a6ec826..74e094e81 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -1000,7 +1000,7 @@ BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s) (nego->RequestedProtocols & PROTOCOL_TLS) ? 1 : 0, (nego->RequestedProtocols == PROTOCOL_RDP) ? 1 : 0 ); - WLog_INFO(TAG, "Server Security: NLA:%d TLS:%d RDP:%d", + WLog_INFO(TAG, "Server Security: NLA:%"PRId32" TLS:%"PRId32" RDP:%"PRId32"", settings->NlaSecurity, settings->TlsSecurity, settings->RdpSecurity); if ((settings->NlaSecurity) && (nego->RequestedProtocols & PROTOCOL_NLA)) diff --git a/libfreerdp/core/errinfo.c b/libfreerdp/core/errinfo.c index 91b71d95b..abfb0f945 100644 --- a/libfreerdp/core/errinfo.c +++ b/libfreerdp/core/errinfo.c @@ -569,12 +569,12 @@ void rdp_print_errinfo(UINT32 code) { if (code == errInfo->code) { - WLog_INFO(TAG, "%s (0x%08X):%s", errInfo->name, code, errInfo->info); + WLog_INFO(TAG, "%s (0x%08"PRIX32"):%s", errInfo->name, code, errInfo->info); return; } errInfo++; } - WLog_ERR(TAG, "ERRINFO_UNKNOWN 0x%08X: Unknown error.", code); + WLog_ERR(TAG, "ERRINFO_UNKNOWN 0x%08"PRIX32": Unknown error.", code); } diff --git a/libfreerdp/core/fastpath.c b/libfreerdp/core/fastpath.c index 411d0e960..16d86c5d3 100644 --- a/libfreerdp/core/fastpath.c +++ b/libfreerdp/core/fastpath.c @@ -255,7 +255,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s rdpPointerUpdate* pointer = update->pointer; #ifdef WITH_DEBUG_RDP - DEBUG_RDP("recv Fast-Path %s Update (0x%X), length:%d", + DEBUG_RDP("recv Fast-Path %s Update (0x%02"PRIX8"), length:%"PRIu32"", updateCode < ARRAYSIZE(FASTPATH_UPDATETYPE_STRINGS) ? FASTPATH_UPDATETYPE_STRINGS[updateCode] : "???", updateCode, size); #endif @@ -338,7 +338,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s break; default: - WLog_ERR(TAG, "unknown updateCode 0x%X", updateCode); + WLog_ERR(TAG, "unknown updateCode 0x%02"PRIX8"", updateCode); break; } @@ -453,7 +453,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) if (totalSize > transport->settings->MultifragMaxRequestSize) { - WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)", + WLog_ERR(TAG, "Total size (%"PRIu32") exceeds MultifragMaxRequestSize (%"PRIu32")", totalSize, transport->settings->MultifragMaxRequestSize); goto out_fail; } @@ -480,7 +480,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) if (totalSize > transport->settings->MultifragMaxRequestSize) { - WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)", + WLog_ERR(TAG, "Total size (%"PRIu32") exceeds MultifragMaxRequestSize (%"PRIu32")", totalSize, transport->settings->MultifragMaxRequestSize); goto out_fail; } @@ -508,7 +508,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) if (totalSize > transport->settings->MultifragMaxRequestSize) { - WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)", + WLog_ERR(TAG, "Total size (%"PRIu32") exceeds MultifragMaxRequestSize (%"PRIu32")", totalSize, transport->settings->MultifragMaxRequestSize); goto out_fail; } @@ -713,7 +713,7 @@ static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, wStream* s) break; default: - WLog_ERR(TAG, "Unknown eventCode %d", eventCode); + WLog_ERR(TAG, "Unknown eventCode %"PRIu8"", eventCode); break; } @@ -962,7 +962,7 @@ BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s /* check if the client's fast path pdu buffer is large enough */ if (totalLength > settings->MultifragMaxRequestSize) { - WLog_ERR(TAG, "fast path update size (%u) exceeds the client's maximum request size (%u)", + WLog_ERR(TAG, "fast path update size (%"PRIu32") exceeds the client's maximum request size (%"PRIu32")", totalLength, settings->MultifragMaxRequestSize); return FALSE; } diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 7ac18eacb..c1315b60c 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -188,7 +188,7 @@ BOOL freerdp_connect(freerdp* instance) /* --authonly tests the connection without a UI */ if (instance->settings->AuthenticationOnly) { - WLog_ERR(TAG, "Authentication only, exit status %d", !status); + WLog_ERR(TAG, "Authentication only, exit status %"PRId32"", !status); goto freerdp_connect_finally; } @@ -363,7 +363,7 @@ BOOL freerdp_check_event_handles(rdpContext* context) if (!status) { - WLog_ERR(TAG, "freerdp_check_fds() failed - %i", status); + WLog_ERR(TAG, "freerdp_check_fds() failed - %"PRIi32"", status); return FALSE; } @@ -371,7 +371,7 @@ BOOL freerdp_check_event_handles(rdpContext* context) if (!status) { - WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %i", status); + WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %"PRIi32"", status); return FALSE; } @@ -796,7 +796,7 @@ const char* freerdp_get_last_error_string(UINT32 code) void freerdp_set_last_error(rdpContext* context, UINT32 lastError) { if (lastError) - WLog_ERR(TAG, "freerdp_set_last_error %s [0x%04X]", + WLog_ERR(TAG, "freerdp_set_last_error %s [0x%08"PRIX32"]", freerdp_get_last_error_name(lastError), lastError); context->LastError = lastError; @@ -902,7 +902,7 @@ BOOL checkChannelErrorEvent(rdpContext* context) { if (WaitForSingleObject(context->channelErrorEvent, 0) == WAIT_OBJECT_0) { - WLog_ERR(TAG, "%s. Error was %u", context->errorDescription, + WLog_ERR(TAG, "%s. Error was %"PRIu32"", context->errorDescription, context->channelErrorNum); return FALSE; } diff --git a/libfreerdp/core/gateway/ntlm.c b/libfreerdp/core/gateway/ntlm.c index c5db8132d..ccfcb521a 100644 --- a/libfreerdp/core/gateway/ntlm.c +++ b/libfreerdp/core/gateway/ntlm.c @@ -53,7 +53,7 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, char* user, char* domain, char* if (status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [%08X]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return FALSE; } @@ -66,7 +66,7 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, char* user, char* domain, char* if (status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [%08X]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return FALSE; } @@ -235,7 +235,7 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm) 0, &ntlm->context, &ntlm->outputBufferDesc, &ntlm->pfContextAttr, &ntlm->expiration); - WLog_VRB(TAG, "InitializeSecurityContext status %s [%08X]", + WLog_VRB(TAG, "InitializeSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); if ((status == SEC_I_COMPLETE_AND_CONTINUE) || (status == SEC_I_COMPLETE_NEEDED) || (status == SEC_E_OK)) @@ -248,7 +248,7 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm) if (cStatus != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(cStatus), cStatus); return FALSE; } @@ -258,7 +258,7 @@ BOOL ntlm_authenticate(rdpNtlm* ntlm) if (status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [%08X]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return FALSE; } @@ -302,19 +302,19 @@ void ntlm_client_uninit(rdpNtlm* ntlm) status = ntlm->table->FreeCredentialsHandle(&ntlm->credentials); if (status != SEC_E_OK) { - WLog_WARN(TAG, "FreeCredentialsHandle status %s [%08X]", + WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } status = ntlm->table->FreeContextBuffer(ntlm->pPackageInfo); if (status != SEC_E_OK) { - WLog_WARN(TAG, "FreeContextBuffer status %s [%08X]", + WLog_WARN(TAG, "FreeContextBuffer status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } status = ntlm->table->DeleteSecurityContext(&ntlm->context); if (status != SEC_E_OK) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [%08X]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } ntlm->table = NULL; diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index be177ab10..8bb0d62cf 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -56,7 +56,7 @@ BOOL rdg_write_packet(rdpRdg* rdg, wStream* sPacket) wStream* sChunk; char chunkSize[11]; - sprintf_s(chunkSize, sizeof(chunkSize), "%X\r\n", (unsigned int) Stream_Length(sPacket)); + sprintf_s(chunkSize, sizeof(chunkSize), "%"PRIXz"\r\n", Stream_Length(sPacket)); sChunk = Stream_New(NULL, strlen(chunkSize) + Stream_Length(sPacket) + 2); if (!sChunk) diff --git a/libfreerdp/core/gateway/rpc.c b/libfreerdp/core/gateway/rpc.c index d7309b957..b3cccf159 100644 --- a/libfreerdp/core/gateway/rpc.c +++ b/libfreerdp/core/gateway/rpc.c @@ -118,15 +118,15 @@ const RPC_SECURITY_PROVIDER_INFO RPC_SECURITY_PROVIDER_INFO_TABLE[] = void rpc_pdu_header_print(rpcconn_hdr_t* header) { - WLog_INFO(TAG, "rpc_vers: %d", header->common.rpc_vers); - WLog_INFO(TAG, "rpc_vers_minor: %d", header->common.rpc_vers_minor); + WLog_INFO(TAG, "rpc_vers: %"PRIu8"", header->common.rpc_vers); + WLog_INFO(TAG, "rpc_vers_minor: %"PRIu8"", header->common.rpc_vers_minor); if (header->common.ptype > PTYPE_RTS) - WLog_INFO(TAG, "ptype: %s (%d)", "PTYPE_UNKNOWN", header->common.ptype); + WLog_INFO(TAG, "ptype: %s (%"PRIu8")", "PTYPE_UNKNOWN", header->common.ptype); else - WLog_INFO(TAG, "ptype: %s (%d)", PTYPE_STRINGS[header->common.ptype], header->common.ptype); + WLog_INFO(TAG, "ptype: %s (%"PRIu8")", PTYPE_STRINGS[header->common.ptype], header->common.ptype); - WLog_INFO(TAG, "pfc_flags (0x%02X) = {", header->common.pfc_flags); + WLog_INFO(TAG, "pfc_flags (0x%02"PRIX8") = {", header->common.pfc_flags); if (header->common.pfc_flags & PFC_FIRST_FRAG) WLog_INFO(TAG, " PFC_FIRST_FRAG"); @@ -150,19 +150,19 @@ void rpc_pdu_header_print(rpcconn_hdr_t* header) WLog_INFO(TAG, " PFC_OBJECT_UUID"); WLog_INFO(TAG, " }"); - WLog_INFO(TAG, "packed_drep[4]: %02X %02X %02X %02X", + WLog_INFO(TAG, "packed_drep[4]: %02"PRIX8" %02"PRIX8" %02"PRIX8" %02"PRIX8"", header->common.packed_drep[0], header->common.packed_drep[1], header->common.packed_drep[2], header->common.packed_drep[3]); - WLog_INFO(TAG, "frag_length: %d", header->common.frag_length); - WLog_INFO(TAG, "auth_length: %d", header->common.auth_length); - WLog_INFO(TAG, "call_id: %d", header->common.call_id); + WLog_INFO(TAG, "frag_length: %"PRIu16"", header->common.frag_length); + WLog_INFO(TAG, "auth_length: %"PRIu16"", header->common.auth_length); + WLog_INFO(TAG, "call_id: %"PRIu32"", header->common.call_id); if (header->common.ptype == PTYPE_RESPONSE) { - WLog_INFO(TAG, "alloc_hint: %d", header->response.alloc_hint); - WLog_INFO(TAG, "p_cont_id: %d", header->response.p_cont_id); - WLog_INFO(TAG, "cancel_count: %d", header->response.cancel_count); - WLog_INFO(TAG, "reserved: %d", header->response.reserved); + WLog_INFO(TAG, "alloc_hint: %"PRIu32"", header->response.alloc_hint); + WLog_INFO(TAG, "p_cont_id: %"PRIu16"", header->response.p_cont_id); + WLog_INFO(TAG, "cancel_count: %"PRIu8"", header->response.cancel_count); + WLog_INFO(TAG, "reserved: %"PRIu8"", header->response.reserved); } } @@ -298,7 +298,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l break; default: - WLog_ERR(TAG, "Unknown PTYPE: 0x%04X", header->common.ptype); + WLog_ERR(TAG, "Unknown PTYPE: 0x%02"PRIX8"", header->common.ptype); return FALSE; } @@ -320,7 +320,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l auth_pad_length = sec_trailer->auth_pad_length; #if 0 - WLog_DBG(TAG, "sec_trailer: type: %d level: %d pad_length: %d reserved: %d context_id: %d", + WLog_DBG(TAG, "sec_trailer: type: %"PRIu8" level: %"PRIu8" pad_length: %"PRIu8" reserved: %"PRIu8" context_id: %"PRIu32"", sec_trailer->auth_type, sec_trailer->auth_level, sec_trailer->auth_pad_length, sec_trailer->auth_reserved, sec_trailer->auth_context_id); @@ -334,7 +334,7 @@ BOOL rpc_get_stub_data_info(rdpRpc* rpc, BYTE* buffer, UINT32* offset, UINT32* l if ((frag_length - (sec_trailer_offset + 8)) != auth_length) { - WLog_ERR(TAG, "invalid auth_length: actual: %d, expected: %d", auth_length, + WLog_ERR(TAG, "invalid auth_length: actual: %"PRIu32", expected: %"PRIu32"", auth_length, (frag_length - (sec_trailer_offset + 8))); } diff --git a/libfreerdp/core/gateway/rpc_client.c b/libfreerdp/core/gateway/rpc_client.c index 1863901fe..be8807934 100644 --- a/libfreerdp/core/gateway/rpc_client.c +++ b/libfreerdp/core/gateway/rpc_client.c @@ -268,7 +268,7 @@ int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) } else { - WLog_ERR(TAG, "RPC_CLIENT_STATE_WAIT_SECURE_BIND_ACK unexpected pdu type: 0x%04X", pdu->Type); + WLog_ERR(TAG, "RPC_CLIENT_STATE_WAIT_SECURE_BIND_ACK unexpected pdu type: 0x%08"PRIX32"", pdu->Type); return -1; } @@ -360,7 +360,7 @@ int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) if (rpc->StubCallId != header->common.call_id) { - WLog_ERR(TAG, "invalid call_id: actual: %d, expected: %d, frag_count: %d", + WLog_ERR(TAG, "invalid call_id: actual: %"PRIu32", expected: %"PRIu32", frag_count: %"PRIu32"", rpc->StubCallId, header->common.call_id, rpc->StubFragCount); } @@ -450,7 +450,7 @@ int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) } else { - WLog_ERR(TAG, "unexpected RPC PDU type 0x%04X", header->common.ptype); + WLog_ERR(TAG, "unexpected RPC PDU type 0x%02"PRIX8"", header->common.ptype); return -1; } @@ -543,7 +543,7 @@ int rpc_client_default_out_channel_recv(rdpRpc* rpc) if (statusCode != HTTP_STATUS_OK) { - WLog_ERR(TAG, "error! Status Code: %d", statusCode); + WLog_ERR(TAG, "error! Status Code: %"PRIu32"", statusCode); http_response_print(response); http_response_free(response); @@ -593,7 +593,7 @@ int rpc_client_default_out_channel_recv(rdpRpc* rpc) if (header->frag_length > rpc->max_recv_frag) { - WLog_ERR(TAG, "rpc_client_recv: invalid fragment size: %d (max: %d)", + WLog_ERR(TAG, "rpc_client_recv: invalid fragment size: %"PRIu16" (max: %"PRIu16")", header->frag_length, rpc->max_recv_frag); winpr_HexDump(TAG, WLOG_ERROR, Stream_Buffer(fragment), Stream_GetPosition(fragment)); return -1; @@ -922,7 +922,7 @@ int rpc_client_write_call(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum) status = ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, &ntlm->ContextSizes); if (status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [%08X]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return -1; } @@ -997,7 +997,7 @@ int rpc_client_write_call(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum) if (encrypt_status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [%08X]", + WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", GetSecurityStatusString(encrypt_status), encrypt_status); goto out_free_pdu; } diff --git a/libfreerdp/core/gateway/rpc_fault.c b/libfreerdp/core/gateway/rpc_fault.c index ca758befb..3dd7072d2 100644 --- a/libfreerdp/core/gateway/rpc_fault.c +++ b/libfreerdp/core/gateway/rpc_fault.c @@ -325,7 +325,7 @@ int rpc_recv_fault_pdu(rpcconn_hdr_t* header) { if (RPC_FAULT_CODES[index].code == code) { - WLog_ERR(TAG, "status: %s (0x%08X)", RPC_FAULT_CODES[index].name, code); + WLog_ERR(TAG, "status: %s (0x%08"PRIX32")", RPC_FAULT_CODES[index].name, code); return 0; } } @@ -334,11 +334,11 @@ int rpc_recv_fault_pdu(rpcconn_hdr_t* header) { if (RPC_TSG_FAULT_CODES[index].code == code) { - WLog_ERR(TAG, "status: %s (0x%08X)", RPC_TSG_FAULT_CODES[index].name, code); + WLog_ERR(TAG, "status: %s (0x%08"PRIX32")", RPC_TSG_FAULT_CODES[index].name, code); return 0; } } - WLog_ERR(TAG, "status: %s (0x%08X)", "UNKNOWN", code); + WLog_ERR(TAG, "status: %s (0x%08"PRIX32")", "UNKNOWN", code); return 0; } diff --git a/libfreerdp/core/gateway/rts.c b/libfreerdp/core/gateway/rts.c index df939b9d8..263ca03f5 100644 --- a/libfreerdp/core/gateway/rts.c +++ b/libfreerdp/core/gateway/rts.c @@ -474,7 +474,7 @@ int rts_recv_CONN_A3_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) rts_connection_timeout_command_read(rpc, &buffer[24], length - 24, &ConnectionTimeout); - WLog_DBG(TAG, "Receiving CONN/A3 RTS PDU: ConnectionTimeout: %d", ConnectionTimeout); + WLog_DBG(TAG, "Receiving CONN/A3 RTS PDU: ConnectionTimeout: %"PRIu32"", ConnectionTimeout); rpc->VirtualConnection->DefaultInChannel->PingOriginator.ConnectionTimeout = ConnectionTimeout; @@ -541,7 +541,7 @@ int rts_recv_CONN_C2_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) offset += rts_receive_window_size_command_read(rpc, &buffer[offset], length - offset, &ReceiveWindowSize) + 4; offset += rts_connection_timeout_command_read(rpc, &buffer[offset], length - offset, &ConnectionTimeout) + 4; - WLog_DBG(TAG, "Receiving CONN/C2 RTS PDU: ConnectionTimeout: %d ReceiveWindowSize: %d", + WLog_DBG(TAG, "Receiving CONN/C2 RTS PDU: ConnectionTimeout: %"PRIu32" ReceiveWindowSize: %"PRIu32"", ConnectionTimeout, ReceiveWindowSize); rpc->VirtualConnection->DefaultInChannel->PingOriginator.ConnectionTimeout = ConnectionTimeout; @@ -641,7 +641,7 @@ int rts_recv_flow_control_ack_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) offset += rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, &BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4; - WLog_ERR(TAG, "Receiving FlowControlAck RTS PDU: BytesReceived: %d AvailableWindow: %d", + WLog_ERR(TAG, "Receiving FlowControlAck RTS PDU: BytesReceived: %"PRIu32" AvailableWindow: %"PRIu32"", BytesReceived, AvailableWindow); rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow = @@ -679,7 +679,7 @@ int rts_recv_flow_control_ack_with_destination_pdu(rdpRpc* rpc, BYTE* buffer, UI offset += rts_flow_control_ack_command_read(rpc, &buffer[offset], length - offset, &BytesReceived, &AvailableWindow, (BYTE*) &ChannelCookie) + 4; - WLog_DBG(TAG, "Receiving FlowControlAckWithDestination RTS PDU: BytesReceived: %d AvailableWindow: %d", + WLog_DBG(TAG, "Receiving FlowControlAckWithDestination RTS PDU: BytesReceived: %"PRIu32" AvailableWindow: %"PRIu32"", BytesReceived, AvailableWindow); rpc->VirtualConnection->DefaultInChannel->SenderAvailableWindow = @@ -786,7 +786,7 @@ int rts_command_length(rdpRpc* rpc, UINT32 CommandType, BYTE* buffer, UINT32 len break; default: - WLog_ERR(TAG, "Error: Unknown RTS Command Type: 0x%x", CommandType); + WLog_ERR(TAG, "Error: Unknown RTS Command Type: 0x%"PRIx32"", CommandType); return -1; break; } @@ -1024,7 +1024,7 @@ int rts_recv_out_of_sequence_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length) if (status < 0) { - WLog_ERR(TAG, "error parsing RTS PDU with signature id: 0x%08X", SignatureId); + WLog_ERR(TAG, "error parsing RTS PDU with signature id: 0x%08"PRIX32"", SignatureId); rts_print_pdu_signature(rpc, &signature); } diff --git a/libfreerdp/core/gateway/rts_signature.c b/libfreerdp/core/gateway/rts_signature.c index 88d90000b..930e8dfae 100644 --- a/libfreerdp/core/gateway/rts_signature.c +++ b/libfreerdp/core/gateway/rts_signature.c @@ -324,7 +324,7 @@ int rts_print_pdu_signature(rdpRpc* rpc, RtsPduSignature* signature) { UINT32 SignatureId; RTS_PDU_SIGNATURE_ENTRY* entry; - WLog_INFO(TAG, "RTS PDU Signature: Flags: 0x%04X NumberOfCommands: %d", + WLog_INFO(TAG, "RTS PDU Signature: Flags: 0x%04"PRIX16" NumberOfCommands: %"PRIu16"", signature->Flags, signature->NumberOfCommands); SignatureId = rts_identify_pdu_signature(rpc, signature, &entry); diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index 2a0a1e265..8bc24e5b8 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -418,7 +418,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT) { - WLog_ERR(TAG, "Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT", + WLog_ERR(TAG, "Unexpected ComponentId: 0x%04"PRIX16", Expected TS_GATEWAY_TRANSPORT", versionCaps->tsgHeader.ComponentId); free(packetCapsResponse); free(versionCaps); @@ -452,7 +452,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* if ((SwitchValue != TSG_CAPABILITY_TYPE_NAP) || (tsgCaps->capabilityType != TSG_CAPABILITY_TYPE_NAP)) { - WLog_ERR(TAG, "Unexpected CapabilityType: 0x%08X, Expected TSG_CAPABILITY_TYPE_NAP", + WLog_ERR(TAG, "Unexpected CapabilityType: 0x%08"PRIX32", Expected TSG_CAPABILITY_TYPE_NAP", tsgCaps->capabilityType); free(tsgCaps); free(versionCaps); @@ -484,7 +484,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* if (MsgBytes > TSG_MESSAGING_MAX_MESSAGE_LENGTH) { - WLog_ERR(TAG, "Out of Spec Message Length %d", MsgBytes); + WLog_ERR(TAG, "Out of Spec Message Length %"PRIu32"", MsgBytes); free(tsgCaps); free(versionCaps); free(packetCapsResponse); @@ -501,7 +501,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* break; default: - WLog_ERR(TAG, "Unexpected Message Type: 0x%X", (int) MessageSwitchValue); + WLog_ERR(TAG, "Unexpected Message Type: 0x%"PRIX32"", MessageSwitchValue); free(tsgCaps); free(versionCaps); free(packetCapsResponse); @@ -580,7 +580,7 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* if (versionCaps->tsgHeader.ComponentId != TS_GATEWAY_TRANSPORT) { - WLog_ERR(TAG, "Unexpected ComponentId: 0x%04X, Expected TS_GATEWAY_TRANSPORT", + WLog_ERR(TAG, "Unexpected ComponentId: 0x%04"PRIX16", Expected TS_GATEWAY_TRANSPORT", versionCaps->tsgHeader.ComponentId); free(versionCaps); free(packetQuarEncResponse); @@ -612,8 +612,8 @@ BOOL TsProxyCreateTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu, CONTEXT_HANDLE* } else { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_CAPS_RESPONSE " - "or TSG_PACKET_TYPE_QUARENC_RESPONSE", packet->packetId); + WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_CAPS_RESPONSE " + "or TSG_PACKET_TYPE_QUARENC_RESPONSE", packet->packetId); free(packet); return FALSE; } @@ -732,7 +732,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if ((packet->packetId != TSG_PACKET_TYPE_RESPONSE) || (SwitchValue != TSG_PACKET_TYPE_RESPONSE)) { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_RESPONSE", + WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_RESPONSE", packet->packetId); free(packet); return FALSE; @@ -752,7 +752,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (packetResponse->flags != TSG_PACKET_TYPE_QUARREQUEST) { - WLog_ERR(TAG, "Unexpected Packet Response Flags: 0x%08X, Expected TSG_PACKET_TYPE_QUARREQUEST", + WLog_ERR(TAG, "Unexpected Packet Response Flags: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_QUARREQUEST", packetResponse->flags); free(packet); free(packetResponse); @@ -776,7 +776,7 @@ BOOL TsProxyAuthorizeTunnelReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if (SizeValue != packetResponse->responseDataLen) { - WLog_ERR(TAG, "Unexpected size value: %d, expected: %d", + WLog_ERR(TAG, "Unexpected size value: %"PRIu32", expected: %"PRIu32"", SizeValue, packetResponse->responseDataLen); free(packetResponse); free(packet); @@ -885,7 +885,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) if ((packet->packetId != TSG_PACKET_TYPE_MESSAGE_PACKET) || (SwitchValue != TSG_PACKET_TYPE_MESSAGE_PACKET)) { - WLog_ERR(TAG, "Unexpected PacketId: 0x%08X, Expected TSG_PACKET_TYPE_MESSAGE_PACKET", + WLog_ERR(TAG, "Unexpected PacketId: 0x%08"PRIX32", Expected TSG_PACKET_TYPE_MESSAGE_PACKET", packet->packetId); free(packet); return FALSE; @@ -972,7 +972,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) break; default: - WLog_ERR(TAG, "unexpected message type: %d", SwitchValue); + WLog_ERR(TAG, "unexpected message type: %"PRIu32"", SwitchValue); status = FALSE; break; } @@ -1514,7 +1514,7 @@ int tsg_recv_pdu(rdpTsg* tsg, RPC_PDU* pdu) } else { - WLog_ERR(TAG, "TSG_STATE_AUTHORIZED unexpected OpNum: %d\n", call->OpNum); + WLog_ERR(TAG, "TSG_STATE_AUTHORIZED unexpected OpNum: %"PRIu32"\n", call->OpNum); } break; diff --git a/libfreerdp/core/gateway/tsg.h b/libfreerdp/core/gateway/tsg.h index 015a36a12..82561b40b 100644 --- a/libfreerdp/core/gateway/tsg.h +++ b/libfreerdp/core/gateway/tsg.h @@ -123,7 +123,7 @@ typedef struct _tsendpointinfo #define E_PROXY_NOTSUPPORTED 0x000059E8 #define E_PROXY_MAXCONNECTIONSREACHED 0x000059E6 #define E_PROXY_SESSIONTIMEOUT 0x000059F6 -#define E_PROXY_REAUTH_AUTHN_FAILED 0X000059FA +#define E_PROXY_REAUTH_AUTHN_FAILED 0x000059FA #define E_PROXY_REAUTH_CAP_FAILED 0x000059FB #define E_PROXY_REAUTH_RAP_FAILED 0x000059FC #define E_PROXY_SDR_NOT_SUPPORTED_BY_TS 0x000059FD diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index c020be07a..16a8dbfbf 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -396,7 +396,7 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length) break; default: - WLog_ERR(TAG, "Unknown GCC client data block: 0x%04X", type); + WLog_ERR(TAG, "Unknown GCC client data block: 0x%04"PRIX16"", type); Stream_Seek(s, blockLength - 4); break; } @@ -406,7 +406,7 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length) if (endPos != (begPos + blockLength)) { WLog_ERR(TAG, - "Error parsing GCC client data block 0x%04X: Actual Offset: %d Expected Offset: %d", + "Error parsing GCC client data block 0x%04"PRIX16": Actual Offset: %d Expected Offset: %d", type, endPos, begPos + blockLength); } @@ -530,7 +530,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length) break; default: - WLog_ERR(TAG, "gcc_read_server_data_blocks: ignoring type=%hu", type); + WLog_ERR(TAG, "gcc_read_server_data_blocks: ignoring type=%"PRIu16"", type); break; } @@ -1110,7 +1110,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Received unknown encryption method %08X", + WLog_ERR(TAG, "Received unknown encryption method %08"PRIX32"", serverEncryptionMethod); return FALSE; } @@ -1118,7 +1118,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) if (settings->UseRdpSecurityLayer && !(settings->EncryptionMethods & serverEncryptionMethod)) { - WLog_WARN(TAG, "Server uses non-advertised encryption method 0x%08X", + WLog_WARN(TAG, "Server uses non-advertised encryption method 0x%08"PRIX32"", serverEncryptionMethod); /* FIXME: Should we return FALSE; in this case ?? */ } @@ -1158,14 +1158,14 @@ BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Received unknown encryption level %08X", + WLog_ERR(TAG, "Received unknown encryption level 0x%08"PRIX32"", settings->EncryptionLevel); } if (!validCryptoConfig) { WLog_ERR(TAG, - "Received invalid cryptographic configuration (level=0x%08X method=0x%08X)", + "Received invalid cryptographic configuration (level=0x%08"PRIX32" method=0x%08"PRIX32")", settings->EncryptionLevel, settings->EncryptionMethods); return FALSE; } @@ -1312,7 +1312,7 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) break; default: - WLog_ERR(TAG, "Invalid server encryption level 0x%08X", + WLog_ERR(TAG, "Invalid server encryption level 0x%08"PRIX32"", settings->EncryptionLevel); WLog_ERR(TAG, "Switching to encryption level CLIENT-COMPATIBLE"); settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE; @@ -1575,7 +1575,7 @@ BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs) if (channelCount != mcs->channelCount) { - WLog_ERR(TAG, "requested %d channels, got %d instead", + WLog_ERR(TAG, "requested %"PRIu32" channels, got %"PRIu16" instead", mcs->channelCount, channelCount); /* we ensure that the response is not bigger than the request */ @@ -1701,7 +1701,7 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (monitorCount > settings->MonitorDefArraySize) { - WLog_ERR(TAG, "too many announced monitors(%d), clamping to %d", monitorCount, + WLog_ERR(TAG, "too many announced monitors(%"PRIu32"), clamping to %"PRIu32"", monitorCount, settings->MonitorDefArraySize); monitorCount = settings->MonitorDefArraySize; } diff --git a/libfreerdp/core/heartbeat.c b/libfreerdp/core/heartbeat.c index 41addf172..6003dde6b 100644 --- a/libfreerdp/core/heartbeat.c +++ b/libfreerdp/core/heartbeat.c @@ -40,7 +40,7 @@ int rdp_recv_heartbeat_packet(rdpRdp* rdp, wStream* s) Stream_Read_UINT8(s, count1); /* count1 (1 byte) */ Stream_Read_UINT8(s, count2); /* count2 (1 byte) */ - WLog_DBG(HEARTBEAT_TAG, "received Heartbeat PDU -> period=%u, count1=%u, count2=%u", period, count1, count2); + WLog_DBG(HEARTBEAT_TAG, "received Heartbeat PDU -> period=%"PRIu8", count1=%"PRIu8", count2=%"PRIu8"", period, count1, count2); return 0; } diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 2fdd3a262..f4aa48510 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -106,10 +106,11 @@ BOOL rdp_read_server_auto_reconnect_cookie(rdpRdp* rdp, wStream* s, logon_info_e p = autoReconnectCookie->arcRandomBits; - WLog_DBG(TAG, "ServerAutoReconnectCookie: Version: %d LogonId: %d SecurityVerifier: " - "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", + WLog_DBG(TAG, "ServerAutoReconnectCookie: Version: %"PRIu32" LogonId: %"PRIu32" SecurityVerifier: " + "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"" + "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", autoReconnectCookie->version, autoReconnectCookie->logonId, - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], + p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); info->LogonId = autoReconnectCookie->logonId; @@ -168,10 +169,11 @@ void rdp_write_client_auto_reconnect_cookie(rdpRdp* rdp, wStream* s) p = autoReconnectCookie->securityVerifier; - WLog_DBG(TAG, "ClientAutoReconnectCookie: Version: %d LogonId: %d ArcRandomBits: " - "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", + WLog_DBG(TAG, "ClientAutoReconnectCookie: Version: %"PRIu32" LogonId: %"PRIu32" ArcRandomBits: " + "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"" + "%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"%02"PRIX8"", autoReconnectCookie->version, autoReconnectCookie->logonId, - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], + p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); Stream_Write_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */ @@ -211,7 +213,7 @@ BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if ((cbClientAddress % 2) || cbClientAddress > 80) { - WLog_ERR(TAG, "protocol error: invalid cbClientAddress value: %u", cbClientAddress); + WLog_ERR(TAG, "protocol error: invalid cbClientAddress value: %"PRIu16"", cbClientAddress); return FALSE; } @@ -258,7 +260,7 @@ BOOL rdp_read_extended_info_packet(rdpRdp* rdp, wStream* s) if ((cbClientDir % 2) || cbClientDir > 512) { - WLog_ERR(TAG, "protocol error: invalid cbClientDir value: %u", cbClientDir); + WLog_ERR(TAG, "protocol error: invalid cbClientDir value: %"PRIu16"", cbClientDir); return FALSE; } @@ -460,7 +462,7 @@ BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbDomain % 2) || cbDomain > 512) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %u", cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu16"", cbDomain); return FALSE; } wstr = (WCHAR*) Stream_Pointer(s); @@ -489,7 +491,7 @@ BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbUserName % 2) || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %u", cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu16"", cbUserName); return FALSE; } wstr = (WCHAR*) Stream_Pointer(s); @@ -518,7 +520,7 @@ BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbPassword % 2) || cbPassword > 512) { - WLog_ERR(TAG, "protocol error: invalid cbPassword value: %u", cbPassword); + WLog_ERR(TAG, "protocol error: invalid cbPassword value: %"PRIu16"", cbPassword); return FALSE; } wstr = (WCHAR*) Stream_Pointer(s); @@ -547,7 +549,7 @@ BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbAlternateShell % 2) || cbAlternateShell > 512) { - WLog_ERR(TAG, "protocol error: invalid cbAlternateShell value: %u", cbAlternateShell); + WLog_ERR(TAG, "protocol error: invalid cbAlternateShell value: %"PRIu16"", cbAlternateShell); return FALSE; } wstr = (WCHAR*) Stream_Pointer(s); @@ -576,7 +578,7 @@ BOOL rdp_read_info_packet(rdpRdp* rdp, wStream* s) */ if ((cbWorkingDir % 2) || cbWorkingDir > 512) { - WLog_ERR(TAG, "protocol error: invalid cbWorkingDir value: %u", cbWorkingDir); + WLog_ERR(TAG, "protocol error: invalid cbWorkingDir value: %"PRIu16"", cbWorkingDir); return FALSE; } wstr = (WCHAR*) Stream_Pointer(s); @@ -861,7 +863,7 @@ BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info *info) { if ((cbDomain % 2) || cbDomain > 52) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %lu", (unsigned long) cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu32"", cbDomain); goto fail; } wstr = (WCHAR*) Stream_Pointer(s); @@ -888,7 +890,7 @@ BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info *info) { if ((cbUserName % 2) || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %lu", (unsigned long) cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu32"", cbUserName); goto fail; } wstr = (WCHAR*) Stream_Pointer(s); @@ -907,7 +909,7 @@ BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info *info) Stream_Read_UINT32(s, info->sessionId); /* SessionId (4 bytes) */ - WLog_DBG(TAG, "LogonInfoV1: SessionId: 0x%04X UserName: [%s] Domain: [%s]", + WLog_DBG(TAG, "LogonInfoV1: SessionId: 0x%08"PRIX32" UserName: [%s] Domain: [%s]", info->sessionId, info->username, info->domain); return TRUE; @@ -951,7 +953,7 @@ BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info *info) { if ((cbDomain % 2) || cbDomain > 52) { - WLog_ERR(TAG, "protocol error: invalid cbDomain value: %lu", (unsigned long) cbDomain); + WLog_ERR(TAG, "protocol error: invalid cbDomain value: %"PRIu32"", cbDomain); goto fail; } if (Stream_GetRemainingLength(s) < (size_t) cbDomain) @@ -983,7 +985,7 @@ BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info *info) { if ((cbUserName % 2) || cbUserName < 2 || cbUserName > 512) { - WLog_ERR(TAG, "protocol error: invalid cbUserName value: %lu", (unsigned long) cbUserName); + WLog_ERR(TAG, "protocol error: invalid cbUserName value: %"PRIu32"", cbUserName); goto fail; } if (Stream_GetRemainingLength(s) < (size_t) cbUserName) @@ -1005,7 +1007,7 @@ BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info *info) } Stream_Seek(s, cbUserName); /* userName */ - WLog_DBG(TAG, "LogonInfoV2: SessionId: 0x%04X UserName: [%s] Domain: [%s]", + WLog_DBG(TAG, "LogonInfoV2: SessionId: 0x%08"PRIX32" UserName: [%s] Domain: [%s]", info->sessionId, info->username, info->domain); return TRUE; @@ -1041,7 +1043,7 @@ BOOL rdp_recv_logon_error_info(rdpRdp* rdp, wStream* s, logon_info_ex *info) Stream_Read_UINT32(s, errorNotificationType); /* errorNotificationType (4 bytes) */ Stream_Read_UINT32(s, errorNotificationData); /* errorNotificationData (4 bytes) */ - WLog_DBG(TAG, "LogonErrorInfo: Data: 0x%04X Type: 0x%04X", + WLog_DBG(TAG, "LogonErrorInfo: Data: 0x%08"PRIX32" Type: 0x%08"PRIX32"", errorNotificationData, errorNotificationType); IFCALL(rdp->instance->LogonErrorInfo, rdp->instance, errorNotificationData, errorNotificationType); @@ -1066,7 +1068,7 @@ BOOL rdp_recv_logon_info_extended(rdpRdp* rdp, wStream* s, logon_info_ex *info) if ((Length < 6) || (Stream_GetRemainingLength(s) < (Length - 6))) return FALSE; - WLog_DBG(TAG, "LogonInfoExtended: fieldsPresent: 0x%04X", fieldsPresent); + WLog_DBG(TAG, "LogonInfoExtended: fieldsPresent: 0x%08"PRIX32"", fieldsPresent); /* logonFields */ @@ -1156,14 +1158,14 @@ BOOL rdp_recv_save_session_info(rdpRdp* rdp, wStream* s) break; default: - WLog_ERR(TAG, "Unhandled saveSessionInfo type 0x%x", infoType); + WLog_ERR(TAG, "Unhandled saveSessionInfo type 0x%"PRIx32"", infoType); status = TRUE; break; } if (!status) { - WLog_DBG(TAG, "SaveSessionInfo error: infoType: %s (%d)", + WLog_DBG(TAG, "SaveSessionInfo error: infoType: %s (%"PRIu32")", infoType < 4 ? INFO_TYPE_LOGON_STRINGS[infoType % 4] : "Unknown", infoType); } @@ -1330,7 +1332,7 @@ BOOL rdp_send_save_session_info(rdpContext *context, UINT32 type, void *data) status = rdp_write_logon_info_ex(s, (logon_info_ex *)data); break; default: - WLog_ERR(TAG, "saveSessionInfo type 0x%x not handled", type); + WLog_ERR(TAG, "saveSessionInfo type 0x%"PRIx32" not handled", type); status = FALSE; break; } diff --git a/libfreerdp/core/input.c b/libfreerdp/core/input.c index e00685020..af45e26fe 100644 --- a/libfreerdp/core/input.c +++ b/libfreerdp/core/input.c @@ -168,7 +168,7 @@ BOOL input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { if (flags & PTR_FLAGS_HWHEEL) { - WLog_WARN(TAG, "skip mouse event %hux%hu flags=%08X, no horizontal mouse wheel supported", + WLog_WARN(TAG, "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported", x, y, flags); return TRUE; } @@ -322,7 +322,7 @@ BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UI { if (flags & PTR_FLAGS_HWHEEL) { - WLog_WARN(TAG, "skip mouse event %hux%hu flags=%08X, no horizontal mouse wheel supported", + WLog_WARN(TAG, "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported", x, y, flags); return TRUE; } @@ -555,7 +555,7 @@ static BOOL input_recv_event(rdpInput* input, wStream* s) break; default: - WLog_ERR(TAG, "Unknown messageType %u", messageType); + WLog_ERR(TAG, "Unknown messageType %"PRIu16"", messageType); /* Each input event uses 6 bytes. */ Stream_Seek(s, 6); break; diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index ae785e70f..8b19eae25 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -91,7 +91,7 @@ void license_print_product_info(LICENSE_PRODUCT_INFO* productInfo) ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) productInfo->pbProductId, productInfo->cbProductId / 2, &ProductId, 0, NULL, NULL); WLog_INFO(TAG, "ProductInfo:"); - WLog_INFO(TAG, "\tdwVersion: 0x%08X", productInfo->dwVersion); + WLog_INFO(TAG, "\tdwVersion: 0x%08"PRIX32"", productInfo->dwVersion); WLog_INFO(TAG, "\tCompanyName: %s", CompanyName); WLog_INFO(TAG, "\tProductId: %s", ProductId); free(CompanyName); @@ -102,7 +102,7 @@ void license_print_scope_list(SCOPE_LIST* scopeList) { int index; LICENSE_BLOB* scope; - WLog_INFO(TAG, "ScopeList (%d):", scopeList->count); + WLog_INFO(TAG, "ScopeList (%"PRIu32"):", scopeList->count); for (index = 0; index < scopeList->count; index++) { @@ -219,7 +219,7 @@ BOOL license_send(rdpLicense* license, wStream* s, BYTE type) license_write_preamble(s, type, flags, wMsgSize); #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "Sending %s Packet, length %d", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize); + WLog_DBG(TAG, "Sending %s Packet, length %"PRIu16"", LICENSE_MESSAGE_STRINGS[type & 0x1F], wMsgSize); winpr_HexDump(TAG, WLOG_DEBUG, Stream_Pointer(s) - LICENSE_PREAMBLE_LENGTH, wMsgSize); #endif Stream_SetPosition(s, length); @@ -317,7 +317,7 @@ int license_recv(rdpLicense* license, wStream* s) break; default: - WLog_ERR(TAG, "invalid bMsgType:%d", bMsgType); + WLog_ERR(TAG, "invalid bMsgType:%"PRIu8"", bMsgType); return FALSE; } @@ -430,7 +430,7 @@ BOOL license_encrypt_premaster_secret(rdpLicense* license) return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "Modulus (%d bits):", license->ModulusLength * 8); + WLog_DBG(TAG, "Modulus (%"PRIu32" bits):", license->ModulusLength * 8); winpr_HexDump(TAG, WLOG_DEBUG, license->Modulus, license->ModulusLength); WLog_DBG(TAG, "Exponent:"); winpr_HexDump(TAG, WLOG_DEBUG, license->Exponent, 4); @@ -576,7 +576,7 @@ BOOL license_read_binary_blob(wStream* s, LICENSE_BLOB* blob) if ((blob->type != wBlobType) && (blob->type != BB_ANY_BLOB)) { - WLog_ERR(TAG, "license binary blob type (%x) does not match expected type (%x).", wBlobType, blob->type); + WLog_ERR(TAG, "license binary blob type (0x%"PRIx16") does not match expected type (0x%"PRIx16").", wBlobType, blob->type); } blob->type = wBlobType; @@ -816,7 +816,7 @@ BOOL license_read_platform_challenge_packet(rdpLicense* license, wStream* s) if (!license_decrypt_platform_challenge(license)) return FALSE; #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "ConnectFlags: 0x%08X", ConnectFlags); + WLog_DBG(TAG, "ConnectFlags: 0x%08"PRIX32"", ConnectFlags); WLog_DBG(TAG, "EncryptedPlatformChallenge:"); winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPlatformChallenge->data, license->EncryptedPlatformChallenge->length); WLog_DBG(TAG, "PlatformChallenge:"); @@ -933,13 +933,13 @@ BOOL license_write_new_license_request_packet(rdpLicense* license, wStream* s) } #ifdef WITH_DEBUG_LICENSE - WLog_DBG(TAG, "PreferredKeyExchangeAlg: 0x%08X", PreferredKeyExchangeAlg); + WLog_DBG(TAG, "PreferredKeyExchangeAlg: 0x%08"PRIX32"", PreferredKeyExchangeAlg); WLog_DBG(TAG, "ClientRandom:"); winpr_HexDump(TAG, WLOG_DEBUG, license->ClientRandom, 32); WLog_DBG(TAG, "EncryptedPremasterSecret"); winpr_HexDump(TAG, WLOG_DEBUG, license->EncryptedPremasterSecret->data, license->EncryptedPremasterSecret->length); - WLog_DBG(TAG, "ClientUserName (%d): %s", license->ClientUserName->length, (char*) license->ClientUserName->data); - WLog_DBG(TAG, "ClientMachineName (%d): %s", license->ClientMachineName->length, (char*) license->ClientMachineName->data); + WLog_DBG(TAG, "ClientUserName (%"PRIu16"): %s", license->ClientUserName->length, (char*) license->ClientUserName->data); + WLog_DBG(TAG, "ClientMachineName (%"PRIu16"): %s", license->ClientMachineName->length, (char*) license->ClientMachineName->data); #endif return TRUE; } diff --git a/libfreerdp/core/listener.c b/libfreerdp/core/listener.c index 2381c5f46..6fb48c8c6 100644 --- a/libfreerdp/core/listener.c +++ b/libfreerdp/core/listener.c @@ -70,7 +70,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a if (!bind_address) hints.ai_flags = AI_PASSIVE; - sprintf_s(servname, sizeof(servname), "%d", port); + sprintf_s(servname, sizeof(servname), "%"PRIu16"", port); status = getaddrinfo(bind_address, servname, &hints, &res); if (status != 0) diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index 27c9126c6..266c6899e 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -342,14 +342,14 @@ BOOL mcs_write_domain_parameters(wStream* s, DomainParameters* domainParameters) void mcs_print_domain_parameters(DomainParameters* domainParameters) { WLog_INFO(TAG, "DomainParameters {"); - WLog_INFO(TAG, "\tmaxChannelIds:%d", domainParameters->maxChannelIds); - WLog_INFO(TAG, "\tmaxUserIds:%d", domainParameters->maxUserIds); - WLog_INFO(TAG, "\tmaxTokenIds:%d", domainParameters->maxTokenIds); - WLog_INFO(TAG, "\tnumPriorities:%d", domainParameters->numPriorities); - WLog_INFO(TAG, "\tminThroughput:%d", domainParameters->minThroughput); - WLog_INFO(TAG, "\tmaxHeight:%d", domainParameters->maxHeight); - WLog_INFO(TAG, "\tmaxMCSPDUsize:%d", domainParameters->maxMCSPDUsize); - WLog_INFO(TAG, "\tprotocolVersion:%d", domainParameters->protocolVersion); + WLog_INFO(TAG, "\tmaxChannelIds:%"PRIu32"", domainParameters->maxChannelIds); + WLog_INFO(TAG, "\tmaxUserIds:%"PRIu32"", domainParameters->maxUserIds); + WLog_INFO(TAG, "\tmaxTokenIds:%"PRIu32"", domainParameters->maxTokenIds); + WLog_INFO(TAG, "\tnumPriorities:%"PRIu32"", domainParameters->numPriorities); + WLog_INFO(TAG, "\tminThroughput:%"PRIu32"", domainParameters->minThroughput); + WLog_INFO(TAG, "\tmaxHeight:%"PRIu32"", domainParameters->maxHeight); + WLog_INFO(TAG, "\tmaxMCSPDUsize:%"PRIu32"", domainParameters->maxMCSPDUsize); + WLog_INFO(TAG, "\tprotocolVersion:%"PRIu32"", domainParameters->protocolVersion); WLog_INFO(TAG, "}"); } diff --git a/libfreerdp/core/message.c b/libfreerdp/core/message.c index c22498123..7b1d2ee26 100644 --- a/libfreerdp/core/message.c +++ b/libfreerdp/core/message.c @@ -2502,7 +2502,7 @@ static void *update_message_proxy_thread(void *arg) if (!update || !update->queue) { - WLog_ERR(TAG, "update=%p, update->queue=%p", update, update ? update->queue : NULL); + WLog_ERR(TAG, "update=%p, update->queue=%p", (void*) update, (void*) (update ? update->queue : NULL)); ExitThread(-1); return NULL; } diff --git a/libfreerdp/core/nego.c b/libfreerdp/core/nego.c index 136b305e4..d4b023a1c 100644 --- a/libfreerdp/core/nego.c +++ b/libfreerdp/core/nego.c @@ -594,7 +594,7 @@ int nego_recv(rdpTransport* transport, wStream* s, void* extra) case TYPE_RDP_NEG_RSP: nego_process_negotiation_response(nego, s); - WLog_DBG(TAG, "selected_protocol: %d", nego->SelectedProtocol); + WLog_DBG(TAG, "selected_protocol: %"PRIu32"", nego->SelectedProtocol); /* enhanced security selected ? */ @@ -765,7 +765,7 @@ BOOL nego_read_request(rdpNego* nego, wStream* s) if (type != TYPE_RDP_NEG_REQ) { - WLog_ERR(TAG, "Incorrect negotiation request type %d", type); + WLog_ERR(TAG, "Incorrect negotiation request type %"PRIu8"", type); return FALSE; } @@ -855,7 +855,7 @@ BOOL nego_send_negotiation_request(rdpNego* nego) length += cookie_length + 19; } - WLog_DBG(TAG, "RequestedProtocols: %d", nego->RequestedProtocols); + WLog_DBG(TAG, "RequestedProtocols: %"PRIu32"", nego->RequestedProtocols); if ((nego->RequestedProtocols > PROTOCOL_RDP) || (nego->sendNegoData)) { @@ -905,7 +905,7 @@ void nego_process_negotiation_request(rdpNego* nego, wStream* s) Stream_Read_UINT16(s, length); Stream_Read_UINT32(s, nego->RequestedProtocols); - WLog_DBG(TAG, "RDP_NEG_REQ: RequestedProtocol: 0x%04X", nego->RequestedProtocols); + WLog_DBG(TAG, "RDP_NEG_REQ: RequestedProtocol: 0x%08"PRIX32"", nego->RequestedProtocols); nego->state = NEGO_STATE_FINAL; } @@ -979,7 +979,7 @@ void nego_process_negotiation_failure(rdpNego* nego, wStream* s) break; default: - WLog_ERR(TAG, "Error: Unknown protocol security error %d", failureCode); + WLog_ERR(TAG, "Error: Unknown protocol security error %"PRIu32"", failureCode); break; } diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 0d6b4b420..68a519c6b 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -225,7 +225,7 @@ int nla_client_init(rdpNla* nla) if (!identity) { - WLog_ERR(TAG, "NLA identity=%p", identity); + WLog_ERR(TAG, "NLA identity=%p", (void*) identity); return -1; } @@ -286,7 +286,7 @@ int nla_client_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [%08X]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -298,7 +298,7 @@ int nla_client_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [%08X]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -345,7 +345,7 @@ int nla_client_begin(rdpNla* nla) SECURITY_NATIVE_DREP, NULL, 0, &nla->context, &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, " InitializeSecurityContext status %s [%08X]", + WLog_VRB(TAG, " InitializeSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); if ((nla->status == SEC_I_COMPLETE_AND_CONTINUE) || (nla->status == SEC_I_COMPLETE_NEEDED)) @@ -357,7 +357,7 @@ int nla_client_begin(rdpNla* nla) status = nla->table->CompleteAuthToken(&nla->context, &nla->outputBufferDesc); if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return -1; } @@ -422,7 +422,7 @@ int nla_client_recv(rdpNla* nla) SECURITY_NATIVE_DREP, &nla->inputBufferDesc, 0, &nla->context, &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, "InitializeSecurityContext %s [%08X]", + WLog_VRB(TAG, "InitializeSecurityContext %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); free(nla->inputBuffer.pvBuffer); @@ -436,7 +436,7 @@ int nla_client_recv(rdpNla* nla) status = nla->table->CompleteAuthToken(&nla->context, &nla->outputBufferDesc); if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return -1; } @@ -455,7 +455,7 @@ int nla_client_recv(rdpNla* nla) nla->status = nla->table->QueryContextAttributes(&nla->context, SECPKG_ATTR_SIZES, &nla->ContextSizes); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [%08X]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -490,7 +490,7 @@ int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Could not verify public key echo %s [%08X]", + WLog_ERR(TAG, "Could not verify public key echo %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -500,7 +500,7 @@ int nla_client_recv(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "nla_encrypt_ts_credentials status %s [%08X]", + WLog_ERR(TAG, "nla_encrypt_ts_credentials status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -515,14 +515,14 @@ int nla_client_recv(rdpNla* nla) nla->table->FreeCredentialsHandle(&nla->credentials); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "FreeCredentialsHandle status %s [%08X]", + WLog_ERR(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); } nla->status = nla->table->FreeContextBuffer(nla->pPackageInfo); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "FreeContextBuffer status %s [%08X]", + WLog_ERR(TAG, "FreeContextBuffer status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); } @@ -627,7 +627,7 @@ int nla_server_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [%08X]", + WLog_ERR(TAG, "QuerySecurityPackageInfo status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -638,7 +638,7 @@ int nla_server_init(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "AcquireCredentialsHandle status %s [%08X]", + WLog_ERR(TAG, "AcquireCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -719,7 +719,7 @@ int nla_server_authenticate(rdpNla* nla) &nla->inputBufferDesc, nla->fContextReq, SECURITY_NATIVE_DREP, &nla->context, &nla->outputBufferDesc, &nla->pfContextAttr, &nla->expiration); - WLog_VRB(TAG, "AcceptSecurityContext status %s [%08X]", + WLog_VRB(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); nla->negoToken.pvBuffer = nla->outputBuffer.pvBuffer; nla->negoToken.cbBuffer = nla->outputBuffer.cbBuffer; @@ -739,7 +739,7 @@ int nla_server_authenticate(rdpNla* nla) if (status != SEC_E_OK) { - WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return -1; } @@ -773,7 +773,7 @@ int nla_server_authenticate(rdpNla* nla) nla->status = nla->table->QueryContextAttributes(&nla->context, SECPKG_ATTR_SIZES, &nla->ContextSizes); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [%08X]", + WLog_ERR(TAG, "QueryContextAttributes SECPKG_ATTR_SIZES failure %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -781,7 +781,7 @@ int nla_server_authenticate(rdpNla* nla) nla->status = nla_decrypt_public_key_echo(nla); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Error: could not verify client's public key echo %s [%08X]", + WLog_ERR(TAG, "Error: could not verify client's public key echo %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -815,7 +815,7 @@ int nla_server_authenticate(rdpNla* nla) break; } - WLog_ERR(TAG, "AcceptSecurityContext status %s [%08X]", + WLog_ERR(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); nla_send(nla); return -1; /* Access Denied */ @@ -847,7 +847,7 @@ int nla_server_authenticate(rdpNla* nla) nla->status = nla_decrypt_ts_credentials(nla); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "Could not decrypt TSCredentials status %s [%08X]", + WLog_ERR(TAG, "Could not decrypt TSCredentials status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -856,7 +856,7 @@ int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "ImpersonateSecurityContext status %s [%08X]", + WLog_ERR(TAG, "ImpersonateSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -866,7 +866,7 @@ int nla_server_authenticate(rdpNla* nla) if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "RevertSecurityContext status %s [%08X]", + WLog_ERR(TAG, "RevertSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -875,7 +875,7 @@ int nla_server_authenticate(rdpNla* nla) nla->status = nla->table->FreeContextBuffer(nla->pPackageInfo); if (nla->status != SEC_E_OK) { - WLog_ERR(TAG, "DeleteSecurityContext status %s [%08X]", + WLog_ERR(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(nla->status), nla->status); return -1; } @@ -967,7 +967,7 @@ SECURITY_STATUS nla_encrypt_public_key_echo(rdpNla* nla) if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [%08X]", + WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return status; } @@ -998,7 +998,7 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) signature_length = nla->pubKeyAuth.cbBuffer - nla->PublicKey.cbBuffer; if (signature_length < 0 || signature_length > nla->ContextSizes.cbSecurityTrailer) { - WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %lu", nla->pubKeyAuth.cbBuffer); + WLog_ERR(TAG, "unexpected pubKeyAuth buffer size: %"PRIu32"", nla->pubKeyAuth.cbBuffer); return SEC_E_INVALID_TOKEN; } @@ -1024,7 +1024,7 @@ SECURITY_STATUS nla_decrypt_public_key_echo(rdpNla* nla) if (status != SEC_E_OK) { - WLog_ERR(TAG, "DecryptMessage failure %s [%08X]", + WLog_ERR(TAG, "DecryptMessage failure %s [%08"PRIX32"]", GetSecurityStatusString(status), status); return status; } @@ -1321,7 +1321,7 @@ SECURITY_STATUS nla_encrypt_ts_credentials(rdpNla* nla) if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage failure %s [%08X]", + WLog_ERR(TAG, "EncryptMessage failure %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return status; } @@ -1370,7 +1370,7 @@ SECURITY_STATUS nla_decrypt_ts_credentials(rdpNla* nla) if (status != SEC_E_OK) { - WLog_ERR(TAG, "DecryptMessage failure %s [%08X]", + WLog_ERR(TAG, "DecryptMessage failure %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); return status; } @@ -1583,7 +1583,7 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) if (nla->errorCode) { - WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: %08X", nla->errorCode); + WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: 0x%08"PRIX32"", nla->errorCode); freerdp_set_last_error(nla->instance->context, nla->errorCode); return -1; } @@ -1630,19 +1630,19 @@ void nla_buffer_print(rdpNla* nla) { if (nla->negoToken.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.negoToken (length = %d):", (int) nla->negoToken.cbBuffer); + WLog_DBG(TAG, "NLA.negoToken (length = %"PRIu32"):", nla->negoToken.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, nla->negoToken.pvBuffer, nla->negoToken.cbBuffer); } if (nla->pubKeyAuth.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.pubKeyAuth (length = %d):", (int) nla->pubKeyAuth.cbBuffer); + WLog_DBG(TAG, "NLA.pubKeyAuth (length = %"PRIu32"):", nla->pubKeyAuth.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, nla->pubKeyAuth.pvBuffer, nla->pubKeyAuth.cbBuffer); } if (nla->authInfo.cbBuffer > 0) { - WLog_DBG(TAG, "NLA.authInfo (length = %d):", (int) nla->authInfo.cbBuffer); + WLog_DBG(TAG, "NLA.authInfo (length = %"PRIu32"):", nla->authInfo.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, nla->authInfo.pvBuffer, nla->authInfo.cbBuffer); } } @@ -1819,7 +1819,7 @@ void nla_free(rdpNla* nla) status = nla->table->DeleteSecurityContext(&nla->context); if (status != SEC_E_OK) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [%08X]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } } diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c index 45d3e5cef..d20e40b15 100644 --- a/libfreerdp/core/orders.c +++ b/libfreerdp/core/orders.c @@ -712,7 +712,7 @@ static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT* points, if (Stream_GetRemainingLength(s) < zeroBitsSize) { - WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %i", zeroBitsSize); + WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %"PRIu32"", zeroBitsSize); return FALSE; } @@ -821,7 +821,7 @@ static INLINE BOOL FIELD_SKIP_BUFFER16(wStream* s, UINT32 TARGET_LEN) if (!Stream_SafeSeek(s, TARGET_LEN)) { - WLog_ERR(TAG, "error skipping %d bytes", TARGET_LEN); + WLog_ERR(TAG, "error skipping %"PRIu32" bytes", TARGET_LEN); return FALSE; } @@ -1262,7 +1262,7 @@ static BOOL update_read_polyline_order(wStream* s, ORDER_INFO* orderInfo, if (!new_points) { - WLog_ERR(TAG, "realloc(%i) failed", new_num); + WLog_ERR(TAG, "realloc(%"PRIu32") failed", new_num); return FALSE; } @@ -1686,7 +1686,7 @@ static BOOL update_read_cache_bitmap_order(wStream* s, if ((cache_bitmap->bitmapBpp < 1) || (cache_bitmap->bitmapBpp > 32)) { - WLog_ERR(TAG, "invalid bitmap bpp %d", cache_bitmap->bitmapBpp); + WLog_ERR(TAG, "invalid bitmap bpp %"PRIu32"", cache_bitmap->bitmapBpp); return FALSE; } @@ -1955,7 +1955,7 @@ static BOOL update_read_cache_bitmap_v3_order(wStream* s, if ((bitmapData->bpp < 1) || (bitmapData->bpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %d", bitmapData->bpp); + WLog_ERR(TAG, "invalid bpp value %"PRIu32"", bitmapData->bpp); return FALSE; } @@ -2317,7 +2317,7 @@ static BOOL update_read_cache_brush_order(wStream* s, { if (cache_brush->length != 8) { - WLog_ERR(TAG, "incompatible 1bpp brush of length:%d", cache_brush->length); + WLog_ERR(TAG, "incompatible 1bpp brush of length:%"PRIu32"", cache_brush->length); return TRUE; // should be FALSE ? } @@ -2397,7 +2397,7 @@ BOOL update_write_cache_brush_order(wStream* s, { if (cache_brush->length != 8) { - WLog_ERR(TAG, "incompatible 1bpp brush of length:%d", cache_brush->length); + WLog_ERR(TAG, "incompatible 1bpp brush of length:%"PRIu32"", cache_brush->length); return FALSE; } @@ -2573,7 +2573,7 @@ static BOOL update_read_create_nine_grid_bitmap_order( if ((create_nine_grid_bitmap->bitmapBpp < 1) || (create_nine_grid_bitmap->bitmapBpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %d", create_nine_grid_bitmap->bitmapBpp); + WLog_ERR(TAG, "invalid bpp value %"PRIu32"", create_nine_grid_bitmap->bitmapBpp); return FALSE; } @@ -2612,7 +2612,7 @@ static BOOL update_read_stream_bitmap_first_order( if ((stream_bitmap_first->bitmapBpp < 1) || (stream_bitmap_first->bitmapBpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %d", stream_bitmap_first->bitmapBpp); + WLog_ERR(TAG, "invalid bpp value %"PRIu32"", stream_bitmap_first->bitmapBpp); return FALSE; } @@ -2923,7 +2923,7 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) if (orderInfo->orderType >= PRIMARY_DRAWING_ORDER_COUNT) { - WLog_ERR(TAG, "Invalid Primary Drawing Order (0x%02X)", orderInfo->orderType); + WLog_ERR(TAG, "Invalid Primary Drawing Order (0x%08"PRIX32")", orderInfo->orderType); return FALSE; } @@ -2949,7 +2949,7 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) } orderInfo->deltaCoordinates = (flags & ORDER_DELTA_COORDINATES) ? TRUE : FALSE; - WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%02X)", + WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")", PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType); switch (orderInfo->orderType) @@ -3218,10 +3218,10 @@ static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, next = Stream_Pointer(s) + ((INT16) orderLength) + 7; if (orderType < SECONDARY_DRAWING_ORDER_COUNT) - WLog_Print(update->log, WLOG_DEBUG, "%s Secondary Drawing Order (0x%02X)", + WLog_Print(update->log, WLOG_DEBUG, "%s Secondary Drawing Order (0x%02"PRIX8")", SECONDARY_DRAWING_ORDER_STRINGS[orderType], orderType); else - WLog_Print(update->log, WLOG_DEBUG, "Unknown Secondary Drawing Order (0x%02X)", + WLog_Print(update->log, WLOG_DEBUG, "Unknown Secondary Drawing Order (0x%02"PRIX8")", orderType); switch (orderType) @@ -3356,11 +3356,11 @@ static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s, if (orderType < ALTSEC_DRAWING_ORDER_COUNT) WLog_Print(update->log, WLOG_DEBUG, - "%s Alternate Secondary Drawing Order (0x%02X)", + "%s Alternate Secondary Drawing Order (0x%02"PRIX8")", ALTSEC_DRAWING_ORDER_STRINGS[orderType], orderType); else WLog_Print(update->log, WLOG_DEBUG, - "Unknown Alternate Secondary Drawing Order: 0x%02X", orderType); + "Unknown Alternate Secondary Drawing Order: 0x%02"PRIX8"", orderType); switch (orderType) { diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index fc9247e95..0063ddc84 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -286,7 +286,7 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s) return FALSE; #ifdef WITH_DEBUG_RDP - WLog_DBG(TAG, "recv %s Data PDU (0x%02X), length: %d", + WLog_DBG(TAG, "recv %s Data PDU (0x%02"PRIX8"), length: %"PRIu16"", type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, length); #endif @@ -345,7 +345,7 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s) break; default: - WLog_ERR(TAG, "Data PDU type %d", type); + WLog_ERR(TAG, "Data PDU type %"PRIu8"", type); break; } @@ -414,7 +414,7 @@ static int peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s) break; default: - WLog_ERR(TAG, "Client sent pduType %d", pduType); + WLog_ERR(TAG, "Client sent pduType %"PRIu16"", pduType); return -1; } } @@ -446,7 +446,7 @@ static int peer_recv_fastpath_pdu(freerdp_peer* client, wStream* s) if ((length == 0) || (length > Stream_GetRemainingLength(s))) { - WLog_ERR(TAG, "incorrect FastPath PDU header length %d", length); + WLog_ERR(TAG, "incorrect FastPath PDU header length %"PRIu16"", length); return -1; } diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index ed87f1080..85a2bf2ea 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -683,7 +683,7 @@ BOOL rdp_recv_server_auto_reconnect_status_pdu(rdpRdp* rdp, wStream* s) Stream_Read_UINT32(s, arcStatus); /* arcStatus (4 bytes) */ - WLog_WARN(TAG, "AutoReconnectStatus: 0x%04X", arcStatus); + WLog_WARN(TAG, "AutoReconnectStatus: 0x%08"PRIX32"", arcStatus); return TRUE; } @@ -783,7 +783,7 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) if (Stream_GetRemainingLength(s) < (size_t) SrcSize) { - WLog_ERR(TAG, "bulk_decompress: not enough bytes for compressedLength %d", compressedLength); + WLog_ERR(TAG, "bulk_decompress: not enough bytes for compressedLength %"PRIu16"", compressedLength); return -1; } @@ -809,7 +809,7 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s) Stream_Seek(s, SrcSize); } - WLog_DBG(TAG, "recv %s Data PDU (0x%02X), length: %d", + WLog_DBG(TAG, "recv %s Data PDU (0x%02"PRIX8"), length: %"PRIu16"", type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type, length); switch (type) @@ -1200,7 +1200,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s) break; default: - WLog_ERR(TAG, "incorrect PDU type: 0x%04X", pduType); + WLog_ERR(TAG, "incorrect PDU type: 0x%04"PRIX16"", pduType); break; } @@ -1242,7 +1242,7 @@ static int rdp_recv_fastpath_pdu(rdpRdp* rdp, wStream* s) if ((length == 0) || (length > Stream_GetRemainingLength(s))) { - WLog_ERR(TAG, "incorrect FastPath PDU header length %d", length); + WLog_ERR(TAG, "incorrect FastPath PDU header length %"PRIu16"", length); return -1; } diff --git a/libfreerdp/core/redirection.c b/libfreerdp/core/redirection.c index d0ab3bd21..9492adfd3 100644 --- a/libfreerdp/core/redirection.c +++ b/libfreerdp/core/redirection.c @@ -91,13 +91,13 @@ static BOOL rdp_redirection_read_unicode_string(wStream* s, char** str, size_t m if ((length % 2) || length < 2 || length > maxLength) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: invalid unicode string length: %lu", (unsigned long) length); + WLog_ERR(TAG, "rdp_redirection_read_string failure: invalid unicode string length: %"PRIu32"", length); return FALSE; } if (Stream_GetRemainingLength(s) < length) { - WLog_ERR(TAG, "rdp_redirection_read_string failure: insufficient stream length (%lu bytes required)", (unsigned long) length); + WLog_ERR(TAG, "rdp_redirection_read_string failure: insufficient stream length (%"PRIu32" bytes required)", length); return FALSE; } @@ -255,7 +255,7 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) Stream_Read_UINT32(s, redirection->sessionID); /* sessionID (4 bytes) */ Stream_Read_UINT32(s, redirection->flags); /* redirFlags (4 bytes) */ - WLog_DBG(TAG, "flags: 0x%04X, redirFlags: 0x%04X length: %d, sessionID: 0x%08X", + WLog_DBG(TAG, "flags: 0x%04"PRIX16", redirFlags: 0x%08"PRIX32" length: %"PRIu16", sessionID: 0x%08"PRIX32"", flags, redirection->flags, length, redirection->sessionID); rdp_print_redirection_flags(redirection->flags); @@ -422,7 +422,7 @@ static BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, wStream* s) if (!redirection->TargetNetAddresses) return FALSE; - WLog_DBG(TAG, "TargetNetAddressesCount: %d", redirection->TargetNetAddressesCount); + WLog_DBG(TAG, "TargetNetAddressesCount: %"PRIu32"", redirection->TargetNetAddressesCount); for (i = 0; i < (int) count; i++) { diff --git a/libfreerdp/core/server.c b/libfreerdp/core/server.c index 6f9ee7f2c..b66dd0b7b 100644 --- a/libfreerdp/core/server.c +++ b/libfreerdp/core/server.c @@ -152,7 +152,7 @@ static BOOL wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, Stream_Seek_UINT8(channel->receiveData); /* Pad (1 byte) */ Stream_Read_UINT16(channel->receiveData, Version); - DEBUG_DVC("Version: %d", Version); + DEBUG_DVC("Version: %"PRIu16"", Version); channel->vcm->drdynvc_state = DRDYNVC_STATE_READY; return TRUE; } @@ -169,13 +169,13 @@ static BOOL wts_read_drdynvc_create_response(rdpPeerChannel* channel, if ((INT32) CreationStatus < 0) { - DEBUG_DVC("ChannelId %d creation failed (%d)", channel->channelId, + DEBUG_DVC("ChannelId %"PRIu32" creation failed (%"PRId32")", channel->channelId, (INT32) CreationStatus); channel->dvc_open_state = DVC_OPEN_STATE_FAILED; } else { - DEBUG_DVC("ChannelId %d creation succeeded", channel->channelId); + DEBUG_DVC("ChannelId %"PRIu32" creation succeeded", channel->channelId); channel->dvc_open_state = DVC_OPEN_STATE_SUCCEEDED; } @@ -240,7 +240,7 @@ static BOOL wts_read_drdynvc_data(rdpPeerChannel* channel, wStream* s, static void wts_read_drdynvc_close_response(rdpPeerChannel* channel) { - DEBUG_DVC("ChannelId %d close response", channel->channelId); + DEBUG_DVC("ChannelId %"PRIu32" close response", channel->channelId); channel->dvc_open_state = DVC_OPEN_STATE_CLOSED; } @@ -277,7 +277,7 @@ static BOOL wts_read_drdynvc_pdu(rdpPeerChannel* channel) return FALSE; length -= value; - DEBUG_DVC("Cmd %d ChannelId %d length %d", Cmd, ChannelId, length); + DEBUG_DVC("Cmd %d ChannelId %"PRIu32" length %"PRIu32"", Cmd, ChannelId, length); dvc = wts_get_dvc_channel_by_id(channel->vcm, ChannelId); if (dvc) @@ -304,7 +304,7 @@ static BOOL wts_read_drdynvc_pdu(rdpPeerChannel* channel) } else { - DEBUG_DVC("ChannelId %d not exists.", ChannelId); + DEBUG_DVC("ChannelId %"PRIu32" not exists.", ChannelId); } } else diff --git a/libfreerdp/core/surface.c b/libfreerdp/core/surface.c index fd5762f95..dc290dc43 100644 --- a/libfreerdp/core/surface.c +++ b/libfreerdp/core/surface.c @@ -43,7 +43,7 @@ static int update_recv_surfcmd_surface_bits(rdpUpdate* update, wStream* s, UINT3 Stream_Read_UINT8(s, cmd->bpp); if ((cmd->bpp < 1) || (cmd->bpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %d", cmd->bpp); + WLog_ERR(TAG, "invalid bpp value %"PRIu32"", cmd->bpp); return FALSE; } @@ -77,7 +77,7 @@ static int update_recv_surfcmd_frame_marker(rdpUpdate* update, wStream* s, UINT3 Stream_Read_UINT16(s, marker->frameAction); Stream_Read_UINT32(s, marker->frameId); - WLog_Print(update->log, WLOG_DEBUG, "SurfaceFrameMarker: action: %s (%d) id: %d", + WLog_Print(update->log, WLOG_DEBUG, "SurfaceFrameMarker: action: %s (%"PRIu32") id: %"PRIu32"", (!marker->frameAction) ? "Begin" : "End", marker->frameAction, marker->frameId); @@ -115,7 +115,7 @@ int update_recv_surfcmds(rdpUpdate* update, UINT32 size, wStream* s) break; default: - WLog_ERR(TAG, "unknown cmdType 0x%X", cmdType); + WLog_ERR(TAG, "unknown cmdType 0x%04"PRIX16"", cmdType); return -1; } diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index a6feb5676..c1ff5852e 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -371,7 +371,7 @@ static int transport_bio_simple_init(BIO* bio, SOCKET socket, int shutdown) /* WSAEventSelect automatically sets the socket in non-blocking mode */ if (WSAEventSelect(ptr->socket, ptr->hEvent, FD_READ | FD_ACCEPT | FD_CLOSE)) { - WLog_ERR(TAG, "WSAEventSelect returned %08X", WSAGetLastError()); + WLog_ERR(TAG, "WSAEventSelect returned 0x%08X", WSAGetLastError()); return 0; } @@ -692,7 +692,7 @@ char* freerdp_tcp_get_ip_address(int sockfd) if (getsockname(sockfd, (struct sockaddr*) &sockaddr, &length) == 0) { ip = (BYTE*) (&sockaddr.sin_addr); - sprintf_s(ipAddress, sizeof(ipAddress), "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); + sprintf_s(ipAddress, sizeof(ipAddress), "%"PRIu8".%"PRIu8".%"PRIu8".%"PRIu8"", ip[0], ip[1], ip[2], ip[3]); } else { @@ -839,7 +839,7 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, struct addrinfo** addrs; struct addrinfo** results; - sprintf_s(port_str, sizeof(port_str) - 1, "%u", port); + sprintf_s(port_str, sizeof(port_str) - 1, "%d", port); sockfds = (SOCKET*) calloc(count, sizeof(SOCKET)); events = (HANDLE*) calloc(count + 1, sizeof(HANDLE)); @@ -862,7 +862,7 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, hints.ai_socktype = SOCK_STREAM; if (ports) - sprintf_s(port_str, sizeof(port_str) - 1, "%u", ports[index]); + sprintf_s(port_str, sizeof(port_str) - 1, "%"PRIu32"", ports[index]); status = getaddrinfo(hostnames[index], port_str, &hints, &result); @@ -910,13 +910,13 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, events[index] = WSACreateEvent(); if (!events[index]) { - WLog_ERR(TAG, "WSACreateEvent returned %08X", WSAGetLastError()); + WLog_ERR(TAG, "WSACreateEvent returned 0x%08X", WSAGetLastError()); continue; } if (WSAEventSelect(sockfd, events[index], FD_READ | FD_WRITE | FD_CONNECT | FD_CLOSE)) { - WLog_ERR(TAG, "WSAEventSelect returned %08X", WSAGetLastError()); + WLog_ERR(TAG, "WSAEventSelect returned 0x%08X", WSAGetLastError()); continue; } @@ -949,7 +949,7 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames, /* set socket in blocking mode */ if (WSAEventSelect(sockfd, NULL, 0)) { - WLog_ERR(TAG, "WSAEventSelect returned %08X", WSAGetLastError()); + WLog_ERR(TAG, "WSAEventSelect returned 0x%08X", WSAGetLastError()); continue; } @@ -1108,7 +1108,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings, hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - sprintf_s(port_str, sizeof(port_str) - 1, "%u", port); + sprintf_s(port_str, sizeof(port_str) - 1, "%d", port); status = getaddrinfo(hostname, port_str, &hints, &result); diff --git a/libfreerdp/core/timezone.c b/libfreerdp/core/timezone.c index 48374fe58..0fc0776fe 100644 --- a/libfreerdp/core/timezone.c +++ b/libfreerdp/core/timezone.c @@ -65,7 +65,7 @@ void rdp_write_system_time(wStream* s, SYSTEMTIME* system_time) Stream_Write_UINT16(s, system_time->wMinute); /* wMinute */ Stream_Write_UINT16(s, system_time->wSecond); /* wSecond */ Stream_Write_UINT16(s, system_time->wMilliseconds); /* wMilliseconds */ - DEBUG_TIMEZONE("Time: y=%d,m=%d,dow=%d,d=%d, %02d:%02d:%02d.%03d", + DEBUG_TIMEZONE("Time: y=%"PRIu16",m=%"PRIu16",dow=%"PRIu16",d=%"PRIu16", %02"PRIu16":%02"PRIu16":%02"PRIu16".%03"PRIu16"", system_time->wYear, system_time->wMonth, system_time->wDayOfWeek, system_time->wDay, system_time->wHour, system_time->wMinute, system_time->wSecond, system_time->wMilliseconds); @@ -136,13 +136,17 @@ BOOL rdp_write_client_time_zone(wStream* s, rdpSettings* settings) /* StandardDate */ rdp_write_system_time(s, &tz->StandardDate); - DEBUG_TIMEZONE("bias=%d stdName='%s' dlName='%s'", tz->Bias, - tz->StandardName, tz->DaylightName); - +#ifdef WITH_DEBUG_TIMEZONE + WLog_DBG(TIMEZONE_TAG, "bias=%"PRId32"", tz->Bias); + WLog_DBG(TIMEZONE_TAG, "StandardName:"); + winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*) tz->StandardName, sizeof(tz->StandardName)); + WLog_DBG(TIMEZONE_TAG, "DaylightName:"); + winpr_HexDump(TIMEZONE_TAG, WLOG_DEBUG, (const BYTE*) tz->DaylightName, sizeof(tz->DaylightName)); +#endif /* Note that StandardBias is ignored if no valid standardDate is provided. */ /* StandardBias */ Stream_Write_UINT32(s, tz->StandardBias); - DEBUG_TIMEZONE("StandardBias=%d", tz->StandardBias); + DEBUG_TIMEZONE("StandardBias=%"PRId32"", tz->StandardBias); /* daylightName (64 bytes) */ Stream_Write(s, tz->DaylightName, sizeof(tz->DaylightName)); @@ -153,7 +157,7 @@ BOOL rdp_write_client_time_zone(wStream* s, rdpSettings* settings) /* Note that DaylightBias is ignored if no valid daylightDate is provided. */ /* DaylightBias */ Stream_Write_UINT32(s, tz->DaylightBias); - DEBUG_TIMEZONE("DaylightBias=%d", tz->DaylightBias); + DEBUG_TIMEZONE("DaylightBias=%"PRId32"", tz->DaylightBias); return TRUE; } diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 039bbeb2e..24a0670e3 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -778,7 +778,7 @@ DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, { if (nCount > count) { - WLog_ERR(TAG, "%s: provided handles array is too small (count=%d nCount=%d)", + WLog_ERR(TAG, "%s: provided handles array is too small (count=%"PRIu32" nCount=%"PRIu32")", __FUNCTION__, count, nCount); return 0; } @@ -1027,7 +1027,7 @@ static void* transport_client_thread(void* arg) break; default: - WLog_ERR(TAG, "WaitForMultipleObjects failed with status 0x%08X", status); + WLog_ERR(TAG, "WaitForMultipleObjects failed with status 0x%08"PRIX32"", status); dwExitCode = 1; goto out; } @@ -1072,7 +1072,7 @@ static void* transport_client_thread(void* arg) if (status == WAIT_TIMEOUT) WLog_ERR(TAG, "WaitForMultipleObjects returned WAIT_TIMEOUT"); else - WLog_ERR(TAG, "WaitForMultipleObjects returned 0x%08X", status); + WLog_ERR(TAG, "WaitForMultipleObjects returned 0x%08"PRIX32"", status); dwExitCode = 1; break; diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index 81bb6e090..762745abb 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -180,7 +180,7 @@ BOOL update_read_bitmap_update(rdpUpdate* update, wStream* s, return FALSE; Stream_Read_UINT16(s, bitmapUpdate->number); /* numberRectangles (2 bytes) */ - WLog_Print(update->log, WLOG_TRACE, "BitmapUpdate: %d", bitmapUpdate->number); + WLog_Print(update->log, WLOG_TRACE, "BitmapUpdate: %"PRIu32"", bitmapUpdate->number); if (bitmapUpdate->number > bitmapUpdate->count) { @@ -314,7 +314,7 @@ BOOL update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer_color, int xorBpp) { BYTE* newMask; - int scanlineSize; + UINT32 scanlineSize; if (Stream_GetRemainingLength(s) < 14) return FALSE; @@ -375,7 +375,7 @@ BOOL update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer_color, if (scanlineSize * pointer_color->height != pointer_color->lengthXorMask) { - WLog_ERR(TAG, "invalid lengthXorMask: width=%d height=%d, %d instead of %d", + WLog_ERR(TAG, "invalid lengthXorMask: width=%"PRIu32" height=%"PRIu32", %"PRIu32" instead of %"PRIu32"", pointer_color->width, pointer_color->height, pointer_color->lengthXorMask, scanlineSize * pointer_color->height); return FALSE; @@ -407,7 +407,7 @@ BOOL update_read_pointer_color(wStream* s, POINTER_COLOR_UPDATE* pointer_color, if (scanlineSize * pointer_color->height != pointer_color->lengthAndMask) { - WLog_ERR(TAG, "invalid lengthAndMask: %d instead of %d", + WLog_ERR(TAG, "invalid lengthAndMask: %"PRIu32" instead of %"PRIu32"", pointer_color->lengthAndMask, scanlineSize * pointer_color->height); return FALSE; } @@ -436,7 +436,7 @@ BOOL update_read_pointer_new(wStream* s, POINTER_NEW_UPDATE* pointer_new) if ((pointer_new->xorBpp < 1) || (pointer_new->xorBpp > 32)) { - WLog_ERR(TAG, "invalid xorBpp %d", pointer_new->xorBpp); + WLog_ERR(TAG, "invalid xorBpp %"PRIu32"", pointer_new->xorBpp); return FALSE; } @@ -672,7 +672,7 @@ static BOOL update_end_paint(rdpContext* context) if (update->numberOrders > 0) { - WLog_ERR(TAG, "sending %d orders", update->numberOrders); + WLog_ERR(TAG, "sending %"PRIu16" orders", update->numberOrders); fastpath_send_update_pdu(context->rdp->fastpath, FASTPATH_UPDATETYPE_ORDERS, s, FALSE); } diff --git a/libfreerdp/core/window.c b/libfreerdp/core/window.c index e197b76e4..db5560a32 100644 --- a/libfreerdp/core/window.c +++ b/libfreerdp/core/window.c @@ -79,7 +79,7 @@ BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) if ((iconInfo->bpp < 1) || (iconInfo->bpp > 32)) { - WLog_ERR(TAG, "invalid bpp value %d", iconInfo->bpp); + WLog_ERR(TAG, "invalid bpp value %"PRIu32"", iconInfo->bpp); return FALSE; } diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 7f1cfec0e..782778055 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -138,7 +138,7 @@ static int certificate_data_match_legacy(rdpCertificateStore* certificate_store, if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [%08X]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return match; @@ -262,7 +262,7 @@ static int certificate_data_match_raw(rdpCertificateStore* certificate_store, if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [%08X]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return match; @@ -377,7 +377,7 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if ((lowSize = GetFileSize(fp, &highSize)) == INVALID_FILE_SIZE) { - WLog_ERR(TAG, "GetFileSize(%s) returned %s [%08X]", + WLog_ERR(TAG, "GetFileSize(%s) returned %s [0x%08"PRIX32"]", certificate_store->legacy_file, strerror(errno), GetLastError()); CloseHandle(fp); return FALSE; @@ -406,7 +406,7 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (SetFilePointer(fp, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { - WLog_ERR(TAG, "SetFilePointer(%s) returned %s [%08X]", + WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08"PRIX32"]", certificate_store->file, strerror(errno), GetLastError()); free(data); CloseHandle(fp); @@ -415,7 +415,7 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, if (!SetEndOfFile(fp)) { - WLog_ERR(TAG, "SetEndOfFile(%s) returned %s [%08X]", + WLog_ERR(TAG, "SetEndOfFile(%s) returned %s [0x%08"PRIX32"]", certificate_store->file, strerror(errno), GetLastError()); free(data); CloseHandle(fp); @@ -454,20 +454,20 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, rc = TRUE; } - size = _snprintf(NULL, 0, "%s %hu %s %s %s\n", hostname, port, fingerprint, subject, issuer); + size = _snprintf(NULL, 0, "%s %"PRIu16" %s %s %s\n", hostname, port, fingerprint, subject, issuer); tdata = malloc(size + 1); if (!tdata) { - WLog_ERR(TAG, "malloc(%s) returned %s [%08X]", + WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); free(data); CloseHandle(fp); return FALSE; } - if (_snprintf(tdata, size + 1, "%s %hu %s %s %s\n", hostname, port, fingerprint, subject, issuer) != size) + if (_snprintf(tdata, size + 1, "%s %"PRIu16" %s %s %s\n", hostname, port, fingerprint, subject, issuer) != size) { - WLog_ERR(TAG, "_snprintf(%s) returned %s [%08X]", + WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); free(tdata); free(data); @@ -476,7 +476,7 @@ BOOL certificate_data_replace(rdpCertificateStore* certificate_store, } if (!WriteFile(fp, tdata, size, &written, NULL) || (written != size)) { - WLog_ERR(TAG, "WriteFile(%s) returned %s [%08X]", + WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); free(tdata); free(data); @@ -556,28 +556,28 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, rdpCertifica if (SetFilePointer(fp, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER) { - WLog_ERR(TAG, "SetFilePointer(%s) returned %s [%08X]", + WLog_ERR(TAG, "SetFilePointer(%s) returned %s [0x%08"PRIX32"]", certificate_store->file, strerror(errno), GetLastError()); CloseHandle(fp); return FALSE; } - size = _snprintf(NULL, 0, "%s %hu %s %s %s\n", certificate_data->hostname, certificate_data->port, + size = _snprintf(NULL, 0, "%s %"PRIu16" %s %s %s\n", certificate_data->hostname, certificate_data->port, certificate_data->fingerprint, certificate_data->subject, certificate_data->issuer); tdata = malloc(size + 1); if (!tdata) { - WLog_ERR(TAG, "malloc(%s) returned %s [%08X]", + WLog_ERR(TAG, "malloc(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); CloseHandle(fp); return FALSE; } - if (_snprintf(tdata, size + 1, "%s %hu %s %s %s\n", certificate_data->hostname, certificate_data->port, + if (_snprintf(tdata, size + 1, "%s %"PRIu16" %s %s %s\n", certificate_data->hostname, certificate_data->port, certificate_data->fingerprint, certificate_data->subject, certificate_data->issuer) != size) { - WLog_ERR(TAG, "_snprintf(%s) returned %s [%08X]", + WLog_ERR(TAG, "_snprintf(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); free(tdata); CloseHandle(fp); @@ -585,7 +585,7 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, rdpCertifica } if (!WriteFile(fp, tdata, size, &written, NULL) || (written != size)) { - WLog_ERR(TAG, "WriteFile(%s) returned %s [%08X]", + WLog_ERR(TAG, "WriteFile(%s) returned %s [0x%08X]", certificate_store->file, strerror(errno), errno); free(tdata); CloseHandle(fp); diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index 3e8b51b36..569601e8c 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -220,10 +220,10 @@ char* crypto_cert_fingerprint(X509* xcert) p = fp_buffer; for (i = 0; i < (int) (fp_len - 1); i++) { - sprintf(p, "%02x:", fp[i]); + sprintf(p, "%02"PRIx8":", fp[i]); p = &fp_buffer[(i + 1) * 3]; } - sprintf(p, "%02x", fp[i]); + sprintf(p, "%02"PRIx8"", fp[i]); return fp_buffer; } diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 8929ef54b..1071a2e9d 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -762,7 +762,7 @@ int tls_do_handshake(rdpTls* tls, BOOL clientMode) if ((status != WAIT_OBJECT_0) && (status != WAIT_TIMEOUT)) { - WLog_ERR(TAG, "error during WaitForSingleObject(): 0x%04X", status); + WLog_ERR(TAG, "error during WaitForSingleObject(): 0x%08"PRIX32"", status); return -1; } @@ -1409,7 +1409,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname, void tls_print_certificate_error(char* hostname, UINT16 port, char* fingerprint, char* hosts_file) { - WLog_ERR(TAG, "The host key for %s:%hu has changed", hostname, port); + WLog_ERR(TAG, "The host key for %s:%"PRIu16" has changed", hostname, port); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); WLog_ERR(TAG, "@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); @@ -1437,7 +1437,7 @@ void tls_print_certificate_name_mismatch_error(char* hostname, UINT16 port, WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); WLog_ERR(TAG, "@ WARNING: CERTIFICATE NAME MISMATCH! @"); WLog_ERR(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); - WLog_ERR(TAG, "The hostname used for this connection (%s:%hu) ", + WLog_ERR(TAG, "The hostname used for this connection (%s:%"PRIu16") ", hostname, port); WLog_ERR(TAG, "does not match %s given in the certificate:", alt_names_count < 1 ? "the name" : "any of the names"); diff --git a/libfreerdp/gdi/bitmap.c b/libfreerdp/gdi/bitmap.c index c8f5d936a..478b9a799 100644 --- a/libfreerdp/gdi/bitmap.c +++ b/libfreerdp/gdi/bitmap.c @@ -286,7 +286,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, UINT32 nXDest, if (!dstp) { - WLog_ERR(TAG, "dstp=%p", dstp); + WLog_ERR(TAG, "dstp=%p", (void*) dstp); return FALSE; } @@ -298,7 +298,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, UINT32 nXDest, if (!srcp) { - WLog_ERR(TAG, "srcp=%p", srcp); + WLog_ERR(TAG, "srcp=%p", (void*) srcp); return FALSE; } @@ -321,7 +321,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, UINT32 nXDest, if (!patp) { - WLog_ERR(TAG, "patp=%p", patp); + WLog_ERR(TAG, "patp=%p", (void*) patp); return FALSE; } diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index d1b8b2e68..8c0a02801 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -600,7 +600,7 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) break; default: - WLog_ERR(TAG, "unimplemented brush style:%d", brush->style); + WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style); break; } @@ -874,7 +874,7 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) break; default: - WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style); + WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style); break; } @@ -919,7 +919,7 @@ static BOOL gdi_frame_marker(rdpContext* context, BOOL gdi_surface_frame_marker(rdpContext* context, const SURFACE_FRAME_MARKER* surfaceFrameMarker) { - WLog_Print(context->gdi->log, WLOG_DEBUG, "frameId %d frameAction %d", + WLog_Print(context->gdi->log, WLOG_DEBUG, "frameId %"PRIu32" frameAction %"PRIu32"", surfaceFrameMarker->frameId, surfaceFrameMarker->frameAction); @@ -952,8 +952,8 @@ static BOOL gdi_surface_bits(rdpContext* context, gdi = context->gdi; WLog_Print(gdi->log, WLOG_DEBUG, - "destLeft %d destTop %d destRight %d destBottom %d " - "bpp %d codecID %d width %d height %d length %d", + "destLeft %"PRIu32" destTop %"PRIu32" destRight %"PRIu32" destBottom %"PRIu32" " + "bpp %"PRIu32" codecID %"PRIu32" width %"PRIu32" height %"PRIu32" length %"PRIu32"", cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom, cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength); @@ -996,7 +996,7 @@ static BOOL gdi_surface_bits(rdpContext* context, break; default: - WLog_ERR(TAG, "Unsupported codecID %d", cmd->codecID); + WLog_ERR(TAG, "Unsupported codecID %"PRIu32"", cmd->codecID); break; } diff --git a/libfreerdp/gdi/gdi.h b/libfreerdp/gdi/gdi.h index 329d8e95e..2d74fcb61 100644 --- a/libfreerdp/gdi/gdi.h +++ b/libfreerdp/gdi/gdi.h @@ -46,7 +46,7 @@ static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, UINT32 x, UINT32 y) else { WLog_ERR(FREERDP_TAG("gdi"), - "gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d", + "gdi_get_bitmap_pointer: requesting invalid pointer: (%"PRIu32",%"PRIu32") in %"PRIu32"x%"PRIu32"", x, y, hBmp->width, hBmp->height); return 0; } diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 32ea4a910..f66bc277d 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -296,7 +296,7 @@ static UINT gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, if (rc < 0) { - WLog_ERR(TAG, "clear_decompress failure: %d", rc); + WLog_ERR(TAG, "clear_decompress failure: %"PRId32"", rc); return ERROR_INTERNAL_ERROR; } @@ -392,7 +392,7 @@ static UINT gdi_SurfaceCommand_AVC420(rdpGdi* gdi, if (rc < 0) { - WLog_WARN(TAG, "avc420_decompress failure: %d, ignoring update.", status); + WLog_WARN(TAG, "avc420_decompress failure: %"PRIu32", ignoring update.", status); return CHANNEL_RC_OK; } @@ -454,7 +454,7 @@ static UINT gdi_SurfaceCommand_AVC444(rdpGdi* gdi, RdpgfxClientContext* context, if (rc < 0) { - WLog_WARN(TAG, "avc444_decompress failure: %d, ignoring update.", status); + WLog_WARN(TAG, "avc444_decompress failure: %"PRIu32", ignoring update.", status); return CHANNEL_RC_OK; } @@ -498,7 +498,7 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, if (!surface) return ERROR_INTERNAL_ERROR; - WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %d", status); + WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %"PRIu32"", status); /* fill with green for now to distinguish from the rest */ if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, @@ -545,7 +545,7 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, if (rc < 0) { - WLog_ERR(TAG, "progressive_create_surface_context failure: %d", rc); + WLog_ERR(TAG, "progressive_create_surface_context failure: %"PRId32"", rc); return ERROR_INTERNAL_ERROR; } @@ -556,7 +556,7 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, if (rc < 0) { - WLog_ERR(TAG, "progressive_decompress failure: %d", rc); + WLog_ERR(TAG, "progressive_decompress failure: %"PRId32"", rc); return ERROR_INTERNAL_ERROR; } @@ -591,12 +591,12 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, return ERROR_INVALID_PARAMETER; WLog_Print(gdi->log, WLOG_TRACE, - "surfaceId=%lu, codec=%lu, contextId=%lu, format=%s, " - "left=%lu, top=%lu, right=%lu, bottom=%lu, width=%lu, height=%lu " - "length=%lu, data=%p, extra=%p", + "surfaceId=%"PRIu32", codec=%"PRIu32", contextId=%"PRIu32", format=%s, " + "left=%"PRIu32", top=%"PRIu32", right=%"PRIu32", bottom=%"PRIu32", width=%"PRIu32", height=%"PRIu32" " + "length=%"PRIu32", data=%p, extra=%p", cmd->surfaceId, cmd->codecId, cmd->contextId, GetColorFormatName(cmd->format), cmd->left, cmd->top, cmd->right, - cmd->bottom, cmd->width, cmd->height, cmd->length, cmd->data, cmd->extra); + cmd->bottom, cmd->width, cmd->height, cmd->length, (void*) cmd->data, (void*) cmd->extra); switch (cmd->codecId) { @@ -633,11 +633,11 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context, break; case RDPGFX_CODECID_CAPROGRESSIVE_V2: - WLog_WARN(TAG, "SurfaceCommand %08X not implemented", cmd->codecId); + WLog_WARN(TAG, "SurfaceCommand 0x%08"PRIX32" not implemented", cmd->codecId); break; default: - WLog_WARN(TAG, "Invalid SurfaceCommand %08X", cmd->codecId); + WLog_WARN(TAG, "Invalid SurfaceCommand 0x%08"PRIX32"", cmd->codecId); break; } diff --git a/libfreerdp/gdi/test/TestGdiRect.c b/libfreerdp/gdi/test/TestGdiRect.c index 6d439dc3e..cff092b49 100644 --- a/libfreerdp/gdi/test/TestGdiRect.c +++ b/libfreerdp/gdi/test/TestGdiRect.c @@ -116,7 +116,7 @@ int test_gdi_FillRect(void) } else { - printf("actual:%04X expected:%04X\n", gdi_GetPixel(hdc, x, y), color); + printf("actual:%08"PRIX32" expected:%08"PRIX32"\n", gdi_GetPixel(hdc, x, y), color); badPixels++; } } diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index 708737f51..dbbf1dd0a 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -135,7 +135,7 @@ DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode) { - DEBUG_KBD("x11 keycode: %02X -> rdp code: %02X%s", keycode, + DEBUG_KBD("x11 keycode: %02"PRIX32" -> rdp code: %02"PRIX8"%s", keycode, RDP_SCANCODE_CODE(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]), RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_VIRTUAL_SCANCODE[keycode]) ? " extended" : ""); diff --git a/libfreerdp/locale/keyboard_xkbfile.c b/libfreerdp/locale/keyboard_xkbfile.c index a2b4ff210..9e3a19c0e 100644 --- a/libfreerdp/locale/keyboard_xkbfile.c +++ b/libfreerdp/locale/keyboard_xkbfile.c @@ -345,7 +345,7 @@ int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, DWORD x11_keycode_to_ if (*keyboardLayoutId == 0) { detect_keyboard_layout_from_xkbfile(display, keyboardLayoutId); - DEBUG_KBD("detect_keyboard_layout_from_xkb: %p", keyboardLayoutId); + DEBUG_KBD("detect_keyboard_layout_from_xkb: %"PRIu32" (0x%08X"PRIX32")", *keyboardLayoutId, *keyboardLayoutId); } freerdp_keyboard_load_map_from_xkbfile(display, x11_keycode_to_rdp_scancode); @@ -398,7 +398,7 @@ int detect_keyboard_layout_from_xkbfile(void* display, DWORD* keyboardLayoutId) if (XkbGetState(display, XkbUseCoreKbd, &state) == Success) group = state.group; - DEBUG_KBD("group: %d", state.group); + DEBUG_KBD("group: %u", state.group); layout = comma_substring(rules_names.layout, group); variant = comma_substring(rules_names.variant, group); @@ -442,8 +442,8 @@ int freerdp_keyboard_load_map_from_xkbfile(void* display, DWORD x11_keycode_to_r { if (!strcmp(xkb_keyname, XKB_KEY_NAME_SCANCODE_TABLE[j].xkb_keyname)) { - DEBUG_KBD("%4s: keycode: 0x%02X -> rdp scancode: 0x%04X", - xkb_keyname, i, (unsigned int) XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode); + DEBUG_KBD("%4s: keycode: 0x%02X -> rdp scancode: 0x%08"PRIX32"", + xkb_keyname, i, XKB_KEY_NAME_SCANCODE_TABLE[j].rdp_scancode); if (found) { diff --git a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c index c7f49cf94..4073197eb 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c +++ b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c @@ -112,7 +112,7 @@ static BOOL check(const BYTE* pSrc1, UINT32 src1Step, if (colordist(c0, c1) > TOLERANCE) { - printf("alphaComp-general: [%d,%d] 0x%08x+0x%08x=0x%08x, got 0x%08x\n", + printf("alphaComp-general: [%"PRIu32",%"PRIu32"] 0x%08"PRIx32"+0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", x, y, s1, s2, c0, c1); return FALSE; } diff --git a/libfreerdp/primitives/test/TestPrimitivesAndOr.c b/libfreerdp/primitives/test/TestPrimitivesAndOr.c index 52a1e9db5..4e97802e5 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAndOr.c +++ b/libfreerdp/primitives/test/TestPrimitivesAndOr.c @@ -38,13 +38,8 @@ static BOOL test_and_32u_impl(const char* name, __andC_32u_t fkt, if (dst[i] != (src[i] & val)) { - printf("AND %s FAIL[%lu] 0x%08lx&0x%08lx=0x%08lx, got 0x%08lx\n", - name, - (unsigned long) i, - (unsigned long) src[i], - (unsigned long) val, - (unsigned long) (src[i] & val), - (unsigned long) dst[i]); + printf("AND %s FAIL[%"PRIuz"] 0x%08"PRIx32"&0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", + name, i, src[i], val, (src[i] & val), dst[i]); return FALSE; } @@ -105,7 +100,7 @@ static BOOL check(const UINT32* src, const UINT32* dst, UINT32 size, UINT32 valu { if (dst[i] != (src[i] | value)) { - printf("OR-general general FAIL[%d] 0x%08x&0x%08x=0x%08x, got 0x%08x\n", + printf("OR-general general FAIL[%"PRIu32"] 0x%08"PRIx32"&0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n", i, src[i], value, src[i] | value, dst[i]); return FALSE; } diff --git a/libfreerdp/primitives/test/TestPrimitivesColors.c b/libfreerdp/primitives/test/TestPrimitivesColors.c index 18c0dece0..57360bddf 100644 --- a/libfreerdp/primitives/test/TestPrimitivesColors.c +++ b/libfreerdp/primitives/test/TestPrimitivesColors.c @@ -63,7 +63,7 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(void) { if (out1[i] != out2[i]) { - printf("RGBToRGB-SSE FAIL: out1[%d]=0x%08x out2[%d]=0x%08x\n", + printf("RGBToRGB-SSE FAIL: out1[%d]=0x%08"PRIx32" out2[%d]=0x%08"PRIx32"\n", i, out1[i], i, out2[i]); failed = TRUE; } @@ -167,7 +167,7 @@ static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void) || (ABS(g1[i] - g2[i]) > 1) || (ABS(b1[i] - b2[i]) > 1)) { - printf("YCbCrToRGB-SSE FAIL[%d]: %d,%d,%d vs %d,%d,%d\n", i, + printf("YCbCrToRGB-SSE FAIL[%d]: %"PRId16",%"PRId16",%"PRId16" vs %"PRId16",%"PRId16",%"PRId16"\n", i, r1[i], g1[i], b1[i], r2[i], g2[i], b2[i]); return FALSE; } diff --git a/libfreerdp/primitives/test/TestPrimitivesCopy.c b/libfreerdp/primitives/test/TestPrimitivesCopy.c index 917c702b8..cf19d3708 100644 --- a/libfreerdp/primitives/test/TestPrimitivesCopy.c +++ b/libfreerdp/primitives/test/TestPrimitivesCopy.c @@ -49,8 +49,8 @@ static BOOL test_copy8u_func(void) { if (dest[i + doff] != data[i + soff]) { - printf("COPY8U FAIL: off=%d len=%d, dest[%d]=0x%02x" - "data[%d]=0x%02x\n", + printf("COPY8U FAIL: off=%d len=%d, dest[%d]=0x%02"PRIx8"" + "data[%d]=0x%02"PRIx8"\n", doff, length, i + doff, dest[i + doff], i + soff, data[i + soff]); return FALSE; diff --git a/libfreerdp/primitives/test/TestPrimitivesSet.c b/libfreerdp/primitives/test/TestPrimitivesSet.c index 219539b74..ab903da5b 100644 --- a/libfreerdp/primitives/test/TestPrimitivesSet.c +++ b/libfreerdp/primitives/test/TestPrimitivesSet.c @@ -34,7 +34,7 @@ static BOOL check8(const BYTE* src, UINT32 length, UINT32 offset, BYTE value) { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%d len=%d dest[%d]=0x%02x\n", + printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%02"PRIx8"\n", offset, length, i + offset, src[i + offset]); return FALSE; } @@ -111,7 +111,7 @@ static BOOL check32s(const INT32* src, UINT32 length, UINT32 offset, INT32 value { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%d len=%d dest[%d]=0x%08x\n", + printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%08"PRIx32"\n", offset, length, i + offset, src[i + offset]); return FALSE; } @@ -170,7 +170,7 @@ static BOOL check32u(const UINT32* src, UINT32 length, UINT32 offset, UINT32 val { if (src[offset + i] != value) { - printf("SET8U FAILED: off=%d len=%d dest[%d]=0x%08x\n", + printf("SET8U FAILED: off=%"PRIu32" len=%"PRIu32" dest[%"PRIu32"]=0x%08"PRIx32"\n", offset, length, i + offset, src[i + offset]); return FALSE; } diff --git a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c index 8ce125ac8..8b728c8d6 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c @@ -2141,7 +2141,7 @@ static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, if ((error[0] > margin) || (error[1] > margin) || (error[2] > margin)) { - printf("(%2d,%2d) Y: %+5d Cb: %+5d Cr: %+5d R: %03d/%03d G: %03d/%03d B: %03d/%03d %d %d %d\n", + printf("(%2d,%2d) Y: %+5"PRId16" Cb: %+5"PRId16" Cr: %+5"PRId16" R: %03"PRIu8"/%03"PRIu8" G: %03"PRIu8"/%03"PRIu8" B: %03"PRIu8"/%03"PRIu8" %d %d %d\n", x, y, Y, Cb, Cr, R, eR, G, eG, B, eB, R - eR, G - eG, B - eB); count++; } @@ -2205,13 +2205,12 @@ int test_YCbCr_fp(TEST_FP_TYPE coeffs[4], INT16 YCbCr[3], BYTE RGB[3]) R = (INT16) fR; G = (INT16) fG; B = (INT16) fB; - printf("mR: %d mG: %d mB: %d\n", - (R - 16) % 32, (G - 16) % 32, (B - 16) % 32); - printf("iR: %d iG: %d iB: %d\n", R, G, B); + printf("mR: %d mG: %d mB: %d\n", (R - 16) % 32, (G - 16) % 32, (B - 16) % 32); + printf("iR: %"PRId16" iG: %"PRId16" iB: %"PRId16"\n", R, G, B); R >>= 5; G >>= 5; B >>= 5; - printf("R5: %d G5: %d B5: %d\n", R, G, B); + printf("R5: %"PRId16" G5: %"PRId16" B5: %"PRId16"\n", R, G, B); #else R = ((INT16)(((Cr * coeffs[0]) + Y + 16.0f)) >> 5); G = ((INT16)((Y - (Cb * coeffs[1]) - (Cr * coeffs[2]) + 16.0f)) >> 5); @@ -2234,10 +2233,10 @@ int test_YCbCr_fp(TEST_FP_TYPE coeffs[4], INT16 YCbCr[3], BYTE RGB[3]) B = 255; printf("--------------------------------\n"); - printf("R: A: %3d E: %3d %s\n", R, RGB[0], (R == RGB[0]) ? "" : "***"); - printf("G: A: %3d E: %3d %s\n", G, RGB[1], (G == RGB[1]) ? "" : "***"); - printf("B: A: %3d E: %3d %s\n", B, RGB[2], (B == RGB[2]) ? "" : "***"); - printf("Y: %+5d Cb: %+5d Cr: %+5d\n", YCbCr[0], YCbCr[1], YCbCr[2]); + printf("R: A: %3"PRId16" E: %3"PRIu8" %s\n", R, RGB[0], (R == RGB[0]) ? "" : "***"); + printf("G: A: %3"PRId16" E: %3"PRIu8" %s\n", G, RGB[1], (G == RGB[1]) ? "" : "***"); + printf("B: A: %3"PRId16" E: %3"PRIu8" %s\n", B, RGB[2], (B == RGB[2]) ? "" : "***"); + printf("Y: %+5"PRId16" Cb: %+5"PRId16" Cr: %+5"PRId16"\n", YCbCr[0], YCbCr[1], YCbCr[2]); //printf("[0]: %20.20lf\n", coeffs[0]); //printf("[1]: %20.20lf\n", coeffs[1]); //printf("[2]: %20.20lf\n", coeffs[2]); diff --git a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c index a1f508479..47785f1c1 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c @@ -74,8 +74,8 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(void) { if (out_c[i] != out_sse[i]) { - printf("optimized->YCoCgRToRGB FAIL[%d]: 0x%08x -> C 0x%08x vs optimized 0x%08x\n", i, - in[i + 1], out_c[i], out_sse[i]); + printf("optimized->YCoCgRToRGB FAIL[%"PRIu32"]: 0x%08"PRIx32" -> C 0x%08"PRIx32" vs optimized 0x%08"PRIx32"\n", + i, in[i + 1], out_c[i], out_sse[i]); result = FALSE; } } @@ -84,9 +84,8 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(void) { if (out_c_inv[i] != out_sse_inv[i]) { - printf("optimized->YCoCgRToRGB inverted FAIL[%d]: 0x%08x -> C 0x%08x vs optimized 0x%08x\n", - i, - in[i + 1], out_c_inv[i], out_sse_inv[i]); + printf("optimized->YCoCgRToRGB inverted FAIL[%"PRIu32"]: 0x%08"PRIu32" -> C 0x%08"PRIx32" vs optimized 0x%08"PRIx32"\n", + i, in[i + 1], out_c_inv[i], out_sse_inv[i]); result = FALSE; } } diff --git a/libfreerdp/primitives/test/TestPrimitivesYUV.c b/libfreerdp/primitives/test/TestPrimitivesYUV.c index 1cd3571e4..e14aeb7ec 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYUV.c +++ b/libfreerdp/primitives/test/TestPrimitivesYUV.c @@ -23,7 +23,7 @@ static BOOL similar(const BYTE* src, const BYTE* dst, size_t size) if (abs(diff) > 2) { - fprintf(stderr, "%lu %02X : %02X diff=%d\n", (unsigned long)x, src[x], dst[x], abs(diff)); + fprintf(stderr, "%"PRIuz" %02"PRIX8" : %02"PRIX8" diff=%d\n", x, src[x], dst[x], abs(diff)); return FALSE; } } @@ -67,8 +67,8 @@ static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, while ((x < halfPad) && (*esrc++ != 'A')) x++; - fprintf(stderr, "Buffer underflow detected %02x != %02X %s [%lu-%lu]\n", - d, 'A', buffer, (unsigned long)start, (unsigned long)x); + fprintf(stderr, "Buffer underflow detected %02"PRIx8" != %02X %s [%"PRIuz"-%"PRIuz"]\n", + d, 'A', buffer, start, x); return FALSE; } @@ -79,8 +79,8 @@ static BOOL check_padding(const BYTE* psrc, size_t size, size_t padding, while ((x < halfPad) && (*esrc++ != 'A')) x++; - fprintf(stderr, "Buffer overflow detected %02x != %02X %s [%lu-%lu]\n", - d, 'A', buffer, (unsigned long)start, (unsigned long)x); + fprintf(stderr, "Buffer overflow detected %02"PRIx8" != %02X %s [%"PRIuz"-%"PRIuz"]\n", + d, 'A', buffer, start, x); return FALSE; } } @@ -142,9 +142,8 @@ static BOOL TestPrimitiveYUVCombine(void) get_size(&roi.width, &roi.height); awidth = roi.width + 16 - roi.width % 16; aheight = roi.height + 16 - roi.height % 16; - fprintf(stderr, "Running YUVCombine on frame size %lux%lu [%lux%lu]\n", - (unsigned long) roi.width, (unsigned long) roi.height, - (unsigned long) awidth, (unsigned long) aheight); + fprintf(stderr, "Running YUVCombine on frame size %"PRIu32"x%"PRIu32" [%"PRIu32"x%"PRIu32"]\n", + roi.width, roi.height, awidth, aheight); if (!prims || !prims->YUV420CombineToYUV444) goto fail; @@ -331,8 +330,8 @@ static BOOL TestPrimitiveYUV(BOOL use444) return FALSE; } - fprintf(stderr, "Running AVC%s on frame size %lux%lu\n", use444 ? "444" : "420", - (unsigned long) roi.width, (unsigned long) roi.height); + fprintf(stderr, "Running AVC%s on frame size %"PRIu32"x%"PRIu32"\n", use444 ? "444" : "420", + roi.width, roi.height); /* Test RGB to YUV444 conversion and vice versa */ if (!(rgb = set_padding(size * sizeof(UINT32), padding))) diff --git a/libfreerdp/utils/msusb.c b/libfreerdp/utils/msusb.c index c11ec5b50..4241ede84 100644 --- a/libfreerdp/utils/msusb.c +++ b/libfreerdp/utils/msusb.c @@ -317,8 +317,8 @@ MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, if (lenConfiguration != 0x9 || typeConfiguration != 0x2) { - DEBUG_MSUSB("%s: len and type must be 0x9 and 0x2 , but it is 0x%x and 0x%x", - lenConfiguration, typeConfiguration); + DEBUG_MSUSB("%s: len and type must be 0x9 and 0x2 , but it is 0x%"PRIx8" and 0x%"PRIx8"", + __FUNCTION__, lenConfiguration, typeConfiguration); } data_read_UINT16(data + offset + 2, MsConfig->wTotalLength); @@ -347,27 +347,27 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig) MSUSB_PIPE_DESCRIPTOR* MsPipe; int inum = 0, pnum = 0; WLog_INFO(TAG, "=================MsConfig:========================"); - WLog_INFO(TAG, "wTotalLength:%d", MsConfig->wTotalLength); - WLog_INFO(TAG, "bConfigurationValue:%d", MsConfig->bConfigurationValue); - WLog_INFO(TAG, "ConfigurationHandle:0x%x", MsConfig->ConfigurationHandle); + WLog_INFO(TAG, "wTotalLength:%"PRIu16"", MsConfig->wTotalLength); + WLog_INFO(TAG, "bConfigurationValue:%"PRIu8"", MsConfig->bConfigurationValue); + WLog_INFO(TAG, "ConfigurationHandle:0x%08"PRIx32"", MsConfig->ConfigurationHandle); WLog_INFO(TAG, "InitCompleted:%d", MsConfig->InitCompleted); WLog_INFO(TAG, "MsOutSize:%d", MsConfig->MsOutSize); - WLog_INFO(TAG, "NumInterfaces:%d", MsConfig->NumInterfaces); + WLog_INFO(TAG, "NumInterfaces:%"PRIu32"", MsConfig->NumInterfaces); MsInterfaces = MsConfig->MsInterfaces; for (inum = 0; inum < MsConfig->NumInterfaces; inum++) { MsInterface = MsInterfaces[inum]; - WLog_INFO(TAG, " Interfase: %d", MsInterface->InterfaceNumber); - WLog_INFO(TAG, " Length: %d", MsInterface->Length); - WLog_INFO(TAG, " NumberOfPipesExpected: %d", + WLog_INFO(TAG, " Interface: %"PRIu8"", MsInterface->InterfaceNumber); + WLog_INFO(TAG, " Length: %"PRIu16"", MsInterface->Length); + WLog_INFO(TAG, " NumberOfPipesExpected: %"PRIu16"", MsInterface->NumberOfPipesExpected); - WLog_INFO(TAG, " AlternateSetting: %d", MsInterface->AlternateSetting); - WLog_INFO(TAG, " NumberOfPipes: %d", MsInterface->NumberOfPipes); - WLog_INFO(TAG, " InterfaceHandle: 0x%x", MsInterface->InterfaceHandle); - WLog_INFO(TAG, " bInterfaceClass: 0x%x", MsInterface->bInterfaceClass); - WLog_INFO(TAG, " bInterfaceSubClass: 0x%x", MsInterface->bInterfaceSubClass); - WLog_INFO(TAG, " bInterfaceProtocol: 0x%x", MsInterface->bInterfaceProtocol); + WLog_INFO(TAG, " AlternateSetting: %"PRIu8"", MsInterface->AlternateSetting); + WLog_INFO(TAG, " NumberOfPipes: %"PRIu32"", MsInterface->NumberOfPipes); + WLog_INFO(TAG, " InterfaceHandle: 0x%08"PRIx32"", MsInterface->InterfaceHandle); + WLog_INFO(TAG, " bInterfaceClass: 0x%02"PRIx8"", MsInterface->bInterfaceClass); + WLog_INFO(TAG, " bInterfaceSubClass: 0x%02"PRIx8"", MsInterface->bInterfaceSubClass); + WLog_INFO(TAG, " bInterfaceProtocol: 0x%02"PRIx8"", MsInterface->bInterfaceProtocol); WLog_INFO(TAG, " InitCompleted: %d", MsInterface->InitCompleted); MsPipes = MsInterface->MsPipes; @@ -375,13 +375,13 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig) { MsPipe = MsPipes[pnum]; WLog_INFO(TAG, " Pipe: %d", pnum); - WLog_INFO(TAG, " MaximumPacketSize: 0x%x", MsPipe->MaximumPacketSize); - WLog_INFO(TAG, " MaximumTransferSize: 0x%x", MsPipe->MaximumTransferSize); - WLog_INFO(TAG, " PipeFlags: 0x%x", MsPipe->PipeFlags); - WLog_INFO(TAG, " PipeHandle: 0x%x", MsPipe->PipeHandle); - WLog_INFO(TAG, " bEndpointAddress: 0x%x", MsPipe->bEndpointAddress); - WLog_INFO(TAG, " bInterval: %d", MsPipe->bInterval); - WLog_INFO(TAG, " PipeType: 0x%x", MsPipe->PipeType); + WLog_INFO(TAG, " MaximumPacketSize: 0x%04"PRIx16"", MsPipe->MaximumPacketSize); + WLog_INFO(TAG, " MaximumTransferSize: 0x%08"PRIx32"", MsPipe->MaximumTransferSize); + WLog_INFO(TAG, " PipeFlags: 0x%08"PRIx32"", MsPipe->PipeFlags); + WLog_INFO(TAG, " PipeHandle: 0x%08"PRIx32"", MsPipe->PipeHandle); + WLog_INFO(TAG, " bEndpointAddress: 0x%02"PRIx8"", MsPipe->bEndpointAddress); + WLog_INFO(TAG, " bInterval: %"PRIu8"", MsPipe->bInterval); + WLog_INFO(TAG, " PipeType: 0x%02"PRIx8"", MsPipe->PipeType); WLog_INFO(TAG, " InitCompleted: %d", MsPipe->InitCompleted); } } diff --git a/libfreerdp/utils/ringbuffer.c b/libfreerdp/utils/ringbuffer.c index adec61df2..1acc2da1c 100644 --- a/libfreerdp/utils/ringbuffer.c +++ b/libfreerdp/utils/ringbuffer.c @@ -47,7 +47,7 @@ BOOL ringbuffer_init(RingBuffer* rb, size_t initialSize) rb->readPtr = rb->writePtr = 0; rb->initialSize = rb->size = rb->freeSize = initialSize; - DEBUG_RINGBUFFER("ringbuffer_init(%p)", rb); + DEBUG_RINGBUFFER("ringbuffer_init(%p)", (void*) rb); return TRUE; } @@ -63,7 +63,7 @@ size_t ringbuffer_capacity(const RingBuffer* rb) void ringbuffer_destroy(RingBuffer* rb) { - DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", rb); + DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", (void*) rb); free(rb->buffer); rb->buffer = NULL; } @@ -71,7 +71,7 @@ void ringbuffer_destroy(RingBuffer* rb) static BOOL ringbuffer_realloc(RingBuffer* rb, size_t targetSize) { BYTE* newData; - DEBUG_RINGBUFFER("ringbuffer_realloc(%p): targetSize: %d", rb, targetSize); + DEBUG_RINGBUFFER("ringbuffer_realloc(%p): targetSize: %"PRIdz"", (void*) rb, targetSize); if (rb->writePtr == rb->readPtr) { @@ -159,7 +159,7 @@ BOOL ringbuffer_write(RingBuffer* rb, const BYTE* ptr, size_t sz) { size_t toWrite; size_t remaining; - DEBUG_RINGBUFFER("ringbuffer_write(%p): sz: %d", rb, sz); + DEBUG_RINGBUFFER("ringbuffer_write(%p): sz: %"PRIdz"", (void*) rb, sz); if ((rb->freeSize <= sz) && !ringbuffer_realloc(rb, rb->size + sz)) return FALSE; @@ -193,7 +193,7 @@ BOOL ringbuffer_write(RingBuffer* rb, const BYTE* ptr, size_t sz) BYTE* ringbuffer_ensure_linear_write(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_ensure_linear_write(%p): sz: %d", rb, sz); + DEBUG_RINGBUFFER("ringbuffer_ensure_linear_write(%p): sz: %"PRIdz"", (void*) rb, sz); if (rb->freeSize < sz) { @@ -224,7 +224,7 @@ BYTE* ringbuffer_ensure_linear_write(RingBuffer* rb, size_t sz) BOOL ringbuffer_commit_written_bytes(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_commit_written_bytes(%p): sz: %d", rb, sz); + DEBUG_RINGBUFFER("ringbuffer_commit_written_bytes(%p): sz: %"PRIdz"", (void*) rb, sz); if (sz < 1) return TRUE; @@ -243,7 +243,7 @@ int ringbuffer_peek(const RingBuffer* rb, DataChunk chunks[2], size_t sz) size_t toRead; int chunkIndex = 0; int status = 0; - DEBUG_RINGBUFFER("ringbuffer_peek(%p): sz: %d", rb, sz); + DEBUG_RINGBUFFER("ringbuffer_peek(%p): sz: %"PRIdz"", (void*) rb, sz); if (sz < 1) return 0; @@ -277,7 +277,7 @@ int ringbuffer_peek(const RingBuffer* rb, DataChunk chunks[2], size_t sz) void ringbuffer_commit_read_bytes(RingBuffer* rb, size_t sz) { - DEBUG_RINGBUFFER("ringbuffer_commit_read_bytes(%p): sz: %d", rb, sz); + DEBUG_RINGBUFFER("ringbuffer_commit_read_bytes(%p): sz: %"PRIdz"", (void*) rb, sz); if (sz < 1) return; diff --git a/libfreerdp/utils/test/TestRingBuffer.c b/libfreerdp/utils/test/TestRingBuffer.c index dd128f44e..d7160e68d 100644 --- a/libfreerdp/utils/test/TestRingBuffer.c +++ b/libfreerdp/utils/test/TestRingBuffer.c @@ -111,7 +111,7 @@ int TestRingBuffer(int argc, char* argv[]) if (ringbuffer_used(&ringBuffer) != 15) { - fprintf(stderr, "invalid used size got %ld when i would expect 15\n", ringbuffer_used(&ringBuffer)); + fprintf(stderr, "invalid used size got %"PRIuz" when I would expect 15\n", ringbuffer_used(&ringBuffer)); return -1; } @@ -127,14 +127,14 @@ int TestRingBuffer(int argc, char* argv[]) { if (chunks[0].data[i] != i % 5) { - fprintf(stderr, "invalid byte at %d, got %d instead of %d\n", i, chunks[0].data[i], i % 5); + fprintf(stderr, "invalid byte at %d, got %"PRIu8" instead of %d\n", i, chunks[0].data[i], i % 5); return -1; } } if (ringbuffer_used(&ringBuffer) != 5) { - fprintf(stderr, "invalid used size after read got %ld when i would expect 5\n", ringbuffer_used(&ringBuffer)); + fprintf(stderr, "invalid used size after read got %"PRIuz" when I would expect 5\n", ringbuffer_used(&ringBuffer)); return -1; } @@ -189,7 +189,7 @@ int TestRingBuffer(int argc, char* argv[]) if (ringbuffer_capacity(&ringBuffer) != 10) { - fprintf(stderr, "not the expected capacity, have %ld and expects 10\n", ringbuffer_capacity(&ringBuffer)); + fprintf(stderr, "not the expected capacity, have %"PRIuz" and expects 10\n", ringbuffer_capacity(&ringBuffer)); return -1; } fprintf(stderr, "ok\n"); diff --git a/rdtk/librdtk/test/TestRdTkNinePatch.c b/rdtk/librdtk/test/TestRdTkNinePatch.c index 0550488fd..f34ac4eb7 100644 --- a/rdtk/librdtk/test/TestRdTkNinePatch.c +++ b/rdtk/librdtk/test/TestRdTkNinePatch.c @@ -13,7 +13,7 @@ int TestRdTkNinePatch(int argc, char* argv[]) if (!(engine = rdtk_engine_new())) { - printf("%s: error creating rdtk engine (%u)\n", __FUNCTION__, GetLastError()); + printf("%s: error creating rdtk engine (%"PRIu32")\n", __FUNCTION__, GetLastError()); goto out; } @@ -24,7 +24,7 @@ int TestRdTkNinePatch(int argc, char* argv[]) /* let rdtk allocate the surface buffer */ if (!(surface = rdtk_surface_new(engine, NULL, width, height, scanline))) { - printf("%s: error creating auto-allocated surface (%u)\n", __FUNCTION__, GetLastError()); + printf("%s: error creating auto-allocated surface (%"PRIu32")\n", __FUNCTION__, GetLastError()); goto out; } rdtk_surface_free(surface); @@ -34,13 +34,13 @@ int TestRdTkNinePatch(int argc, char* argv[]) /* test self-allocated buffer */ if (!(data = calloc(height, scanline))) { - printf("%s: error allocating surface buffer (%u)\n", __FUNCTION__, GetLastError()); + printf("%s: error allocating surface buffer (%"PRIu32")\n", __FUNCTION__, GetLastError()); goto out; } if (!(surface = rdtk_surface_new(engine, data, width, height, scanline))) { - printf("%s: error creating self-allocated surface (%u)\n", __FUNCTION__, GetLastError()); + printf("%s: error creating self-allocated surface (%"PRIu32")\n", __FUNCTION__, GetLastError()); goto out; } diff --git a/scripts/LECHash.c b/scripts/LECHash.c index 6a9942ae8..885de6c18 100644 --- a/scripts/LECHash.c +++ b/scripts/LECHash.c @@ -89,14 +89,14 @@ main() for (i = 0; i < 512; i++) { if (i == 511) - printf("0x%04x };\n", HashTable[i]); + printf("0x%04"PRIx16" };\n", HashTable[i]); else - printf("0x%04x, ", HashTable[i]); + printf("0x%04"PRIx16", ", HashTable[i]); } for (i = 0; i < 293; i++) if (i != getvalue(HuffCodeLEC[i])) - printf("Fail :( at %d : 0x%04x\n", i, HuffCodeLEC[i]); + printf("Fail :( at %d : 0x%04"PRIx16"\n", i, HuffCodeLEC[i]); return 0; } diff --git a/scripts/LOMHash.c b/scripts/LOMHash.c index cbcaa51db..9a7bf8ecb 100644 --- a/scripts/LOMHash.c +++ b/scripts/LOMHash.c @@ -44,7 +44,7 @@ void buildhashtable(void) HashTable[h] ^= 0xfe0; } - printf("at %d %d=0x%hhx\n", i, h, HashTable[h]); + printf("at %d %"PRIu16"=0x%"PRIx16"\n", i, h, HashTable[h]); } } @@ -69,14 +69,14 @@ main() for (i = 0; i < 32; i++) { if (i == 31) - printf("0x%hx };\n", HashTable[i]); + printf("0x%"PRIx16" };\n", HashTable[i]); else - printf("0x%hx, ", HashTable[i]); + printf("0x%"PRIx16", ", HashTable[i]); } for (i = 0; i < 32; i++) if (i != getvalue(HuffCodeLOM[i])) - printf("Fail :( at %d : 0x%04x got %d\n", i, HuffCodeLOM[i], + printf("Fail :( at %d : 0x%04"PRIx16" got %"PRIu8"\n", i, HuffCodeLOM[i], getvalue(HuffCodeLOM[i])); return 0; diff --git a/server/Mac/mf_rdpsnd.c b/server/Mac/mf_rdpsnd.c index b8c18a476..6ae987ac1 100644 --- a/server/Mac/mf_rdpsnd.c +++ b/server/Mac/mf_rdpsnd.c @@ -115,7 +115,7 @@ static void mf_peer_rdpsnd_activated(RdpsndServerContext* context) if (status != noErr) { - WLog_DBG(TAG, "Failed to create a new Audio Queue. Status code: %d", status); + WLog_DBG(TAG, "Failed to create a new Audio Queue. Status code: %"PRId32"", status); } UInt32 dataFormatSize = sizeof (recorderState.dataFormat); @@ -212,7 +212,7 @@ void mf_peer_rdpsnd_input_callback (void *inUserD if (status != noErr) { - WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %d", status); + WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %"PRId32"", status); } } diff --git a/server/Sample/sf_audin.c b/server/Sample/sf_audin.c index cfc2ea170..67dc92351 100644 --- a/server/Sample/sf_audin.c +++ b/server/Sample/sf_audin.c @@ -58,7 +58,7 @@ static UINT sf_peer_audin_opening(audin_server_context* context) */ static UINT sf_peer_audin_open_result(audin_server_context* context, UINT32 result) { - WLog_DBG(TAG, "AUDIN open result %d.", result); + WLog_DBG(TAG, "AUDIN open result %"PRIu32".", result); return CHANNEL_RC_OK; } diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 0ddd666a2..2753f6c4b 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -510,7 +510,7 @@ static void* tf_debug_channel_thread_func(void* arg) } Stream_SetPosition(s, BytesReturned); - WLog_DBG(TAG, "got %lu bytes", (unsigned long) BytesReturned); + WLog_DBG(TAG, "got %"PRIu32" bytes", BytesReturned); } Stream_Free(s, TRUE); @@ -526,7 +526,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client) * The server may start sending graphics output and receiving keyboard/mouse input after this * callback returns. */ - WLog_DBG(TAG, "Client %s is activated (osMajorType %d osMinorType %d)", + WLog_DBG(TAG, "Client %s is activated (osMajorType %"PRIu32" osMinorType %"PRIu32")", client->local ? "(local)" : client->hostname, client->settings->OsMajorType, client->settings->OsMinorType); @@ -539,7 +539,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client) } WLog_DBG(TAG, ""); - WLog_DBG(TAG, "Client requested desktop: %dx%dx%d", + WLog_DBG(TAG, "Client requested desktop: %"PRIu32"x%"PRIu32"x%"PRIu32"", client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth); #if (SAMPLE_SERVER_USE_CLIENT_RESOLUTION == 1) @@ -552,7 +552,7 @@ BOOL tf_peer_post_connect(freerdp_peer* client) #else client->settings->DesktopWidth = context->rfx_context->width; client->settings->DesktopHeight = context->rfx_context->height; - WLog_DBG(TAG, "Resizing client to %dx%d", client->settings->DesktopWidth, + WLog_DBG(TAG, "Resizing client to %"PRIu32"x%"PRIu32"", client->settings->DesktopWidth, client->settings->DesktopHeight); client->update->DesktopResize(client->update->context); #endif @@ -631,7 +631,7 @@ BOOL tf_peer_activate(freerdp_peer* client) BOOL tf_peer_synchronize_event(rdpInput* input, UINT32 flags) { - WLog_DBG(TAG, "Client sent a synchronize event (flags:0x%X)", flags); + WLog_DBG(TAG, "Client sent a synchronize event (flags:0x%"PRIX32")", flags); return TRUE; } @@ -640,7 +640,7 @@ BOOL tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) freerdp_peer* client = input->context->peer; rdpUpdate* update = client->update; testPeerContext* context = (testPeerContext*) input->context; - WLog_DBG(TAG, "Client sent a keyboard event (flags:0x%X code:0x%X)", flags, + WLog_DBG(TAG, "Client sent a keyboard event (flags:0x%04"PRIX16" code:0x%04"PRIX16")", flags, code); if ((flags & 0x4000) && code == 0x22) /* 'g' key */ @@ -697,14 +697,14 @@ BOOL tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) BOOL tf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { - WLog_DBG(TAG, "Client sent a unicode keyboard event (flags:0x%X code:0x%X)", + WLog_DBG(TAG, "Client sent a unicode keyboard event (flags:0x%04"PRIX16" code:0x%04"PRIX16")", flags, code); return TRUE; } BOOL tf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { - //WLog_DBG(TAG, "Client sent a mouse event (flags:0x%X pos:%d,%d)", flags, x, y); + //WLog_DBG(TAG, "Client sent a mouse event (flags:0x%04"PRIX16" pos:%"PRIu16",%"PRIu16")", flags, x, y); test_peer_draw_icon(input->context->peer, x + 10, y); return TRUE; } @@ -712,7 +712,7 @@ BOOL tf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) BOOL tf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { - //WLog_DBG(TAG, "Client sent an extended mouse event (flags:0x%X pos:%d,%d)", flags, x, y); + //WLog_DBG(TAG, "Client sent an extended mouse event (flags:0x%04"PRIX16" pos:%"PRIu16",%"PRIu16")", flags, x, y); return TRUE; } @@ -724,7 +724,7 @@ static BOOL tf_peer_refresh_rect(rdpContext* context, BYTE count, for (i = 0; i < count; i++) { - WLog_DBG(TAG, " (%d, %d) (%d, %d)", areas[i].left, areas[i].top, + WLog_DBG(TAG, " (%"PRIu16", %"PRIu16") (%"PRIu16", %"PRIu16")", areas[i].left, areas[i].top, areas[i].right, areas[i].bottom); } @@ -736,7 +736,7 @@ static BOOL tf_peer_suppress_output(rdpContext* context, BYTE allow, { if (allow > 0) { - WLog_DBG(TAG, "Client restore output (%d, %d) (%d, %d).", area->left, area->top, + WLog_DBG(TAG, "Client restore output (%"PRIu16", %"PRIu16") (%"PRIu16", %"PRIu16").", area->left, area->top, area->right, area->bottom); } else diff --git a/server/Windows/cli/wfreerdp.c b/server/Windows/cli/wfreerdp.c index 5599d13b1..0b7c2f753 100644 --- a/server/Windows/cli/wfreerdp.c +++ b/server/Windows/cli/wfreerdp.c @@ -39,7 +39,7 @@ int IDcount = 0; BOOL CALLBACK moncb(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { - WLog_DBG(TAG, "%d\t(%d, %d), (%d, %d)", + WLog_DBG(TAG, "%d\t(%ld, %ld), (%ld, %ld)", IDcount, lprcMonitor->left, lprcMonitor->top, lprcMonitor->right, lprcMonitor->bottom); IDcount++; diff --git a/server/Windows/wf_directsound.c b/server/Windows/wf_directsound.c index 14248393c..1ba1e2342 100644 --- a/server/Windows/wf_directsound.c +++ b/server/Windows/wf_directsound.c @@ -155,7 +155,7 @@ DWORD WINAPI wf_rdpsnd_directsound_thread(LPVOID lpParam) lLockSize = dwReadPos - lastPos;//dscbd.dwBufferBytes; if (lLockSize < 0) lLockSize += dscbd.dwBufferBytes; - //WLog_DBG(TAG, "Last, read, lock = [%d, %d, %d]\n", lastPos, dwReadPos, lLockSize); + //WLog_DBG(TAG, "Last, read, lock = [%"PRIu32", %"PRIu32", %"PRId32"]\n", lastPos, dwReadPos, lLockSize); if (lLockSize == 0) { diff --git a/server/Windows/wf_dxgi.c b/server/Windows/wf_dxgi.c index a2801f665..61dd96322 100644 --- a/server/Windows/wf_dxgi.c +++ b/server/Windows/wf_dxgi.c @@ -97,7 +97,7 @@ int wf_dxgi_createDevice(wfInfo* wfi) if (SUCCEEDED(status)) break; - WLog_INFO(TAG, "D3D11CreateDevice returned [%d] for Driver Type %d", status, DriverTypes[DriverTypeIndex]); + WLog_INFO(TAG, "D3D11CreateDevice returned [%ld] for Driver Type %d", status, DriverTypes[DriverTypeIndex]); } if (FAILED(status)) @@ -153,7 +153,7 @@ int wf_dxgi_getDuplication(wfInfo* wfi) return 1; } - WLog_INFO(TAG, "Output %d: [%s] [%d]", i, pDesc->DeviceName, pDesc->AttachedToDesktop); + WLog_INFO(TAG, "Output %u: [%s] [%d]", i, pDesc->DeviceName, pDesc->AttachedToDesktop); if (pDesc->AttachedToDesktop) dTop = i; @@ -196,7 +196,7 @@ int wf_dxgi_getDuplication(wfInfo* wfi) return 1; } - WLog_ERR(TAG, "Failed to get duplicate output. Status = %#X", status); + WLog_ERR(TAG, "Failed to get duplicate output. Status = %ld", status); return 1; } @@ -268,7 +268,7 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) { if (status == DXGI_ERROR_ACCESS_LOST) { - WLog_ERR(TAG, "Failed to acquire next frame with status=%#X", status); + WLog_ERR(TAG, "Failed to acquire next frame with status=%ld", status); WLog_ERR(TAG, "Trying to reinitialize due to ACCESS LOST..."); if (gAcquiredDesktopImage) @@ -289,12 +289,12 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) } else { - WLog_ERR(TAG, "Failed to acquire next frame with status=%#X", status); + WLog_ERR(TAG, "Failed to acquire next frame with status=%ld", status); status = gOutputDuplication->lpVtbl->ReleaseFrame(gOutputDuplication); if (FAILED(status)) { - WLog_ERR(TAG, "Failed to release frame with status=%d", status); + WLog_ERR(TAG, "Failed to release frame with status=%ld", status); } return 1; @@ -318,7 +318,7 @@ int wf_dxgi_nextFrame(wfInfo* wfi, UINT timeout) if (FAILED(status)) { - WLog_ERR(TAG, "Failed to release frame with status=%d", status); + WLog_ERR(TAG, "Failed to release frame with status=%ld", status); } } diff --git a/server/Windows/wf_info.c b/server/Windows/wf_info.c index a582bc835..f8f8c3ea4 100644 --- a/server/Windows/wf_info.c +++ b/server/Windows/wf_info.c @@ -58,7 +58,7 @@ BOOL wf_info_lock(wfInfo* wfi) return FALSE; case WAIT_FAILED: - WLog_ERR(TAG, "wf_info_lock failed with 0x%08X", GetLastError()); + WLog_ERR(TAG, "wf_info_lock failed with 0x%08lX", GetLastError()); return FALSE; } @@ -81,7 +81,7 @@ BOOL wf_info_try_lock(wfInfo* wfi, DWORD dwMilliseconds) return FALSE; case WAIT_FAILED: - WLog_ERR(TAG, "wf_info_try_lock failed with 0x%08X", GetLastError()); + WLog_ERR(TAG, "wf_info_try_lock failed with 0x%08lX", GetLastError()); return FALSE; } @@ -92,7 +92,7 @@ BOOL wf_info_unlock(wfInfo* wfi) { if (!ReleaseMutex(wfi->mutex)) { - WLog_ERR(TAG, "wf_info_unlock failed with 0x%08X", GetLastError()); + WLog_ERR(TAG, "wf_info_unlock failed with 0x%08lX", GetLastError()); return FALSE; } @@ -117,7 +117,7 @@ wfInfo* wf_info_init() if (wfi->mutex == NULL) { - WLog_ERR(TAG, "CreateMutex error: %d", GetLastError()); + WLog_ERR(TAG, "CreateMutex error: %lu", GetLastError()); free(wfi); return NULL; } @@ -125,7 +125,7 @@ wfInfo* wf_info_init() wfi->updateSemaphore = CreateSemaphore(NULL, 0, 32, NULL); if (!wfi->updateSemaphore) { - WLog_ERR(TAG, "CreateSemaphore error: %d", GetLastError()); + WLog_ERR(TAG, "CreateSemaphore error: %lu", GetLastError()); CloseHandle(wfi->mutex); free(wfi); return NULL; @@ -341,7 +341,7 @@ void wf_info_find_invalid_region(wfInfo* wfi) if (wfi->invalid.bottom >= wfi->servscreen_height) wfi->invalid.bottom = wfi->servscreen_height - 1; - //WLog_DBG(TAG, "invalid region: (%d, %d), (%d, %d)", wfi->invalid.left, wfi->invalid.top, wfi->invalid.right, wfi->invalid.bottom); + //WLog_DBG(TAG, "invalid region: (%"PRId32", %"PRId32"), (%"PRId32", %"PRId32")", wfi->invalid.left, wfi->invalid.top, wfi->invalid.right, wfi->invalid.bottom); } void wf_info_clear_invalid_region(wfInfo* wfi) diff --git a/server/Windows/wf_mirage.c b/server/Windows/wf_mirage.c index cd048e398..5e1613451 100644 --- a/server/Windows/wf_mirage.c +++ b/server/Windows/wf_mirage.c @@ -94,7 +94,7 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) if (status != ERROR_SUCCESS) { - WLog_DBG(TAG, "Error opening RegKey: status=%0X", status); + WLog_DBG(TAG, "Error opening RegKey: status=0x%08lX", status); if (status == ERROR_ACCESS_DENIED) WLog_DBG(TAG, "access denied. Do you have admin privleges?"); @@ -108,7 +108,7 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) if (status != ERROR_SUCCESS) { - WLog_DBG(TAG, "Error querying RegKey: status=%0X", status); + WLog_DBG(TAG, "Error querying RegKey: status=0x%08lX", status); if (status == ERROR_ACCESS_DENIED) WLog_DBG(TAG, "access denied. Do you have admin privleges?"); @@ -126,7 +126,7 @@ BOOL wf_mirror_driver_display_device_attach(wfInfo* wfi, DWORD mode) if (status != ERROR_SUCCESS) { - WLog_DBG(TAG, "Error writing registry key: %d ", status); + WLog_DBG(TAG, "Error writing registry key: %ld", status); if (status == ERROR_ACCESS_DENIED) WLog_DBG(TAG, "access denied. Do you have admin privleges?"); @@ -183,9 +183,9 @@ void wf_mirror_driver_print_display_change_status(LONG status) } if (status != DISP_CHANGE_SUCCESSFUL) - WLog_ERR(TAG, "ChangeDisplaySettingsEx() failed with %s (%d)", disp_change, status); + WLog_ERR(TAG, "ChangeDisplaySettingsEx() failed with %s (%ld)", disp_change, status); else - WLog_INFO(TAG, "ChangeDisplaySettingsEx() succeeded with %s (%d)", disp_change, status); + WLog_INFO(TAG, "ChangeDisplaySettingsEx() succeeded with %s (%ld)", disp_change, status); } /** @@ -275,7 +275,7 @@ BOOL wf_mirror_driver_map_memory(wfInfo* wfi) 0, NULL ); // Display the error message and exit the process - WLog_ERR(TAG, "CreateDC failed on device [%s] with error %d: %s", wfi->deviceName, dw, lpMsgBuf); + WLog_ERR(TAG, "CreateDC failed on device [%s] with error %lu: %s", wfi->deviceName, dw, lpMsgBuf); LocalFree(lpMsgBuf); } diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index ecb3a21bf..a23604cdb 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -110,7 +110,7 @@ BOOL wf_peer_post_connect(freerdp_peer* client) if ((settings->DesktopWidth != wfi->servscreen_width) || (settings->DesktopHeight != wfi->servscreen_height)) { /* - WLog_DBG(TAG, "Client requested resolution %dx%d, but will resize to %dx%d", + WLog_DBG(TAG, "Client requested resolution %"PRIu32"x%"PRIu32", but will resize to %dx%d", settings->DesktopWidth, settings->DesktopHeight, wfi->servscreen_width, wfi->servscreen_height); */ diff --git a/server/Windows/wf_rdpsnd.c b/server/Windows/wf_rdpsnd.c index 346557155..56b682440 100644 --- a/server/Windows/wf_rdpsnd.c +++ b/server/Windows/wf_rdpsnd.c @@ -117,7 +117,7 @@ int wf_rdpsnd_lock() break; case WAIT_FAILED: - WLog_ERR(TAG, "wf_rdpsnd_lock failed with 0x%08X", GetLastError()); + WLog_ERR(TAG, "wf_rdpsnd_lock failed with 0x%08lX", GetLastError()); return -1; break; } @@ -133,7 +133,7 @@ int wf_rdpsnd_unlock() if (ReleaseMutex(wfi->snd_mutex) == 0) { - WLog_DBG(TAG, "wf_rdpsnd_unlock failed with 0x%08X", GetLastError()); + WLog_DBG(TAG, "wf_rdpsnd_unlock failed with 0x%08lX", GetLastError()); return -1; } diff --git a/server/Windows/wf_update.c b/server/Windows/wf_update.c index 7c125f734..05c0edb10 100644 --- a/server/Windows/wf_update.c +++ b/server/Windows/wf_update.c @@ -118,7 +118,7 @@ void wf_update_encode(wfInfo* wfi) rect.y = 0; rect.width = (UINT16) width; rect.height = (UINT16) height; - //WLog_DBG(TAG, "x:%d y:%d w:%d h:%d", wfi->invalid.left, wfi->invalid.top, width, height); + //WLog_DBG(TAG, "x:%"PRId32" y:%"PRId32" w:%ld h:%ld", wfi->invalid.left, wfi->invalid.top, width, height); Stream_Clear(wfi->s); if (!(rfx_compose_message(wfi->rfx_context, wfi->s, &rect, 1, diff --git a/server/Windows/wf_wasapi.c b/server/Windows/wf_wasapi.c index 99ea764be..93c0b725d 100644 --- a/server/Windows/wf_wasapi.c +++ b/server/Windows/wf_wasapi.c @@ -83,7 +83,7 @@ int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) } pCollection->lpVtbl->GetCount(pCollection, &count); - WLog_INFO(TAG, "Num endpoints: %d", count); + WLog_INFO(TAG, "Num endpoints: %u", count); if (count == 0) { @@ -99,7 +99,7 @@ int wf_wasapi_get_device_string(LPWSTR pattern, LPWSTR * deviceStr) hr = pCollection->lpVtbl->Item(pCollection, i, &pEndpoint); if ( FAILED(hr) ) { - WLog_ERR(TAG, "Failed to get endpoint %d", i); + WLog_ERR(TAG, "Failed to get endpoint %u", i); exit(1); } diff --git a/server/shadow/Mac/mac_shadow.c b/server/shadow/Mac/mac_shadow.c index 9f79c7c60..56902ee4c 100644 --- a/server/shadow/Mac/mac_shadow.c +++ b/server/shadow/Mac/mac_shadow.c @@ -495,7 +495,7 @@ static int mac_shadow_subsystem_process_message(macShadowSubsystem* subsystem, break; default: - WLog_ERR(TAG, "Unknown message id: %u", message->id); + WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); break; } diff --git a/server/shadow/Win/win_dxgi.c b/server/shadow/Win/win_dxgi.c index 50a1881d9..ce5ef9752 100644 --- a/server/shadow/Win/win_dxgi.c +++ b/server/shadow/Win/win_dxgi.c @@ -250,7 +250,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "ID3D11Device::QueryInterface(IDXGIDevice) failure: %s (0x%04X)", + WLog_ERR(TAG, "ID3D11Device::QueryInterface(IDXGIDevice) failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -265,7 +265,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIDevice::GetParent(IDXGIAdapter) failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIDevice::GetParent(IDXGIAdapter) failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -281,7 +281,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutput::GetDesc failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIOutput::GetDesc failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -305,7 +305,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIAdapter::EnumOutputs failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIAdapter::EnumOutputs failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -320,7 +320,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutput::QueryInterface(IDXGIOutput1) failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIOutput::QueryInterface(IDXGIOutput1) failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -336,7 +336,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutput1::DuplicateOutput failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIOutput1::DuplicateOutput failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -358,7 +358,7 @@ int win_shadow_dxgi_init_duplication(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "ID3D11Device::CreateTexture2D failure: %s (0x%04X)", + WLog_ERR(TAG, "ID3D11Device::CreateTexture2D failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -394,7 +394,7 @@ int win_shadow_dxgi_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "D3D11CreateDevice failure: 0x%04X", hr); + WLog_ERR(TAG, "D3D11CreateDevice failure: 0x%08lX", hr); return -1; } @@ -464,7 +464,7 @@ int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, if (FAILED(hr)) { - WLog_ERR(TAG, "ID3D11Texture2D::QueryInterface(IDXGISurface) failure: %s 0x%04X", + WLog_ERR(TAG, "ID3D11Texture2D::QueryInterface(IDXGISurface) failure: %s 0x%08lX", GetDxgiErrorString(hr), hr); return -1; } @@ -473,7 +473,7 @@ int win_shadow_dxgi_fetch_frame_data(winShadowSubsystem* subsystem, if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGISurface::Map failure: %s 0x%04X", + WLog_ERR(TAG, "IDXGISurface::Map failure: %s 0x%08lX", GetDxgiErrorString(hr), hr); if (hr == DXGI_ERROR_DEVICE_REMOVED) @@ -561,7 +561,7 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutputDuplication::AcquireNextFrame failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIOutputDuplication::AcquireNextFrame failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); if (hr == DXGI_ERROR_ACCESS_LOST) @@ -613,7 +613,7 @@ int win_shadow_dxgi_get_next_frame(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIResource::QueryInterface(ID3D11Texture2D) failure: %s (0x%04X)", + WLog_ERR(TAG, "IDXGIResource::QueryInterface(ID3D11Texture2D) failure: %s (0x%08lX)", GetDxgiErrorString(hr), hr); return -1; } @@ -670,7 +670,7 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameMoveRects failure: %s (0x%04X) Size: %d Total %d Used: %d", + WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameMoveRects failure: %s (0x%08lX) Size: %u Total %u Used: %u", GetDxgiErrorString(hr), hr, MoveRectsBufferSize, MetadataBufferSize, UsedBufferSize); return -1; } @@ -687,7 +687,7 @@ int win_shadow_dxgi_get_invalid_region(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameDirtyRects failure: %s (0x%04X) Size: %d Total %d Used: %d", + WLog_ERR(TAG, "IDXGIOutputDuplication::GetFrameDirtyRects failure: %s (0x%08lX) Size: %u Total %u Used: %u", GetDxgiErrorString(hr), hr, DirtyRectsBufferSize, MetadataBufferSize, UsedBufferSize); return -1; } diff --git a/server/shadow/Win/win_rdp.c b/server/shadow/Win/win_rdp.c index a1a968a5c..fbcd3c2ce 100644 --- a/server/shadow/Win/win_rdp.c +++ b/server/shadow/Win/win_rdp.c @@ -213,7 +213,7 @@ void* shw_client_thread(void* arg) if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1000, QS_ALLINPUT) == WAIT_FAILED) { - WLog_ERR(TAG, "MsgWaitForMultipleObjects failure: 0x%08X", GetLastError()); + WLog_ERR(TAG, "MsgWaitForMultipleObjects failure: 0x%08lX", GetLastError()); break; } diff --git a/server/shadow/Win/win_wds.c b/server/shadow/Win/win_wds.c index 2bfc4231a..9270a753b 100644 --- a/server/shadow/Win/win_wds.c +++ b/server/shadow/Win/win_wds.c @@ -266,7 +266,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( VARIANT vr; UINT uArgErr; - WLog_INFO(TAG, "%s (%d)", GetRDPSessionEventString(dispIdMember), dispIdMember); + WLog_INFO(TAG, "%s (%ld)", GetRDPSessionEventString(dispIdMember), dispIdMember); switch (dispIdMember) { @@ -283,7 +283,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08X", + WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -294,7 +294,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08X", + WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -306,7 +306,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08X", + WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -349,7 +349,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_INFO(TAG, "%s DispGetParam(1, VT_INT) failure: 0x%08X", + WLog_INFO(TAG, "%s DispGetParam(1, VT_INT) failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -363,7 +363,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08X", + WLog_ERR(TAG, "%s DispGetParam(0, VT_DISPATCH) failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -374,7 +374,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08X", + WLog_INFO(TAG, "%s IDispatch::QueryInterface(IRDPSRAPIAttendee) failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -383,7 +383,7 @@ static HRESULT STDMETHODCALLTYPE Shadow_IRDPSessionEvents_Invoke( if (FAILED(hr)) { - WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08X", + WLog_INFO(TAG, "%s IRDPSRAPIAttendee::put_ControlLevel() failure: 0x%08lX", GetRDPSessionEventString(dispIdMember), hr); return hr; } @@ -571,7 +571,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "CoCreateInstance(IRDPSRAPISharingSession) failure: 0x%08X", hr); + WLog_ERR(TAG, "CoCreateInstance(IRDPSRAPISharingSession) failure: 0x%08lX", hr); return -1; } @@ -580,7 +580,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "QueryInterface(IID_IConnectionPointContainer) failure: 0x%08X", hr); + WLog_ERR(TAG, "QueryInterface(IID_IConnectionPointContainer) failure: 0x%08lX", hr); return -1; } @@ -588,7 +588,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IConnectionPointContainer::FindConnectionPoint(_IRDPSessionEvents) failure: 0x%08X", hr); + WLog_ERR(TAG, "IConnectionPointContainer::FindConnectionPoint(_IRDPSessionEvents) failure: 0x%08lX", hr); return -1; } @@ -600,7 +600,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IConnectionPoint::Advise(Shadow_IRDPSessionEvents) failure: 0x%08X", hr); + WLog_ERR(TAG, "IConnectionPoint::Advise(Shadow_IRDPSessionEvents) failure: 0x%08lX", hr); return -1; } @@ -608,7 +608,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::put_ColorDepth() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::put_ColorDepth() failure: 0x%08lX", hr); return -1; } @@ -617,14 +617,14 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::GetDesktopSharedRect() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::GetDesktopSharedRect() failure: 0x%08lX", hr); return -1; } width = right - left; height = bottom - top; - WLog_INFO(TAG, "GetDesktopSharedRect(): left: %d top: %d right: %d bottom: %d width: %d height: %d", + WLog_INFO(TAG, "GetDesktopSharedRect(): left: %ld top: %ld right: %ld bottom: %ld width: %ld height: %ld", left, top, right, bottom, width, height); hr = subsystem->pSharingSession->lpVtbl->get_VirtualChannelManager(subsystem->pSharingSession, @@ -632,7 +632,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::get_VirtualChannelManager() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::get_VirtualChannelManager() failure: 0x%08lX", hr); return -1; } @@ -641,7 +641,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::get_ApplicationFilter() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::get_ApplicationFilter() failure: 0x%08lX", hr); return -1; } @@ -650,7 +650,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::get_Attendees() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::get_Attendees() failure: 0x%08lX", hr); return -1; } @@ -658,7 +658,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::get_Properties() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::get_Properties() failure: 0x%08lX", hr); return -1; } @@ -673,7 +673,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortId) failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortId) failure: 0x%08lX", hr); return -1; } @@ -688,7 +688,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(DrvConAttach) failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(DrvConAttach) failure: 0x%08lX", hr); return -1; } @@ -706,7 +706,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortProtocol) failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISessionProperties::put_Property(PortProtocol) failure: 0x%08lX", hr); return -1; } @@ -714,7 +714,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPISharingSession::Open() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPISharingSession::Open() failure: 0x%08lX", hr); return -1; } @@ -740,7 +740,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPIInvitationManager::CreateInvitation() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPIInvitationManager::CreateInvitation() failure: 0x%08lX", hr); return -1; } @@ -748,7 +748,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem) if (FAILED(hr)) { - WLog_ERR(TAG, "IRDPSRAPIInvitation::get_ConnectionString() failure: 0x%08X", hr); + WLog_ERR(TAG, "IRDPSRAPIInvitation::get_ConnectionString() failure: 0x%08lX", hr); return -1; } diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c index 9e987f96e..f566260bd 100644 --- a/server/shadow/X11/x11_shadow.c +++ b/server/shadow/X11/x11_shadow.c @@ -368,7 +368,7 @@ static void x11_shadow_message_free(UINT32 id, SHADOW_MSG_OUT* msg) break; default: - WLog_ERR(TAG, "Unknown message id: %u", id); + WLog_ERR(TAG, "Unknown message id: %"PRIu32"", id); free(msg); break; } @@ -837,7 +837,7 @@ static int x11_shadow_subsystem_process_message(x11ShadowSubsystem* subsystem, break; default: - WLog_ERR(TAG, "Unknown message id: %u", message->id); + WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); break; } @@ -1297,7 +1297,7 @@ static int x11_shadow_subsystem_init(x11ShadowSubsystem* subsystem) virtualScreen->right = subsystem->width; virtualScreen->bottom = subsystem->height; virtualScreen->flags = 1; - WLog_INFO(TAG, "X11 Extensions: XFixes: %d Xinerama: %d XDamage: %d XShm: %d", + WLog_INFO(TAG, "X11 Extensions: XFixes: %"PRId32" Xinerama: %"PRId32" XDamage: %"PRId32" XShm: %"PRId32"", subsystem->use_xfixes, subsystem->use_xinerama, subsystem->use_xdamage, subsystem->use_xshm); return 1; diff --git a/server/shadow/shadow_audin.c b/server/shadow/shadow_audin.c index c655c82a0..fa04d4f51 100644 --- a/server/shadow/shadow_audin.c +++ b/server/shadow/shadow_audin.c @@ -76,7 +76,7 @@ static UINT AudinServerOpening(audin_server_context* context) */ static UINT AudinServerOpenResult(audin_server_context* context, UINT32 result) { - WLog_INFO(TAG, "AUDIN open result %u.\n", result); + WLog_INFO(TAG, "AUDIN open result %"PRIu32".\n", result); return CHANNEL_RC_OK; } /** diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 0133f2177..34ff24535 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -60,7 +60,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "CreateSurface failed with error %u", error); + WLog_ERR(TAG, "CreateSurface failed with error %"PRIu32"", error); return FALSE; } @@ -68,7 +68,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "MapSurfaceToOutput failed with error %u", error); + WLog_ERR(TAG, "MapSurfaceToOutput failed with error %"PRIu32"", error); return FALSE; } @@ -85,7 +85,7 @@ static INLINE BOOL shadow_client_rdpgfx_release_surface(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "DeleteSurface failed with error %u", error); + WLog_ERR(TAG, "DeleteSurface failed with error %"PRIu32"", error); return FALSE; } @@ -106,7 +106,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) if (error) { - WLog_ERR(TAG, "ResetGraphics failed with error %u", error); + WLog_ERR(TAG, "ResetGraphics failed with error %"PRIu32"", error); return FALSE; } @@ -237,7 +237,7 @@ static void shadow_client_message_free(wMessage* message) break; default: - WLog_ERR(TAG, "Unknown message id: %u", message->id); + WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); free(message->wParam); break; } @@ -342,7 +342,7 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) settings->NSCodec = FALSE; /* NSCodec compressor does not support fragmentation yet */ - WLog_INFO(TAG, "Client from %s is activated (%dx%d@%d)", + WLog_INFO(TAG, "Client from %s is activated (%"PRIu32"x%"PRIu32"@%"PRIu32")", peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth); @@ -350,7 +350,7 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) if (shadow_client_recalc_desktop_size(client)) { peer->update->DesktopResize(peer->update->context); - WLog_INFO(TAG, "Client from %s is resized (%dx%d@%d)", + WLog_INFO(TAG, "Client from %s is resized (%"PRIu32"x%"PRIu32"@%"PRIu32")", peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth); } @@ -714,17 +714,22 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, RDPGFX_START_FRAME_PDU cmdstart; RDPGFX_END_FRAME_PDU cmdend; SYSTEMTIME sTime; + context = (rdpContext*) client; update = context->update; settings = context->settings; server = client->server; encoder = client->encoder; + cmdstart.frameId = shadow_encoder_create_frame_id(encoder); GetSystemTime(&sTime); cmdstart.timestamp = sTime.wHour << 22 | sTime.wMinute << 16 | sTime.wSecond << 10 | sTime.wMilliseconds; + cmdend.frameId = cmdstart.frameId; + cmd.surfaceId = 0; + cmd.codecId = 0; cmd.contextId = 0; cmd.format = PIXEL_FORMAT_BGRX32; cmd.left = nXSrc; @@ -733,6 +738,9 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, cmd.bottom = cmd.top + nHeight; cmd.width = nWidth; cmd.height = nHeight; + cmd.length = 0; + cmd.data = NULL; + cmd.extra = NULL; if (settings->GfxH264) { @@ -766,7 +774,7 @@ static BOOL shadow_client_send_surface_gfx(rdpShadowClient* client, if (error) { - WLog_ERR(TAG, "SurfaceFrameCommand failed with error %u", error); + WLog_ERR(TAG, "SurfaceFrameCommand failed with error %"PRIu32"", error); return FALSE; } } @@ -1304,7 +1312,7 @@ static BOOL shadow_client_send_resize(rdpShadowClient* client, EnterCriticalSection(&(client->lock)); region16_clear(&(client->invalidRegion)); LeaveCriticalSection(&(client->lock)); - WLog_INFO(TAG, "Client from %s is resized (%dx%d@%d)", + WLog_INFO(TAG, "Client from %s is resized (%"PRIu32"x%"PRIu32"@%"PRIu32")", peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth); return TRUE; @@ -1437,7 +1445,7 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, } default: - WLog_ERR(TAG, "Unknown message id: %u", message->id); + WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id); break; } diff --git a/server/shadow/shadow_encomsp.c b/server/shadow/shadow_encomsp.c index e74bea61b..cb89f10f5 100644 --- a/server/shadow/shadow_encomsp.c +++ b/server/shadow/shadow_encomsp.c @@ -42,7 +42,7 @@ static UINT encomsp_change_participant_control_level(EncomspServerContext* conte BOOL mayInteract; rdpShadowClient* client = (rdpShadowClient*) context->custom; - WLog_INFO(TAG, "ChangeParticipantControlLevel: ParticipantId: %d Flags: 0x%04X", + WLog_INFO(TAG, "ChangeParticipantControlLevel: ParticipantId: %"PRIu32" Flags: 0x%04"PRIX16"", pdu->ParticipantId, pdu->Flags); mayView = (pdu->Flags & ENCOMSP_MAY_VIEW) ? TRUE : FALSE; diff --git a/server/shadow/shadow_mcevent.c b/server/shadow/shadow_mcevent.c index 5ad17bffb..b31911c25 100644 --- a/server/shadow/shadow_mcevent.c +++ b/server/shadow/shadow_mcevent.c @@ -258,9 +258,9 @@ void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event) if (ArrayList_Add(event->subscribers, subscriber) < 0) goto out_free; - WLog_VRB(TAG, "Get subscriber %p. Wait event %d. %d clients.\n", (void *)subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Get subscriber %p. Wait event %d. %d clients.\n", (void*) subscriber, event->eventid, event->consuming); (void)_Consume(subscriber, TRUE); - WLog_VRB(TAG, "Get subscriber %p. Quit event %d. %d clients.\n", (void *)subscriber, event->eventid, event->consuming); + WLog_VRB(TAG, "Get subscriber %p. Quit event %d. %d clients.\n", (void*) subscriber, event->eventid, event->consuming); LeaveCriticalSection(&(event->lock)); diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index cbbff4efd..9a66e9c01 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -363,7 +363,7 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a width = monitor->right - monitor->left; height = monitor->bottom - monitor->top; - WLog_INFO(TAG, " %s [%d] %dx%d\t+%d+%d", + WLog_INFO(TAG, " %s [%d] %dx%d\t+%"PRId32"+%"PRId32"", (monitor->flags == 1) ? "*" : " ", index, width, height, monitor->left, monitor->top); } diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 507f4f8f6..89c5e272e 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -375,12 +375,12 @@ static void touch_handle_down(void *data, struct wl_touch *wl_touch, input->touch_focus = wl_surface_get_user_data(surface); if (!input->touch_focus) { - DBG("Failed to find to touch focus for surface %p\n", surface); + DBG("Failed to find to touch focus for surface %p\n", (void*) surface); return; } if (surface != input->touch_focus->main_surface->surface) { - DBG("Ignoring input event from subsurface %p\n", surface); + DBG("Ignoring input event from subsurface %p\n", (void*) surface); input->touch_focus = NULL; return; } diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index f8965e463..ae1fbc862 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -58,9 +58,11 @@ set(WINPR_API_VERSION "${WINPR_VERSION_MAJOR}") if(NOT IOS) check_include_files(stdbool.h WINPR_HAVE_STDBOOL_H) check_include_files(stdint.h WINPR_HAVE_STDINT_H) + check_include_files(inttypes.h WINPR_HAVE_INTTYPES_H) else(NOT IOS) set(WINPR_HAVE_STDBOOL_H 1) set(WINPR_HAVE_STDINT_H 1) + set(WINPR_HAVE_INTTYPES_H 1) endif(NOT IOS) if(FREERDP_BUILD) diff --git a/winpr/include/winpr/bitstream.h b/winpr/include/winpr/bitstream.h index 750b23e6d..361fe91db 100644 --- a/winpr/include/winpr/bitstream.h +++ b/winpr/include/winpr/bitstream.h @@ -107,7 +107,7 @@ extern "C" { } \ } \ } else { \ - WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%d)", _nbits); \ + WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%u)", (unsigned)_nbits); \ } \ } while(0) diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index f780a7dd4..421b94e00 100644 --- a/winpr/libwinpr/clipboard/synthetic.c +++ b/winpr/libwinpr/clipboard/synthetic.c @@ -382,7 +382,7 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form body = strstr(pSrcData, ""); /* StartFragment */ - sprintf_s(num, sizeof(num), "%010lu", (unsigned long int)strlen(pDstData)); + sprintf_s(num, sizeof(num), "%010lu", strlen(pDstData)); CopyMemory(&pDstData[69], num, 10); strcat(pDstData, pSrcData); /* EndFragment */ - sprintf_s(num, sizeof(num), "%010lu", (unsigned long int)strlen(pDstData)); + sprintf_s(num, sizeof(num), "%010lu", strlen(pDstData)); CopyMemory(&pDstData[93], num, 10); strcat(pDstData, ""); @@ -404,7 +404,7 @@ static void* clipboard_synthesize_html_format(wClipboard* clipboard, UINT32 form strcat(pDstData, ""); /* EndHTML */ - sprintf_s(num, sizeof(num), "%010lu", (unsigned long int)strlen(pDstData)); + sprintf_s(num, sizeof(num), "%010lu", strlen(pDstData)); CopyMemory(&pDstData[43], num, 10); *pSize = (UINT32) strlen(pDstData) + 1; diff --git a/winpr/libwinpr/clipboard/test/TestClipboardFormats.c b/winpr/libwinpr/clipboard/test/TestClipboardFormats.c index 6c0bc4a20..c591d721a 100644 --- a/winpr/libwinpr/clipboard/test/TestClipboardFormats.c +++ b/winpr/libwinpr/clipboard/test/TestClipboardFormats.c @@ -24,7 +24,7 @@ int TestClipboardFormats(int argc, char* argv[]) { formatId = pFormatIds[index]; formatName = ClipboardGetFormatName(clipboard, formatId); - fprintf(stderr, "Format: 0x%04X %s\n", formatId, formatName); + fprintf(stderr, "Format: 0x%08"PRIX32" %s\n", formatId, formatName); } free(pFormatIds); @@ -46,7 +46,7 @@ int TestClipboardFormats(int argc, char* argv[]) SrcSize = (UINT32)(strlen(pSrcData) + 1); bSuccess = ClipboardSetData(clipboard, utf8StringFormatId, pSrcData, SrcSize); - fprintf(stderr, "ClipboardSetData: %d\n", bSuccess); + fprintf(stderr, "ClipboardSetData: %"PRId32"\n", bSuccess); DstSize = 0; pDstData = (char*) ClipboardGetData(clipboard, utf8StringFormatId, &DstSize); fprintf(stderr, "ClipboardGetData: %s\n", pDstData); @@ -74,7 +74,7 @@ int TestClipboardFormats(int argc, char* argv[]) { formatId = pFormatIds[index]; formatName = ClipboardGetFormatName(clipboard, formatId); - fprintf(stderr, "Format: 0x%04X %s\n", formatId, formatName); + fprintf(stderr, "Format: 0x%08"PRIX32" %s\n", formatId, formatName); } free(pFormatIds); diff --git a/winpr/libwinpr/comm/comm.c b/winpr/libwinpr/comm/comm.c index 8a469a5fc..9e4e7f0a8 100644 --- a/winpr/libwinpr/comm/comm.c +++ b/winpr/libwinpr/comm/comm.c @@ -604,7 +604,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) break; default: - CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %d\n", + CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %"PRIu32"\n", lpDCB->fDtrControl); return FALSE; } @@ -659,7 +659,7 @@ BOOL SetCommState(HANDLE hFile, LPDCB lpDCB) break; default: - CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %d\n", + CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %"PRIu32"\n", lpDCB->fRtsControl); return FALSE; } @@ -1301,7 +1301,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (dwDesiredAccess != (GENERIC_READ | GENERIC_WRITE)) { - CommLog_Print(WLOG_WARN, "unexpected access to the device: 0x%lX", + CommLog_Print(WLOG_WARN, "unexpected access to the device: 0x%08"PRIX32"", dwDesiredAccess); } @@ -1316,7 +1316,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (lpSecurityAttributes != NULL) { - CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%lu", + CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%"PRIu32"", lpSecurityAttributes->nLength); } @@ -1348,7 +1348,7 @@ HANDLE CommCreateFileA(LPCSTR lpDeviceName, DWORD dwDesiredAccess, if (dwFlagsAndAttributes != 0) { - CommLog_Print(WLOG_WARN, "unexpected flags and attributes: 0x%lX", + CommLog_Print(WLOG_WARN, "unexpected flags and attributes: 0x%08"PRIX32"", dwFlagsAndAttributes); } diff --git a/winpr/libwinpr/comm/comm_io.c b/winpr/libwinpr/comm/comm_io.c index 0a5ca4613..d3eb2c147 100644 --- a/winpr/libwinpr/comm/comm_io.c +++ b/winpr/libwinpr/comm/comm_io.c @@ -223,7 +223,7 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (tcsetattr(pComm->fd, TCSANOW, ¤tTermios) < 0) { CommLog_Print(WLOG_WARN, - "CommReadFile failure, could not apply new timeout values: VMIN=%u, VTIME=%u", + "CommReadFile failure, could not apply new timeout values: VMIN=%"PRIu8", VTIME=%"PRIu8"", vmin, vtime); SetLastError(ERROR_IO_DEVICE); goto return_false; @@ -315,12 +315,12 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, if (nbRead < 0) { CommLog_Print(WLOG_WARN, - "CommReadFile failed, ReadIntervalTimeout=%lu, ReadTotalTimeoutMultiplier=%lu, ReadTotalTimeoutConstant=%lu VMIN=%u, VTIME=%u", + "CommReadFile failed, ReadIntervalTimeout=%"PRIu32", ReadTotalTimeoutMultiplier=%"PRIu32", ReadTotalTimeoutConstant=%"PRIu32" VMIN=%u, VTIME=%u", pTimeouts->ReadIntervalTimeout, pTimeouts->ReadTotalTimeoutMultiplier, pTimeouts->ReadTotalTimeoutConstant, currentTermios.c_cc[VMIN], currentTermios.c_cc[VTIME]); CommLog_Print(WLOG_WARN, - "CommReadFile failed, nNumberOfBytesToRead=%lu, errno=[%d] %s", + "CommReadFile failed, nNumberOfBytesToRead=%"PRIu32", errno=[%d] %s", nNumberOfBytesToRead, errno, strerror(errno)); if (errno == EAGAIN) @@ -516,7 +516,7 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, if (nbWritten < 0) { CommLog_Print(WLOG_WARN, - "CommWriteFile failed after %lu bytes written, errno=[%d] %s\n", + "CommWriteFile failed after %"PRIu32" bytes written, errno=[%d] %s\n", *lpNumberOfBytesWritten, errno, strerror(errno)); if (errno == EAGAIN) diff --git a/winpr/libwinpr/comm/comm_ioctl.c b/winpr/libwinpr/comm/comm_ioctl.c index ed680a9d2..9ea439d6b 100644 --- a/winpr/libwinpr/comm/comm_ioctl.c +++ b/winpr/libwinpr/comm/comm_ioctl.c @@ -629,7 +629,7 @@ static BOOL _CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID l } } - CommLog_Print(WLOG_WARN, _T("unsupported IoControlCode=[0x%lX] %s (remote serial driver: %s)"), + CommLog_Print(WLOG_WARN, _T("unsupported IoControlCode=[0x%08"PRIX32"] %s (remote serial driver: %s)"), dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), pServerSerialDriver->name); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); /* => STATUS_NOT_IMPLEMENTED */ return FALSE; @@ -673,14 +673,14 @@ BOOL CommDeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffe if (lpBytesReturned && *lpBytesReturned != nOutBufferSize) { /* This might be a hint for a bug, especially when result==TRUE */ - CommLog_Print(WLOG_WARN, "lpBytesReturned=%ld and nOutBufferSize=%ld are different!", *lpBytesReturned, nOutBufferSize); + CommLog_Print(WLOG_WARN, "lpBytesReturned=%"PRIu32" and nOutBufferSize=%"PRIu32" are different!", *lpBytesReturned, nOutBufferSize); } if (pComm->permissive) { if (!result) { - CommLog_Print(WLOG_WARN, "[permissive]: whereas it failed, made to succeed IoControlCode=[0x%lX] %s, last-error: 0x%lX", + CommLog_Print(WLOG_WARN, "[permissive]: whereas it failed, made to succeed IoControlCode=[0x%08"PRIX32"] %s, last-error: 0x%08"PRIX32"", dwIoControlCode, _comm_serial_ioctl_name(dwIoControlCode), GetLastError()); } diff --git a/winpr/libwinpr/comm/comm_ioctl.h b/winpr/libwinpr/comm/comm_ioctl.h index 8abdc1012..01114f57d 100644 --- a/winpr/libwinpr/comm/comm_ioctl.h +++ b/winpr/libwinpr/comm/comm_ioctl.h @@ -119,7 +119,7 @@ typedef struct _SERIAL_HANDFLOW #define SERIAL_SP_RS422 ((ULONG)0x00000003) #define SERIAL_SP_RS423 ((ULONG)0x00000004) #define SERIAL_SP_RS449 ((ULONG)0x00000005) -#define SERIAL_SP_MODEM ((ULONG)0X00000006) +#define SERIAL_SP_MODEM ((ULONG)0x00000006) #define SERIAL_SP_FAX ((ULONG)0x00000021) #define SERIAL_SP_SCANNER ((ULONG)0x00000022) #define SERIAL_SP_BRIDGE ((ULONG)0x00000100) diff --git a/winpr/libwinpr/comm/comm_sercx2_sys.c b/winpr/libwinpr/comm/comm_sercx2_sys.c index 8bdffbe97..c937f6661 100644 --- a/winpr/libwinpr/comm/comm_sercx2_sys.c +++ b/winpr/libwinpr/comm/comm_sercx2_sys.c @@ -81,7 +81,7 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx2.sys), requested events= 0X%lX, possible events= 0X%lX", *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx2.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; diff --git a/winpr/libwinpr/comm/comm_sercx_sys.c b/winpr/libwinpr/comm/comm_sercx_sys.c index 7d392d31e..59c31b9ce 100644 --- a/winpr/libwinpr/comm/comm_sercx_sys.c +++ b/winpr/libwinpr/comm/comm_sercx_sys.c @@ -155,7 +155,7 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx.sys), requested events= 0x%lX, possible events= 0x%lX", *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, "Not all wait events supported (SerCx.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; diff --git a/winpr/libwinpr/comm/comm_serial_sys.c b/winpr/libwinpr/comm/comm_serial_sys.c index 04e11da4b..975c514a4 100644 --- a/winpr/libwinpr/comm/comm_serial_sys.c +++ b/winpr/libwinpr/comm/comm_serial_sys.c @@ -235,7 +235,7 @@ static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) newSpeed = _BAUD_TABLE[i][0]; if (cfsetspeed(&futureState, newSpeed) < 0) { - CommLog_Print(WLOG_WARN, "failed to set speed 0x%x (%lu)", newSpeed, pBaudRate->BaudRate); + CommLog_Print(WLOG_WARN, "failed to set speed 0x%x (%"PRIu32")", newSpeed, pBaudRate->BaudRate); return FALSE; } @@ -243,7 +243,7 @@ static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &futureState) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%lX", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%"PRIX32"", GetLastError()); return FALSE; } @@ -251,7 +251,7 @@ static BOOL _set_baud_rate(WINPR_COMM *pComm, const SERIAL_BAUD_RATE *pBaudRate) } } - CommLog_Print(WLOG_WARN, "could not find a matching speed for the baud rate %lu", pBaudRate->BaudRate); + CommLog_Print(WLOG_WARN, "could not find a matching speed for the baud rate %"PRIu32"", pBaudRate->BaudRate); SetLastError(ERROR_INVALID_DATA); return FALSE; } @@ -328,7 +328,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar */ if (pSerialChars->EofChar != '\0') { - CommLog_Print(WLOG_WARN, "EofChar='%c' cannot be set\n", pSerialChars->EofChar); + CommLog_Print(WLOG_WARN, "EofChar %02"PRIX8" cannot be set\n", pSerialChars->EofChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -341,7 +341,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar /* FIXME: see also: _set_handflow() */ if (pSerialChars->ErrorChar != '\0') { - CommLog_Print(WLOG_WARN, "ErrorChar='%c' (0x%x) cannot be set (unsupported).\n", pSerialChars->ErrorChar, pSerialChars->ErrorChar); + CommLog_Print(WLOG_WARN, "ErrorChar 0x%02"PRIX8" ('%c') cannot be set (unsupported).\n", pSerialChars->ErrorChar, (char) pSerialChars->ErrorChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -349,7 +349,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar /* FIXME: see also: _set_handflow() */ if (pSerialChars->BreakChar != '\0') { - CommLog_Print(WLOG_WARN, "BreakChar='%c' (0x%x) cannot be set (unsupported).\n", pSerialChars->BreakChar, pSerialChars->BreakChar); + CommLog_Print(WLOG_WARN, "BreakChar 0x%02"PRIX8" ('%c') cannot be set (unsupported).\n", pSerialChars->BreakChar, (char) pSerialChars->BreakChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -357,7 +357,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar /* FIXME: could be implemented during read/write I/O. What about ISIG? */ if (pSerialChars->EventChar != '\0') { - CommLog_Print(WLOG_WARN, "EventChar='%c' (0x%x) cannot be set\n", pSerialChars->EventChar, pSerialChars->EventChar); + CommLog_Print(WLOG_WARN, "EventChar 0x%02"PRIX8" ('%c') cannot be set\n", pSerialChars->EventChar, (char) pSerialChars->EventChar); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -369,7 +369,7 @@ static BOOL _set_serial_chars(WINPR_COMM *pComm, const SERIAL_CHARS *pSerialChar if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%lX", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08"PRIX32"", GetLastError()); return FALSE; } @@ -447,7 +447,7 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected number of stop bits: %d\n", pLineControl->StopBits); + CommLog_Print(WLOG_WARN, "unexpected number of stop bits: %"PRIu8"\n", pLineControl->StopBits); result = FALSE; /* but keep on */ break; } @@ -479,7 +479,7 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected type of parity: %d\n", pLineControl->Parity); + CommLog_Print(WLOG_WARN, "unexpected type of parity: %"PRIu8"\n", pLineControl->Parity); result = FALSE; /* but keep on */ break; } @@ -507,14 +507,14 @@ static BOOL _set_line_control(WINPR_COMM *pComm, const SERIAL_LINE_CONTROL *pLin break; default: - CommLog_Print(WLOG_WARN, "unexpected number od data bits per character: %d\n", pLineControl->WordLength); + CommLog_Print(WLOG_WARN, "unexpected number od data bits per character: %"PRIu8"\n", pLineControl->WordLength); result = FALSE; /* but keep on */ break; } if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%lX", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%08"PRIX32"", GetLastError()); return FALSE; } @@ -733,7 +733,7 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) // FIXME: could be implemented during read/write I/O if (pHandflow->XonLimit != TTY_THRESHOLD_UNTHROTTLE) { - CommLog_Print(WLOG_WARN, "Attempt to set XonLimit with an unsupported value: %lu", pHandflow->XonLimit); + CommLog_Print(WLOG_WARN, "Attempt to set XonLimit with an unsupported value: %"PRId32"", pHandflow->XonLimit); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -743,7 +743,7 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) // FIXME: could be implemented during read/write I/O if (pHandflow->XoffLimit != TTY_THRESHOLD_THROTTLE) { - CommLog_Print(WLOG_WARN, "Attempt to set XoffLimit with an unsupported value: %lu", pHandflow->XoffLimit); + CommLog_Print(WLOG_WARN, "Attempt to set XoffLimit with an unsupported value: %"PRId32"", pHandflow->XoffLimit); SetLastError(ERROR_NOT_SUPPORTED); result = FALSE; /* but keep on */ } @@ -751,7 +751,7 @@ static BOOL _set_handflow(WINPR_COMM *pComm, const SERIAL_HANDFLOW *pHandflow) if (_comm_ioctl_tcsetattr(pComm->fd, TCSANOW, &upcomingTermios) < 0) { - CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%lX", GetLastError()); + CommLog_Print(WLOG_WARN, "_comm_ioctl_tcsetattr failure: last-error: 0x%"PRIX32"", GetLastError()); return FALSE; } @@ -849,11 +849,11 @@ static BOOL _set_timeouts(WINPR_COMM *pComm, const SERIAL_TIMEOUTS *pTimeouts) pComm->timeouts.WriteTotalTimeoutMultiplier = pTimeouts->WriteTotalTimeoutMultiplier; pComm->timeouts.WriteTotalTimeoutConstant = pTimeouts->WriteTotalTimeoutConstant; - CommLog_Print(WLOG_DEBUG, "ReadIntervalTimeout %d", pComm->timeouts.ReadIntervalTimeout); - CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutMultiplier %d", pComm->timeouts.ReadTotalTimeoutMultiplier); - CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutConstant %d", pComm->timeouts.ReadTotalTimeoutConstant); - CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutMultiplier %d", pComm->timeouts.WriteTotalTimeoutMultiplier); - CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutConstant %d", pComm->timeouts.WriteTotalTimeoutConstant); + CommLog_Print(WLOG_DEBUG, "ReadIntervalTimeout %"PRIu32"", pComm->timeouts.ReadIntervalTimeout); + CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutMultiplier %"PRIu32"", pComm->timeouts.ReadTotalTimeoutMultiplier); + CommLog_Print(WLOG_DEBUG, "ReadTotalTimeoutConstant %"PRIu32"", pComm->timeouts.ReadTotalTimeoutConstant); + CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutMultiplier %"PRIu32"", pComm->timeouts.WriteTotalTimeoutMultiplier); + CommLog_Print(WLOG_DEBUG, "WriteTotalTimeoutConstant %"PRIu32"", pComm->timeouts.WriteTotalTimeoutConstant); return TRUE; } @@ -874,7 +874,7 @@ static BOOL _set_lines(WINPR_COMM *pComm, UINT32 lines) { if (ioctl(pComm->fd, TIOCMBIS, &lines) < 0) { - CommLog_Print(WLOG_WARN, "TIOCMBIS ioctl failed, lines=0x%X, errno=[%d] %s", lines, errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "TIOCMBIS ioctl failed, lines=0x%"PRIX32", errno=[%d] %s", lines, errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); return FALSE; } @@ -887,7 +887,7 @@ static BOOL _clear_lines(WINPR_COMM *pComm, UINT32 lines) { if (ioctl(pComm->fd, TIOCMBIC, &lines) < 0) { - CommLog_Print(WLOG_WARN, "TIOCMBIC ioctl failed, lines=0x%X, errno=[%d] %s", lines, errno, strerror(errno)); + CommLog_Print(WLOG_WARN, "TIOCMBIC ioctl failed, lines=0x%"PRIX32", errno=[%d] %s", lines, errno, strerror(errno)); SetLastError(ERROR_IO_DEVICE); return FALSE; } @@ -1070,7 +1070,7 @@ static BOOL _set_wait_mask(WINPR_COMM *pComm, const ULONG *pWaitMask) if (possibleMask != *pWaitMask) { - CommLog_Print(WLOG_WARN, "Not all wait events supported (Serial.sys), requested events= 0X%lX, possible events= 0X%lX", *pWaitMask, possibleMask); + CommLog_Print(WLOG_WARN, "Not all wait events supported (Serial.sys), requested events= 0x%08"PRIX32", possible events= 0x%08"PRIX32"", *pWaitMask, possibleMask); /* FIXME: shall we really set the possibleMask and return FALSE? */ pComm->WaitEventMask = possibleMask; @@ -1102,10 +1102,10 @@ static BOOL _set_queue_size(WINPR_COMM *pComm, const SERIAL_QUEUE_SIZE *pQueueSi /* FIXME: could be implemented on top of N_TTY */ if (pQueueSize->InSize > N_TTY_BUF_SIZE) - CommLog_Print(WLOG_WARN, "Requested an incompatible input buffer size: %lu, keeping on with a %d bytes buffer.", pQueueSize->InSize, N_TTY_BUF_SIZE); + CommLog_Print(WLOG_WARN, "Requested an incompatible input buffer size: %"PRIu32", keeping on with a %"PRIu32" bytes buffer.", pQueueSize->InSize, N_TTY_BUF_SIZE); if (pQueueSize->OutSize > N_TTY_BUF_SIZE) - CommLog_Print(WLOG_WARN, "Requested an incompatible output buffer size: %lu, keeping on with a %d bytes buffer.", pQueueSize->OutSize, N_TTY_BUF_SIZE); + CommLog_Print(WLOG_WARN, "Requested an incompatible output buffer size: %"PRIu32", keeping on with a %"PRIu32" bytes buffer.", pQueueSize->OutSize, N_TTY_BUF_SIZE); SetLastError(ERROR_CANCELLED); return FALSE; @@ -1116,7 +1116,7 @@ static BOOL _purge(WINPR_COMM *pComm, const ULONG *pPurgeMask) { if ((*pPurgeMask & ~(SERIAL_PURGE_TXABORT | SERIAL_PURGE_RXABORT | SERIAL_PURGE_TXCLEAR | SERIAL_PURGE_RXCLEAR)) > 0) { - CommLog_Print(WLOG_WARN, "Invalid purge mask: 0x%lX\n", *pPurgeMask); + CommLog_Print(WLOG_WARN, "Invalid purge mask: 0x%"PRIX32"\n", *pPurgeMask); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -1459,7 +1459,7 @@ static BOOL _wait_on_mask(WINPR_COMM *pComm, ULONG *pOutputMask) Sleep(100); /* 100 ms */ } - CommLog_Print(WLOG_WARN, "_wait_on_mask, unexpected return, WaitEventMask=0X%lX", pComm->WaitEventMask); + CommLog_Print(WLOG_WARN, "_wait_on_mask, unexpected return, WaitEventMask=0x%08"PRIX32"", pComm->WaitEventMask); EnterCriticalSection(&pComm->EventsLock); pComm->PendingEvents &= ~SERIAL_EV_FREERDP_WAITING; LeaveCriticalSection(&pComm->EventsLock); diff --git a/winpr/libwinpr/comm/test/TestCommConfig.c b/winpr/libwinpr/comm/test/TestCommConfig.c index 4d667ee7e..a76feb111 100644 --- a/winpr/libwinpr/comm/test/TestCommConfig.c +++ b/winpr/libwinpr/comm/test/TestCommConfig.c @@ -90,12 +90,12 @@ int TestCommConfig(int argc, char* argv[]) success = GetCommState(hComm, &dcb); if (!success) { - fprintf(stderr, "GetCommState failure: GetLastError() = Ox%x\n", (int) GetLastError()); + fprintf(stderr, "GetCommState failure: GetLastError() = Ox%x\n", GetLastError()); return EXIT_FAILURE; } - fprintf(stderr, "BaudRate: %d ByteSize: %d Parity: %d StopBits: %d\n", - (int) dcb.BaudRate, (int) dcb.ByteSize, (int) dcb.Parity, (int) dcb.StopBits); + fprintf(stderr, "BaudRate: %"PRIu32" ByteSize: %"PRIu8" Parity: %"PRIu8" StopBits: %"PRIu8"\n", + dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); ZeroMemory(&commProp, sizeof(COMMPROP)); if (!GetCommProperties(hComm, &commProp)) @@ -125,7 +125,7 @@ int TestCommConfig(int argc, char* argv[]) if (!success) { - fprintf(stderr, "SetCommState failure: GetLastError() = 0x%x\n", (int) GetLastError()); + fprintf(stderr, "SetCommState failure: GetLastError() = 0x%x\n", GetLastError()); return EXIT_FAILURE; } @@ -133,14 +133,14 @@ int TestCommConfig(int argc, char* argv[]) if (!success) { - fprintf(stderr, "GetCommState failure: GetLastError() = 0x%x\n", (int) GetLastError()); + fprintf(stderr, "GetCommState failure: GetLastError() = 0x%x\n", GetLastError()); return 0; } if ((dcb.BaudRate != CBR_57600) || (dcb.ByteSize != 8) || (dcb.Parity != NOPARITY) || (dcb.StopBits != ONESTOPBIT)) { - fprintf(stderr, "Got an unexpeted value among: BaudRate: %d ByteSize: %d Parity: %d StopBits: %d\n", - (int) dcb.BaudRate, (int) dcb.ByteSize, (int) dcb.Parity, (int) dcb.StopBits); + fprintf(stderr, "Got an unexpeted value among: BaudRate: %"PRIu32" ByteSize: %"PRIu8" Parity: %"PRIu8" StopBits: %"PRIu8"\n", + dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits); } CloseHandle(hComm); diff --git a/winpr/libwinpr/comm/test/TestCommDevice.c b/winpr/libwinpr/comm/test/TestCommDevice.c index 96d000391..9e9d747d6 100644 --- a/winpr/libwinpr/comm/test/TestCommDevice.c +++ b/winpr/libwinpr/comm/test/TestCommDevice.c @@ -26,7 +26,7 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) { BOOL result; TCHAR lpTargetPath[MAX_PATH]; - DWORD tcslen; + size_t tcslen; result = DefineCommDevice(lpDeviceName, _T("/dev/test")); if ((!expectedResult && result) || (expectedResult && !result)) /* logical XOR */ @@ -50,12 +50,12 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) return FALSE; } - tcslen = QueryCommDevice(lpDeviceName, lpTargetPath, MAX_PATH); + tcslen = (size_t) QueryCommDevice(lpDeviceName, lpTargetPath, MAX_PATH); if (expectedResult) { if (tcslen <= _tcslen(lpTargetPath)) /* at least 2 more TCHAR are expected */ { - _tprintf(_T("QueryCommDevice failure: didn't found the device name: %s\n"), lpDeviceName); + _tprintf(_T("QueryCommDevice failure: didn't find the device name: %s\n"), lpDeviceName); return FALSE; } @@ -77,7 +77,7 @@ static int test_CommDevice(LPCTSTR lpDeviceName, BOOL expectedResult) { if (tcslen > 0) { - _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: , result: %d %s\n"), + _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: , result: %")_T(PRIuz)_T(" %s\n"), lpDeviceName, tcslen, lpTargetPath); return FALSE; diff --git a/winpr/libwinpr/comm/test/TestCommMonitor.c b/winpr/libwinpr/comm/test/TestCommMonitor.c index 41c20812a..69aa6d131 100644 --- a/winpr/libwinpr/comm/test/TestCommMonitor.c +++ b/winpr/libwinpr/comm/test/TestCommMonitor.c @@ -28,14 +28,14 @@ int TestCommMonitor(int argc, char* argv[]) if (!fSuccess) { - printf("SetCommMask failure: GetLastError() = %d\n", (int) GetLastError()); + printf("SetCommMask failure: GetLastError() = %"PRIu32"\n", GetLastError()); return -1; } ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failed: GetLastError() = %d\n", (int) GetLastError()); + printf("CreateEvent failed: GetLastError() = %"PRIu32"\n", GetLastError()); return -1; } @@ -61,7 +61,7 @@ int TestCommMonitor(int argc, char* argv[]) } else { - printf("WaitCommEvent failure: GetLastError() = %d\n", (int) dwError); + printf("WaitCommEvent failure: GetLastError() = %"PRIu32"\n", dwError); return -1; } } diff --git a/winpr/libwinpr/comm/test/TestSetCommState.c b/winpr/libwinpr/comm/test/TestSetCommState.c index 85fb8159a..0815517cc 100644 --- a/winpr/libwinpr/comm/test/TestSetCommState.c +++ b/winpr/libwinpr/comm/test/TestSetCommState.c @@ -42,7 +42,7 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } @@ -51,7 +51,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } @@ -59,13 +59,13 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } if (!dcb.fParity) { - fprintf(stderr, "unexpected fParity: %d instead of TRUE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %"PRIu32" instead of TRUE\n", dcb.fParity); return FALSE; } @@ -74,7 +74,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } @@ -82,13 +82,13 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } if (dcb.fParity) { - fprintf(stderr, "unexpected fParity: %d instead of FALSE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %"PRIu32" instead of FALSE\n", dcb.fParity); return FALSE; } @@ -97,7 +97,7 @@ static BOOL test_fParity(HANDLE hComm) result = SetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "SetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "SetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } @@ -105,13 +105,13 @@ static BOOL test_fParity(HANDLE hComm) result = GetCommState(hComm, &dcb); if (!result) { - fprintf(stderr, "GetCommState failure: 0x%x\n", GetLastError()); + fprintf(stderr, "GetCommState failure: 0x%08"PRIx32"\n", GetLastError()); return FALSE; } if (!dcb.fParity) { - fprintf(stderr, "unexpected fParity: %d instead of TRUE\n", dcb.fParity); + fprintf(stderr, "unexpected fParity: %"PRIu32" instead of TRUE\n", dcb.fParity); return FALSE; } diff --git a/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c b/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c index 478498888..e8c72039e 100644 --- a/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c +++ b/winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c @@ -26,7 +26,7 @@ int TestCredUICmdLinePromptForCredentials(int argc, char* argv[]) if (status != NO_ERROR) { - printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status); + printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status); return -1; } diff --git a/winpr/libwinpr/credui/test/TestCredUIParseUserName.c b/winpr/libwinpr/credui/test/TestCredUIParseUserName.c index 27073d3fd..123c677e7 100644 --- a/winpr/libwinpr/credui/test/TestCredUIParseUserName.c +++ b/winpr/libwinpr/credui/test/TestCredUIParseUserName.c @@ -22,7 +22,7 @@ int TestCredUIParseUserName(int argc, char* argv[]) status = CredUIParseUserName(testUserName1, User, sizeof(User) / sizeof(TCHAR), Domain, sizeof(Domain) / sizeof(TCHAR)); - printf("CredUIParseUserName status: 0x%08X\n", status); + printf("CredUIParseUserName status: 0x%08"PRIX32"\n", status); _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName1, Domain, User); @@ -34,7 +34,7 @@ int TestCredUIParseUserName(int argc, char* argv[]) status = CredUIParseUserName(testUserName2, User, sizeof(User) / sizeof(TCHAR), Domain, sizeof(Domain) / sizeof(TCHAR)); - printf("CredUIParseUserName status: 0x%08X\n", status); + printf("CredUIParseUserName status: 0x%08"PRIX32"\n", status); _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName2, Domain, User); diff --git a/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c b/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c index aa79dc662..fa8d265a5 100644 --- a/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c +++ b/winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c @@ -35,7 +35,7 @@ int TestCredUIPromptForCredentials(int argc, char* argv[]) if (status != NO_ERROR) { - printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status); + printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status); return -1; } diff --git a/winpr/libwinpr/crt/test/TestAlignment.c b/winpr/libwinpr/crt/test/TestAlignment.c index d520bfad6..37dafd98f 100644 --- a/winpr/libwinpr/crt/test/TestAlignment.c +++ b/winpr/libwinpr/crt/test/TestAlignment.c @@ -26,7 +26,7 @@ int TestAlignment(int argc, char* argv[]) if (((size_t) ptr % alignment) != 0) { - printf("This pointer, %p, is not aligned on %lu\n", ptr, (unsigned long)alignment); + printf("This pointer, %p, is not aligned on %"PRIuz"\n", ptr, alignment); return -1; } @@ -36,7 +36,7 @@ int TestAlignment(int argc, char* argv[]) if (((size_t) ptr % alignment) != 0) { - printf("This pointer, %p, is not aligned on %lu\n", ptr, (unsigned long)alignment); + printf("This pointer, %p, is not aligned on %"PRIuz"\n", ptr, alignment); return -1; } @@ -54,8 +54,7 @@ int TestAlignment(int argc, char* argv[]) if (((((size_t) ptr) + offset) % alignment) != 0) { - printf("This pointer, %p, does not satisfy offset %lu and alignment %lu\n", ptr, (unsigned - long)offset, (unsigned long)alignment); + printf("This pointer, %p, does not satisfy offset %"PRIuz" and alignment %"PRIuz"\n", ptr, offset, alignment); return -1; } @@ -71,8 +70,7 @@ int TestAlignment(int argc, char* argv[]) if (((((size_t) ptr) + offset) % alignment) != 0) { - printf("This pointer, %p, does not satisfy offset %lu and alignment %lu\n", ptr, (unsigned - long)offset, (unsigned long)alignment); + printf("This pointer, %p, does not satisfy offset %"PRIuz" and alignment %"PRIuz"\n", ptr, offset, alignment); return -1; } diff --git a/winpr/libwinpr/crt/test/TestString.c b/winpr/libwinpr/crt/test/TestString.c index 25484a218..e4e5b26be 100644 --- a/winpr/libwinpr/crt/test/TestString.c +++ b/winpr/libwinpr/crt/test/TestString.c @@ -56,8 +56,7 @@ int TestString(int argc, char* argv[]) if (length != testStringW_Length) { - printf("_wcslen error: length mismatch: Actual: %lu, Expected: %lu\n", (unsigned long) length, - (unsigned long) testStringW_Length); + printf("_wcslen error: length mismatch: Actual: %"PRIuz", Expected: %"PRIuz"\n", length, testStringW_Length); return -1; } @@ -68,8 +67,7 @@ int TestString(int argc, char* argv[]) if (pos != 11) { - printf("_wcschr error: position mismatch: Actual: %lu, Expected: %u\n", (unsigned long)pos, - 11); + printf("_wcschr error: position mismatch: Actual: %"PRIuz", Expected: 11\n", pos); return -1; } @@ -78,7 +76,7 @@ int TestString(int argc, char* argv[]) if (pos != 29) { - printf("_wcschr error: position mismatch: Actual: %lu, Expected: %u\n", (unsigned long)pos, 29); + printf("_wcschr error: position mismatch: Actual: %"PRIuz", Expected: 29\n", pos); return -1; } @@ -86,8 +84,7 @@ int TestString(int argc, char* argv[]) if (p != NULL) { - printf("_wcschr error: return value mismatch: Actual: 0x%08lX, Expected: 0x%08lX\n", (unsigned - long) p, (unsigned long) NULL); + printf("_wcschr error: return value mismatch: Actual: %p, Expected: NULL\n", (void*) p); return -1; } diff --git a/winpr/libwinpr/crt/test/TestTypes.c b/winpr/libwinpr/crt/test/TestTypes.c index 1261dc895..2ab32fd84 100644 --- a/winpr/libwinpr/crt/test/TestTypes.c +++ b/winpr/libwinpr/crt/test/TestTypes.c @@ -45,8 +45,8 @@ #define TEST_SIZEOF_TYPE(_name) \ if (sizeof(_name) != EXPECTED_SIZEOF_ ##_name) { \ - fprintf(stderr, "sizeof(%s) mismatch: Actual: %d, Expected: %d\n", \ - #_name, (int) sizeof(_name), (int) EXPECTED_SIZEOF_ ##_name); \ + fprintf(stderr, "sizeof(%s) mismatch: Actual: %"PRIuz", Expected: %"PRIuz"\n", \ + #_name, sizeof(_name), (size_t) EXPECTED_SIZEOF_ ##_name); \ status = -1; \ } diff --git a/winpr/libwinpr/crt/test/TestUnicodeConversion.c b/winpr/libwinpr/crt/test/TestUnicodeConversion.c index 58ecb7f10..0e141d655 100644 --- a/winpr/libwinpr/crt/test/TestUnicodeConversion.c +++ b/winpr/libwinpr/crt/test/TestUnicodeConversion.c @@ -101,13 +101,13 @@ void string_hexdump(BYTE* data, int length) line = 16; for (i = 0; i < line; i++) - printf("%02x ", p[i]); + printf("%02"PRIx8" ", p[i]); for (; i < 16; i++) printf(" "); for (i = 0; i < line; i++) - printf("%c", (p[i] >= 0x20 && p[i] < 0x7F) ? p[i] : '.'); + printf("%c", (p[i] >= 0x20 && p[i] < 0x7F) ? (char) p[i] : '.'); printf("\n"); @@ -152,7 +152,7 @@ int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideCharStr, in if (!length) { DWORD error = GetLastError(); - printf("MultiByteToWideChar error: 0x%08X\n", error); + printf("MultiByteToWideChar error: 0x%08"PRIX32"\n", error); return -1; } @@ -224,7 +224,7 @@ int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, in if (!length) { DWORD error = GetLastError(); - printf("WideCharToMultiByte error: 0x%08X\n", error); + printf("WideCharToMultiByte error: 0x%08"PRIX32"\n", error); return -1; } @@ -581,7 +581,7 @@ int TestUnicodeConversion(int argc, char* argv[]) WCHAR *dst = NULL; int num; num = ConvertToUnicode(CP_UTF8, 0, src, 16, &dst, 0); - printf("ConvertToUnicode returned %d dst=%p\n", num, dst); + printf("ConvertToUnicode returned %d dst=%p\n", num, (void*) dst); string_hexdump((BYTE*)dst, num * 2 + 2); } diff --git a/winpr/libwinpr/crypto/test/TestCryptoCipher.c b/winpr/libwinpr/crypto/test/TestCryptoCipher.c index 1f99a3f93..b77f30d54 100644 --- a/winpr/libwinpr/crypto/test/TestCryptoCipher.c +++ b/winpr/libwinpr/crypto/test/TestCryptoCipher.c @@ -53,7 +53,7 @@ static BOOL test_crypto_cipher_aes_128_cbc() if (xlen != ilen) { - fprintf(stderr, "%s: error, xlen (%u) != ilen (%u) (encrypt)\n", __FUNCTION__, (unsigned)xlen, (unsigned)ilen); + fprintf(stderr, "%s: error, xlen (%"PRIuz") != ilen (%"PRIuz") (encrypt)\n", __FUNCTION__, xlen, ilen); goto out; } @@ -92,7 +92,7 @@ static BOOL test_crypto_cipher_aes_128_cbc() if (xlen != ilen) { - fprintf(stderr, "%s: error, xlen (%u) != ilen (%u) (decrypt)\n", __FUNCTION__, (unsigned)xlen, (unsigned)ilen); + fprintf(stderr, "%s: error, xlen (%"PRIuz") != ilen (%"PRIuz") (decrypt)\n", __FUNCTION__, xlen, ilen); goto out; } @@ -124,7 +124,7 @@ static BOOL test_crypto_cipher_rc4() if (!(text = (BYTE*) calloc(1, len))) { - fprintf(stderr, "%s: failed to allocate text buffer (len=%u)\n", __FUNCTION__, (unsigned)len); + fprintf(stderr, "%s: failed to allocate text buffer (len=%"PRIuz")\n", __FUNCTION__, len); goto out; } diff --git a/winpr/libwinpr/dsparse/test/TestDsCrackNames.c b/winpr/libwinpr/dsparse/test/TestDsCrackNames.c index b2645442f..9264499e6 100644 --- a/winpr/libwinpr/dsparse/test/TestDsCrackNames.c +++ b/winpr/libwinpr/dsparse/test/TestDsCrackNames.c @@ -18,7 +18,7 @@ int TestDsCrackNames(int argc, char* argv[]) if (status != ERROR_SUCCESS) { - _tprintf(_T("DsBind: expected ERROR_SUCCESS: 0x%08X\n"), status); + _tprintf(_T("DsBind: expected ERROR_SUCCESS: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -31,9 +31,9 @@ int TestDsCrackNames(int argc, char* argv[]) return -1; } - _tprintf(_T("DsCrackNames: pResult->cItems: %d\n"), pResult->cItems); + _tprintf(_T("DsCrackNames: pResult->cItems: %")_T(PRIu32)_T("\n"), pResult->cItems); - _tprintf(_T("DsCrackNames: pResult->rItems[0]: Domain: %s Name: %s Status: 0x%08X\n"), + _tprintf(_T("DsCrackNames: pResult->rItems[0]: Domain: %s Name: %s Status: 0x%08")_T(PRIX32)_T("\n"), pResult->rItems[0].pDomain, pResult->rItems[0].pName, pResult->rItems[0].status); status = DsUnBind(&ds); diff --git a/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c b/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c index 333a4569c..11510577c 100644 --- a/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c +++ b/winpr/libwinpr/dsparse/test/TestDsMakeSpn.c @@ -35,7 +35,7 @@ int TestDsMakeSpn(int argc, char* argv[]) if (SpnLength != 37) { - _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %d, Expected: %d\n"), SpnLength, 37); + _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %")_T(PRIu32)_T(", Expected: 37\n"), SpnLength); return -1; } diff --git a/winpr/libwinpr/error/test/TestErrorSetLastError.c b/winpr/libwinpr/error/test/TestErrorSetLastError.c index 44c986a8f..2d8a699de 100644 --- a/winpr/libwinpr/error/test/TestErrorSetLastError.c +++ b/winpr/libwinpr/error/test/TestErrorSetLastError.c @@ -44,7 +44,7 @@ static void* test_error_thread(void* arg) SetLastError(dwErrorSet); if ((dwErrorGet = GetLastError()) != dwErrorSet) { - printf("GetLastError() failure (thread %d): Expected: 0x%04X, Actual: 0x%04X\n", + printf("GetLastError() failure (thread %d): Expected: 0x%08"PRIX32", Actual: 0x%08"PRIX32"\n", id, dwErrorSet, dwErrorGet); if (!status) status = -1; @@ -73,7 +73,7 @@ int TestErrorSetLastError(int argc, char* argv[]) if (error != ERROR_ACCESS_DENIED) { - printf("GetLastError() failure: Expected: 0x%04X, Actual: 0x%04X\n", + printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08"PRIX32"\n", ERROR_ACCESS_DENIED, error); return -1; } @@ -113,7 +113,7 @@ int TestErrorSetLastError(int argc, char* argv[]) if (error != ERROR_ACCESS_DENIED) { - printf("GetLastError() failure: Expected: 0x%04X, Actual: 0x%04X\n", + printf("GetLastError() failure: Expected: 0x%08X, Actual: 0x%08"PRIX32"\n", ERROR_ACCESS_DENIED, error); return -1; } @@ -124,7 +124,7 @@ int TestErrorSetLastError(int argc, char* argv[]) return -1; } - printf("Completed %d iterations.\n", *pLoopCount); + printf("Completed %"PRId32" iterations.\n", *pLoopCount); return status; } diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index 6f3bd9ab8..335c9c487 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -99,7 +99,7 @@ static BOOL FileSetEndOfFile(HANDLE hFile) size = ftell(pFile->fp); if (ftruncate(fileno(pFile->fp), size) < 0) { - WLog_ERR(TAG, "ftruncate %s failed with %s [%08X]", + WLog_ERR(TAG, "ftruncate %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), errno); return FALSE; } @@ -135,7 +135,7 @@ static DWORD FileSetFilePointer(HANDLE hFile, LONG lDistanceToMove, if (fseek(pFile->fp, offset, whence)) { - WLog_ERR(TAG, "fseek(%s) failed with %s [%08X]", pFile->lpFileName, + WLog_ERR(TAG, "fseek(%s) failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), errno); return INVALID_SET_FILE_POINTER; } @@ -221,14 +221,14 @@ static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) if (cur < 0) { - WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName, + WLog_ERR(TAG, "ftell(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), errno); return INVALID_FILE_SIZE; } if (fseek(file->fp, 0, SEEK_END) != 0) { - WLog_ERR(TAG, "fseek(%s) failed with %s [%08X]", file->lpFileName, + WLog_ERR(TAG, "fseek(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), errno); return INVALID_FILE_SIZE; } @@ -237,14 +237,14 @@ static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) if (size < 0) { - WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName, + WLog_ERR(TAG, "ftell(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), errno); return INVALID_FILE_SIZE; } if (fseek(file->fp, cur, SEEK_SET) != 0) { - WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName, + WLog_ERR(TAG, "ftell(%s) failed with %s [0x%08X]", file->lpFileName, strerror(errno), errno); return INVALID_FILE_SIZE; } @@ -288,7 +288,7 @@ static BOOL FileLockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, if (flock(fileno(pFile->fp), lock) < 0) { - WLog_ERR(TAG, "flock failed with %s [%08X]", + WLog_ERR(TAG, "flock failed with %s [0x%08X]", strerror(errno), errno); return FALSE; } @@ -314,7 +314,7 @@ static BOOL FileUnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffs if (flock(fileno(pFile->fp), LOCK_UN) < 0) { - WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [%08X]", + WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), errno); return FALSE; } @@ -345,7 +345,7 @@ static BOOL FileUnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfByte if (flock(fileno(pFile->fp), LOCK_UN) < 0) { - WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [%08X]", + WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [0x%08X]", pFile->lpFileName, strerror(errno), errno); return FALSE; } @@ -609,7 +609,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw { if (flock(fileno(pFile->fp), lock) < 0) { - WLog_ERR(TAG, "flock failed with %s [%08X]", + WLog_ERR(TAG, "flock failed with %s [0x%08X]", strerror(errno), errno); FileCloseHandle(pFile); return INVALID_HANDLE_VALUE; diff --git a/winpr/libwinpr/file/test/TestFileFindNextFile.c b/winpr/libwinpr/file/test/TestFileFindNextFile.c index 23b9fcc80..20d5400b7 100644 --- a/winpr/libwinpr/file/test/TestFileFindNextFile.c +++ b/winpr/libwinpr/file/test/TestFileFindNextFile.c @@ -77,7 +77,7 @@ int TestFileFindNextFile(int argc, char* argv[]) if (!status) { - _tprintf(_T("FindNextFile failure: Expected: TRUE, Actual: %d\n"), status); + _tprintf(_T("FindNextFile failure: Expected: TRUE, Actual: %")_T(PRId32)_T("\n"), status); return -1; } @@ -92,7 +92,7 @@ int TestFileFindNextFile(int argc, char* argv[]) if (status) { - _tprintf(_T("FindNextFile failure: Expected: FALSE, Actual: %d\n"), status); + _tprintf(_T("FindNextFile failure: Expected: FALSE, Actual: %")_T(PRId32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c b/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c index 17e72abce..ac0971285 100644 --- a/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c +++ b/winpr/libwinpr/interlocked/test/TestInterlockedAccess.c @@ -1,4 +1,3 @@ - #include #include #include @@ -30,7 +29,7 @@ int TestInterlockedAccess(int argc, char* argv[]) if (*Addend != 10) { - printf("InterlockedIncrement failure: Actual: %ld, Expected: 10\n", (long) *Addend); + printf("InterlockedIncrement failure: Actual: %"PRId32", Expected: 10\n", *Addend); return -1; } @@ -41,7 +40,7 @@ int TestInterlockedAccess(int argc, char* argv[]) if (*Addend != 0) { - printf("InterlockedDecrement failure: Actual: %ld, Expected: 0\n", (long) *Addend); + printf("InterlockedDecrement failure: Actual: %"PRId32", Expected: 0\n", *Addend); return -1; } @@ -61,13 +60,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 0xAA) { - printf("InterlockedExchange failure: Actual: 0x%08lX, Expected: 0xAA\n", (long) oldValue); + printf("InterlockedExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAA\n", oldValue); return -1; } if (*Target != 0xFF) { - printf("InterlockedExchange failure: Actual: 0x%08lX, Expected: 0xFF\n", (long) *Target); + printf("InterlockedExchange failure: Actual: 0x%08"PRIX32", Expected: 0xFF\n", *Target); return -1; } @@ -79,13 +78,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 25) { - printf("InterlockedExchangeAdd failure: Actual: %ld, Expected: 25\n", (long) oldValue); + printf("InterlockedExchangeAdd failure: Actual: %"PRId32", Expected: 25\n", oldValue); return -1; } if (*Addend != 125) { - printf("InterlockedExchangeAdd failure: Actual: %ld, Expected: 125\n", (long) *Addend); + printf("InterlockedExchangeAdd failure: Actual: %"PRId32", Expected: 125\n", *Addend); return -1; } @@ -104,13 +103,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 0xAABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%08lX, Expected: 0xAABBCCDD\n", (long) oldValue); + printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", oldValue); return -1; } if (*Destination != 0xCCDDEEFF) { - printf("InterlockedCompareExchange failure: Actual: 0x%08lX, Expected: 0xCCDDEEFF\n", (long) *Destination); + printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xCCDDEEFF\n", *Destination); return -1; } @@ -122,13 +121,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue != 0xAABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%08lX, Expected: 0xAABBCCDD\n", (long) oldValue); + printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", oldValue); return -1; } if (*Destination != 0xAABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%08lX, Expected: 0xAABBCCDD\n", (long) *Destination); + printf("InterlockedCompareExchange failure: Actual: 0x%08"PRIX32", Expected: 0xAABBCCDD\n", *Destination); return -1; } @@ -147,13 +146,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue64 != 0x66778899AABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%016llX, Expected: 0x66778899AABBCCDD\n", (long long) oldValue64); + printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", oldValue64); return -1; } if (*Destination64 != 0x8899AABBCCDDEEFF) { - printf("InterlockedCompareExchange failure: Actual: 0x%016llX, Expected: 0x8899AABBCCDDEEFF\n", (long long) *Destination64); + printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x8899AABBCCDDEEFF\n", *Destination64); return -1; } @@ -165,13 +164,13 @@ int TestInterlockedAccess(int argc, char* argv[]) if (oldValue64 != 0x66778899AABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%016llX, Expected: 0x66778899AABBCCDD\n", (long long) oldValue64); + printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", oldValue64); return -1; } if (*Destination64 != 0x66778899AABBCCDD) { - printf("InterlockedCompareExchange failure: Actual: 0x%016llX, Expected: 0x66778899AABBCCDD\n", (long long) *Destination64); + printf("InterlockedCompareExchange failure: Actual: 0x%016"PRIX64", Expected: 0x66778899AABBCCDD\n", *Destination64); return -1; } diff --git a/winpr/libwinpr/interlocked/test/TestInterlockedSList.c b/winpr/libwinpr/interlocked/test/TestInterlockedSList.c index 33390d0b4..b7e20b3c2 100644 --- a/winpr/libwinpr/interlocked/test/TestInterlockedSList.c +++ b/winpr/libwinpr/interlocked/test/TestInterlockedSList.c @@ -56,7 +56,7 @@ int TestInterlockedSList(int argc, char* argv[]) } pProgramItem = (PPROGRAM_ITEM) pListEntry; - printf("Signature is %d\n", (int) pProgramItem->Signature); + printf("Signature is %"PRIu32"\n", pProgramItem->Signature); /* * This example assumes that the SLIST_ENTRY structure is the diff --git a/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c b/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c index ddbb3e031..244549a0b 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c +++ b/winpr/libwinpr/library/test/TestLibraryGetModuleFileName.c @@ -16,13 +16,13 @@ int TestLibraryGetModuleFileName(int argc, char* argv[]) len = GetModuleFileNameA(NULL, ModuleFileName, 2); if (len != 2) { - printf("%s: GetModuleFileNameA unexpectedly returned %u instead of 2\n", + printf("%s: GetModuleFileNameA unexpectedly returned %"PRIu32" instead of 2\n", __FUNCTION__, len); return -1; } if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - printf("%s: Invalid last error value: 0x%08X. Expected 0x%08X (ERROR_INSUFFICIENT_BUFFER)\n", + printf("%s: Invalid last error value: 0x%08"PRIX32". Expected 0x%08X (ERROR_INSUFFICIENT_BUFFER)\n", __FUNCTION__, GetLastError(), ERROR_INSUFFICIENT_BUFFER); return -1; } @@ -32,7 +32,7 @@ int TestLibraryGetModuleFileName(int argc, char* argv[]) len = GetModuleFileNameA(NULL, ModuleFileName, sizeof(ModuleFileName)); if (len == 0) { - printf("%s: GetModuleFileNameA failed with error 0x%08X\n", + printf("%s: GetModuleFileNameA failed with error 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } @@ -44,7 +44,7 @@ int TestLibraryGetModuleFileName(int argc, char* argv[]) } if (GetLastError() != ERROR_SUCCESS) { - printf("%s: Invalid last error value: 0x%08X. Expected 0x%08X (ERROR_SUCCESS)\n", + printf("%s: Invalid last error value: 0x%08"PRIX32". Expected 0x%08X (ERROR_SUCCESS)\n", __FUNCTION__, GetLastError(), ERROR_SUCCESS); return -1; } diff --git a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c index 319fea4de..c6500ea37 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c +++ b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c @@ -20,7 +20,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH)) { - printf("%s: GetModuleFilenameA failed: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: GetModuleFilenameA failed: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } @@ -41,7 +41,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!(library = LoadLibraryA(LibraryPath))) { - printf("%s: LoadLibraryA failure: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: LoadLibraryA failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } @@ -81,7 +81,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) if (!FreeLibrary(library)) { - printf("%s: FreeLibrary failure: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: FreeLibrary failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } diff --git a/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c b/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c index 9421f8ac6..1c9a58fb4 100644 --- a/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c +++ b/winpr/libwinpr/library/test/TestLibraryLoadLibrary.c @@ -15,7 +15,7 @@ int TestLibraryLoadLibrary(int argc, char* argv[]) if (!GetModuleFileNameA(NULL, LibraryPath, PATHCCH_MAX_CCH)) { - printf("%s: GetModuleFilenameA failed: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: GetModuleFilenameA failed: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } @@ -36,13 +36,13 @@ int TestLibraryLoadLibrary(int argc, char* argv[]) if (!(library = LoadLibraryA(LibraryPath))) { - printf("%s: LoadLibraryA failure: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: LoadLibraryA failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } if (!FreeLibrary(library)) { - printf("%s: FreeLibrary failure: 0x%08X\n", __FUNCTION__, GetLastError()); + printf("%s: FreeLibrary failure: 0x%08"PRIX32"\n", __FUNCTION__, GetLastError()); return -1; } diff --git a/winpr/libwinpr/nt/test/TestNtCreateFile.c b/winpr/libwinpr/nt/test/TestNtCreateFile.c index 8394ce4e4..d7167fdcd 100644 --- a/winpr/libwinpr/nt/test/TestNtCreateFile.c +++ b/winpr/libwinpr/nt/test/TestNtCreateFile.c @@ -27,7 +27,7 @@ int TestNtCreateFile(int argc, char* argv[]) ntstatus = _RtlAnsiStringToUnicodeString(&uString, &aString, TRUE); if (ntstatus != STATUS_SUCCESS) { - printf("_RtlAnsiStringToUnicodeString failure: 0x%08X\n", ntstatus); + printf("_RtlAnsiStringToUnicodeString failure: 0x%08"PRIX32"\n", ntstatus); goto out; } @@ -45,7 +45,7 @@ int TestNtCreateFile(int argc, char* argv[]) if (ntstatus != STATUS_SUCCESS) { - printf("_NtCreateFile failure: 0x%08X\n", ntstatus); + printf("_NtCreateFile failure: 0x%08"PRIX32"\n", ntstatus); goto out; } @@ -55,7 +55,7 @@ int TestNtCreateFile(int argc, char* argv[]) if (ntstatus != STATUS_SUCCESS) { - printf("_NtClose failure: 0x%08X\n", ntstatus); + printf("_NtClose failure: 0x%08"PRIX32"\n", ntstatus); goto out; } diff --git a/winpr/libwinpr/path/test/TestPathAllocCombine.c b/winpr/libwinpr/path/test/TestPathAllocCombine.c index dcddb2dc9..b315a8623 100644 --- a/winpr/libwinpr/path/test/TestPathAllocCombine.c +++ b/winpr/libwinpr/path/test/TestPathAllocCombine.c @@ -23,7 +23,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -41,7 +41,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -59,7 +59,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -77,7 +77,7 @@ int TestPathAllocCombine(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status); + _tprintf(_T("PathAllocCombine status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/path/test/TestPathCchAddBackslash.c b/winpr/libwinpr/path/test/TestPathCchAddBackslash.c index 42f8f74d8..dcde5eb61 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddBackslash.c +++ b/winpr/libwinpr/path/test/TestPathCchAddBackslash.c @@ -27,7 +27,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -45,7 +45,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -61,7 +61,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslash unexpectedly succeded with null buffer. Status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslash unexpectedly succeded with null buffer. Status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -73,7 +73,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslash unexpectedly succeded with insufficient buffer size. Status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslash unexpectedly succeded with insufficient buffer size. Status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -85,7 +85,7 @@ int TestPathCchAddBackslash(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash failed with status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslash failed with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c b/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c index 9fc4aaf2b..f1bf35598 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c +++ b/winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c @@ -29,7 +29,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -47,7 +47,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddBackslash status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -63,7 +63,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with null buffer. Status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with null buffer. Status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -75,7 +75,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with insufficient buffer size. Status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslashEx unexpectedly succeded with insufficient buffer size. Status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -87,7 +87,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddBackslashEx failed with status: 0x%08X\n"), (unsigned) status); + _tprintf(_T("PathCchAddBackslashEx failed with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/path/test/TestPathCchAddExtension.c b/winpr/libwinpr/path/test/TestPathCchAddExtension.c index 39763391b..87d91f21d 100644 --- a/winpr/libwinpr/path/test/TestPathCchAddExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchAddExtension.c @@ -23,7 +23,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -41,7 +41,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -59,7 +59,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -77,7 +77,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -92,7 +92,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(NULL, PATHCCH_MAX_CCH, testExtDot); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAddExtension with null buffer returned status: 0x%08X (expected E_INVALIDARG)\n"), status); + _tprintf(_T("PathCchAddExtension with null buffer returned status: 0x%08")_T(PRIX32)_T(" (expected E_INVALIDARG)\n"), status); return -1; } @@ -101,7 +101,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, PATHCCH_MAX_CCH, NULL); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAddExtension with null extension returned status: 0x%08X (expected E_INVALIDARG)\n"), status); + _tprintf(_T("PathCchAddExtension with null extension returned status: 0x%08")_T(PRIX32)_T(" (expected E_INVALIDARG)\n"), status); return -1; } @@ -111,7 +111,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, 9 + 4, _T(".jpg")); if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAddExtension with insufficient buffer unexpectedly succeeded with status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension with insufficient buffer unexpectedly succeeded with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -121,7 +121,7 @@ int TestPathCchAddExtension(int argc, char* argv[]) status = PathCchAddExtension(Path, 9 + 4 + 1, _T(".jpg")); if (FAILED(status)) { - _tprintf(_T("PathCchAddExtension with sufficient buffer unexpectedly failed with status: 0x%08X\n"), status); + _tprintf(_T("PathCchAddExtension with sufficient buffer unexpectedly failed with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/path/test/TestPathCchAppend.c b/winpr/libwinpr/path/test/TestPathCchAppend.c index 0f5964f48..7492721fb 100644 --- a/winpr/libwinpr/path/test/TestPathCchAppend.c +++ b/winpr/libwinpr/path/test/TestPathCchAppend.c @@ -25,7 +25,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -43,7 +43,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -61,7 +61,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -79,7 +79,7 @@ int TestPathCchAppend(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchAppend status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -93,7 +93,7 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(NULL, PATHCCH_MAX_CCH, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with NULL path unexpectedly returned status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend with NULL path unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -102,7 +102,7 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, PATHCCH_MAX_CCH, NULL); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with NULL pszMore unexpectedly returned status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend with NULL pszMore unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -111,14 +111,14 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, 0, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with cchPath value 0 unexpectedly returned status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend with cchPath value 0 unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH + 1, testMorePathNoBackslash); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchAppend with cchPath value > PATHCCH_MAX_CCH unexpectedly returned status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend with cchPath value > PATHCCH_MAX_CCH unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -132,7 +132,7 @@ int TestPathCchAppend(int argc, char* argv[]) status = PathCchAppend(Path, PATHCCH_MAX_CCH, _T("\\This cannot be appended to Path")); if (SUCCEEDED(status)) { - _tprintf(_T("PathCchAppend unexepectedly succeeded with status: 0x%08X\n"), status); + _tprintf(_T("PathCchAppend unexepectedly succeeded with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/path/test/TestPathCchFindExtension.c b/winpr/libwinpr/path/test/TestPathCchFindExtension.c index 42a32783d..c30c072f4 100644 --- a/winpr/libwinpr/path/test/TestPathCchFindExtension.c +++ b/winpr/libwinpr/path/test/TestPathCchFindExtension.c @@ -1,4 +1,3 @@ - #include #include #include @@ -18,21 +17,21 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(NULL, sizeof(testPathExtension), &pszExt); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with pszPath = NULL. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA unexpectedly succeeded with pszPath = NULL. result: 0x%08"PRIX32"\n", hr); return -1; } hr = PathCchFindExtensionA(testPathExtension, 0, &pszExt); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with cchPath = 0. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA unexpectedly succeeded with cchPath = 0. result: 0x%08"PRIX32"\n", hr); return -1; } hr = PathCchFindExtensionA(testPathExtension, sizeof(testPathExtension), NULL); if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with ppszExt = NULL. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA unexpectedly succeeded with ppszExt = NULL. result: 0x%08"PRIX32"\n", hr); return -1; } @@ -42,7 +41,7 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA("c:\\45.789", 9, &pszExt); /* nb: correct would be 10 */ if (SUCCEEDED(hr)) { - printf("PathCchFindExtensionA unexpectedly succeeded with unterminated pszPath. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA unexpectedly succeeded with unterminated pszPath. result: 0x%08"PRIX32"\n", hr); return -1; } @@ -54,7 +53,7 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(pszTmp, 1, &pszExt); if (hr != S_OK) { - printf("PathCchFindExtensionA failed with an empty terminated string. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA failed with an empty terminated string. result: 0x%08"PRIX32"\n", hr); return -1; } /* pszExt must point to the strings terminating 0 now */ @@ -72,7 +71,7 @@ int TestPathCchFindExtension(int argc, char* argv[]) hr = PathCchFindExtensionA(pszTmp, 10, &pszExt); if (hr != S_OK) { - printf("PathCchFindExtensionA failed with a directory path. result: 0x%08X\n", (ULONG)hr); + printf("PathCchFindExtensionA failed with a directory path. result: 0x%08"PRIX32"\n", hr); return -1; } /* The extension must not have been found and pszExt must point to the diff --git a/winpr/libwinpr/path/test/TestPathCchStripPrefix.c b/winpr/libwinpr/path/test/TestPathCchStripPrefix.c index 080bf9df7..57c14987d 100644 --- a/winpr/libwinpr/path/test/TestPathCchStripPrefix.c +++ b/winpr/libwinpr/path/test/TestPathCchStripPrefix.c @@ -37,7 +37,7 @@ int TestPathCchStripPrefix(int argc, char* argv[]) if (status != S_OK) { - _tprintf(_T("PathCchStripPrefix status: 0x%08X\n"), status); + _tprintf(_T("PathCchStripPrefix status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -55,7 +55,7 @@ int TestPathCchStripPrefix(int argc, char* argv[]) if (status != S_FALSE) { - _tprintf(_T("PathCchStripPrefix status: 0x%08X\n"), status); + _tprintf(_T("PathCchStripPrefix status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -69,7 +69,7 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(NULL, PATHCCH_MAX_CCH); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchStripPrefix with null path unexpectedly succeeded with status 0x%08X\n"), status); + _tprintf(_T("PathCchStripPrefix with null path unexpectedly succeeded with status 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -82,7 +82,7 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(Path, i); if (status != E_INVALIDARG) { - _tprintf(_T("PathCchStripPrefix with invalid cchPath value %d unexpectedly succeeded with status 0x%08X\n"), i, status); + _tprintf(_T("PathCchStripPrefix with invalid cchPath value %d unexpectedly succeeded with status 0x%08")_T(PRIX32)_T("\n"), i, status); return -1; } } @@ -94,7 +94,7 @@ int TestPathCchStripPrefix(int argc, char* argv[]) status = PathCchStripPrefix(Path, i); if (status != S_OK) { - _tprintf(_T("PathCchStripPrefix with minimum valid strippable path length unexpectedly returned status 0x%08X\n"), status); + _tprintf(_T("PathCchStripPrefix with minimum valid strippable path length unexpectedly returned status 0x%08")_T(PRIX32)_T("\n"), status); return -1; } if (_tcscmp(Path, testPathNoPrefixFileNamespaceMinimum)) diff --git a/winpr/libwinpr/path/test/TestPathIsUNCEx.c b/winpr/libwinpr/path/test/TestPathIsUNCEx.c index 027026909..20688f32b 100644 --- a/winpr/libwinpr/path/test/TestPathIsUNCEx.c +++ b/winpr/libwinpr/path/test/TestPathIsUNCEx.c @@ -23,7 +23,7 @@ int TestPathIsUNCEx(int argc, char* argv[]) if (!status) { - _tprintf(_T("PathIsUNCEx status: 0x%08X\n"), status); + _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } @@ -41,7 +41,7 @@ int TestPathIsUNCEx(int argc, char* argv[]) if (status) { - _tprintf(_T("PathIsUNCEx status: 0x%08X\n"), status); + _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c index 399c2d4ca..799ae94ea 100644 --- a/winpr/libwinpr/pipe/pipe.c +++ b/winpr/libwinpr/pipe/pipe.c @@ -522,7 +522,7 @@ static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe) assert(pNamedPipe->name); assert(g_NamedPipeServerSockets); - //WLog_VRB(TAG, "%p (%s)", pNamedPipe, pNamedPipe->name); + //WLog_VRB(TAG, "%p (%s)", (void*) pNamedPipe, pNamedPipe->name); ArrayList_Lock(g_NamedPipeServerSockets); for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++) @@ -615,7 +615,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD if (!strcmp(baseSocket->name, lpName)) { serverfd = baseSocket->serverfd; - //WLog_DBG(TAG, "using shared socked resource for pipe %p (%s)", pNamedPipe, lpName); + //WLog_DBG(TAG, "using shared socked resource for pipe %p (%s)", (void*) pNamedPipe, lpName); break; } } @@ -685,7 +685,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD free(baseSocket->name); goto out; } - //WLog_DBG(TAG, "created shared socked resource for pipe %p (%s). base serverfd = %d", pNamedPipe, lpName, serverfd); + //WLog_DBG(TAG, "created shared socked resource for pipe %p (%s). base serverfd = %d", (void*) pNamedPipe, lpName, serverfd); } pNamedPipe->serverfd = dup(baseSocket->serverfd); diff --git a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c index 4595784bd..27b78cbe8 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipe.c @@ -76,7 +76,7 @@ static void* named_pipe_client_thread(void* arg) goto out; } - printf("Client ReadFile: %u bytes\n", lpNumberOfBytesRead); + printf("Client ReadFile: %"PRIu32" bytes\n", lpNumberOfBytesRead); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, lpNumberOfBytesRead); fSuccess = TRUE; out: @@ -157,7 +157,7 @@ static void* named_pipe_server_thread(void* arg) goto out; } - printf("Server ReadFile: %u bytes\n", lpNumberOfBytesRead); + printf("Server ReadFile: %"PRIu32" bytes\n", lpNumberOfBytesRead); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, lpNumberOfBytesRead); lpNumberOfBytesWritten = 0; nNumberOfBytesToWrite = PIPE_BUFFER_SIZE; @@ -272,7 +272,7 @@ static void* named_pipe_single_thread(void* arg) if (!fConnected) { - printf("%s: ConnectNamedPipe #%d failed. (%u)\n", __FUNCTION__, i, GetLastError()); + printf("%s: ConnectNamedPipe #%d failed. (%"PRIu32")\n", __FUNCTION__, i, GetLastError()); goto out; } } @@ -462,22 +462,22 @@ int TestPipeCreateNamedPipe(int argc, char* argv[]) #endif if (!(ReadyEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failure: (%d)\n", GetLastError()); + printf("CreateEvent failure: (%"PRIu32")\n", GetLastError()); return -1; } if (!(SingleThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_single_thread, NULL, 0, NULL))) { - printf("CreateThread (SingleThread) failure: (%d)\n", GetLastError()); + printf("CreateThread (SingleThread) failure: (%"PRIu32")\n", GetLastError()); return -1; } if (!(ClientThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_client_thread, NULL, 0, NULL))) { - printf("CreateThread (ClientThread) failure: (%d)\n", GetLastError()); + printf("CreateThread (ClientThread) failure: (%"PRIu32")\n", GetLastError()); return -1; } if (!(ServerThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_server_thread, NULL, 0, NULL))) { - printf("CreateThread (ServerThread) failure: (%d)\n", GetLastError()); + printf("CreateThread (ServerThread) failure: (%"PRIu32")\n", GetLastError()); return -1; } WaitForSingleObject(SingleThread, INFINITE); diff --git a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c index 80898c936..3bae9d119 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreateNamedPipeOverlapped.c @@ -38,7 +38,7 @@ static void* named_pipe_client_thread(void* arg) status = WaitForSingleObject(serverReadyEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for server ready event: %u\n", status); + printf("client: failed to wait for server ready event: %"PRIu32"\n", status); goto finish; } @@ -48,7 +48,7 @@ static void* named_pipe_client_thread(void* arg) ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("client: CreateEvent failure: %u\n", GetLastError()); + printf("client: CreateEvent failure: %"PRIu32"\n", GetLastError()); goto finish; } overlapped.hEvent = hEvent; @@ -61,7 +61,7 @@ static void* named_pipe_client_thread(void* arg) if (hNamedPipe == INVALID_HANDLE_VALUE) { - printf("client: Named Pipe CreateFile failure: %u\n", GetLastError()); + printf("client: Named Pipe CreateFile failure: %"PRIu32"\n", GetLastError()); goto finish; } @@ -78,24 +78,24 @@ static void* named_pipe_client_thread(void* arg) if (!fSuccess) { - printf("client: NamedPipe WriteFile failure (initial): %u\n", GetLastError()); + printf("client: NamedPipe WriteFile failure (initial): %"PRIu32"\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for overlapped event (write): %u\n", status); + printf("client: failed to wait for overlapped event (write): %"PRIu32"\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("client: NamedPipe WriteFile failure (final): %u\n", GetLastError()); + printf("client: NamedPipe WriteFile failure (final): %"PRIu32"\n", GetLastError()); goto finish; } - printf("client: WriteFile transferred %u bytes:\n", NumberOfBytesTransferred); + printf("client: WriteFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); /* 4: read from named pipe */ @@ -116,25 +116,25 @@ static void* named_pipe_client_thread(void* arg) if (!fSuccess) { - printf("client: NamedPipe ReadFile failure (initial): %u\n", GetLastError()); + printf("client: NamedPipe ReadFile failure (initial): %"PRIu32"\n", GetLastError()); goto finish; } status = WaitForMultipleObjects(1, &hEvent, FALSE, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("client: failed to wait for overlapped event (read): %u\n", status); + printf("client: failed to wait for overlapped event (read): %"PRIu32"\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, TRUE); if (!fSuccess) { - printf("client: NamedPipe ReadFile failure (final): %u\n", GetLastError()); + printf("client: NamedPipe ReadFile failure (final): %"PRIu32"\n", GetLastError()); goto finish; } - printf("client: ReadFile transferred %u bytes:\n", NumberOfBytesTransferred); + printf("client: ReadFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, NumberOfBytesTransferred); if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || memcmp(lpReadBuffer, SERVER_MESSAGE, PIPE_BUFFER_SIZE)) @@ -174,7 +174,7 @@ static void* named_pipe_server_thread(void* arg) ZeroMemory(&overlapped, sizeof(OVERLAPPED)); if (!(hEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("server: CreateEvent failure: %u\n", GetLastError()); + printf("server: CreateEvent failure: %"PRIu32"\n", GetLastError()); SetEvent(serverReadyEvent); /* unblock client thread */ goto finish; } @@ -189,7 +189,7 @@ static void* named_pipe_server_thread(void* arg) if (hNamedPipe == INVALID_HANDLE_VALUE) { - printf("server: CreateNamedPipe failure: %u\n", GetLastError()); + printf("server: CreateNamedPipe failure: %"PRIu32"\n", GetLastError()); SetEvent(serverReadyEvent); /* unblock client thread */ goto finish; } @@ -223,7 +223,7 @@ static void* named_pipe_server_thread(void* arg) if (!fConnected) fConnected = (status == ERROR_PIPE_CONNECTED); - printf("server: ConnectNamedPipe status: %u\n", status); + printf("server: ConnectNamedPipe status: %"PRIu32"\n", status); if (!fConnected && status == ERROR_IO_PENDING) { @@ -233,12 +233,12 @@ static void* named_pipe_server_thread(void* arg) if (status == WAIT_OBJECT_0) fConnected = GetOverlappedResult(hNamedPipe, &overlapped, &dwDummy, FALSE); else - printf("server: failed to wait for overlapped event (connect): %u\n", status); + printf("server: failed to wait for overlapped event (connect): %"PRIu32"\n", status); } if (!fConnected) { - printf("server: ConnectNamedPipe failed: %u\n", status); + printf("server: ConnectNamedPipe failed: %"PRIu32"\n", status); goto finish; } @@ -263,25 +263,25 @@ static void* named_pipe_server_thread(void* arg) if (!fSuccess) { - printf("server: NamedPipe ReadFile failure (initial): %u\n", GetLastError()); + printf("server: NamedPipe ReadFile failure (initial): %"PRIu32"\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("server: failed to wait for overlapped event (read): %u\n", status); + printf("server: failed to wait for overlapped event (read): %"PRIu32"\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("server: NamedPipe ReadFile failure (final): %u\n", GetLastError()); + printf("server: NamedPipe ReadFile failure (final): %"PRIu32"\n", GetLastError()); goto finish; } - printf("server: ReadFile transferred %u bytes:\n", NumberOfBytesTransferred); + printf("server: ReadFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); winpr_HexDump("pipe.test", WLOG_DEBUG, lpReadBuffer, NumberOfBytesTransferred); if (NumberOfBytesTransferred != PIPE_BUFFER_SIZE || memcmp(lpReadBuffer, CLIENT_MESSAGE, PIPE_BUFFER_SIZE)) @@ -303,25 +303,25 @@ static void* named_pipe_server_thread(void* arg) if (!fSuccess) { - printf("server: NamedPipe WriteFile failure (initial): %u\n", GetLastError()); + printf("server: NamedPipe WriteFile failure (initial): %"PRIu32"\n", GetLastError()); goto finish; } status = WaitForSingleObject(hEvent, PIPE_TIMEOUT_MS); if (status != WAIT_OBJECT_0) { - printf("server: failed to wait for overlapped event (write): %u\n", status); + printf("server: failed to wait for overlapped event (write): %"PRIu32"\n", status); goto finish; } fSuccess = GetOverlappedResult(hNamedPipe, &overlapped, &NumberOfBytesTransferred, FALSE); if (!fSuccess) { - printf("server: NamedPipe WriteFile failure (final): %u\n", GetLastError()); + printf("server: NamedPipe WriteFile failure (final): %"PRIu32"\n", GetLastError()); goto finish; } - printf("server: WriteFile transferred %u bytes:\n", NumberOfBytesTransferred); + printf("server: WriteFile transferred %"PRIu32" bytes:\n", NumberOfBytesTransferred); //winpr_HexDump("pipe.test", WLOG_DEBUG, lpWriteBuffer, NumberOfBytesTransferred); bServerSuccess = TRUE; @@ -345,29 +345,29 @@ int TestPipeCreateNamedPipeOverlapped(int argc, char* argv[]) if (!(serverReadyEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("CreateEvent failed: %d\n", GetLastError()); + printf("CreateEvent failed: %"PRIu32"\n", GetLastError()); goto out; } if (!(ClientThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_client_thread, NULL, 0, NULL))) { - printf("CreateThread (client) failed: %d\n", GetLastError()); + printf("CreateThread (client) failed: %"PRIu32"\n", GetLastError()); goto out; } if (!(ServerThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) named_pipe_server_thread, NULL, 0, NULL))) { - printf("CreateThread (server) failed: %d\n", GetLastError()); + printf("CreateThread (server) failed: %"PRIu32"\n", GetLastError()); goto out; } if (WAIT_OBJECT_0 != WaitForSingleObject(ClientThread, INFINITE)) { - printf("%s: Failed to wait for client thread: %u\n", + printf("%s: Failed to wait for client thread: %"PRIu32"\n", __FUNCTION__, GetLastError()); goto out; } if (WAIT_OBJECT_0 != WaitForSingleObject(ServerThread, INFINITE)) { - printf("%s: Failed to wait for server thread: %u\n", + printf("%s: Failed to wait for server thread: %"PRIu32"\n", __FUNCTION__, GetLastError()); goto out; } diff --git a/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c index e464977d6..91af3e85a 100644 --- a/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c +++ b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c @@ -36,8 +36,8 @@ int TestPipeCreatePipe(int argc, char* argv[]) if (dwWrite != sizeof(writeBuffer)) { - _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %d, Expected: %d\n"), - dwWrite, (int) sizeof(writeBuffer)); + _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %")_T(PRIu32)_T(", Expected: %")_T(PRIuz)_T("\n"), + dwWrite, sizeof(writeBuffer)); return -1; } @@ -52,8 +52,8 @@ int TestPipeCreatePipe(int argc, char* argv[]) if (dwRead != sizeof(readBuffer)) { - _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %d, Expected: %d\n"), - dwWrite, (int) sizeof(readBuffer)); + _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %")_T(PRIu32)_T(", Expected: %")_T(PRIuz)_T("\n"), + dwWrite, sizeof(readBuffer)); return -1; } diff --git a/winpr/libwinpr/pool/test/TestPoolWork.c b/winpr/libwinpr/pool/test/TestPoolWork.c index 67c80da89..fee583333 100644 --- a/winpr/libwinpr/pool/test/TestPoolWork.c +++ b/winpr/libwinpr/pool/test/TestPoolWork.c @@ -12,7 +12,7 @@ void CALLBACK test_WorkCallback(PTP_CALLBACK_INSTANCE instance, void* context, P BYTE b[1024]; BYTE c[1024]; - printf("Hello %s: %3d (thread: 0x%08X)\n", (char*) context, + printf("Hello %s: %03"PRId32" (thread: 0x%08"PRIX32")\n", (char*) context, InterlockedIncrement(&count), GetCurrentThreadId()); for (index = 0; index < 100; index++) diff --git a/winpr/libwinpr/pool/timer.c b/winpr/libwinpr/pool/timer.c index fb4287af5..6e874ca9e 100644 --- a/winpr/libwinpr/pool/timer.c +++ b/winpr/libwinpr/pool/timer.c @@ -51,4 +51,4 @@ VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCal } -#endif \ No newline at end of file +#endif diff --git a/winpr/libwinpr/registry/registry_reg.c b/winpr/libwinpr/registry/registry_reg.c index 3b4e00b28..afc6739f6 100644 --- a/winpr/libwinpr/registry/registry_reg.c +++ b/winpr/libwinpr/registry/registry_reg.c @@ -444,7 +444,7 @@ void reg_print_value(Reg* reg, RegVal* value) if (value->type == REG_DWORD) { - WLog_INFO(TAG, "dword:%08X", (int) value->data.dword); + WLog_INFO(TAG, "dword:%08"PRIX32"", value->data.dword); } else if (value->type == REG_SZ) { diff --git a/winpr/libwinpr/rpc/ndr.c b/winpr/libwinpr/rpc/ndr.c index 5df4e579a..f68c8c234 100644 --- a/winpr/libwinpr/rpc/ndr.c +++ b/winpr/libwinpr/rpc/ndr.c @@ -172,7 +172,7 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P #endif type = (params[i].Attributes.IsBasetype) ? params[i].Type.FormatChar : *fmt; - WLog_INFO(TAG, "'\t#%d\ttype %s (0x%02X) ", i, FC_TYPE_STRINGS[type], type); + WLog_INFO(TAG, "'\t#%u\ttype %s (0x%02X) ", i, FC_TYPE_STRINGS[type], type); NdrPrintParamAttributes(params[i].Attributes); if (params[i].Attributes.IsIn) @@ -267,9 +267,9 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING /* The Header: http://msdn.microsoft.com/en-us/library/windows/desktop/aa378707/ */ /* Procedure Header Descriptor: http://msdn.microsoft.com/en-us/library/windows/desktop/aa374387/ */ /* Handles: http://msdn.microsoft.com/en-us/library/windows/desktop/aa373932/ */ - WLog_DBG(TAG, "Oi Header: HandleType: 0x%02X OiFlags: 0x%02X ProcNum: %d StackSize: 0x%04X", + WLog_DBG(TAG, "Oi Header: HandleType: 0x%02X OiFlags: 0x%02X ProcNum: %hu StackSize: 0x%04X", handleType, *((unsigned char*) &flags), - (unsigned short) procNum, (unsigned short) stackSize); + procNum, stackSize); if (handleType > 0) { @@ -288,9 +288,9 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING optFlags = oi2ProcHeader->Oi2Flags; numberParams = oi2ProcHeader->NumberParams; - WLog_DBG(TAG, "Oi2 Header: Oi2Flags: 0x%02X, NumberParams: %d ClientBufferSize: %d ServerBufferSize: %d", + WLog_DBG(TAG, "Oi2 Header: Oi2Flags: 0x%02X, NumberParams: %u ClientBufferSize: %hu ServerBufferSize: %hu", *((unsigned char*) &optFlags), - (unsigned char) numberParams, + numberParams, oi2ProcHeader->ClientBufferSize, oi2ProcHeader->ServerBufferSize); WLog_INFO(TAG, "Oi2Flags: "); @@ -303,7 +303,7 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING NDR_PROC_HEADER_EXTS* extensions = (NDR_PROC_HEADER_EXTS*) pFormat; pFormat += extensions->Size; extFlags = extensions->Flags2; - WLog_DBG(TAG, "Extensions: Size: %d, flags2: 0x%02X", + WLog_DBG(TAG, "Extensions: Size: %hhu, flags2: 0x%02X", extensions->Size, *((unsigned char*) &extensions->Flags2)); #ifdef __x86_64__ @@ -334,7 +334,7 @@ CLIENT_CALL_RETURN NdrClientCall(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING stubMsg.StackTop = (unsigned char*) stackTop; NdrProcessParams(&stubMsg, pFormat, NDR_PHASE_SIZE, fpuStack, numberParams); - WLog_DBG(TAG, "stubMsg BufferLength: %d", (int) stubMsg.BufferLength); + WLog_DBG(TAG, "stubMsg BufferLength: %"PRIu32"", stubMsg.BufferLength); return client_call_return; } diff --git a/winpr/libwinpr/smartcard/smartcard_inspect.c b/winpr/libwinpr/smartcard/smartcard_inspect.c index 9b872f11c..7fa838843 100644 --- a/winpr/libwinpr/smartcard/smartcard_inspect.c +++ b/winpr/libwinpr/smartcard/smartcard_inspect.c @@ -43,12 +43,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardEstablishContext(DWORD dwScope, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext { dwScope: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext { dwScope: %s (0x%08"PRIX32")", SCardGetScopeString(dwScope), dwScope); status = g_SCardApi->pfnSCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardEstablishContext } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -58,11 +58,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardReleaseContext(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardReleaseContext(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardReleaseContext } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -72,11 +72,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIsValidContext(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIsValidContext(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIsValidContext } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -87,11 +87,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReaderGroupsA(hContext, mszGroups, pcchGroups); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -102,11 +102,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReaderGroupsW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReaderGroupsW(hContext, mszGroups, pcchGroups); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReaderGroupsW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -117,11 +117,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReadersA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReadersA(hContext, mszGroups, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -132,11 +132,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReadersW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReadersW(hContext, mszGroups, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -147,12 +147,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListCardsA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListCardsA(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -163,12 +163,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListCardsW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListCardsW(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListCardsW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -179,11 +179,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListInterfacesA(hContext, szCard, pguidInterfaces, pcguidInterfaces); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -194,11 +194,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListInterfacesW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListInterfacesW(hContext, szCard, pguidInterfaces, pcguidInterfaces); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListInterfacesW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -209,11 +209,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetProviderIdA(hContext, szCard, pguidProviderId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -224,11 +224,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetProviderIdW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetProviderIdW(hContext, szCard, pguidProviderId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetProviderIdW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -239,12 +239,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetCardTypeProviderNameA(SCARDCONTEXT hCont { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetCardTypeProviderNameA(hContext, szCardName, dwProviderId, szProvider, pcchProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -255,12 +255,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetCardTypeProviderNameW(SCARDCONTEXT hCont { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetCardTypeProviderNameW(hContext, szCardName, dwProviderId, szProvider, pcchProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetCardTypeProviderNameW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -270,11 +270,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupA(SCARDCONTEXT hContext { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceReaderGroupA(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -284,11 +284,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderGroupW(SCARDCONTEXT hContext { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceReaderGroupW(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderGroupW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -298,11 +298,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderGroupA(SCARDCONTEXT hContext, L { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetReaderGroupA(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -312,11 +312,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderGroupW(SCARDCONTEXT hContext, L { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetReaderGroupW(hContext, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderGroupW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -327,11 +327,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceReaderA(hContext, szReaderName, szDeviceName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -342,11 +342,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceReaderW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceReaderW(hContext, szReaderName, szDeviceName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceReaderW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -356,11 +356,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetReaderA(hContext, szReaderName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -370,11 +370,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetReaderW(SCARDCONTEXT hContext, LPCWST { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetReaderW(hContext, szReaderName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetReaderW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -385,11 +385,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardAddReaderToGroupA(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -400,11 +400,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardAddReaderToGroupW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardAddReaderToGroupW(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardAddReaderToGroupW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -415,11 +415,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardRemoveReaderFromGroupA(SCARDCONTEXT hContex { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardRemoveReaderFromGroupA(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -430,11 +430,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardRemoveReaderFromGroupW(SCARDCONTEXT hContex { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardRemoveReaderFromGroupW(hContext, szReaderName, szGroupName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardRemoveReaderFromGroupW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -446,12 +446,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceCardTypeA(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -463,12 +463,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardIntroduceCardTypeW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardIntroduceCardTypeW(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardIntroduceCardTypeW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -479,11 +479,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardSetCardTypeProviderNameA(SCARDCONTEXT hCont { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardSetCardTypeProviderNameA(hContext, szCardName, dwProviderId, szProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -494,11 +494,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardSetCardTypeProviderNameW(SCARDCONTEXT hCont { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardSetCardTypeProviderNameW(hContext, szCardName, dwProviderId, szProvider); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetCardTypeProviderNameW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -508,11 +508,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCS { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetCardTypeA(hContext, szCardName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -522,11 +522,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCW { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardForgetCardTypeW(hContext, szCardName); - WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardForgetCardTypeW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -536,11 +536,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID p { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardFreeMemory(hContext, pvMem); - WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardFreeMemory } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -573,11 +573,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardLocateCardsA(hContext, mszCards, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -588,11 +588,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardLocateCardsW(hContext, mszCards, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -603,11 +603,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsByATRA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardLocateCardsByATRA(hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -618,11 +618,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardLocateCardsByATRW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardLocateCardsByATRW(hContext, rgAtrMasks, cAtrs, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardLocateCardsByATRW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -633,11 +633,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetStatusChangeA(hContext, dwTimeout, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -648,11 +648,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetStatusChangeW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetStatusChangeW(hContext, dwTimeout, rgReaderStates, cReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetStatusChangeW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -662,11 +662,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardCancel(SCARDCONTEXT hContext) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardCancel(hContext); - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancel } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -678,12 +678,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardConnectA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardConnectA(hContext, szReader, dwShareMode, dwPreferredProtocols, phCard, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -695,12 +695,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardConnectW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardConnectW(hContext, szReader, dwShareMode, dwPreferredProtocols, phCard, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardConnectW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -711,12 +711,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardReconnect(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardReconnect(hCard, dwShareMode, dwPreferredProtocols, dwInitialization, pdwActiveProtocol); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardReconnect } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -726,11 +726,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardDisconnect(SCARDHANDLE hCard, DWORD dwDispo { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardDisconnect(hCard, dwDisposition); - WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardDisconnect } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -740,11 +740,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardBeginTransaction(SCARDHANDLE hCard) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardBeginTransaction(hCard); - WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardBeginTransaction } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -754,11 +754,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardEndTransaction(SCARDHANDLE hCard, DWORD dwD { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardEndTransaction(hCard, dwDisposition); - WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardEndTransaction } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -768,11 +768,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardCancelTransaction(SCARDHANDLE hCard) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardCancelTransaction(hCard); - WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardCancelTransaction } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -783,11 +783,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardState(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardState { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardState { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardState(hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardState } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardState } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -799,12 +799,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardStatusA(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardStatusA(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -816,12 +816,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardStatusW(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardStatusW(hCard, mszReaderNames, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardStatusW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -833,12 +833,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardTransmit(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, pioRecvPci, pbRecvBuffer, pcbRecvLength); - WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardTransmit } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -848,11 +848,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetTransmitCount(SCARDHANDLE hCard, LPDWORD { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardGetTransmitCount(hCard, pcTransmitCount); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetTransmitCount } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -864,12 +864,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardControl(SCARDHANDLE hCard, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardControl { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardControl { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardControl(hCard, dwControlCode, lpInBuffer, cbInBufferSize, lpOutBuffer, cbOutBufferSize, lpBytesReturned); - WLog_Print(g_Log, WLOG_DEBUG, "SCardControl } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardControl } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -879,11 +879,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardGetAttrib(hCard, dwAttrId, pbAttr, pcbAttrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetAttrib } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -893,11 +893,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib { hCard: %p", hCard); + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib { hCard: %p", (void*) hCard); status = g_SCardApi->pfnSCardSetAttrib(hCard, dwAttrId, pbAttr, cbAttrLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardSetAttrib } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -911,7 +911,7 @@ WINSCARDAPI LONG WINAPI Inspect_SCardUIDlgSelectCardA(LPOPENCARDNAMEA_EX pDlgStr status = g_SCardApi->pfnSCardUIDlgSelectCardA(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -925,7 +925,7 @@ WINSCARDAPI LONG WINAPI Inspect_SCardUIDlgSelectCardW(LPOPENCARDNAMEW_EX pDlgStr status = g_SCardApi->pfnSCardUIDlgSelectCardW(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardUIDlgSelectCardW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -939,7 +939,7 @@ WINSCARDAPI LONG WINAPI Inspect_GetOpenCardNameA(LPOPENCARDNAMEA pDlgStruc) status = g_SCardApi->pfnGetOpenCardNameA(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -953,7 +953,7 @@ WINSCARDAPI LONG WINAPI Inspect_GetOpenCardNameW(LPOPENCARDNAMEW pDlgStruc) status = g_SCardApi->pfnGetOpenCardNameW(pDlgStruc); - WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "GetOpenCardNameW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -967,7 +967,7 @@ WINSCARDAPI LONG WINAPI Inspect_SCardDlgExtendedError(void) status = g_SCardApi->pfnSCardDlgExtendedError(); - WLog_Print(g_Log, WLOG_DEBUG, "SCardDlgExtendedError } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardDlgExtendedError } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -978,12 +978,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardReadCacheA(hContext, CardIdentifier, FreshnessCounter, LookupName, Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -994,12 +994,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardReadCacheW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardReadCacheW(hContext, CardIdentifier, FreshnessCounter, LookupName, Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardReadCacheW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1010,12 +1010,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardWriteCacheA(hContext, CardIdentifier, FreshnessCounter, LookupName, Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1026,12 +1026,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardWriteCacheW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardWriteCacheW(hContext, CardIdentifier, FreshnessCounter, LookupName, Data, DataLen); - WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardWriteCacheW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1042,11 +1042,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconA(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetReaderIconA(hContext, szReaderName, pbIcon, pcbIcon); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1057,11 +1057,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderIconW(SCARDCONTEXT hContext, { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetReaderIconW(hContext, szReaderName, pbIcon, pcbIcon); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderIconW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1071,11 +1071,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdA(SCARDCONTEXT hContext, LPC { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetDeviceTypeIdA(hContext, szReaderName, pdwDeviceTypeId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1085,11 +1085,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetDeviceTypeIdW(SCARDCONTEXT hContext, LPC { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetDeviceTypeIdW(hContext, szReaderName, pdwDeviceTypeId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetDeviceTypeIdW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1100,12 +1100,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdA(SCARDCONTEXT hCo { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdA(hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1116,12 +1116,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hCo { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardGetReaderDeviceInstanceIdW(hContext, szReaderName, szDeviceInstanceId, pcchDeviceInstanceId); - WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardGetReaderDeviceInstanceIdW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1132,12 +1132,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdA(SCARDCONTE { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdA(hContext, szDeviceInstanceId, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdA } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1148,12 +1148,12 @@ WINSCARDAPI LONG WINAPI Inspect_SCardListReadersWithDeviceInstanceIdW(SCARDCONTE { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardListReadersWithDeviceInstanceIdW(hContext, szDeviceInstanceId, mszReaders, pcchReaders); - WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardListReadersWithDeviceInstanceIdW } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; @@ -1163,11 +1163,11 @@ WINSCARDAPI LONG WINAPI Inspect_SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent) { LONG status; - WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit { hContext: %p", hContext); + WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit { hContext: %p", (void*) hContext); status = g_SCardApi->pfnSCardAudit(hContext, dwEvent); - WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit } status: %s (0x%08X)", + WLog_Print(g_Log, WLOG_DEBUG, "SCardAudit } status: %s (0x%08"PRIX32")", SCardGetErrorString(status), status); return status; diff --git a/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c b/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c index fde44b5b4..1b0cb2a3a 100644 --- a/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c +++ b/winpr/libwinpr/smartcard/test/TestSmartCardListReaders.c @@ -14,8 +14,8 @@ int TestSmartCardListReaders(int argc, char* argv[]) if (lStatus != SCARD_S_SUCCESS) { - printf("SCardEstablishContext failure: %s (0x%08X)\n", - SCardGetErrorString(lStatus), (int) lStatus); + printf("SCardEstablishContext failure: %s (0x%08"PRIX32")\n", + SCardGetErrorString(lStatus), lStatus); return 0; } diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.c b/winpr/libwinpr/sspi/NTLM/ntlm.c index 90ee89c40..83ce83dad 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm.c @@ -969,7 +969,7 @@ SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, #ifdef WITH_DEBUG_NTLM WLog_DBG(TAG, "Data Buffer (length = %d)", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); - WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", (int) 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); #endif free(data); @@ -982,7 +982,7 @@ SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, Data_Write_UINT32(&signature[12], SeqNo); context->SendSeqNum++; #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "Signature (length = %d)", (int) signature_buffer->cbBuffer); + WLog_DBG(TAG, "Signature (length = %"PRIu32")", signature_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, signature_buffer->pvBuffer, signature_buffer->cbBuffer); #endif return SEC_E_OK; @@ -1055,7 +1055,7 @@ SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSecBufferD #ifdef WITH_DEBUG_NTLM WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", length); winpr_HexDump(TAG, WLOG_DEBUG, data, length); - WLog_DBG(TAG, "Data Buffer (length = %d)", (int) data_buffer->cbBuffer); + WLog_DBG(TAG, "Data Buffer (length = %"PRIu32")", data_buffer->cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer); #endif free(data); diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c index 48c9b65c6..c35179c4a 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c @@ -89,7 +89,7 @@ void ntlm_print_av_pair_list(NTLM_AV_PAIR* pAvPairList) while (ntlm_av_pair_get_id(pAvPair) != MsvAvEOL) { - WLog_INFO(TAG, "\t%s AvId: %d AvLen: %d", + WLog_INFO(TAG, "\t%s AvId: %"PRIu16" AvLen: %"PRIu16"", AV_PAIR_STRINGS[ntlm_av_pair_get_id(pAvPair)], ntlm_av_pair_get_id(pAvPair), ntlm_av_pair_get_len(pAvPair)); diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c index 4f492c1f6..e8b570b13 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c @@ -107,12 +107,12 @@ void ntlm_write_version_info(wStream* s, NTLM_VERSION_INFO* versionInfo) void ntlm_print_version_info(NTLM_VERSION_INFO* versionInfo) { WLog_INFO(TAG, "VERSION ={"); - WLog_INFO(TAG, "\tProductMajorVersion: %d", versionInfo->ProductMajorVersion); - WLog_INFO(TAG, "\tProductMinorVersion: %d", versionInfo->ProductMinorVersion); - WLog_INFO(TAG, "\tProductBuild: %d", versionInfo->ProductBuild); - WLog_INFO(TAG, "\tReserved: 0x%02X%02X%02X", versionInfo->Reserved[0], + WLog_INFO(TAG, "\tProductMajorVersion: %"PRIu8"", versionInfo->ProductMajorVersion); + WLog_INFO(TAG, "\tProductMinorVersion: %"PRIu8"", versionInfo->ProductMinorVersion); + WLog_INFO(TAG, "\tProductBuild: %"PRIu16"", versionInfo->ProductBuild); + WLog_INFO(TAG, "\tReserved: 0x%02"PRIX8"%02"PRIX8"%02"PRIX8"", versionInfo->Reserved[0], versionInfo->Reserved[1], versionInfo->Reserved[2]); - WLog_INFO(TAG, "\tNTLMRevisionCurrent: 0x%02X", versionInfo->NTLMRevisionCurrent); + WLog_INFO(TAG, "\tNTLMRevisionCurrent: 0x%02"PRIX8"", versionInfo->NTLMRevisionCurrent); } int ntlm_read_ntlm_v2_client_challenge(wStream* s, NTLMv2_CLIENT_CHALLENGE* challenge) @@ -378,13 +378,13 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context) return -1; #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "Password (length = %d)", credentials->identity.PasswordLength * 2); + WLog_DBG(TAG, "Password (length = %"PRIu32")", credentials->identity.PasswordLength * 2); winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Password, credentials->identity.PasswordLength * 2); - WLog_DBG(TAG, "Username (length = %d)", credentials->identity.UserLength * 2); + WLog_DBG(TAG, "Username (length = %"PRIu32")", credentials->identity.UserLength * 2); winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.User, credentials->identity.UserLength * 2); - WLog_DBG(TAG, "Domain (length = %d)", credentials->identity.DomainLength * 2); + WLog_DBG(TAG, "Domain (length = %"PRIu32")", credentials->identity.DomainLength * 2); winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Domain, credentials->identity.DomainLength * 2); - WLog_DBG(TAG, "Workstation (length = %d)", context->Workstation.Length); + WLog_DBG(TAG, "Workstation (length = %"PRIu16")", context->Workstation.Length); winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) context->Workstation.Buffer, context->Workstation.Length); WLog_DBG(TAG, "NTOWFv2, NTLMv2 Hash"); winpr_HexDump(TAG, WLOG_DEBUG, context->NtlmV2Hash, WINPR_MD5_DIGEST_LENGTH); diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_message.c b/winpr/libwinpr/sspi/NTLM/ntlm_message.c index 61363e8d6..637ebe9b1 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_message.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_message.c @@ -78,7 +78,7 @@ void ntlm_print_negotiate_flags(UINT32 flags) { int i; const char* str; - WLog_INFO(TAG, "negotiateFlags \"0x%08X\"", flags); + WLog_INFO(TAG, "negotiateFlags \"0x%08"PRIX32"\"", flags); for (i = 31; i >= 0; i--) { @@ -182,7 +182,7 @@ void ntlm_free_message_fields_buffer(NTLM_MESSAGE_FIELDS* fields) void ntlm_print_message_fields(NTLM_MESSAGE_FIELDS* fields, const char* name) { - WLog_DBG(TAG, "%s (Len: %d MaxLen: %d BufferOffset: %d)", + WLog_DBG(TAG, "%s (Len: %"PRIu16" MaxLen: %"PRIu16" BufferOffset: %"PRIu32")", name, fields->Len, fields->MaxLen, fields->BufferOffset); if (fields->Len > 0) @@ -244,7 +244,7 @@ SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buf CopyMemory(context->NegotiateMessage.pvBuffer, buffer->pvBuffer, buffer->cbBuffer); context->NegotiateMessage.BufferType = buffer->BufferType; #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %d)", (int) context->NegotiateMessage.cbBuffer); + WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %"PRIu32")", context->NegotiateMessage.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer); ntlm_print_negotiate_flags(message->NegotiateFlags); @@ -431,7 +431,7 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf if (context->ChallengeTargetInfo.cbBuffer > 0) { - WLog_DBG(TAG, "ChallengeTargetInfo (%d):", (int) context->ChallengeTargetInfo.cbBuffer); + WLog_DBG(TAG, "ChallengeTargetInfo (%"PRIu32"):", context->ChallengeTargetInfo.cbBuffer); ntlm_print_av_pair_list(context->ChallengeTargetInfo.pvBuffer); } @@ -714,7 +714,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer } #ifdef WITH_DEBUG_NTLM - WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %d)", (int) context->AuthenticateMessage.cbBuffer); + WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %"PRIu32")", context->AuthenticateMessage.cbBuffer); winpr_HexDump(TAG, WLOG_DEBUG, context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer); if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION) @@ -916,7 +916,7 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer if (context->AuthenticateTargetInfo.cbBuffer > 0) { - WLog_DBG(TAG, "AuthenticateTargetInfo (%d):", (int) context->AuthenticateTargetInfo.cbBuffer); + WLog_DBG(TAG, "AuthenticateTargetInfo (%"PRIu32"):", context->AuthenticateTargetInfo.cbBuffer); ntlm_print_av_pair_list(context->AuthenticateTargetInfo.pvBuffer); } diff --git a/winpr/libwinpr/sspi/Negotiate/negotiate.c b/winpr/libwinpr/sspi/Negotiate/negotiate.c index c6b7b8150..54582080d 100644 --- a/winpr/libwinpr/sspi/Negotiate/negotiate.c +++ b/winpr/libwinpr/sspi/Negotiate/negotiate.c @@ -142,7 +142,7 @@ SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext(PCredHandle phCredenti if (status != SEC_E_OK) { - WLog_WARN(TAG, "AcceptSecurityContext status %s [%08X]", + WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } return status; diff --git a/winpr/libwinpr/sspi/sspi.c b/winpr/libwinpr/sspi/sspi.c index 628a07430..9f5f6fcc1 100644 --- a/winpr/libwinpr/sspi/sspi.c +++ b/winpr/libwinpr/sspi/sspi.c @@ -381,7 +381,7 @@ SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW(ULONG* pcPackages, PSe status = g_SspiW->EnumerateSecurityPackagesW(pcPackages, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -398,7 +398,7 @@ SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA(ULONG* pcPackages, PSe status = g_SspiA->EnumerateSecurityPackagesA(pcPackages, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "EnumerateSecurityPackagesA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -435,7 +435,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageNa status = g_SspiW->QuerySecurityPackageInfoW(pszPackageName, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -452,7 +452,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageNam status = g_SspiA->QuerySecurityPackageInfoA(pszPackageName, ppPackageInfo); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityPackageInfoA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -474,7 +474,7 @@ SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal status = g_SspiW->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -494,7 +494,7 @@ SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, status = g_SspiA->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -511,7 +511,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext(PCtxtHandle phContext, ULON status = g_SspiW->ExportSecurityContext(phContext, fFlags, pPackedContext, pToken); - WLog_Print(g_Log, WLOG_DEBUG, "ExportSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "ExportSecurityContext: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -528,7 +528,7 @@ SECURITY_STATUS SEC_ENTRY sspi_FreeCredentialsHandle(PCredHandle phCredential) status = g_SspiW->FreeCredentialsHandle(phCredential); - WLog_Print(g_Log, WLOG_DEBUG, "FreeCredentialsHandle: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "FreeCredentialsHandle: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -545,7 +545,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW(SEC_WCHAR* pszPackage, PSe status = g_SspiW->ImportSecurityContextW(pszPackage, pPackedContext, pToken, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -562,7 +562,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA(SEC_CHAR* pszPackage, PSec status = g_SspiA->ImportSecurityContextA(pszPackage, pPackedContext, pToken, phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "ImportSecurityContextA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -579,7 +579,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW(PCredHandle phCredent status = g_SspiW->QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -596,7 +596,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(PCredHandle phCredent status = g_SspiA->QueryCredentialsAttributesA(phCredential, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QueryCredentialsAttributesA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -618,7 +618,7 @@ SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, P status = g_SspiW->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp); - WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -635,7 +635,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken(PCtxtHandle phContext, PSecBuff status = g_SspiW->ApplyControlToken(phContext, pInput); - WLog_Print(g_Log, WLOG_DEBUG, "ApplyControlToken: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "ApplyControlToken: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -652,7 +652,7 @@ SECURITY_STATUS SEC_ENTRY sspi_CompleteAuthToken(PCtxtHandle phContext, PSecBuff status = g_SspiW->CompleteAuthToken(phContext, pToken); - WLog_Print(g_Log, WLOG_DEBUG, "CompleteAuthToken: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "CompleteAuthToken: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -669,7 +669,7 @@ SECURITY_STATUS SEC_ENTRY sspi_DeleteSecurityContext(PCtxtHandle phContext) status = g_SspiW->DeleteSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "DeleteSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "DeleteSecurityContext: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -686,7 +686,7 @@ SECURITY_STATUS SEC_ENTRY sspi_FreeContextBuffer(void* pvContextBuffer) status = g_SspiW->FreeContextBuffer(pvContextBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "FreeContextBuffer: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "FreeContextBuffer: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -703,7 +703,7 @@ SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext(PCtxtHandle phContext) status = g_SspiW->ImpersonateSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "ImpersonateSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "ImpersonateSecurityContext: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -725,7 +725,7 @@ SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredenti pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -747,7 +747,7 @@ SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(PCredHandle phCredenti pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput, Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry); - WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -764,7 +764,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW(PCtxtHandle phContext, UL status = g_SspiW->QueryContextAttributesW(phContext, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -781,7 +781,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA(PCtxtHandle phContext, UL status = g_SspiA->QueryContextAttributesA(phContext, ulAttribute, pBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QueryContextAttributesA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -798,7 +798,7 @@ SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityContextToken(PCtxtHandle phContext, status = g_SspiW->QuerySecurityContextToken(phContext, phToken); - WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityContextToken: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "QuerySecurityContextToken: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -815,7 +815,7 @@ SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW(PCtxtHandle phContext, ULON status = g_SspiW->SetContextAttributesW(phContext, ulAttribute, pBuffer, cbBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesW: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesW: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -832,7 +832,7 @@ SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA(PCtxtHandle phContext, ULON status = g_SspiA->SetContextAttributesA(phContext, ulAttribute, pBuffer, cbBuffer); - WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesA: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "SetContextAttributesA: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -849,7 +849,7 @@ SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext(PCtxtHandle phContext) status = g_SspiW->RevertSecurityContext(phContext); - WLog_Print(g_Log, WLOG_DEBUG, "RevertSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "RevertSecurityContext: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -868,7 +868,7 @@ SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage(PCtxtHandle phContext, PSecBufferD status = g_SspiW->DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP); - WLog_Print(g_Log, WLOG_DEBUG, "DecryptMessage: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "DecryptMessage: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -885,7 +885,7 @@ SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, status = g_SspiW->EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo); - WLog_Print(g_Log, WLOG_DEBUG, "EncryptMessage: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "EncryptMessage: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -902,7 +902,7 @@ SECURITY_STATUS SEC_ENTRY sspi_MakeSignature(PCtxtHandle phContext, ULONG fQOP, status = g_SspiW->MakeSignature(phContext, fQOP, pMessage, MessageSeqNo); - WLog_Print(g_Log, WLOG_DEBUG, "MakeSignature: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "MakeSignature: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } @@ -919,7 +919,7 @@ SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(PCtxtHandle phContext, PSecBuffer status = g_SspiW->VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP); - WLog_Print(g_Log, WLOG_DEBUG, "VerifySignature: %s (0x%04X)", GetSecurityStatusString(status), status); + WLog_Print(g_Log, WLOG_DEBUG, "VerifySignature: %s (0x%08"PRIX32")", GetSecurityStatusString(status), status); return status; } diff --git a/winpr/libwinpr/sspi/sspi_winpr.c b/winpr/libwinpr/sspi/sspi_winpr.c index f1dfc754c..1ebc78858 100644 --- a/winpr/libwinpr/sspi/sspi_winpr.c +++ b/winpr/libwinpr/sspi/sspi_winpr.c @@ -801,7 +801,7 @@ SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipa if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [%08X]", + WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -826,7 +826,7 @@ SECURITY_STATUS SEC_ENTRY winpr_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [%08X]", + WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -856,7 +856,7 @@ SECURITY_STATUS SEC_ENTRY winpr_ExportSecurityContext(PCtxtHandle phContext, ULO if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ExportSecurityContext status %s [%08X]", + WLog_WARN(TAG, "ExportSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -886,7 +886,7 @@ SECURITY_STATUS SEC_ENTRY winpr_FreeCredentialsHandle(PCredHandle phCredential) if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "FreeCredentialsHandle status %s [%08X]", + WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -916,7 +916,7 @@ SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextW(SEC_WCHAR* pszPackage, PS if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImportSecurityContextW status %s [%08X]", + WLog_WARN(TAG, "ImportSecurityContextW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -946,7 +946,7 @@ SECURITY_STATUS SEC_ENTRY winpr_ImportSecurityContextA(SEC_CHAR* pszPackage, PSe if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImportSecurityContextA status %s [%08X]", + WLog_WARN(TAG, "ImportSecurityContextA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -976,7 +976,7 @@ SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesW(PCredHandle phCreden if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [%08X]", + WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1006,7 +1006,7 @@ SECURITY_STATUS SEC_ENTRY winpr_QueryCredentialsAttributesA(PCredHandle phCreden if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [%08X]", + WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1041,7 +1041,7 @@ SECURITY_STATUS SEC_ENTRY winpr_AcceptSecurityContext(PCredHandle phCredential, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "AcceptSecurityContext status %s [%08X]", + WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1071,7 +1071,7 @@ SECURITY_STATUS SEC_ENTRY winpr_ApplyControlToken(PCtxtHandle phContext, PSecBuf if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ApplyControlToken status %s [%08X]", + WLog_WARN(TAG, "ApplyControlToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1101,7 +1101,7 @@ SECURITY_STATUS SEC_ENTRY winpr_CompleteAuthToken(PCtxtHandle phContext, PSecBuf if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]", + WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1131,7 +1131,7 @@ SECURITY_STATUS SEC_ENTRY winpr_DeleteSecurityContext(PCtxtHandle phContext) if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "DeleteSecurityContext status %s [%08X]", + WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1171,7 +1171,7 @@ SECURITY_STATUS SEC_ENTRY winpr_ImpersonateSecurityContext(PCtxtHandle phContext if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "ImpersonateSecurityContext status %s [%08X]", + WLog_WARN(TAG, "ImpersonateSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1206,7 +1206,7 @@ SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextW(PCredHandle phCredent if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "InitializeSecurityContextW status %s [%08X]", + WLog_WARN(TAG, "InitializeSecurityContextW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1241,7 +1241,7 @@ SECURITY_STATUS SEC_ENTRY winpr_InitializeSecurityContextA(PCredHandle phCredent if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "InitializeSecurityContextA status %s [%08X]", + WLog_WARN(TAG, "InitializeSecurityContextA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1271,7 +1271,7 @@ SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesW(PCtxtHandle phContext, U if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryContextAttributesW status %s [%08X]", + WLog_WARN(TAG, "QueryContextAttributesW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1301,7 +1301,7 @@ SECURITY_STATUS SEC_ENTRY winpr_QueryContextAttributesA(PCtxtHandle phContext, U if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QueryContextAttributesA status %s [%08X]", + WLog_WARN(TAG, "QueryContextAttributesA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1331,7 +1331,7 @@ SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityContextToken(PCtxtHandle phContext, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "QuerySecurityContextToken status %s [%08X]", + WLog_WARN(TAG, "QuerySecurityContextToken status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1361,7 +1361,7 @@ SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesW(PCtxtHandle phContext, ULO if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "SetContextAttributesW status %s [%08X]", + WLog_WARN(TAG, "SetContextAttributesW status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1391,7 +1391,7 @@ SECURITY_STATUS SEC_ENTRY winpr_SetContextAttributesA(PCtxtHandle phContext, ULO if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "SetContextAttributesA status %s [%08X]", + WLog_WARN(TAG, "SetContextAttributesA status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1421,7 +1421,7 @@ SECURITY_STATUS SEC_ENTRY winpr_RevertSecurityContext(PCtxtHandle phContext) if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "RevertSecurityContext status %s [%08X]", + WLog_WARN(TAG, "RevertSecurityContext status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1453,7 +1453,7 @@ SECURITY_STATUS SEC_ENTRY winpr_DecryptMessage(PCtxtHandle phContext, PSecBuffer if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "DecryptMessage status %s [%08X]", + WLog_WARN(TAG, "DecryptMessage status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1483,7 +1483,7 @@ SECURITY_STATUS SEC_ENTRY winpr_EncryptMessage(PCtxtHandle phContext, ULONG fQOP if (status != SEC_E_OK) { - WLog_ERR(TAG, "EncryptMessage status %s [%08X]", + WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1513,7 +1513,7 @@ SECURITY_STATUS SEC_ENTRY winpr_MakeSignature(PCtxtHandle phContext, ULONG fQOP, if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "MakeSignature status %s [%08X]", + WLog_WARN(TAG, "MakeSignature status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } @@ -1543,7 +1543,7 @@ SECURITY_STATUS SEC_ENTRY winpr_VerifySignature(PCtxtHandle phContext, PSecBuffe if (IsSecurityStatusError(status)) { - WLog_WARN(TAG, "VerifySignature status %s [%08X]", + WLog_WARN(TAG, "VerifySignature status %s [0x%08"PRIX32"]", GetSecurityStatusString(status), status); } diff --git a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c index b705101f0..6bf2fec68 100644 --- a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c +++ b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c @@ -22,7 +22,7 @@ int TestEnumerateSecurityPackages(int argc, char* argv[]) return -1; } - _tprintf(_T("\nEnumerateSecurityPackages (%d):\n"), (unsigned int)cPackages); + _tprintf(_T("\nEnumerateSecurityPackages (%")_T(PRIu32)_T("):\n"), cPackages); for (index = 0; index < (int) cPackages; index++) { diff --git a/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c b/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c index 1fe213f9f..e5e930843 100644 --- a/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c +++ b/winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c @@ -33,7 +33,7 @@ int TestInitializeSecurityContext(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo status: 0x%08X\n", status); + printf("QuerySecurityPackageInfo status: 0x%08"PRIX32"\n", status); return -1; } @@ -61,7 +61,7 @@ int TestInitializeSecurityContext(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle status: 0x%08X\n", status); + printf("AcquireCredentialsHandle status: 0x%08"PRIX32"\n", status); sspi_GlobalFinish(); return -1; } @@ -89,16 +89,16 @@ int TestInitializeSecurityContext(int argc, char* argv[]) if (status != SEC_I_CONTINUE_NEEDED) { - printf("InitializeSecurityContext status: 0x%08X\n", status); + printf("InitializeSecurityContext status: 0x%08"PRIX32"\n", status); sspi_GlobalFinish(); return -1; } - printf("cBuffers: %d ulVersion: %d\n", output_SecBuffer_desc.cBuffers, output_SecBuffer_desc.ulVersion); + printf("cBuffers: %"PRIu32" ulVersion: %"PRIu32"\n", output_SecBuffer_desc.cBuffers, output_SecBuffer_desc.ulVersion); p_SecBuffer = &output_SecBuffer_desc.pBuffers[0]; - printf("BufferType: 0x%04X cbBuffer: %d\n", p_SecBuffer->BufferType, p_SecBuffer->cbBuffer); + printf("BufferType: 0x%08"PRIX32" cbBuffer: %"PRIu32"\n", p_SecBuffer->BufferType, p_SecBuffer->cbBuffer); table->FreeCredentialsHandle(&credentials); diff --git a/winpr/libwinpr/sspi/test/TestNTLM.c b/winpr/libwinpr/sspi/test/TestNTLM.c index ab5acfcf8..eb424e65a 100644 --- a/winpr/libwinpr/sspi/test/TestNTLM.c +++ b/winpr/libwinpr/sspi/test/TestNTLM.c @@ -108,7 +108,7 @@ int test_ntlm_client_init(TEST_NTLM_CLIENT* ntlm, const char* user, const char* if (status != SEC_E_OK) { - fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%04X)\n", + fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08"PRIX32")\n", GetSecurityStatusString(status), status); return -1; } @@ -119,7 +119,7 @@ int test_ntlm_client_init(TEST_NTLM_CLIENT* ntlm, const char* user, const char* if (status != SEC_E_OK) { - fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%04X)\n", + fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08"PRIX32")\n", GetSecurityStatusString(status), status); return -1; } @@ -319,7 +319,7 @@ int test_ntlm_server_init(TEST_NTLM_SERVER* ntlm) if (status != SEC_E_OK) { - fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%04X)\n", + fprintf(stderr, "QuerySecurityPackageInfo status: %s (0x%08"PRIX32")\n", GetSecurityStatusString(status), status); return -1; } @@ -331,7 +331,7 @@ int test_ntlm_server_init(TEST_NTLM_SERVER* ntlm) if (status != SEC_E_OK) { - fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%04X)\n", + fprintf(stderr, "AcquireCredentialsHandle status: %s (0x%08"PRIX32")\n", GetSecurityStatusString(status), status); return -1; } @@ -436,7 +436,7 @@ int test_ntlm_server_authenticate(TEST_NTLM_SERVER* ntlm) if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED)) { - fprintf(stderr, "AcceptSecurityContext status: %s (0x%04X)\n", + fprintf(stderr, "AcceptSecurityContext status: %s (0x%08"PRIX32")\n", GetSecurityStatusString(status), status); return -1; /* Access Denied */ } @@ -552,7 +552,7 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(pSecBuffer->pvBuffer, TEST_NTLM_NEGOTIATE, pSecBuffer->cbBuffer); } - fprintf(stderr, "NTLM_NEGOTIATE (length = %d):\n", pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_NEGOTIATE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Server <- Negotiate Message @@ -610,7 +610,7 @@ int TestNTLM(int argc, char* argv[]) &AuthNtlmMessage, sizeof(SecPkgContext_AuthNtlmMessage)); } - fprintf(stderr, "NTLM_CHALLENGE (length = %d):\n", pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_CHALLENGE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Client <- Challenge Message @@ -642,7 +642,7 @@ int TestNTLM(int argc, char* argv[]) CopyMemory(pSecBuffer->pvBuffer, TEST_NTLM_AUTHENTICATE, pSecBuffer->cbBuffer); } - fprintf(stderr, "NTLM_AUTHENTICATE (length = %d):\n", pSecBuffer->cbBuffer); + fprintf(stderr, "NTLM_AUTHENTICATE (length = %"PRIu32"):\n", pSecBuffer->cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); /** * Server <- Authenticate Message diff --git a/winpr/libwinpr/sspi/test/TestSchannel.c b/winpr/libwinpr/sspi/test/TestSchannel.c index 6ffbb70cc..c9ff68193 100644 --- a/winpr/libwinpr/sspi/test/TestSchannel.c +++ b/winpr/libwinpr/sspi/test/TestSchannel.c @@ -262,8 +262,8 @@ int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phCont Message.pBuffers = Buffers; ioBufferLength = Message.pBuffers[0].cbBuffer + Message.pBuffers[1].cbBuffer + Message.pBuffers[2].cbBuffer; status = table->EncryptMessage(phContext, 0, &Message, 0); - printf("EncryptMessage status: 0x%08X\n", status); - printf("EncryptMessage output: cBuffers: %d [0]: %u / %u [1]: %u / %u [2]: %u / %u [3]: %u / %u\n", Message.cBuffers, + printf("EncryptMessage status: 0x%08"PRIX32"\n", status); + printf("EncryptMessage output: cBuffers: %"PRIu32" [0]: %"PRIu32" / %"PRIu32" [1]: %"PRIu32" / %"PRIu32" [2]: %"PRIu32" / %"PRIu32" [3]: %"PRIu32" / %"PRIu32"\n", Message.cBuffers, Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, @@ -272,7 +272,7 @@ int schannel_send(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phCont if (status != SEC_E_OK) return -1; - printf("Client > Server (%d)\n", ioBufferLength); + printf("Client > Server (%"PRIu32")\n", ioBufferLength); winpr_HexDump("sspi.test", WLOG_DEBUG, ioBuffer, ioBufferLength); if (!WriteFile(hPipe, ioBuffer, ioBufferLength, &NumberOfBytesWritten, NULL)) @@ -323,8 +323,8 @@ int schannel_recv(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phCont Message.cBuffers = 4; Message.pBuffers = Buffers; status = table->DecryptMessage(phContext, &Message, 0, NULL); - printf("DecryptMessage status: 0x%08X\n", status); - printf("DecryptMessage output: cBuffers: %d [0]: %u / %u [1]: %u / %u [2]: %u / %u [3]: %u / %u\n", Message.cBuffers, + printf("DecryptMessage status: 0x%08"PRIX32"\n", status); + printf("DecryptMessage output: cBuffers: %"PRIu32" [0]: %"PRIu32" / %"PRIu32" [1]: %"PRIu32" / %"PRIu32" [2]: %"PRIu32" / %"PRIu32" [3]: %"PRIu32" / %"PRIu32"\n", Message.cBuffers, Message.pBuffers[0].cbBuffer, Message.pBuffers[0].BufferType, Message.pBuffers[1].cbBuffer, Message.pBuffers[1].BufferType, Message.pBuffers[2].cbBuffer, Message.pBuffers[2].BufferType, @@ -333,7 +333,7 @@ int schannel_recv(PSecurityFunctionTable table, HANDLE hPipe, PCtxtHandle phCont if (status != SEC_E_OK) return -1; - printf("Decrypted Message (%d)\n", Message.pBuffers[1].cbBuffer); + printf("Decrypted Message (%"PRIu32")\n", Message.pBuffers[1].cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) Message.pBuffers[1].pvBuffer, Message.pBuffers[1].cbBuffer); if (memcmp(Message.pBuffers[1].pvBuffer, test_LastDummyMessage, sizeof(test_LastDummyMessage)) == 0) @@ -376,7 +376,7 @@ static void* schannel_test_server_thread(void* arg) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo failure: 0x%08X\n", status); + printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status); return NULL; } @@ -423,7 +423,7 @@ static void* schannel_test_server_thread(void* arg) if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle failure: 0x%08X\n", status); + printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status); return NULL; } @@ -483,7 +483,7 @@ static void* schannel_test_server_thread(void* arg) if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && (status != SEC_E_INCOMPLETE_MESSAGE)) { - printf("AcceptSecurityContext unexpected status: 0x%08X\n", status); + printf("AcceptSecurityContext unexpected status: 0x%08"PRIX32"\n", status); return NULL; } @@ -496,9 +496,9 @@ static void* schannel_test_server_thread(void* arg) else if (status == SEC_E_INCOMPLETE_MESSAGE) printf("AcceptSecurityContext status: SEC_E_INCOMPLETE_MESSAGE\n"); - printf("Server cBuffers: %u pBuffers[0]: %u type: %u\n", + printf("Server cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, SecBufferDesc_out.pBuffers[0].BufferType); - printf("Server Input cBuffers: %d pBuffers[0]: %u type: %u pBuffers[1]: %u type: %u\n", SecBufferDesc_in.cBuffers, + printf("Server Input cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32" pBuffers[1]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_in.cBuffers, SecBufferDesc_in.pBuffers[0].cbBuffer, SecBufferDesc_in.pBuffers[0].BufferType, SecBufferDesc_in.pBuffers[1].cbBuffer, SecBufferDesc_in.pBuffers[1].BufferType); @@ -517,7 +517,7 @@ static void* schannel_test_server_thread(void* arg) if (pSecBuffer->cbBuffer > 0) { - printf("Server > Client (%d)\n", pSecBuffer->cbBuffer); + printf("Server > Client (%"PRIu32")\n", pSecBuffer->cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); if (!WriteFile(g_ClientWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, &NumberOfBytesWritten, NULL)) @@ -644,7 +644,7 @@ int TestSchannel(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QuerySecurityPackageInfo failure: 0x%08X\n", status); + printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status); return -1; } @@ -664,7 +664,7 @@ int TestSchannel(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("AcquireCredentialsHandle failure: 0x%08X\n", status); + printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status); return -1; } @@ -673,7 +673,7 @@ int TestSchannel(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_ALGS failure: 0x%08X\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_ALGS failure: 0x%08"PRIX32"\n", status); return -1; } @@ -682,12 +682,12 @@ int TestSchannel(int argc, char* argv[]) * 0x660E 0x6610 0x6801 0x6603 0x6601 0x8003 0x8004 * 0x800C 0x800D 0x800E 0x2400 0xAA02 0xAE06 0x2200 0x2203 */ - printf("SupportedAlgs: %d\n", SupportedAlgs.cSupportedAlgs); + printf("SupportedAlgs: %"PRIu32"\n", SupportedAlgs.cSupportedAlgs); for (index = 0; index < SupportedAlgs.cSupportedAlgs; index++) { algId = SupportedAlgs.palgSupportedAlgs[index]; - printf("\t0x%04X CLASS: %d TYPE: %d SID: %d\n", algId, + printf("\t0x%08"PRIX32" CLASS: %"PRIu32" TYPE: %"PRIu32" SID: %"PRIu32"\n", algId, ((GET_ALG_CLASS(algId)) >> 13), ((GET_ALG_TYPE(algId)) >> 9), GET_ALG_SID(algId)); } @@ -697,24 +697,24 @@ int TestSchannel(int argc, char* argv[]) if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_CIPHER_STRENGTHS failure: 0x%08X\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_CIPHER_STRENGTHS failure: 0x%08"PRIX32"\n", status); return -1; } /* CipherStrengths: Minimum: 40 Maximum: 256 */ - printf("CipherStrengths: Minimum: %d Maximum: %d\n", + printf("CipherStrengths: Minimum: %"PRIu32" Maximum: %"PRIu32"\n", CipherStrengths.dwMinimumCipherStrength, CipherStrengths.dwMaximumCipherStrength); ZeroMemory(&SupportedProtocols, sizeof(SecPkgCred_SupportedProtocols)); status = table->QueryCredentialsAttributes(&credentials, SECPKG_ATTR_SUPPORTED_PROTOCOLS, &SupportedProtocols); if (status != SEC_E_OK) { - printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_PROTOCOLS failure: 0x%08X\n", status); + printf("QueryCredentialsAttributes SECPKG_ATTR_SUPPORTED_PROTOCOLS failure: 0x%08"PRIX32"\n", status); return -1; } /* SupportedProtocols: 0x208A0 */ - printf("SupportedProtocols: 0x%04X\n", SupportedProtocols.grbitProtocol); + printf("SupportedProtocols: 0x%08"PRIX32"\n", SupportedProtocols.grbitProtocol); fContextReq = ISC_REQ_STREAM | ISC_REQ_SEQUENCE_DETECT | ISC_REQ_REPLAY_DETECT | ISC_REQ_CONFIDENTIALITY | ISC_RET_EXTENDED_ERROR | @@ -751,7 +751,7 @@ int TestSchannel(int argc, char* argv[]) } g_ClientWait = TRUE; - printf("NumberOfBytesRead: %d\n", NumberOfBytesRead); + printf("NumberOfBytesRead: %"PRIu32"\n", NumberOfBytesRead); SecBuffer_in[0].BufferType = SECBUFFER_TOKEN; SecBuffer_in[0].pvBuffer = lpTokenIn; SecBuffer_in[0].cbBuffer = NumberOfBytesRead; @@ -772,7 +772,7 @@ int TestSchannel(int argc, char* argv[]) if ((status != SEC_E_OK) && (status != SEC_I_CONTINUE_NEEDED) && (status != SEC_E_INCOMPLETE_MESSAGE)) { - printf("InitializeSecurityContext unexpected status: 0x%08X\n", status); + printf("InitializeSecurityContext unexpected status: 0x%08"PRIX32"\n", status); return -1; } @@ -785,9 +785,9 @@ int TestSchannel(int argc, char* argv[]) else if (status == SEC_E_INCOMPLETE_MESSAGE) printf("InitializeSecurityContext status: SEC_E_INCOMPLETE_MESSAGE\n"); - printf("Client Output cBuffers: %d pBuffers[0]: %d type: %d\n", + printf("Client Output cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_out.cBuffers, SecBufferDesc_out.pBuffers[0].cbBuffer, SecBufferDesc_out.pBuffers[0].BufferType); - printf("Client Input cBuffers: %d pBuffers[0]: %d type: %d pBuffers[1]: %d type: %d\n", SecBufferDesc_in.cBuffers, + printf("Client Input cBuffers: %"PRIu32" pBuffers[0]: %"PRIu32" type: %"PRIu32" pBuffers[1]: %"PRIu32" type: %"PRIu32"\n", SecBufferDesc_in.cBuffers, SecBufferDesc_in.pBuffers[0].cbBuffer, SecBufferDesc_in.pBuffers[0].BufferType, SecBufferDesc_in.pBuffers[1].cbBuffer, SecBufferDesc_in.pBuffers[1].BufferType); @@ -797,7 +797,7 @@ int TestSchannel(int argc, char* argv[]) if (pSecBuffer->cbBuffer > 0) { - printf("Client > Server (%d)\n", pSecBuffer->cbBuffer); + printf("Client > Server (%"PRIu32")\n", pSecBuffer->cbBuffer); winpr_HexDump("sspi.test", WLOG_DEBUG, (BYTE*) pSecBuffer->pvBuffer, pSecBuffer->cbBuffer); if (!WriteFile(g_ServerWritePipe, pSecBuffer->pvBuffer, pSecBuffer->cbBuffer, &NumberOfBytesWritten, NULL)) diff --git a/winpr/libwinpr/synch/mutex.c b/winpr/libwinpr/synch/mutex.c index 6801206ca..3c5a89816 100644 --- a/winpr/libwinpr/synch/mutex.c +++ b/winpr/libwinpr/synch/mutex.c @@ -85,7 +85,7 @@ BOOL MutexCloseHandle(HANDLE handle) if (msg) { for(i=0; i> Testing with flags 0x%08x. Using %u threads performing %u loops\n", + printf("%s: >> Testing with flags 0x%08"PRIx32". Using %"PRIu32" threads performing %"PRIu32" loops\n", __FUNCTION__, dwFlags, dwThreads, dwLoops); if (!(threads = calloc(dwThreads, sizeof(HANDLE)))) @@ -106,7 +106,7 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (!(threads[i] = CreateThread(NULL, 0, test_synch_barrier_thread, &p, 0, NULL))) { - printf("%s: CreateThread failed for thread #%u with error 0x%08x\n", + printf("%s: CreateThread failed for thread #%"PRIu32" with error 0x%08x\n", __FUNCTION__, i, GetLastError()); InterlockedIncrement(&gErrorCount); break; @@ -126,14 +126,14 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo { if (WAIT_OBJECT_0 != (dwStatus = WaitForSingleObject(threads[i], INFINITE))) { - printf("%s: WaitForSingleObject(thread[%d] unexpectedly returned %u (error = 0x%08x)\n", + printf("%s: WaitForSingleObject(thread[%"PRIu32"] unexpectedly returned %"PRIu32" (error = 0x%08x)\n", __FUNCTION__, i, dwStatus, GetLastError()); InterlockedIncrement(&gErrorCount); } if (!CloseHandle(threads[i])) { - printf("%s: CloseHandle(thread[%d]) failed with error = 0x%08x)\n", + printf("%s: CloseHandle(thread[%"PRIu32"]) failed with error = 0x%08x)\n", __FUNCTION__, i, GetLastError()); InterlockedIncrement(&gErrorCount); } @@ -160,17 +160,17 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo if (p.falseCount != expectedFalseCount) InterlockedIncrement(&gErrorCount); - printf("%s: error count: %d\n", __FUNCTION__, gErrorCount); - printf("%s: thread count: %d (expected %u)\n", __FUNCTION__, p.threadCount, + printf("%s: error count: %"PRId32"\n", __FUNCTION__, gErrorCount); + printf("%s: thread count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.threadCount, dwThreads); - printf("%s: true count: %d (expected %d)\n", __FUNCTION__, p.trueCount, + printf("%s: true count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.trueCount, expectedTrueCount); - printf("%s: false count: %d (expected %d)\n", __FUNCTION__, p.falseCount, + printf("%s: false count: %"PRId32" (expected %"PRIu32")\n", __FUNCTION__, p.falseCount, expectedFalseCount); if (gErrorCount > 0) { - printf("%s: Error test failed with %d reported errors\n", __FUNCTION__, + printf("%s: Error test failed with %"PRId32" reported errors\n", __FUNCTION__, gErrorCount); return FALSE; } @@ -186,7 +186,7 @@ int TestSynchBarrier(int argc, char* argv[]) DWORD dwMinThreads; DWORD dwNumLoops = 200; GetNativeSystemInfo(&sysinfo); - printf("%s: Number of processors: %u\n", __FUNCTION__, + printf("%s: Number of processors: %"PRIu32"\n", __FUNCTION__, sysinfo.dwNumberOfProcessors); dwMinThreads = sysinfo.dwNumberOfProcessors; dwMaxThreads = sysinfo.dwNumberOfProcessors * 4; diff --git a/winpr/libwinpr/synch/test/TestSynchCritical.c b/winpr/libwinpr/synch/test/TestSynchCritical.c index 426baf59d..3575acec6 100644 --- a/winpr/libwinpr/synch/test/TestSynchCritical.c +++ b/winpr/libwinpr/synch/test/TestSynchCritical.c @@ -131,7 +131,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) #endif if (dwPreviousSpinCount != dwSpinCountExpected) { - printf("CriticalSection failure: SetCriticalSectionSpinCount returned %u (expected: %u)\n", dwPreviousSpinCount, dwSpinCountExpected); + printf("CriticalSection failure: SetCriticalSectionSpinCount returned %"PRIu32" (expected: %"PRIu32")\n", dwPreviousSpinCount, dwSpinCountExpected); goto fail; } @@ -156,7 +156,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) { if (critical.RecursionCount != i) { - printf("CriticalSection failure: RecursionCount field is %d instead of %d.\n", critical.RecursionCount, i); + printf("CriticalSection failure: RecursionCount field is %"PRId32" instead of %d.\n", critical.RecursionCount, i); goto fail; } if (i%2==0) @@ -182,7 +182,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) LeaveCriticalSection(&critical); if (critical.RecursionCount != i) { - printf("CriticalSection failure: RecursionCount field is %d instead of %d.\n", critical.RecursionCount, i); + printf("CriticalSection failure: RecursionCount field is %"PRId32" instead of %d.\n", critical.RecursionCount, i); goto fail; } if (critical.OwningThread != (HANDLE)(i ? hMainThread : NULL)) @@ -240,7 +240,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) GetExitCodeThread(hThreads[i], &dwThreadExitCode); if(dwThreadExitCode != 0) { - printf("CriticalSection failure: Thread #%d returned error code %u\n", i, dwThreadExitCode); + printf("CriticalSection failure: Thread #%d returned error code %"PRIu32"\n", i, dwThreadExitCode); goto fail; } CloseHandle(hThreads[i]); @@ -248,7 +248,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) if (gTestValueVulnerable != gTestValueSerialized) { - printf("CriticalSection failure: unexpected test value %d (expected %d)\n", gTestValueVulnerable, gTestValueSerialized); + printf("CriticalSection failure: unexpected test value %"PRId32" (expected %"PRId32")\n", gTestValueVulnerable, gTestValueSerialized); goto fail; } @@ -283,7 +283,7 @@ static PVOID TestSynchCritical_Main(PVOID arg) GetExitCodeThread(hThread, &dwThreadExitCode); if(dwThreadExitCode != 0) { - printf("CriticalSection failure: Thread returned error code %u\n", dwThreadExitCode); + printf("CriticalSection failure: Thread returned error code %"PRIu32"\n", dwThreadExitCode); goto fail; } CloseHandle(hThread); @@ -307,7 +307,7 @@ int TestSynchCritical(int argc, char* argv[]) dwDeadLockDetectionTimeMs = 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS; - printf("Deadlock will be assumed after %u ms.\n", dwDeadLockDetectionTimeMs); + printf("Deadlock will be assumed after %"PRIu32" ms.\n", dwDeadLockDetectionTimeMs); if (!(hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) TestSynchCritical_Main, &bThreadTerminated, 0, NULL))) { diff --git a/winpr/libwinpr/synch/test/TestSynchInit.c b/winpr/libwinpr/synch/test/TestSynchInit.c index efcd9c3af..44aa6c337 100644 --- a/winpr/libwinpr/synch/test/TestSynchInit.c +++ b/winpr/libwinpr/synch/test/TestSynchInit.c @@ -93,7 +93,7 @@ int TestSynchInit(int argc, char* argv[]) { if (!(hThreads[i] = CreateThread(NULL, 0, TestThreadFunction, NULL, 0, NULL))) { - fprintf(stderr, "error creating thread #%d\n", i); + fprintf(stderr, "error creating thread #%"PRIu32"\n", i); InterlockedIncrement(pErrors); goto out; } @@ -107,7 +107,7 @@ int TestSynchInit(int argc, char* argv[]) { if (WaitForSingleObject(hThreads[i], INFINITE) != WAIT_OBJECT_0) { - fprintf(stderr, "error: error waiting for thread #%d\n", i); + fprintf(stderr, "error: error waiting for thread #%"PRIu32"\n", i); InterlockedIncrement(pErrors); goto out; } @@ -123,11 +123,11 @@ int TestSynchInit(int argc, char* argv[]) out: fprintf(stderr, "Test result: %s\n", result ? "OK" : "ERROR"); - fprintf(stderr, "Error count: %d\n", pErrors ? *pErrors : -1); - fprintf(stderr, "Threads created: %u\n", dwCreatedThreads); - fprintf(stderr, "TestThreadFunctionCalls: %d\n", pTestThreadFunctionCalls ? *pTestThreadFunctionCalls : -1); - fprintf(stderr, "InitOnceExecuteOnceCalls: %d\n", pInitOnceExecuteOnceCalls ? *pInitOnceExecuteOnceCalls : -1); - fprintf(stderr, "TestOnceFunctionCalls: %d\n", pTestOnceFunctionCalls ? *pTestOnceFunctionCalls : -1); + fprintf(stderr, "Error count: %"PRId32"\n", pErrors ? *pErrors : -1); + fprintf(stderr, "Threads created: %"PRIu32"\n", dwCreatedThreads); + fprintf(stderr, "TestThreadFunctionCalls: %"PRId32"\n", pTestThreadFunctionCalls ? *pTestThreadFunctionCalls : -1); + fprintf(stderr, "InitOnceExecuteOnceCalls: %"PRId32"\n", pInitOnceExecuteOnceCalls ? *pInitOnceExecuteOnceCalls : -1); + fprintf(stderr, "TestOnceFunctionCalls: %"PRId32"\n", pTestOnceFunctionCalls ? *pTestOnceFunctionCalls : -1); _aligned_free(pErrors); _aligned_free(pTestThreadFunctionCalls); diff --git a/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c b/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c index 4319441ee..4a0f8b1b9 100644 --- a/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c +++ b/winpr/libwinpr/synch/test/TestSynchMultipleThreads.c @@ -26,7 +26,7 @@ static int start_threads(DWORD count, HANDLE *threads) if (!threads[i]) { - printf("CreateThread [%i] failure\n", i); + printf("CreateThread [%"PRIu32"] failure\n", i); return -1; } } @@ -42,7 +42,7 @@ static int close_threads(DWORD count, HANDLE *threads) { if (!CloseHandle(threads[i])) { - printf("CloseHandle [%d] failure\n", i); + printf("CloseHandle [%"PRIu32"] failure\n", i); return -1; } } diff --git a/winpr/libwinpr/synch/test/TestSynchMutex.c b/winpr/libwinpr/synch/test/TestSynchMutex.c index a7461ee33..9ee317104 100644 --- a/winpr/libwinpr/synch/test/TestSynchMutex.c +++ b/winpr/libwinpr/synch/test/TestSynchMutex.c @@ -18,7 +18,7 @@ BOOL test_mutex_basic() rc = WaitForSingleObject(mutex, INFINITE); if (rc != WAIT_OBJECT_0) { - printf("%s: WaitForSingleObject on mutex failed with %u\n", __FUNCTION__, rc); + printf("%s: WaitForSingleObject on mutex failed with %"PRIu32"\n", __FUNCTION__, rc); return FALSE; } @@ -58,7 +58,7 @@ BOOL test_mutex_recursive() rc = WaitForSingleObject(mutex, INFINITE); if (rc != WAIT_OBJECT_0) { - printf("%s: WaitForSingleObject #%u on mutex failed with %u\n", __FUNCTION__, i, rc); + printf("%s: WaitForSingleObject #%"PRIu32" on mutex failed with %"PRIu32"\n", __FUNCTION__, i, rc); return FALSE; } } @@ -67,7 +67,7 @@ BOOL test_mutex_recursive() { if (!ReleaseMutex(mutex)) { - printf("%s: ReleaseMutex #%u failed\n", __FUNCTION__, i); + printf("%s: ReleaseMutex #%"PRIu32" failed\n", __FUNCTION__, i); return FALSE; } } @@ -120,7 +120,7 @@ DWORD WINAPI test_mutex_thread1(LPVOID lpParam) rc = WaitForSingleObject(thread1_mutex1, 10); if (rc != WAIT_TIMEOUT) { - fprintf(stderr, "%s: WaitForSingleObject on thread1_mutex1 unexpectedly returned %u instead of WAIT_TIMEOUT (%u)\n", + fprintf(stderr, "%s: WaitForSingleObject on thread1_mutex1 unexpectedly returned %"PRIu32" instead of WAIT_TIMEOUT (%u)\n", __FUNCTION__, rc, WAIT_TIMEOUT); return 0; } @@ -128,7 +128,7 @@ DWORD WINAPI test_mutex_thread1(LPVOID lpParam) rc = WaitForSingleObject(thread1_mutex2, 10); if (rc != WAIT_OBJECT_0) { - fprintf(stderr, "%s: WaitForSingleObject on thread1_mutex2 unexpectedly returned %u instead of WAIT_OBJECT_0\n", + fprintf(stderr, "%s: WaitForSingleObject on thread1_mutex2 unexpectedly returned %"PRIu32" instead of WAIT_OBJECT_0\n", __FUNCTION__, rc); return 0; } diff --git a/winpr/libwinpr/synch/test/TestSynchThread.c b/winpr/libwinpr/synch/test/TestSynchThread.c index 74a412ef7..7b019c57d 100644 --- a/winpr/libwinpr/synch/test/TestSynchThread.c +++ b/winpr/libwinpr/synch/test/TestSynchThread.c @@ -28,7 +28,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_TIMEOUT != rc) { - printf("Timed WaitForSingleObject on running thread failed with %d\n", rc); + printf("Timed WaitForSingleObject on running thread failed with %"PRIu32"\n", rc); return -3; } @@ -37,7 +37,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("WaitForSingleObject on thread failed with %d\n", rc); + printf("WaitForSingleObject on thread failed with %"PRIu32"\n", rc); return -2; } @@ -46,7 +46,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("Timed WaitForSingleObject on dead thread failed with %d\n", rc); + printf("Timed WaitForSingleObject on dead thread failed with %"PRIu32"\n", rc); return -5; } @@ -70,7 +70,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_TIMEOUT != rc) { - printf("Timed WaitForSingleObject on running thread failed with %d\n", rc); + printf("Timed WaitForSingleObject on running thread failed with %"PRIu32"\n", rc); return -3; } @@ -79,7 +79,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("WaitForSingleObject on thread failed with %d\n", rc); + printf("WaitForSingleObject on thread failed with %"PRIu32"\n", rc); return -2; } @@ -88,7 +88,7 @@ int TestSynchThread(int argc, char *argv[]) if (WAIT_OBJECT_0 != rc) { - printf("Timed WaitForSingleObject on dead thread failed with %d\n", rc); + printf("Timed WaitForSingleObject on dead thread failed with %"PRIu32"\n", rc); return -5; } diff --git a/winpr/libwinpr/synch/test/TestSynchTimerQueue.c b/winpr/libwinpr/synch/test/TestSynchTimerQueue.c index 761eafc14..44b511620 100644 --- a/winpr/libwinpr/synch/test/TestSynchTimerQueue.c +++ b/winpr/libwinpr/synch/test/TestSynchTimerQueue.c @@ -36,7 +36,7 @@ VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired) apcData->FireCount++; - printf("TimerRoutine: TimerId: %d FireCount: %d ActualTime: %d ExpectedTime: %d Discrepancy: %d\n", + printf("TimerRoutine: TimerId: %"PRIu32" FireCount: %"PRIu32" ActualTime: %"PRIu32" ExpectedTime: %"PRIu32" Discrepancy: %"PRIu32"\n", apcData->TimerId, apcData->FireCount, TimerTime, expectedTime, TimerTime - expectedTime); Sleep(50); @@ -58,7 +58,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!hTimerQueue) { - printf("CreateTimerQueue failed (%u)\n", GetLastError()); + printf("CreateTimerQueue failed (%"PRIu32")\n", GetLastError()); return -1; } @@ -73,14 +73,14 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!(apcData[index].CompletionEvent = CreateEvent(NULL, TRUE, FALSE, NULL))) { - printf("Failed to create apcData[%u] event (%u)\n", index, GetLastError()); + printf("Failed to create apcData[%"PRIu32"] event (%"PRIu32")\n", index, GetLastError()); return -1; } if (!CreateTimerQueueTimer(&hTimers[index], hTimerQueue, (WAITORTIMERCALLBACK) TimerRoutine, &apcData[index], apcData[index].DueTime, apcData[index].Period, 0)) { - printf("CreateTimerQueueTimer failed (%u)\n", GetLastError()); + printf("CreateTimerQueueTimer failed (%"PRIu32")\n", GetLastError()); return -1; } } @@ -89,7 +89,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) { if (WaitForSingleObject(apcData[index].CompletionEvent, 20000) != WAIT_OBJECT_0) { - printf("Failed to wait for timer queue timer #%u (%u)\n", index, GetLastError()); + printf("Failed to wait for timer queue timer #%"PRIu32" (%"PRIu32")\n", index, GetLastError()); return -1; } } @@ -102,7 +102,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) */ if (!DeleteTimerQueueTimer(hTimerQueue, hTimers[index], INVALID_HANDLE_VALUE)) { - printf("DeleteTimerQueueTimer failed (%u)\n", GetLastError()); + printf("DeleteTimerQueueTimer failed (%"PRIu32")\n", GetLastError()); return -1; } CloseHandle(apcData[index].CompletionEvent); @@ -110,7 +110,7 @@ int TestSynchTimerQueue(int argc, char* argv[]) if (!DeleteTimerQueue(hTimerQueue)) { - printf("DeleteTimerQueue failed (%u)\n", GetLastError()); + printf("DeleteTimerQueue failed (%"PRIu32")\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c b/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c index 403931fb9..c0efd4897 100644 --- a/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c +++ b/winpr/libwinpr/synch/test/TestSynchWaitableTimer.c @@ -40,7 +40,7 @@ int TestSynchWaitableTimer(int argc, char* argv[]) if (status != WAIT_TIMEOUT) { - printf("WaitForSingleObject(timer, 2000) failure: Actual: 0x%04X, Expected: 0x%04X\n", status, WAIT_TIMEOUT); + printf("WaitForSingleObject(timer, 2000) failure: Actual: 0x%08"PRIX32", Expected: 0x%08X\n", status, WAIT_TIMEOUT); goto out; } diff --git a/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c b/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c index 36d2b9f4e..0bfaf9fda 100644 --- a/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c +++ b/winpr/libwinpr/synch/test/TestSynchWaitableTimerAPC.c @@ -22,7 +22,7 @@ VOID CALLBACK TimerAPCProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwTimerHig apcData = (APC_DATA*) lpArg; - printf("TimerAPCProc: time: %d\n", CurrentTime - apcData->StartTime); + printf("TimerAPCProc: time: %"PRIu32"\n", CurrentTime - apcData->StartTime); g_Count++; @@ -95,7 +95,7 @@ int TestSynchWaitableTimerAPC(int argc, char* argv[]) if (rc == 0x000000C0L) /* WAIT_IO_COMPLETION */ continue; - printf("Failed to wait for completion event (%u)\n", GetLastError()); + printf("Failed to wait for completion event (%"PRIu32")\n", GetLastError()); goto cleanup; } diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index cb2b9adc7..721fb5f56 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -340,7 +340,7 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAl if (!nCount || (nCount > MAXIMUM_WAIT_OBJECTS)) { - WLog_ERR(TAG, "invalid handles count(%d)", nCount); + WLog_ERR(TAG, "invalid handles count(%"PRIu32")", nCount); return WAIT_FAILED; } @@ -447,10 +447,10 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAl if (status < 0) { #ifdef HAVE_POLL_H - WLog_ERR(TAG, "poll() handle %d (%d) failure [%d] %s", index, nCount, errno, + WLog_ERR(TAG, "poll() handle %d (%"PRIu32") failure [%d] %s", index, nCount, errno, strerror(errno)); #else - WLog_ERR(TAG, "select() handle %d (%d) failure [%d] %s", index, nCount, errno, + WLog_ERR(TAG, "select() handle %d (%"PRIu32") failure [%d] %s", index, nCount, errno, strerror(errno)); #endif winpr_log_backtrace(TAG, WLOG_ERROR, 20); diff --git a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c index 302598446..424bf01e6 100644 --- a/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c +++ b/winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c @@ -9,17 +9,17 @@ int TestGetNativeSystemInfo(int argc, char* argv[]) GetNativeSystemInfo(&sysinfo); printf("SystemInfo:\n"); - printf("\twProcessorArchitecture: %d\n", sysinfo.wProcessorArchitecture); - printf("\twReserved: %d\n", sysinfo.wReserved); - printf("\tdwPageSize: 0x%08X\n", sysinfo.dwPageSize); + printf("\twProcessorArchitecture: %"PRIu16"\n", sysinfo.wProcessorArchitecture); + printf("\twReserved: %"PRIu16"\n", sysinfo.wReserved); + printf("\tdwPageSize: 0x%08"PRIX32"\n", sysinfo.dwPageSize); printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress); printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress); - printf("\tdwActiveProcessorMask: 0x%08X\n", (unsigned int) sysinfo.dwActiveProcessorMask); - printf("\tdwNumberOfProcessors: %d\n", sysinfo.dwNumberOfProcessors); - printf("\tdwProcessorType: %d\n", sysinfo.dwProcessorType); - printf("\tdwAllocationGranularity: %d\n", sysinfo.dwAllocationGranularity); - printf("\twProcessorLevel: %d\n", sysinfo.wProcessorLevel); - printf("\twProcessorRevision: %d\n", sysinfo.wProcessorRevision); + printf("\tdwActiveProcessorMask: 0x%08"PRIXz"\n", sysinfo.dwActiveProcessorMask); + printf("\tdwNumberOfProcessors: %"PRIu32"\n", sysinfo.dwNumberOfProcessors); + printf("\tdwProcessorType: %"PRIu32"\n", sysinfo.dwProcessorType); + printf("\tdwAllocationGranularity: %"PRIu32"\n", sysinfo.dwAllocationGranularity); + printf("\twProcessorLevel: %"PRIu16"\n", sysinfo.wProcessorLevel); + printf("\twProcessorRevision: %"PRIu16"\n", sysinfo.wProcessorRevision); printf("\n"); return 0; diff --git a/winpr/libwinpr/sysinfo/test/TestLocalTime.c b/winpr/libwinpr/sysinfo/test/TestLocalTime.c index 1b6ebf31c..a1642d1e5 100644 --- a/winpr/libwinpr/sysinfo/test/TestLocalTime.c +++ b/winpr/libwinpr/sysinfo/test/TestLocalTime.c @@ -8,7 +8,7 @@ int TestLocalTime(int argc, char* argv[]) GetLocalTime(&lTime); - printf("GetLocalTime: wYear: %d wMonth: %d wDayOfWeek: %d wDay: %d wHour: %d wMinute: %d wSecond: %d wMilliseconds: %d\n", + printf("GetLocalTime: wYear: %"PRIu16" wMonth: %"PRIu16" wDayOfWeek: %"PRIu16" wDay: %"PRIu16" wHour: %"PRIu16" wMinute: %"PRIu16" wSecond: %"PRIu16" wMilliseconds: %"PRIu16"\n", lTime.wYear, lTime.wMonth, lTime.wDayOfWeek, lTime.wDay, lTime.wHour, lTime.wMinute, lTime.wSecond, lTime.wMilliseconds); return 0; diff --git a/winpr/libwinpr/sysinfo/test/TestSystemTime.c b/winpr/libwinpr/sysinfo/test/TestSystemTime.c index 30efe733c..b07194d3a 100644 --- a/winpr/libwinpr/sysinfo/test/TestSystemTime.c +++ b/winpr/libwinpr/sysinfo/test/TestSystemTime.c @@ -8,7 +8,7 @@ int TestSystemTime(int argc, char* argv[]) GetSystemTime(&sTime); - printf("GetSystemTime: wYear: %d wMonth: %d wDayOfWeek: %d wDay: %d wHour: %d wMinute: %d wSecond: %d wMilliseconds: %d\n", + printf("GetSystemTime: wYear: %"PRIu16" wMonth: %"PRIu16" wDayOfWeek: %"PRIu16" wDay: %"PRIu16" wHour: %"PRIu16" wMinute: %"PRIu16" wSecond: %"PRIu16" wMilliseconds: %"PRIu16"\n", sTime.wYear, sTime.wMonth, sTime.wDayOfWeek, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds); return 0; diff --git a/winpr/libwinpr/thread/test/TestThreadCreateProcess.c b/winpr/libwinpr/thread/test/TestThreadCreateProcess.c index cbf83dca9..ecfcd456f 100644 --- a/winpr/libwinpr/thread/test/TestThreadCreateProcess.c +++ b/winpr/libwinpr/thread/test/TestThreadCreateProcess.c @@ -68,21 +68,21 @@ int TestThreadCreateProcess(int argc, char* argv[]) if (!status) { - printf("CreateProcess failed. error=%d\n", GetLastError()); + printf("CreateProcess failed. error=%"PRIu32"\n", GetLastError()); return 1; } if (WaitForSingleObject(ProcessInformation.hProcess, 5000) != WAIT_OBJECT_0) { - printf("Failed to wait for first process. error=%d\n", GetLastError()); + printf("Failed to wait for first process. error=%"PRIu32"\n", GetLastError()); return 1; } exitCode = 0; status = GetExitCodeProcess(ProcessInformation.hProcess, &exitCode); - printf("GetExitCodeProcess status: %d\n", status); - printf("Process exited with code: 0x%08X\n", exitCode); + printf("GetExitCodeProcess status: %"PRId32"\n", status); + printf("Process exited with code: 0x%08"PRIX32"\n", exitCode); CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hThread); @@ -97,7 +97,7 @@ int TestThreadCreateProcess(int argc, char* argv[]) if (!CreatePipe(&pipe_read, &pipe_write, &saAttr, 0)) { - printf("Pipe creation failed. error=%d\n", GetLastError()); + printf("Pipe creation failed. error=%"PRIu32"\n", GetLastError()); return 1; } @@ -113,7 +113,7 @@ int TestThreadCreateProcess(int argc, char* argv[]) if (!(lpEnvironment = calloc(1, sizeof(TESTENV_T) + sizeof(TCHAR)))) { - printf("Failed to allocate environment buffer. error=%d\n", GetLastError()); + printf("Failed to allocate environment buffer. error=%"PRIu32"\n", GetLastError()); return 1; } memcpy(lpEnvironment, (void*)TESTENV_T, sizeof(TESTENV_T)); @@ -136,13 +136,13 @@ int TestThreadCreateProcess(int argc, char* argv[]) { CloseHandle(pipe_read); CloseHandle(pipe_write); - printf("CreateProcess failed. error=%d\n", GetLastError()); + printf("CreateProcess failed. error=%"PRIu32"\n", GetLastError()); return 1; } if (WaitForSingleObject(ProcessInformation.hProcess, 5000) != WAIT_OBJECT_0) { - printf("Failed to wait for second process. error=%d\n", GetLastError()); + printf("Failed to wait for second process. error=%"PRIu32"\n", GetLastError()); return 1; } @@ -160,8 +160,8 @@ int TestThreadCreateProcess(int argc, char* argv[]) exitCode = 0; status = GetExitCodeProcess(ProcessInformation.hProcess, &exitCode); - printf("GetExitCodeProcess status: %d\n", status); - printf("Process exited with code: 0x%08X\n", exitCode); + printf("GetExitCodeProcess status: %"PRId32"\n", status); + printf("Process exited with code: 0x%08"PRIX32"\n", exitCode); CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hThread); diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index 402ca2246..7e3d724ce 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -173,7 +173,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); free(msg); winpr_backtrace_free(stack); @@ -181,7 +181,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(thread->create_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); free(msg); @@ -199,7 +199,7 @@ static void dump_thread(WINPR_THREAD* thread) msg = winpr_backtrace_symbols(thread->exit_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); free(msg); } @@ -296,7 +296,7 @@ static void* thread_launcher(void* arg) if (!(fkt = (fkt_t)thread->lpStartAddress)) { - WLog_ERR(TAG, "Thread function argument is %p", fkt); + WLog_ERR(TAG, "Thread function argument is %p", (void *)fkt); goto exit; } @@ -768,7 +768,7 @@ VOID DumpThreadHandles(void) for (i = 0; i < used; i++) { - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); } free(msg); @@ -795,7 +795,7 @@ VOID DumpThreadHandles(void) for (i = 0; i < used; i++) { - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); } free(msg); @@ -810,7 +810,7 @@ VOID DumpThreadHandles(void) msg = winpr_backtrace_symbols(thread->exit_stack, &used); for (i = 0; i < used; i++) - WLog_DBG(TAG, "[%d]: %s", i, msg[i]); + WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]); free(msg); } diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index e2e5e3d8a..7d1ac4c44 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -2155,7 +2155,7 @@ static TIME_ZONE_RULE_ENTRY* winpr_get_current_time_zone_rule(TIME_ZONE_RULE_ENT { if ((rules[i].TicksStart >= windows_time) && (windows_time >= rules[i].TicksEnd)) { - /*WLog_ERR(TAG, "Got rule %d from table at %p with count %u", i, rules, count);*/ + /*WLog_ERR(TAG, "Got rule %d from table at %p with count %"PRIu32"", i, (void*) rules, count);*/ return &rules[i]; } } @@ -2189,7 +2189,7 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) if (dtz!= NULL) { int status; - WLog_DBG(TAG, "tz: Bias=%d sn='%s' dln='%s'", + WLog_DBG(TAG, "tz: Bias=%"PRId32" sn='%s' dln='%s'", dtz->Bias, dtz->StandardName, dtz->DaylightName); tz->Bias = dtz->Bias; @@ -2235,7 +2235,7 @@ DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) } /* could not detect timezone, use computed bias from tm_gmtoff */ - WLog_DBG(TAG, "tz not found, using computed bias %d.", tz->Bias); + WLog_DBG(TAG, "tz not found, using computed bias %"PRId32".", tz->Bias); out_error: free(dtz); memcpy(tz->StandardName, L"Client Local Time", sizeof(tz->StandardName)); diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index 847e5331e..4d1090c49 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -424,7 +424,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used) if (SymGetLineFromAddr64(process, address, &displacement, line)) { - sprintf_s(vlines[i], line_len, "%08lX: %s in %s:%lu", symbol->Address, symbol->Name, line->FileName, (unsigned long) line->LineNumber); + sprintf_s(vlines[i], line_len, "%08lX: %s in %s:%lu", symbol->Address, symbol->Name, line->FileName, line->LineNumber); } else sprintf_s(vlines[i], line_len, "%08lX: %s", symbol->Address, symbol->Name); @@ -495,7 +495,7 @@ void winpr_log_backtrace(const char* tag, DWORD level, DWORD size) if (msg) { for (x=0; x= 0x20 && p[i] < 0x7F) ? p[i] : '.'); + (p[i] >= 0x20 && p[i] < 0x7F) ? (char) p[i] : '.'); WLog_LVL(tag, level, "%s", buffer); offset += line; @@ -84,7 +84,7 @@ void winpr_CArrayDump(const char* tag, UINT32 level, const BYTE* data, int lengt if (!buffer) { - WLog_ERR(tag, "malloc(%lu) failed with [%d] %s", (unsigned long)llen, errno, strerror(errno)); + WLog_ERR(tag, "malloc(%"PRIuz") failed with [%d] %s", llen, errno, strerror(errno)); return; } @@ -98,7 +98,7 @@ void winpr_CArrayDump(const char* tag, UINT32 level, const BYTE* data, int lengt pos = 0; for (i = 0; i < line; i++) - pos += trio_snprintf(&buffer[pos], llen - pos, "\\x%02X", p[i]); + pos += trio_snprintf(&buffer[pos], llen - pos, "\\x%02"PRIX8"", p[i]); WLog_LVL(tag, level, "%s", buffer); offset += line; diff --git a/winpr/libwinpr/utils/test/TestArrayList.c b/winpr/libwinpr/utils/test/TestArrayList.c index 16ece244a..38d1650e6 100644 --- a/winpr/libwinpr/utils/test/TestArrayList.c +++ b/winpr/libwinpr/utils/test/TestArrayList.c @@ -53,7 +53,7 @@ int TestArrayList(int argc, char* argv[]) ArrayList_RemoveAt(arrayList, 0); if (val != index) { - printf("ArrayList: shifted %d entries, expected value %d, got %ld\n", index, index, (long int)val); + printf("ArrayList: shifted %d entries, expected value %d, got %"PRIdz"\n", index, index, val); return -1; } } diff --git a/winpr/libwinpr/utils/test/TestBacktrace.c b/winpr/libwinpr/utils/test/TestBacktrace.c index ea731923f..76ff919d7 100644 --- a/winpr/libwinpr/utils/test/TestBacktrace.c +++ b/winpr/libwinpr/utils/test/TestBacktrace.c @@ -17,7 +17,7 @@ int TestBacktrace(int argc, char* argv[]) if (msg) { for (x=0; x #include #include diff --git a/winpr/libwinpr/utils/test/TestLinkedList.c b/winpr/libwinpr/utils/test/TestLinkedList.c index 6697ae668..05cf4c645 100644 --- a/winpr/libwinpr/utils/test/TestLinkedList.c +++ b/winpr/libwinpr/utils/test/TestLinkedList.c @@ -19,7 +19,7 @@ int TestLinkedList(int argc, char* argv[]) if (count != 3) { - printf("LinkedList_Count: expected %d, actual: %d\n", 3, count); + printf("LinkedList_Count: expected 3, actual: %d\n", count); return -1; } @@ -27,13 +27,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %d Last: %d\n", - (int) (size_t) LinkedList_First(list), (int) (size_t) LinkedList_Last(list)); + printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", + (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); LinkedList_RemoveFirst(list); LinkedList_RemoveLast(list); @@ -42,7 +41,7 @@ int TestLinkedList(int argc, char* argv[]) if (count != 1) { - printf("LinkedList_Count: expected %d, actual: %d\n", 1, count); + printf("LinkedList_Count: expected 1, actual: %d\n", count); return -1; } @@ -50,13 +49,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %d Last: %d\n", - (int) (size_t) LinkedList_First(list), (int) (size_t) LinkedList_Last(list)); + printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", + (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); LinkedList_RemoveFirst(list); LinkedList_RemoveLast(list); @@ -65,7 +63,7 @@ int TestLinkedList(int argc, char* argv[]) if (count != 0) { - printf("LinkedList_Count: expected %d, actual: %d\n", 0, count); + printf("LinkedList_Count: expected 0, actual: %d\n", count); return -1; } @@ -77,7 +75,7 @@ int TestLinkedList(int argc, char* argv[]) if (count != 3) { - printf("LinkedList_Count: expected %d, actual: %d\n", 3, count); + printf("LinkedList_Count: expected 3, actual: %d\n", count); return -1; } @@ -85,13 +83,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %d Last: %d\n", - (int) (size_t) LinkedList_First(list), (int) (size_t) LinkedList_Last(list)); + printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", + (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); LinkedList_Remove(list, (void*) (size_t) 5); @@ -99,13 +96,12 @@ int TestLinkedList(int argc, char* argv[]) while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); - printf("LinkedList First: %d Last: %d\n", - (int) (size_t) LinkedList_First(list), (int) (size_t) LinkedList_Last(list)); + printf("LinkedList First: %"PRIuz" Last: %"PRIuz"\n", + (size_t) LinkedList_First(list), (size_t) LinkedList_Last(list)); LinkedList_Free(list); @@ -116,8 +112,7 @@ int TestLinkedList(int argc, char* argv[]) LinkedList_Enumerator_Reset(list); while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\terror: %"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); LinkedList_Free(list); @@ -129,8 +124,7 @@ int TestLinkedList(int argc, char* argv[]) LinkedList_AddLast(list, (void*) (size_t) 6); while (LinkedList_Enumerator_MoveNext(list)) { - number = (int) (size_t) LinkedList_Enumerator_Current(list); - printf("\t%d\n", number); + printf("\t%"PRIuz"\n", (size_t) LinkedList_Enumerator_Current(list)); } printf("\n"); LinkedList_Free(list); diff --git a/winpr/libwinpr/utils/test/TestListDictionary.c b/winpr/libwinpr/utils/test/TestListDictionary.c index 56b04d268..d0b5545f1 100644 --- a/winpr/libwinpr/utils/test/TestListDictionary.c +++ b/winpr/libwinpr/utils/test/TestListDictionary.c @@ -30,7 +30,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 3) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 3, count); + printf("ListDictionary_Count: Expected : 3, Actual: %d\n", count); return -1; } @@ -40,7 +40,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 2) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 2, count); + printf("ListDictionary_Count: Expected : 2, Actual: %d\n", count); return -1; } @@ -50,7 +50,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 1) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 1, count); + printf("ListDictionary_Count: Expected : 1, Actual: %d\n", count); return -1; } @@ -60,7 +60,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 0) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 0, count); + printf("ListDictionary_Count: Expected : 0, Actual: %d\n", count); return -1; } @@ -73,7 +73,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 3) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 3, count); + printf("ListDictionary_Count: Expected : 3, Actual: %d\n", count); return -1; } @@ -81,8 +81,8 @@ int TestListDictionary(int argc, char* argv[]) if (strcmp(value, val1) != 0) { - printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", - (int) (size_t) val1, (int) (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", + (size_t) val1, (size_t) value); return -1; } @@ -90,8 +90,8 @@ int TestListDictionary(int argc, char* argv[]) if (strcmp(value, val2) != 0) { - printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", - (int) (size_t) val2, (int) (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", + (size_t) val2, (size_t) value); return -1; } @@ -99,8 +99,8 @@ int TestListDictionary(int argc, char* argv[]) if (strcmp(value, val3) != 0) { - printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", - (int) (size_t) val3, (int) (size_t) value); + printf("ListDictionary_GetItemValue: Expected : %"PRIuz", Actual: %"PRIuz"\n", + (size_t) val3, (size_t) value); return -1; } @@ -116,19 +116,19 @@ int TestListDictionary(int argc, char* argv[]) if (!ListDictionary_Contains(list, key2)) { - printf("ListDictionary_Contains: Expected : %d, Actual: %d\n", TRUE, FALSE); + printf("ListDictionary_Contains: Expected : TRUE, Actual: FALSE\n"); return -1; } if (!ListDictionary_Remove(list, key2)) { - printf("ListDictionary_Remove: Expected : %d, Actual: %d\n", TRUE, FALSE); + printf("ListDictionary_Remove: Expected : TRUE, Actual: FALSE\n"); return -1; } if (ListDictionary_Remove(list, key2)) { - printf("ListDictionary_Remove: Expected : %d, Actual: %d\n", FALSE, TRUE); + printf("ListDictionary_Remove: Expected : FALSE, Actual: TRUE\n"); return -1; } @@ -165,7 +165,7 @@ int TestListDictionary(int argc, char* argv[]) if (count != 0) { - printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 0, count); + printf("ListDictionary_Count: Expected : 0, Actual: %d\n", count); return -1; } diff --git a/winpr/libwinpr/utils/test/TestMessageQueue.c b/winpr/libwinpr/utils/test/TestMessageQueue.c index 16da36c15..97dcec035 100644 --- a/winpr/libwinpr/utils/test/TestMessageQueue.c +++ b/winpr/libwinpr/utils/test/TestMessageQueue.c @@ -17,7 +17,7 @@ static void* message_queue_consumer_thread(void* arg) if (message.id == WMQ_QUIT) break; - printf("Message.Type: %d\n", message.id); + printf("Message.Type: %"PRIu32"\n", message.id); } } diff --git a/winpr/libwinpr/utils/test/TestStream.c b/winpr/libwinpr/utils/test/TestStream.c index e9ba77f1f..ded6157f0 100644 --- a/winpr/libwinpr/utils/test/TestStream.c +++ b/winpr/libwinpr/utils/test/TestStream.c @@ -1,4 +1,3 @@ - #include #include #include @@ -18,46 +17,46 @@ static BOOL TestStream_Verify(wStream* s, int mincap, int len, int pos) if (Stream_Pointer(s) < Stream_Buffer(s)) { printf("stream pointer (%p) or buffer (%p) is invalid\n", - Stream_Pointer(s), Stream_Buffer(s)); + (void*) Stream_Pointer(s), (void*) Stream_Buffer(s)); return FALSE; } if (Stream_Capacity(s) < mincap) { - printf("stream capacity is %ld but minimum expected value is %d\n", + printf("stream capacity is %"PRIuz" but minimum expected value is %d\n", Stream_Capacity(s), mincap); return FALSE; } if (Stream_Length(s) != len) { - printf("stream has unexpected length (%ld instead of %d)\n", + printf("stream has unexpected length (%"PRIuz" instead of %d)\n", Stream_Length(s), len); return FALSE; } if (Stream_GetPosition(s) != pos) { - printf("stream has unexpected position (%ld instead of %d)\n", + printf("stream has unexpected position (%"PRIuz" instead of %d)\n", Stream_GetPosition(s), pos); return FALSE; } if (Stream_GetPosition(s) > Stream_Length(s)) { - printf("stream position (%ld) exceeds length (%ld)\n", + printf("stream position (%"PRIuz") exceeds length (%"PRIuz")\n", Stream_GetPosition(s), Stream_Length(s)); return FALSE; } if (Stream_GetPosition(s) > Stream_Capacity(s)) { - printf("stream position (%ld) exceeds capacity (%ld)\n", + printf("stream position (%"PRIuz") exceeds capacity (%"PRIuz")\n", Stream_GetPosition(s), Stream_Capacity(s)); return FALSE; } if (Stream_Length(s) > Stream_Capacity(s)) { - printf("stream length (%ld) exceeds capacity (%ld)\n", + printf("stream length (%"PRIuz") exceeds capacity (%"PRIuz")\n", Stream_Length(s), Stream_Capacity(s)); return FALSE; } if (Stream_GetRemainingLength(s) != len - pos) { - printf("stream remaining length (%ld instead of %d)\n", + printf("stream remaining length (%"PRIuz" instead of %d)\n", Stream_GetRemainingLength(s), len - pos); return FALSE; } @@ -173,7 +172,7 @@ static BOOL TestStream_Extent(UINT32 maxSize) if (!TestStream_Verify(s, i, i, i)) { - printf("%s: failed to verify stream in iteration %d\n", __FUNCTION__, i); + printf("%s: failed to verify stream in iteration %"PRIu32"\n", __FUNCTION__, i); goto fail; } } diff --git a/winpr/libwinpr/utils/test/TestWLog.c b/winpr/libwinpr/utils/test/TestWLog.c index 2757bb152..1162db4ba 100644 --- a/winpr/libwinpr/utils/test/TestWLog.c +++ b/winpr/libwinpr/utils/test/TestWLog.c @@ -1,4 +1,3 @@ - #include #include #include diff --git a/winpr/libwinpr/utils/test/TestWLogCallback.c b/winpr/libwinpr/utils/test/TestWLogCallback.c index e41c11c76..e073e949a 100644 --- a/winpr/libwinpr/utils/test/TestWLogCallback.c +++ b/winpr/libwinpr/utils/test/TestWLogCallback.c @@ -1,4 +1,3 @@ - #include #include #include diff --git a/winpr/libwinpr/utils/wlog/Appender.c b/winpr/libwinpr/utils/wlog/Appender.c index 461023fea..6a331c2f3 100644 --- a/winpr/libwinpr/utils/wlog/Appender.c +++ b/winpr/libwinpr/utils/wlog/Appender.c @@ -128,7 +128,7 @@ wLogAppender* WLog_Appender_New(wLog* log, DWORD logAppenderType) appender = (wLogAppender*) WLog_UdpAppender_New(log); break; default: - fprintf(stderr, "%s: unknown handler type %d\n", __FUNCTION__, logAppenderType); + fprintf(stderr, "%s: unknown handler type %"PRIu32"\n", __FUNCTION__, logAppenderType); appender = NULL; break; } diff --git a/winpr/libwinpr/utils/wlog/BinaryAppender.c b/winpr/libwinpr/utils/wlog/BinaryAppender.c index 10290dc65..8908e460d 100644 --- a/winpr/libwinpr/utils/wlog/BinaryAppender.c +++ b/winpr/libwinpr/utils/wlog/BinaryAppender.c @@ -53,7 +53,7 @@ static BOOL WLog_BinaryAppender_Open(wLog* log, wLogAppender* appender) binaryAppender->FileName = (char*) malloc(MAX_PATH); if (!binaryAppender->FileName) return FALSE; - sprintf_s(binaryAppender->FileName, MAX_PATH, "%u.wlog", (unsigned int) GetCurrentProcessId()); + sprintf_s(binaryAppender->FileName, MAX_PATH, "%"PRIu32".wlog", GetCurrentProcessId()); } if (!binaryAppender->FilePath) diff --git a/winpr/libwinpr/utils/wlog/FileAppender.c b/winpr/libwinpr/utils/wlog/FileAppender.c index 8c921283a..040fe139f 100644 --- a/winpr/libwinpr/utils/wlog/FileAppender.c +++ b/winpr/libwinpr/utils/wlog/FileAppender.c @@ -81,7 +81,7 @@ static BOOL WLog_FileAppender_Open(wLog* log, wLogAppender* appender) if (!fileAppender->FileName) return FALSE; - sprintf_s(fileAppender->FileName, MAX_PATH, "%u.log", (unsigned int) GetCurrentProcessId()); + sprintf_s(fileAppender->FileName, MAX_PATH, "%"PRIu32".log", GetCurrentProcessId()); } if (!fileAppender->FullFileName) diff --git a/winpr/libwinpr/utils/wlog/JournaldAppender.c b/winpr/libwinpr/utils/wlog/JournaldAppender.c index 875682e3d..7064d198e 100644 --- a/winpr/libwinpr/utils/wlog/JournaldAppender.c +++ b/winpr/libwinpr/utils/wlog/JournaldAppender.c @@ -107,7 +107,7 @@ static BOOL WLog_JournaldAppender_WriteMessage(wLog* log, wLogAppender* appender case WLOG_OFF: return TRUE; default: - fprintf(stderr, "%s: unknown level %d\n", __FUNCTION__, message->Level); + fprintf(stderr, "%s: unknown level %"PRIu32"\n", __FUNCTION__, message->Level); return FALSE; } diff --git a/winpr/libwinpr/utils/wlog/Message.c b/winpr/libwinpr/utils/wlog/Message.c index 77f94d7df..46265069f 100644 --- a/winpr/libwinpr/utils/wlog/Message.c +++ b/winpr/libwinpr/utils/wlog/Message.c @@ -54,9 +54,9 @@ char* WLog_Message_GetOutputFileName(int id, const char* ext) ProcessId = GetCurrentProcessId(); if (id >= 0) - sprintf_s(FileName, 256, "%u-%d.%s", (unsigned int) ProcessId, id, ext); + sprintf_s(FileName, 256, "%"PRIu32"-%d.%s", ProcessId, id, ext); else - sprintf_s(FileName, 256, "%u.%s", (unsigned int) ProcessId, ext); + sprintf_s(FileName, 256, "%"PRIu32".%s", ProcessId, ext); FullFileName = GetCombinedPath(FilePath, FileName); diff --git a/winpr/libwinpr/utils/wlog/wlog.c b/winpr/libwinpr/utils/wlog/wlog.c index f3f51df46..d84708ba7 100644 --- a/winpr/libwinpr/utils/wlog/wlog.c +++ b/winpr/libwinpr/utils/wlog/wlog.c @@ -112,7 +112,7 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, int line) return FALSE; for (i = 0; i < used; i++) - if (fprintf(stderr, "%s: %lu: %s\n", fkt, (unsigned long)i, msg[i]) < 0) + if (fprintf(stderr, "%s: %"PRIuz": %s\n", fkt, i, msg[i]) < 0) return FALSE; #endif diff --git a/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c b/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c index c9898ac64..c3dfff116 100644 --- a/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c +++ b/winpr/libwinpr/wnd/test/TestWndCreateWindowEx.c @@ -31,13 +31,13 @@ static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM { PWTSSESSION_NOTIFICATION pNotification = (PWTSSESSION_NOTIFICATION) lParam; - printf("WM_WTSSESSION_CHANGE: %s SessionId: %d\n", + printf("WM_WTSSESSION_CHANGE: %s SessionId: %"PRIu32"\n", WM_WTS_STRINGS[wParam], (int) pNotification->dwSessionId); } break; default: - printf("TestWndProc: uMsg: 0x%04X\n", uMsg); + printf("TestWndProc: uMsg: 0x%08"PRIX32"\n", uMsg); return DefWindowProc(hwnd, uMsg, wParam, lParam); break; } diff --git a/winpr/libwinpr/wnd/test/TestWndWmCopyData.c b/winpr/libwinpr/wnd/test/TestWndWmCopyData.c index ab075356f..4581c19a6 100644 --- a/winpr/libwinpr/wnd/test/TestWndWmCopyData.c +++ b/winpr/libwinpr/wnd/test/TestWndWmCopyData.c @@ -17,7 +17,7 @@ static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM if (!pCopyData) break; - printf("WM_COPYDATA: cbData: %d dwData: %d\n", + printf("WM_COPYDATA: cbData: %"PRIu32" dwData: %"PRIu32"\n", (int) pCopyData->cbData, (int) pCopyData->dwData); } break; @@ -27,7 +27,7 @@ static LRESULT CALLBACK TestWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM break; default: - printf("TestWndProc: uMsg: 0x%04X\n", uMsg); + printf("TestWndProc: uMsg: 0x%08"PRIX32"\n", uMsg); return DefWindowProc(hwnd, uMsg, wParam, lParam); break; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c index 64f7ba0a5..aad4b3db3 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateProcesses.c @@ -28,16 +28,16 @@ int TestWtsApiEnumerateProcesses(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateProcesses failed: %u\n", GetLastError()); + printf("WTSEnumerateProcesses failed: %"PRIu32"\n", GetLastError()); return -1; } #if 0 { DWORD i; - printf("WTSEnumerateProcesses enumerated %u processs:\n", count); + printf("WTSEnumerateProcesses enumerated %"PRIu32" processs:\n", count); for (i = 0; i < count; i++) - printf("\t[%u]: %s (%lu)\n", i, pProcessInfo[i].pProcessName, pProcessInfo[i].ProcessId); + printf("\t[%"PRIu32"]: %s (%"PRIu32")\n", i, pProcessInfo[i].pProcessName, pProcessInfo[i].ProcessId); } #endif diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c index bec10bd73..da6ff4e35 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiEnumerateSessions.c @@ -29,15 +29,15 @@ int TestWtsApiEnumerateSessions(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateSessions failed: %d\n", (int) GetLastError()); + printf("WTSEnumerateSessions failed: %"PRIu32"\n", GetLastError()); return 0; } - printf("WTSEnumerateSessions count: %d\n", (int) count); + printf("WTSEnumerateSessions count: %"PRIu32"\n", count); for (index = 0; index < count; index++) { - printf("[%u] SessionId: %u WinstationName: '%s' State: %s (%u)\n", index, + printf("[%"PRIu32"] SessionId: %"PRIu32" WinstationName: '%s' State: %s (%u)\n", index, pSessionInfo[index].SessionId, pSessionInfo[index].pWinStationName, WTSSessionStateToString(pSessionInfo[index].State), diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c index ed7373537..2e2cfe2fd 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDisconnectSession.c @@ -14,7 +14,7 @@ int TestWtsApiExtraDisconnectSession(int argc, char* argv[]) if (!bSuccess) { - printf("WTSDisconnectSession failed: %d\n", (int) GetLastError()); + printf("WTSDisconnectSession failed: %"PRIu32"\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c index 04c71c09e..a2c61fe3e 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraDynamicVirtualChannel.c @@ -19,7 +19,7 @@ int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) if (hVirtualChannel == INVALID_HANDLE_VALUE) { - printf("WTSVirtualChannelOpen failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelOpen opend"); @@ -28,7 +28,7 @@ int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) if (!bSuccess) { - printf("WTSVirtualChannelWrite failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelWrite written"); @@ -38,7 +38,7 @@ int TestWtsApiExtraDynamicVirtualChannel(int argc, char* argv[]) if (!bSuccess) { - printf("WTSVirtualChannelRead failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelRead read"); diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c index 907f268f2..595de269c 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraLogoffSession.c @@ -16,7 +16,7 @@ int TestWtsApiExtraLogoffSession(int argc, char* argv[]) if (!bSuccess) { - printf("WTSLogoffSession failed: %d\n", (int) GetLastError()); + printf("WTSLogoffSession failed: %"PRIu32"\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c index ef8420abc..32ba995b4 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraSendMessage.c @@ -19,11 +19,11 @@ int TestWtsApiExtraSendMessage(int argc, char* argv[]) if (!bSuccess) { - printf("WTSSendMessage failed: %d\n", (int) GetLastError()); + printf("WTSSendMessage failed: %"PRIu32"\n", GetLastError()); return -1; } - printf("WTSSendMessage got result: %d\n", (int) result); + printf("WTSSendMessage got result: %"PRIu32"\n", result); return 0; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c index 816bc46ce..74dc0f8a1 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraStartRemoteSessionEx.c @@ -21,7 +21,7 @@ int TestWtsApiExtraStartRemoteSessionEx(int argc, char* argv[]) if (!bSuccess) { - printf("WTSStartRemoteControlSessionEx failed: %d\n", (int) GetLastError()); + printf("WTSStartRemoteControlSessionEx failed: %"PRIu32"\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c index 30bd89783..0ec08cdcf 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiExtraVirtualChannel.c @@ -18,7 +18,7 @@ int TestWtsApiExtraVirtualChannel(int argc, char* argv[]) if (hVirtualChannel == INVALID_HANDLE_VALUE) { - printf("WTSVirtualChannelOpen failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelOpen opend"); @@ -27,7 +27,7 @@ int TestWtsApiExtraVirtualChannel(int argc, char* argv[]) if (!bSuccess) { - printf("WTSVirtualChannelWrite failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelWrite written"); @@ -37,7 +37,7 @@ int TestWtsApiExtraVirtualChannel(int argc, char* argv[]) if (!bSuccess) { - printf("WTSVirtualChannelRead failed: %d\n", (int) GetLastError()); + printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError()); return -1; } printf("WTSVirtualChannelRead read"); diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c index 835180633..6e0b137fd 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c @@ -32,11 +32,11 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSEnumerateSessions failed: %d\n", (int) GetLastError()); + printf("WTSEnumerateSessions failed: %"PRIu32"\n", GetLastError()); return 0; } - printf("WTSEnumerateSessions count: %d\n", (int) count); + printf("WTSEnumerateSessions count: %"PRIu32"\n", count); for (index = 0; index < count; index++) { @@ -56,7 +56,7 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) sessionId = pSessionInfo[index].SessionId; - printf("[%u] SessionId: %u State: %s (%u) WinstationName: '%s'\n", + printf("[%"PRIu32"] SessionId: %"PRIu32" State: %s (%u) WinstationName: '%s'\n", index, pSessionInfo[index].SessionId, WTSSessionStateToString(pSessionInfo[index].State), @@ -69,7 +69,7 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSUserName failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSUserName failed: %"PRIu32"\n", GetLastError()); return -1; } @@ -82,7 +82,7 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSDomainName failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSDomainName failed: %"PRIu32"\n", GetLastError()); return -1; } @@ -95,7 +95,7 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSConnectState failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSConnectState failed: %"PRIu32"\n", GetLastError()); return -1; } @@ -108,12 +108,12 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientBuildNumber failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientBuildNumber failed: %"PRIu32"\n", GetLastError()); return -1; } ClientBuildNumber = *((ULONG*) pBuffer); - printf("\tWTSClientBuildNumber: %u\n", ClientBuildNumber); + printf("\tWTSClientBuildNumber: %"PRIu32"\n", ClientBuildNumber); /* WTSClientName */ @@ -121,7 +121,7 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientName failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientName failed: %"PRIu32"\n", GetLastError()); return -1; } @@ -134,12 +134,12 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientProductId failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientProductId failed: %"PRIu32"\n", GetLastError()); return -1; } ClientProductId = *((USHORT*) pBuffer); - printf("\tWTSClientProductId: %u\n", ClientProductId); + printf("\tWTSClientProductId: %"PRIu16"\n", ClientProductId); /* WTSClientHardwareId */ @@ -147,12 +147,12 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientHardwareId failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientHardwareId failed: %"PRIu32"\n", GetLastError()); return -1; } ClientHardwareId = *((ULONG*) pBuffer); - printf("\tWTSClientHardwareId: %u\n", ClientHardwareId); + printf("\tWTSClientHardwareId: %"PRIu32"\n", ClientHardwareId); /* WTSClientAddress */ @@ -160,15 +160,15 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientAddress failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientAddress failed: %"PRIu32"\n", GetLastError()); return -1; } ClientAddress = (PWTS_CLIENT_ADDRESS) pBuffer; - printf("\tWTSClientAddress: AddressFamily: %u Address: ", + printf("\tWTSClientAddress: AddressFamily: %"PRIu32" Address: ", ClientAddress->AddressFamily); for (i = 0; i < sizeof(ClientAddress->Address); i++) - printf("%02X", ClientAddress->Address[i]); + printf("%02"PRIX8"", ClientAddress->Address[i]); printf("\n"); @@ -178,12 +178,12 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientDisplay failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientDisplay failed: %"PRIu32"\n", GetLastError()); return -1; } ClientDisplay = (PWTS_CLIENT_DISPLAY) pBuffer; - printf("\tWTSClientDisplay: HorizontalResolution: %u VerticalResolution: %u ColorDepth: %u\n", + printf("\tWTSClientDisplay: HorizontalResolution: %"PRIu32" VerticalResolution: %"PRIu32" ColorDepth: %"PRIu32"\n", ClientDisplay->HorizontalResolution, ClientDisplay->VerticalResolution, ClientDisplay->ColorDepth); @@ -193,12 +193,12 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) if (!bSuccess) { - printf("WTSQuerySessionInformation WTSClientProtocolType failed: %d\n", (int) GetLastError()); + printf("WTSQuerySessionInformation WTSClientProtocolType failed: %"PRIu32"\n", GetLastError()); return -1; } ClientProtocolType = *((USHORT*) pBuffer); - printf("\tWTSClientProtocolType: %u\n", ClientProtocolType); + printf("\tWTSClientProtocolType: %"PRIu16"\n", ClientProtocolType); } WTSFreeMemory(pSessionInfo); diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c b/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c index 3e9b047b7..ba5d5676c 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiSessionNotification.c @@ -21,7 +21,7 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) hWnd = CreateWindowA("STATIC", "TestWtsApiSessionNotification", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); if (!hWnd) { - printf("%s: error creating message-only window: %u\n", __FUNCTION__, GetLastError()); + printf("%s: error creating message-only window: %"PRIu32"\n", __FUNCTION__, GetLastError()); return -1; } #endif @@ -32,7 +32,7 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) if (!bSuccess) { - printf("%s: WTSRegisterSessionNotification failed: %u\n", __FUNCTION__, GetLastError()); + printf("%s: WTSRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError()); return -1; } @@ -48,7 +48,7 @@ int TestWtsApiSessionNotification(int argc, char* argv[]) if (!bSuccess) { - printf("%s: WTSUnRegisterSessionNotification failed: %u\n", __FUNCTION__, GetLastError()); + printf("%s: WTSUnRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c b/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c index 80d5335a8..c79abab44 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiShutdownSystem.c @@ -24,7 +24,7 @@ int TestWtsApiShutdownSystem(int argc, char* argv[]) if (!bSuccess) { - printf("WTSShutdownSystem failed: %d\n", (int) GetLastError()); + printf("WTSShutdownSystem failed: %"PRIu32"\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c b/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c index e42879f2a..2f7051f4c 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiWaitSystemEvent.c @@ -28,7 +28,7 @@ int TestWtsApiWaitSystemEvent(int argc, char* argv[]) if (!bSuccess) { - printf("WTSWaitSystemEvent failed: %d\n", (int) GetLastError()); + printf("WTSWaitSystemEvent failed: %"PRIu32"\n", GetLastError()); return -1; } diff --git a/winpr/libwinpr/wtsapi/wtsapi_win32.c b/winpr/libwinpr/wtsapi/wtsapi_win32.c index 300a9642c..5c85d1235 100644 --- a/winpr/libwinpr/wtsapi/wtsapi_win32.c +++ b/winpr/libwinpr/wtsapi/wtsapi_win32.c @@ -152,13 +152,13 @@ BOOL Win32_WTSVirtualChannelReadAsync(WTSAPI_CHANNEL* pChannel) if (status) { - WLog_ERR(TAG, "Unexpected ReadFile status: %d numBytes: %d", status, numBytes); + WLog_ERR(TAG, "Unexpected ReadFile status: %"PRId32" numBytes: %"PRIu32"", status, numBytes); return FALSE; /* ReadFile should return FALSE and set ERROR_IO_PENDING */ } if (GetLastError() != ERROR_IO_PENDING) { - WLog_ERR(TAG, "ReadFile: GetLastError() = %d", GetLastError()); + WLog_ERR(TAG, "ReadFile: GetLastError() = %"PRIu32"", GetLastError()); return FALSE; } diff --git a/winpr/test/TestIntrinsics.c b/winpr/test/TestIntrinsics.c index 4c63fc062..430f74a69 100644 --- a/winpr/test/TestIntrinsics.c +++ b/winpr/test/TestIntrinsics.c @@ -29,7 +29,7 @@ static INLINE UINT32 lzcnt_s(UINT32 x) int test_lzcnt() { if (lzcnt_s(0x1) != 31) { - fprintf(stderr, "__lzcnt(0x1) != 31: %d\n", __lzcnt(0x1)); + fprintf(stderr, "__lzcnt(0x1) != 31: %"PRIu32"\n", __lzcnt(0x1)); return -1; } @@ -80,7 +80,7 @@ int TestIntrinsics(int argc, char* argv[]) { g_LZCNT = IsProcessorFeaturePresentEx(PF_EX_LZCNT); - printf("LZCNT available: %d\n", g_LZCNT); + printf("LZCNT available: %"PRId32"\n", g_LZCNT); //test_lzcnt16(); return test_lzcnt(); diff --git a/winpr/tools/hash-cli/hash.c b/winpr/tools/hash-cli/hash.c index ea791630d..d12c71ccc 100644 --- a/winpr/tools/hash-cli/hash.c +++ b/winpr/tools/hash-cli/hash.c @@ -163,7 +163,7 @@ int main(int argc, char* argv[]) if (format == 0) { for (index = 0; index < 16; index++) - printf("%02x", NtHash[index]); + printf("%02"PRIx8"", NtHash[index]); printf("\n"); } else if (format == 1) @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) printf(":"); for (index = 0; index < 16; index++) - printf("%02x", NtHash[index]); + printf("%02"PRIx8"", NtHash[index]); printf(":::"); printf("\n");