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);
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
Stream_Read_UINT32(s, Version);
- DEBUG_DVC("Version=%d", Version);
+ DEBUG_DVC("Version=%"PRIu32"", Version);
out = Stream_New(NULL, 5);
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 */
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);
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;
}
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;
}
}
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;
}
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;
}
}
Stream_Read_UINT8(data, MessageId);
- DEBUG_DVC("MessageId=0x%x", MessageId);
+ DEBUG_DVC("MessageId=0x%02"PRIx8"", MessageId);
switch (MessageId)
{
break;
default:
- WLog_ERR(TAG, "unknown MessageId=0x%x", MessageId);
+ WLog_ERR(TAG, "unknown MessageId=0x%02"PRIx8"", MessageId);
error = ERROR_INVALID_DATA;
break;
}
{
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);
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;
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;
}
{
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;
}
}
{
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;
}
}
{
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;
}
{
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);
}
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;
}
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;
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
{
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. */
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);
}
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;
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);
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;
}
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;
}
{
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);
UINT error;
AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device;
- DEBUG_DVC("device=%p", device);
+ DEBUG_DVC("device=%p", (void*) device);
assert(opensles);
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);
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;
AudinOpenSLESDevice* opensles;
UINT error;
- DEBUG_DVC("pEntryPoints=%p", pEntryPoints);
+ DEBUG_DVC("pEntryPoints=%p", (void*) pEntryPoints);
opensles = (AudinOpenSLESDevice*) calloc(1, sizeof(AudinOpenSLESDevice));
if (!opensles)
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;
}
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;
}
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)
{
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;
// 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;
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;
// 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)
// 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)
// 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;
{
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);
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;
}
}
if (!e)
{
- WLog_ERR(TAG, "[ERROR] got e=%p from queue", e);
+ WLog_ERR(TAG, "[ERROR] got e=NULL from queue");
return -1;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
}
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)
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;
}
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;
}
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");
}
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");
}
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");
}
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");
}
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");
}
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");
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
};
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;
}
}
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;
}
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;
}
}
}
- 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:
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;
}
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;
}
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;
}
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
}
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;
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");
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
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
&unlockClipboardData);
if (error)
- WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %u!", error);
+ WLog_ERR(TAG, "ServerUnlockClipboardData failed with error %"PRIu32"!", error);
return error;
}
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
{
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;
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;
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;
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;
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;
}
}
}
- 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);
}
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);;
}
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);
}
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);
}
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);
}
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;
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;
}
}
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;
}
&& (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;
}
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;
}
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;
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;
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);
}
}
- WLog_DBG(TAG, "ServerFormatList: numFormats: %d",
+ WLog_DBG(TAG, "ServerFormatList: numFormats: %"PRIu32"",
formatList->numFormats);
return cliprdr_server_packet_send(cliprdr, s);
}
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);
}
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);
}
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);
}
*/
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
}
- 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:
&formatListResponse);
if (error)
- WLog_ERR(TAG, "ClientFormatListResponse failed with error %u!", error);
+ WLog_ERR(TAG, "ClientFormatListResponse failed with error %"PRIu32"!", error);
return error;
}
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;
}
&unlockClipboardData);
if (error)
- WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %u!", error);
+ WLog_ERR(TAG, "ClientUnlockClipboardData failed with error %"PRIu32"!", error);
return error;
}
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;
}
&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;
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;
}
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;
}
{
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;
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
if ((error = context->CheckEventHandle(context)))
{
- WLog_ERR(TAG, "CheckEventHandle failed with error %u!", error);
+ WLog_ERR(TAG, "CheckEventHandle failed with error %"PRIu32"!", error);
break;
}
}
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;
}
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++)
{
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
}
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;
}
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)
{
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;
}
}
}
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;
}
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;
}
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;
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;
}
}
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;
}
(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;
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;
}
{
if (error)
{
- WLog_ERR(TAG, "OnNewChannelConnection failed with error %u!", error);
+ WLog_ERR(TAG, "OnNewChannelConnection failed with error %"PRIu32"!", error);
return error;
}
else
if (!channel)
{
- WLog_ERR(TAG, "ChannelId %d not found!", ChannelId);
+ WLog_ERR(TAG, "ChannelId %"PRIu32" not found!", ChannelId);
return ERROR_INTERNAL_ERROR;
}
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;
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.
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;
}
}
* 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;
}
{
/* 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;
}
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);
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;
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)
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;
}
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);
}
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));
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;
}
{
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;
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);
{
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);
}
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;
}
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;
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;
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;
}
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;
}
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;
}
(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;
}
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);
}
{
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;
}
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);
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;
}
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;
}
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;
}
}
&& (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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
if (error)
{
- WLog_ERR(TAG, "Response failed with error %u!", error);
+ WLog_ERR(TAG, "Response failed with error %"PRIu32"!", error);
break;
}
}
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;
}
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;
}
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,
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
{
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
&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;
}
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;
}
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;
}
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;
}
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);
}
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;
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;
}
}
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;
}
&& (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;
}
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;
}
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;
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;
break;
default:
- WLog_ERR(TAG, "Unhandled event type %d", event);
+ WLog_ERR(TAG, "Unhandled event type %"PRIu32"", event);
}
if (error && encomsp->rdpcontext)
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;
}
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;
{
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)
&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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
&& (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;
}
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;
}
if (error)
{
- WLog_ERR(TAG, "printjob->Write failed with error %u!", error);
+ WLog_ERR(TAG, "printjob->Write failed with error %"PRIu32"!", error);
return error;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
}
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;
}
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);
}
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);
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
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;
}
}
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;
}
&& (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;
}
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;
}
{
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;
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;
}
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);
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;
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;
}
{
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;
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;
}
{
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);
}
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;
}
{
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);
}
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;
}
{
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;
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;
}
{
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;
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;
}
{
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;
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;
}
{
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;
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;
}
{
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;
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)
{
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);
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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);
}
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;
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;
}
{
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);
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);
}
}
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;
}
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;
}
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);
}
}
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;
}
/* 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
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;
}
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;
}
}
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);
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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);
}
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;
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,
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,
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;
}
&& (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;
}
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;
}
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);
}
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;
break;
default:
- WLog_ERR(TAG, "unknown event %d!", event);
+ WLog_ERR(TAG, "unknown event %"PRIu32"!", event);
error = ERROR_INVALID_DATA;
break;
}
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;
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;
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;
}
{
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;
}
}
{
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;
}
}
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;
}
{
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;
}
{
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;
}
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;
}
}
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;
}
}
{
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;
}
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;
}
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;
}
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;
}
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;
}
&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;
}
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++)
{
}
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)
}
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++)
{
}
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)
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;
}
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));
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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);
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);
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);
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);
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;
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;
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);
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)
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);
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)
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)
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;
}
}
{
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)
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)
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)
{
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)
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);
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);
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)
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);
{
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)
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)
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;
}
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;
}
{
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;
}
}
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;
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) */
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) */
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;
}
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;
}
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;
}
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;
}
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
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
}
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;
}
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;
}
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;
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;
}
{
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;
{
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;
}
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);
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;
}
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;
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;
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);
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;
}
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;
}
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;
}
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);
}
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);
}
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;
}
{
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);
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);
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;
}
{
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);
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;
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;
{
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;
}
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)
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;
}
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;
}
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)
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;
}
}
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)
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);
}
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;
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)
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);
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)
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;
}
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;
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)
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++;
}
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)
{
if (error)
{
- WLog_ERR(TAG, "context->EndFrame failed with error %u", error);
+ WLog_ERR(TAG, "context->EndFrame failed with error %"PRIu32"", error);
return error;
}
}
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;
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;
}
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;
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;
}
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;
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;
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)
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;
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;
}
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)
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);
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;
}
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);
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);
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);
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;
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);
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;
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;
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
{
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;
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;
}
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));
}
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;
}
}
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);
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;
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));
}
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;
}
/* 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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
}
/* 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;
}
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;
}
}
/* 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;
}
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;
}
}
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);
}
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;
}
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);
}
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;
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);
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);
}
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);
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;
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;
}
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));
}
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;
}
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;
}
&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)
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;
}
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;
}
}
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);
}
{
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;
}
}
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;
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;
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;
// 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;
// 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;
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;
// 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;
// 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);
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;
}
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;
{
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;
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;
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;
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);
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);
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)
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;
} 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;
}
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;
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);
{
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[] =
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,
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)
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;
}
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;
}
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;
}
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);
}
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);
}
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);
}
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)
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);
}
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)
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))
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)
{
break;
default:
- WLog_ERR(TAG, "unknown msgType %d", msgType);
+ WLog_ERR(TAG, "unknown msgType %"PRIu8"", msgType);
break;
}
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;
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;
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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;
}
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);
}
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;
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;
}
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;
}
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;
}
{
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;
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;
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;
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;
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;
if (mmResult != MMSYSERR_NOERROR)
{
- WLog_ERR(TAG, "waveOutOpen failed: %d", mmResult);
+ WLog_ERR(TAG, "waveOutOpen failed: %"PRIu32"", mmResult);
return FALSE;
}
if (mmResult != MMSYSERR_NOERROR)
{
- WLog_ERR(TAG, "waveOutSetVolume failed: %d", mmResult);
+ WLog_ERR(TAG, "waveOutSetVolume failed: %"PRIu32"", mmResult);
return FALSE;
}
if (mmResult != MMSYSERR_NOERROR)
{
- WLog_ERR(TAG, "waveOutClose failure: %d", mmResult);
+ WLog_ERR(TAG, "waveOutClose failure: %"PRIu32"", mmResult);
}
winmm->hWaveOut = NULL;
if (mmResult != MMSYSERR_NOERROR)
{
- WLog_ERR(TAG, "waveOutPrepareHeader failure: %d", mmResult);
+ WLog_ERR(TAG, "waveOutPrepareHeader failure: %"PRIu32"", mmResult);
return;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
{
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;
}
}
}
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);
}
}
&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)
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;
}
/* 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;
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;
}
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;
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);
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;
}
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;
}
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);
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);
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;
}
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);
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;
}
Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */
- //WLog_DBG(TAG, "msgType: %d", msgType);
+ //WLog_DBG(TAG, "msgType: %"PRIu32"", msgType);
switch (msgType)
{
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;
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;
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;
}
{
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;
}
}
{
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;
}
break;
default:
- WLog_ERR(TAG, "unknown msgType: %d", msgType);
+ WLog_ERR(TAG, "unknown msgType: %"PRIu32"", msgType);
error = ERROR_INVALID_DATA;
break;
}
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;
}
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);
}
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;
break;
default:
- WLog_ERR(TAG, "unhandled event %u!", event);
+ WLog_ERR(TAG, "unhandled event %"PRIu32"!", event);
error = ERROR_INTERNAL_ERROR;
}
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;
}
}
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;
}
&& (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;
}
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);
}
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;
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;
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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);
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;
}
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;
}
}
Stream_Read_UINT32(s, msgType); /* msgType (4 bytes) */
- WLog_INFO(TAG, "msgType: %d", msgType);
+ WLog_INFO(TAG, "msgType: %"PRIu32"", msgType);
switch (msgType)
{
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
*
*/
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;
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;
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) */
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;
/* 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 */
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) */
* 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 */
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) */
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);
}
{
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)
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;
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;
/* 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;
}
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--;
{
/* 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);
}
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 */
}
{
/* 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
}
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);
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
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);
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);
&& (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;
}
{
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
}
{
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;
}
}
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;
}
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;
}
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;
}
}
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);
}
else
{
- WLog_ERR(TAG, "SCardEstablishContext failed with error %ld", status);
+ WLog_ERR(TAG, "SCardEstablishContext failed with error %"PRId32"", status);
return status;
}
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;
}
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;
}
else
{
- WLog_ERR(TAG, "SCardReleaseContext failed with error %ld", status);
+ WLog_ERR(TAG, "SCardReleaseContext failed with error %"PRId32"", status);
return status;
}
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;
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");
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;
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;
}
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));
if (status)
{
- WLog_ERR(TAG, "SCardListReadersW failed with error %ld", status);
+ WLog_ERR(TAG, "SCardListReadersW failed with error %"PRId32"", status);
return status;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
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");
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;
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;
}
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));
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;
}
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));
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;
}
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));
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");
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));
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");
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));
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");
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;
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;
}
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));
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;
}
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));
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;
}
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);
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;
}
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));
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;
}
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));
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);
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;
}
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;
}
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;
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;
}
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;
}
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);
{
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;
}
}
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)
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);
}
/* 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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
}
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, "}");
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;
}
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);
}
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;
}
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, "%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, "}");
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;
}
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;
}
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;
}
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, "}");
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;
}
}
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)
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, "}");
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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);
}
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, "}");
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;
}
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;
}
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);
}
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);
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, "}");
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;
}
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;
}
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);
}
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, "}");
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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++)
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);
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++)
{
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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, "}");
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;
}
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, "}");
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;
}
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;
}
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);
}
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, "}");
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;
}
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)
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);
}
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;
}
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;
}
{
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;
}
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;
}
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);
}
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)
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;
}
}
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)
{
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;
}
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;
}
{
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;
}
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;
}
{
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;
}
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;
}
{
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;
}
{
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;
}
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;
}
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);
}
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);
}
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)
WLog_DBG(TAG, "pioSendPci: null");
}
- WLog_DBG(TAG, "cbSendLength: %d", call->cbSendLength);
+ WLog_DBG(TAG, "cbSendLength: %"PRIu32"", call->cbSendLength);
if (call->pbSendBuffer)
{
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)
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, "}");
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;
}
}
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;
}
}
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)
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)
WLog_DBG(TAG, "pioRecvPci: null");
}
- WLog_DBG(TAG, "cbRecvLength: %d", ret->cbRecvLength);
+ WLog_DBG(TAG, "cbRecvLength: %"PRIu32"", ret->cbRecvLength);
if (ret->pbRecvBuffer)
{
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
{
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);
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);
}
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;
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;
#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
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"));
}
/* 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;
}
{
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;
}
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);
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)
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... */
* 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)
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;
}
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
/* 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;
}
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
{
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);
}
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;
}
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;
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;
}
}
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;
}
}
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);
}
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;
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);
#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],
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
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;
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);
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;
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;
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;
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)
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);
}
}
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);
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;
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)
tsmf_stream_end(stream, ifman->message_id, ifman->channel_callback);
}
- DEBUG_TSMF("StreamId %d", StreamId);
+ DEBUG_TSMF("StreamId %"PRIu32"", StreamId);
ifman->output_pending = TRUE;
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)
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
{
/* 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;
}
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));
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)
{
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;
if (error)
{
- WLog_ERR(TAG, "ifman data received processing error %d", error);
+ WLog_ERR(TAG, "ifman data received processing error %"PRIu32"", error);
}
if (!processed)
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 */
}
if (error)
{
- WLog_ERR(TAG, "response error %d", error);
+ WLog_ERR(TAG, "response error %"PRIu32"", error);
}
}
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;
}
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)
{
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);
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)
{
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;
}
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);
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;
}
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;
}
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)
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;
}
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;
}
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;
}
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;
}
}
if (stream)
{
- WLog_ERR(TAG, "duplicated stream id %d!", stream_id);
+ WLog_ERR(TAG, "duplicated stream id %"PRIu32"!", stream_id);
return NULL;
}
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);
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,
}
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);
{
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;
}
{
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;
}
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);
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;
}
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]);
}
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;
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);
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;
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,
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,
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,
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,
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;
}
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;
}
{
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,
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,
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,
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,
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,
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,
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,
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,
break;
default:
WLog_DBG(TAG, "urbdrc_process_udev_data_transfer:"
- " unknown FunctionId 0x%X", FunctionId);
+ " unknown FunctionId 0x%"PRIX32"", FunctionId);
error = -1;
break;
}
}
else
{
- //WLog_ERR(TAG, "actual length %d ", act_len);
+ //WLog_ERR(TAG, "actual length %"PRIu32"", act_len);
//exit(EXIT_FAILURE);
}
}
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;
}
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));
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);
}
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;
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;i<strlen(deviceLocation);i++){
Buffer[i*2] = (BYTE)deviceLocation[i];
*BufferSize = (i*2);
break;
default:
- WLog_DBG(TAG,"Query Text: unknown TextType %d", TextType);
+ WLog_DBG(TAG,"Query Text: unknown TextType %"PRIu32"", TextType);
break;
}
}
else
{
- WLog_DBG(TAG,"PORT STATUS:0x%02x%02x%02x%02x",
+ WLog_DBG(TAG,"PORT STATUS:0x%02"PRIx8"%02"PRIx8"%02"PRIx8"%02"PRIx8"",
Buffer[3], Buffer[2], Buffer[1], Buffer[0]);
success = 1;
}
if (!ep_desc)
{
- WLog_ERR(TAG, "func_get_ep_desc: endpoint 0x%x is not found!!", EndpointAddress);
+ WLog_ERR(TAG, "func_get_ep_desc: endpoint 0x%"PRIx32" is not found!!", EndpointAddress);
return -1;
}
transfer_type = (ep_desc->bmAttributes) & 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)
{
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;
}
*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);
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))
/* 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);
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*));
return (IUDEVICE*) pdev;
}
- WLog_ERR(TAG, "0x%x ERROR!!", UsbDevice);
+ WLog_ERR(TAG, "0x%"PRIx32" ERROR!!", UsbDevice);
return NULL;
}
{
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 ===============");
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;
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
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],
/* 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],
break;
default:
- WLog_ERR(TAG, "unknown FunctionId 0x%X", FunctionId);
+ WLog_ERR(TAG, "unknown FunctionId 0x%"PRIX32"", FunctionId);
error = ERROR_NOT_FOUND;
break;
}
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;
}
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;
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;
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)
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;
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);
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);
break;
default:
- WLog_ERR(TAG, "vchannel_status unknown value %d",
+ WLog_ERR(TAG, "vchannel_status unknown value %"PRIu32"",
urbdrc->vchannel_status);
break;
}
break;
default:
- WLog_VRB(TAG, "unknown FunctionId 0x%X", FunctionId);
+ WLog_VRB(TAG, "unknown FunctionId 0x%"PRIX32"", FunctionId);
error = 1;
break;
}
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)
{
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;
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;
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);
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")
if (!context || !e)
{
WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p",
- __FUNCTION__, context, e);
+ __FUNCTION__, (void*) context, (void*) e);
return;
}
if (!context || !e)
{
WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p",
- __FUNCTION__, context, e);
+ __FUNCTION__, (void*) context, (void*) e);
return;
}
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)
{
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
_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)
if (status != NO_ERROR)
{
- WLog_ERR(TAG, "CredUIPromptForCredentials unexpected status: 0x%08X", status);
+ WLog_ERR(TAG, "CredUIPromptForCredentials unexpected status: 0x%08lX", status);
return FALSE;
}
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))
{
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;
}
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;
}
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)) &&
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);
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)
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);
}
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)
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);
}
{
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);
}
}
{
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);
}
}
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, "}");
}
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;
}
}
/* 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;
/* --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)
{
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) ==
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;
}
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;
}
{
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)
{
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;
}
}
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)
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)
{
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;
}
break;
default:
- WLog_ERR(TAG, "unimplemented brush style:%d", brush->style);
+ WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style);
goto fail;
}
break;
default:
- WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style);
+ WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style);
goto fail;
}
break;
default:
- WLog_ERR(TAG, "PolygonSC unknown fillMode: %d", polygon_sc->fillMode);
+ WLog_ERR(TAG, "PolygonSC unknown fillMode: %"PRIu32"", polygon_sc->fillMode);
break;
}
break;
default:
- WLog_ERR(TAG, "PolygonCB unknown fillMode: %d", polygon_cb->fillMode);
+ WLog_ERR(TAG, "PolygonCB unknown fillMode: %"PRIu32"", polygon_cb->fillMode);
break;
}
}
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);
break;
default:
- WLog_ERR(TAG, "Unsupported codecID %d", cmd->codecID);
+ WLog_ERR(TAG, "Unsupported codecID %"PRIu32"", cmd->codecID);
ret = TRUE;
goto fail;
}
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)
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);
}
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;
}
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;
}
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)
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);
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;
}
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);
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);
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");
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")
}
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")
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;
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;
}
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;
}
}
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");
}
if (!context || !e)
{
WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p",
- __FUNCTION__, context, e);
+ __FUNCTION__, (void*) context, (void*) e);
return;
}
if (!context || !e)
{
WLog_FATAL(TAG, "%s(context=%p, EventArgs=%p",
- __FUNCTION__, context, e);
+ __FUNCTION__, (void*) context, (void*) e);
return;
}
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})
#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
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;
}
}
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;
}
{
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;
}
}
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;
}
{
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;
}
{
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;
}
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;
}
{
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;
}
{
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;
}
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;
}
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];
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;
}
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;
}
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;
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;
}
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;
}
{
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;
}
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;
}
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;
}
{
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;
}
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;
}
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;
}
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;
}
{
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;
}
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;
if (index >= pointer_cache->cacheSize)
{
- WLog_ERR(TAG, "invalid pointer index:%d", index);
+ WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index);
return NULL;
}
if (index >= pointer_cache->cacheSize)
{
- WLog_ERR(TAG, "invalid pointer index:%d", index);
+ WLog_ERR(TAG, "invalid pointer index:%"PRIu32"", index);
return FALSE;
}
}
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);
}
}
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);
if (formats)
{
- WLog_INFO(TAG, "AUDIO_FORMATS (%d) ={", count);
+ WLog_INFO(TAG, "AUDIO_FORMATS (%"PRIu16") ={", count);
for (index = 0; index < (int) count; index++)
{
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;
}
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;
}
if (paletteCount > 127)
{
- WLog_ERR(TAG, "paletteCount %lu", paletteCount);
+ WLog_ERR(TAG, "paletteCount %"PRIu8"", paletteCount);
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;
}
{
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;
}
{
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;
}
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;
}
if (suiteIndex > 127)
{
- WLog_ERR(TAG, "suiteIndex %lu > %lu]", suiteIndex, 127);
+ WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127]", suiteIndex);
return FALSE;
}
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;
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;
if (suiteIndex > 127)
{
- WLog_ERR(TAG, "suiteIndex %lu > %lu", suiteIndex, 127);
+ WLog_ERR(TAG, "suiteIndex %"PRIu8" > 127", suiteIndex);
return FALSE;
}
if (pixelIndex != pixelCount)
{
- WLog_ERR(TAG, "pixelIndex %lu != pixelCount %lu", pixelIndex, pixelCount);
+ WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount);
return FALSE;
}
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;
}
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;
}
{
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;
}
{
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;
}
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;
if (pixelIndex != pixelCount)
{
- WLog_ERR(TAG, "pixelIndex %lu != pixelCount %lu", pixelIndex, pixelCount);
+ WLog_ERR(TAG, "pixelIndex %"PRIu32" != pixelCount %"PRIu32"", pixelIndex, pixelCount);
return FALSE;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (bitmapDataByteCount != nSrcSize)
{
- WLog_ERR(TAG, "bitmapDataByteCount %lu != nSrcSize %lu", bitmapDataByteCount,
+ WLog_ERR(TAG, "bitmapDataByteCount %"PRIu32" != nSrcSize %"PRIu32"", bitmapDataByteCount,
nSrcSize);
return FALSE;
}
break;
default:
- WLog_ERR(TAG, "Unknown subcodec ID %lu", subcodecId);
+ WLog_ERR(TAG, "Unknown subcodec ID %"PRIu8"", subcodecId);
return FALSE;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (vBarHeight > 52)
{
- WLog_ERR(TAG, "vBarHeight > 52", vBarHeight);
+ WLog_ERR(TAG, "vBarHeight (%"PRIu32") > 52", vBarHeight);
return FALSE;
}
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;
}
if (vBarYOff < vBarYOn)
{
- WLog_ERR(TAG, "vBarYOff %lu < vBarYOn %lu", vBarYOff, vBarYOn);
+ WLog_ERR(TAG, "vBarYOff %"PRIu16" < vBarYOn %"PRIu16"", vBarYOff, vBarYOn);
return FALSE;
}
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;
}
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;
}
}
else
{
- WLog_ERR(TAG, "invalid vBarHeader %08lX", vBarHeader);
+ WLog_ERR(TAG, "invalid vBarHeader 0x%04"PRIX16"", vBarHeader);
return FALSE; /* invalid vBarHeader */
}
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;
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;
}
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;
}
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;
}
if (glyphIndex >= 4000)
{
- WLog_ERR(TAG, "Invalid glyphIndex %u", glyphIndex);
+ WLog_ERR(TAG, "Invalid glyphIndex %"PRIu16"", glyphIndex);
return FALSE;
}
if (!glyphEntry)
{
- WLog_ERR(TAG, "clear->GlyphCache[%lu]=NULL", glyphIndex);
+ WLog_ERR(TAG, "clear->GlyphCache[%"PRIu16"]=NULL", glyphIndex);
return FALSE;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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)
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;
}
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFCreateSample failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFCreateSample failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "GetOutputStreamInfo failure: 0x%04X", hr);
+ WLog_ERR(TAG, "GetOutputStreamInfo failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "AddBuffer failure: 0x%04X", hr);
+ WLog_ERR(TAG, "AddBuffer failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFCreateMemoryBuffer failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "Lock failure: 0x%04X", hr);
+ WLog_ERR(TAG, "Lock failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "SetCurrentLength failure: 0x%04X", hr);
+ WLog_ERR(TAG, "SetCurrentLength failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "Unlock failure: 0x%04X", hr);
+ WLog_ERR(TAG, "Unlock failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFCreateSample failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFCreateSample failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "AddBuffer failure: 0x%04X", hr);
+ WLog_ERR(TAG, "AddBuffer failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "ProcessInput failure: 0x%04X", hr);
+ WLog_ERR(TAG, "ProcessInput failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "SetOutputType failure: 0x%04X", hr);
+ WLog_ERR(TAG, "SetOutputType failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
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;
}
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;
}
}
else if (FAILED(hr))
{
- WLog_ERR(TAG, "ProcessOutput failure: 0x%04X", hr);
+ WLog_ERR(TAG, "ProcessOutput failure: 0x%08"PRIX32"", hr);
goto error;
}
else
if (FAILED(hr))
{
- WLog_ERR(TAG, "GetBufferCount failure: 0x%04X", hr);
+ WLog_ERR(TAG, "GetBufferCount failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "GetBufferByIndex failure: 0x%04X", hr);
+ WLog_ERR(TAG, "GetBufferByIndex failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "Lock failure: 0x%04X", hr);
+ WLog_ERR(TAG, "Lock failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "Unlock failure: 0x%04X", hr);
+ WLog_ERR(TAG, "Unlock failure: 0x%08"PRIX32"", hr);
goto error;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFStartup failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFStartup failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "MFCreateMediaType failure: 0x%04X", hr);
+ WLog_ERR(TAG, "MFCreateMediaType failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "SetInputType failure: 0x%04X", hr);
+ WLog_ERR(TAG, "SetInputType failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "SetOutputType failure: 0x%04X", hr);
+ WLog_ERR(TAG, "SetOutputType failure: 0x%08"PRIX32"", hr);
goto error;
}
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;
}
}
}
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;
}
#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
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)
}
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
break;
default:
- WLog_ERR(TAG, "Invalid color depth %d", bpp);
+ WLog_ERR(TAG, "Invalid color depth %"PRIu32"", bpp);
return FALSE;
}
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;
}
}
#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)
accumulator = Sym1;
#ifdef DEBUG_MPPC
- WLog_DBG(TAG, "%c", accumulator);
+ WLog_DBG(TAG, "%"PRIu32"", accumulator);
#endif
if (accumulator < 0x80)
}
#ifdef DEBUG_MPPC
- WLog_DBG(TAG, "<%d,%d>", (int) CopyOffset, (int) LengthOfMatch);
+ WLog_DBG(TAG, "<%"PRIu32",%"PRIu32">", CopyOffset, LengthOfMatch);
#endif
/* Encode CopyOffset */
accumulator = *pSrcPtr;
#ifdef DEBUG_MPPC
- WLog_DBG(TAG, "%c", accumulator);
+ WLog_DBG(TAG, "%"PRIu32"", accumulator);
#endif
if (accumulator < 0x80)
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;
}
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 */
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);
}
}
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);
}
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,
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,
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);
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);
}
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
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))
{
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);
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);
}
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++)
{
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);
}
}
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;
}
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;
}
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;
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;
}
if (channelId != 0x00)
{
- WLog_ERR(TAG, "channelId:0x%02X, expected:0x00", channelId);
+ WLog_ERR(TAG, "channelId:0x%02"PRIX8", expected:0x00", channelId);
return FALSE;
}
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;
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);
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;
}
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;
}
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);
}
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;
}
/* 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;
}
*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],
/* 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;
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;
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;
/* 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)
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;
}
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;
}
/* 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;
}
/* 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;
}
break;
default:
- WLog_ERR(TAG, "%s: unknown blockType 0x%X", __FUNCTION__, blockType);
+ WLog_ERR(TAG, "%s: unknown blockType 0x%"PRIX32"", __FUNCTION__, blockType);
goto fail;
}
#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;
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
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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");
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;
}
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;
}
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");
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");
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;
}
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;
}
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;
}
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;
}
{
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
);
}
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;
}
}
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;
}
}
- WLog_ERR(TAG, "unknown device type %d", device->Type);
+ WLog_ERR(TAG, "unknown device type %"PRIu32"", device->Type);
return NULL;
}
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;
}
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;
}
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;
}
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);
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);
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;
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;
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) */
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) */
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();
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;
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;
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);
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);
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);
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);
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
}
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
}
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) */
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
}
{
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;
}
{
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;
}
{
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;
}
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;
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;
}
{
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) */
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;
}
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
{
UINT32 flags;
UINT32 VCChunkSize;
- WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %d):", length);
+ WLog_INFO(TAG, "VirtualChannelCapabilitySet (length %"PRIu16"):", length);
if (length < 8)
return FALSE;
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;
}
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;
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;
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;
}
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;
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;
}
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;
}
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;
}
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;
}
{
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]);
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);
}
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)
{
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)
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;
}
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;
}
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);
}
else
{
- WLog_WARN(TAG, "not handling capability type %d yet", type);
+ WLog_WARN(TAG, "not handling capability type %"PRIu16" yet", type);
}
em = bm + length;
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;
}
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;
}
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);
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);
}
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;
}
}
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;
{
UINT32 dwSigAlgId;
UINT32 dwKeyAlgId;
- UINT32 wPublicKeyBlobType;
- UINT32 wPublicKeyBlobLen;
- UINT32 wSignatureBlobType;
- UINT32 wSignatureBlobLen;
+ UINT16 wPublicKeyBlobType;
+ UINT16 wPublicKeyBlobLen;
+ UINT16 wSignatureBlobType;
+ UINT16 wSignatureBlobLen;
BYTE* sigdata;
int sigdatalen;
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;
}
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))
{
if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB)
{
- WLog_ERR(TAG, "unsupported blob signature %d", wSignatureBlobType);
+ WLog_ERR(TAG, "unsupported blob signature %"PRIu16"", wSignatureBlobType);
return FALSE;
}
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;
}
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)
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);
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);
}
}
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;
}
if (!channel)
{
- WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %d", channelId);
+ WLog_ERR(TAG, "freerdp_channel_send: unknown channelId %"PRIu16"", channelId);
return FALSE;
}
(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))
{
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);
}
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
break;
default:
- WLog_ERR(TAG, "unknown updateCode 0x%X", updateCode);
+ WLog_ERR(TAG, "unknown updateCode 0x%02"PRIX8"", updateCode);
break;
}
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;
}
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;
}
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;
}
break;
default:
- WLog_ERR(TAG, "Unknown eventCode %d", eventCode);
+ WLog_ERR(TAG, "Unknown eventCode %"PRIu8"", eventCode);
break;
}
/* 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;
}
/* --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;
}
if (!status)
{
- WLog_ERR(TAG, "freerdp_check_fds() failed - %i", status);
+ WLog_ERR(TAG, "freerdp_check_fds() failed - %"PRIi32"", status);
return FALSE;
}
if (!status)
{
- WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %i", status);
+ WLog_ERR(TAG, "freerdp_channels_check_fds() failed - %"PRIi32"", status);
return FALSE;
}
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;
{
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;
}
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;
}
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;
}
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))
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;
}
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;
}
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;
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)
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");
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);
}
}
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;
}
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);
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)));
}
}
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;
}
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);
}
}
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;
}
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);
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;
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;
}
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;
}
{
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;
}
}
{
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;
}
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;
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;
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 =
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 =
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;
}
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);
}
{
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);
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);
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);
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);
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);
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);
}
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;
}
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;
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);
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);
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;
break;
default:
- WLog_ERR(TAG, "unexpected message type: %d", SwitchValue);
+ WLog_ERR(TAG, "unexpected message type: %"PRIu32"", SwitchValue);
status = FALSE;
break;
}
}
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;
#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
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;
}
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);
}
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;
}
break;
default:
- WLog_ERR(TAG, "Received unknown encryption method %08X",
+ WLog_ERR(TAG, "Received unknown encryption method %08"PRIX32"",
serverEncryptionMethod);
return FALSE;
}
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 ?? */
}
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;
}
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;
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 */
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;
}
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;
}
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;
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) */
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;
}
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;
}
*/
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);
*/
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);
*/
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);
*/
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);
*/
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);
{
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);
{
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);
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;
{
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)
{
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)
}
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;
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);
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 */
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);
}
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;
}
{
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;
}
{
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;
}
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;
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);
{
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++)
{
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);
break;
default:
- WLog_ERR(TAG, "invalid bMsgType:%d", bMsgType);
+ WLog_ERR(TAG, "invalid bMsgType:%"PRIu8"", bMsgType);
return FALSE;
}
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);
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;
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:");
}
#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;
}
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)
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, "}");
}
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;
}
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 ? */
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;
}
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))
{
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;
}
break;
default:
- WLog_ERR(TAG, "Error: Unknown protocol security error %d", failureCode);
+ WLog_ERR(TAG, "Error: Unknown protocol security error %"PRIu32"", failureCode);
break;
}
if (!identity)
{
- WLog_ERR(TAG, "NLA identity=%p", identity);
+ WLog_ERR(TAG, "NLA identity=%p", (void*) identity);
return -1;
}
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;
}
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;
}
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))
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
&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;
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;
}
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;
}
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;
}
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 */
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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);
}
}
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);
}
}
if (Stream_GetRemainingLength(s) < zeroBitsSize)
{
- WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %i", zeroBitsSize);
+ WLog_ERR(TAG, "Stream_GetRemainingLength(s) < %"PRIu32"", zeroBitsSize);
return FALSE;
}
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;
}
if (!new_points)
{
- WLog_ERR(TAG, "realloc(%i) failed", new_num);
+ WLog_ERR(TAG, "realloc(%"PRIu32") failed", new_num);
return FALSE;
}
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;
}
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;
}
{
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 ?
}
{
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;
}
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;
}
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;
}
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;
}
}
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)
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)
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)
{
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
break;
default:
- WLog_ERR(TAG, "Data PDU type %d", type);
+ WLog_ERR(TAG, "Data PDU type %"PRIu8"", type);
break;
}
break;
default:
- WLog_ERR(TAG, "Client sent pduType %d", pduType);
+ WLog_ERR(TAG, "Client sent pduType %"PRIu16"", pduType);
return -1;
}
}
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;
}
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;
}
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;
}
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)
break;
default:
- WLog_ERR(TAG, "incorrect PDU type: 0x%04X", pduType);
+ WLog_ERR(TAG, "incorrect PDU type: 0x%04"PRIX16"", pduType);
break;
}
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;
}
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;
}
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);
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++)
{
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;
}
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;
}
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;
}
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)
}
else
{
- DEBUG_DVC("ChannelId %d not exists.", ChannelId);
+ DEBUG_DVC("ChannelId %"PRIu32" not exists.", ChannelId);
}
}
else
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;
}
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);
break;
default:
- WLog_ERR(TAG, "unknown cmdType 0x%X", cmdType);
+ WLog_ERR(TAG, "unknown cmdType 0x%04"PRIX16"", cmdType);
return -1;
}
/* 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;
}
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
{
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));
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);
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;
}
/* 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;
}
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);
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);
/* 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));
/* 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;
}
{
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;
}
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;
}
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;
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)
{
int xorBpp)
{
BYTE* newMask;
- int scanlineSize;
+ UINT32 scanlineSize;
if (Stream_GetRemainingLength(s) < 14)
return FALSE;
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;
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;
}
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;
}
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);
}
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;
}
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;
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;
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;
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);
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);
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);
}
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);
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);
}
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);
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;
}
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;
}
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, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
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");
if (!dstp)
{
- WLog_ERR(TAG, "dstp=%p", dstp);
+ WLog_ERR(TAG, "dstp=%p", (void*) dstp);
return FALSE;
}
if (!srcp)
{
- WLog_ERR(TAG, "srcp=%p", srcp);
+ WLog_ERR(TAG, "srcp=%p", (void*) srcp);
return FALSE;
}
if (!patp)
{
- WLog_ERR(TAG, "patp=%p", patp);
+ WLog_ERR(TAG, "patp=%p", (void*) patp);
return FALSE;
}
break;
default:
- WLog_ERR(TAG, "unimplemented brush style:%d", brush->style);
+ WLog_ERR(TAG, "unimplemented brush style:%"PRIu32"", brush->style);
break;
}
break;
default:
- WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style);
+ WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%"PRIu32"", brush->style);
break;
}
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);
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);
break;
default:
- WLog_ERR(TAG, "Unsupported codecID %d", cmd->codecID);
+ WLog_ERR(TAG, "Unsupported codecID %"PRIu32"", cmd->codecID);
break;
}
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;
}
if (rc < 0)
{
- WLog_ERR(TAG, "clear_decompress failure: %d", rc);
+ WLog_ERR(TAG, "clear_decompress failure: %"PRId32"", rc);
return ERROR_INTERNAL_ERROR;
}
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;
}
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;
}
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,
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;
}
if (rc < 0)
{
- WLog_ERR(TAG, "progressive_decompress failure: %d", rc);
+ WLog_ERR(TAG, "progressive_decompress failure: %"PRId32"", rc);
return ERROR_INTERNAL_ERROR;
}
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)
{
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;
}
}
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++;
}
}
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" : "");
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);
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);
{
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)
{
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;
}
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;
}
{
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;
}
{
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;
}
|| (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;
}
{
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;
{
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;
}
{
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;
}
{
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;
}
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++;
}
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);
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]);
{
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;
}
}
{
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
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)))
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);
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;
{
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);
}
}
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;
}
void ringbuffer_destroy(RingBuffer* rb)
{
- DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", rb);
+ DEBUG_RINGBUFFER("ringbuffer_destroy(%p)", (void*) rb);
free(rb->buffer);
rb->buffer = NULL;
}
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)
{
{
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;
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)
{
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;
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;
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;
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;
}
{
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;
}
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");
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;
}
/* 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);
/* 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;
}
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;
}
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]);
}
}
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;
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);
if (status != noErr)
{
- WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %d", status);
+ WLog_DBG(TAG, "AudioQueueEnqueueBuffer() returned status = %"PRId32"", status);
}
}
*/
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;
}
}
Stream_SetPosition(s, BytesReturned);
- WLog_DBG(TAG, "got %lu bytes", (unsigned long) BytesReturned);
+ WLog_DBG(TAG, "got %"PRIu32" bytes", BytesReturned);
}
Stream_Free(s, TRUE);
* 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);
}
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)
#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
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;
}
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 */
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;
}
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;
}
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);
}
{
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
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++;
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)
{
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))
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;
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;
}
{
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)
}
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;
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 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;
}
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;
}
{
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;
}
if (wfi->mutex == NULL)
{
- WLog_ERR(TAG, "CreateMutex error: %d", GetLastError());
+ WLog_ERR(TAG, "CreateMutex error: %lu", GetLastError());
free(wfi);
return NULL;
}
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;
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)
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?");
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?");
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?");
}
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);
}
/**
0, NULL );\r
\r
// 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);
}
\r
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);
*/
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;
}
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;
}
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,
}
pCollection->lpVtbl->GetCount(pCollection, &count);
- WLog_INFO(TAG, "Num endpoints: %d", count);
+ WLog_INFO(TAG, "Num endpoints: %u", count);
if (count == 0)
{
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);
}
break;
default:
- WLog_ERR(TAG, "Unknown message id: %u", message->id);
+ WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id);
break;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "D3D11CreateDevice failure: 0x%04X", hr);
+ WLog_ERR(TAG, "D3D11CreateDevice failure: 0x%08lX", hr);
return -1;
}
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;
}
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)
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)
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;
}
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;
}
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;
}
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;
}
VARIANT vr;
UINT uArgErr;
- WLog_INFO(TAG, "%s (%d)", GetRDPSessionEventString(dispIdMember), dispIdMember);
+ WLog_INFO(TAG, "%s (%ld)", GetRDPSessionEventString(dispIdMember), dispIdMember);
switch (dispIdMember)
{
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "CoCreateInstance(IRDPSRAPISharingSession) failure: 0x%08X", hr);
+ WLog_ERR(TAG, "CoCreateInstance(IRDPSRAPISharingSession) failure: 0x%08lX", hr);
return -1;
}
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;
}
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;
}
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;
}
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;
}
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,
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "IRDPSRAPISharingSession::Open() failure: 0x%08X", hr);
+ WLog_ERR(TAG, "IRDPSRAPISharingSession::Open() failure: 0x%08lX", hr);
return -1;
}
if (FAILED(hr))
{
- WLog_ERR(TAG, "IRDPSRAPIInvitationManager::CreateInvitation() failure: 0x%08X", hr);
+ WLog_ERR(TAG, "IRDPSRAPIInvitationManager::CreateInvitation() failure: 0x%08lX", hr);
return -1;
}
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;
}
break;
default:
- WLog_ERR(TAG, "Unknown message id: %u", id);
+ WLog_ERR(TAG, "Unknown message id: %"PRIu32"", id);
free(msg);
break;
}
break;
default:
- WLog_ERR(TAG, "Unknown message id: %u", message->id);
+ WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id);
break;
}
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;
*/
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;
}
/**
if (error)
{
- WLog_ERR(TAG, "CreateSurface failed with error %u", error);
+ WLog_ERR(TAG, "CreateSurface failed with error %"PRIu32"", error);
return FALSE;
}
if (error)
{
- WLog_ERR(TAG, "MapSurfaceToOutput failed with error %u", error);
+ WLog_ERR(TAG, "MapSurfaceToOutput failed with error %"PRIu32"", error);
return FALSE;
}
if (error)
{
- WLog_ERR(TAG, "DeleteSurface failed with error %u", error);
+ WLog_ERR(TAG, "DeleteSurface failed with error %"PRIu32"", error);
return FALSE;
}
if (error)
{
- WLog_ERR(TAG, "ResetGraphics failed with error %u", error);
+ WLog_ERR(TAG, "ResetGraphics failed with error %"PRIu32"", error);
return FALSE;
}
break;
default:
- WLog_ERR(TAG, "Unknown message id: %u", message->id);
+ WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id);
free(message->wParam);
break;
}
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);
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);
}
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;
cmd.bottom = cmd.top + nHeight;
cmd.width = nWidth;
cmd.height = nHeight;
+ cmd.length = 0;
+ cmd.data = NULL;
+ cmd.extra = NULL;
if (settings->GfxH264)
{
if (error)
{
- WLog_ERR(TAG, "SurfaceFrameCommand failed with error %u", error);
+ WLog_ERR(TAG, "SurfaceFrameCommand failed with error %"PRIu32"", error);
return FALSE;
}
}
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;
}
default:
- WLog_ERR(TAG, "Unknown message id: %u", message->id);
+ WLog_ERR(TAG, "Unknown message id: %"PRIu32"", message->id);
break;
}
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;
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));
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);
}
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;
}
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)
} \
} \
} else { \
- WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%d)", _nbits); \
+ WLog_WARN("com.winpr.bitstream", "warning: BitStream_Shift(%u)", (unsigned)_nbits); \
} \
} while(0)
body = strstr(pSrcData, "<BODY");
/* StartHTML */
- sprintf_s(num, sizeof(num), "%010lu", (unsigned long int)strlen(pDstData));
+ sprintf_s(num, sizeof(num), "%010lu", strlen(pDstData));
CopyMemory(&pDstData[23], num, 10);
if (!body)
strcat(pDstData, "<!--StartFragment-->");
/* 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, "<!--EndFragment-->");
strcat(pDstData, "</BODY></HTML>");
/* 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;
{
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);
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);
{
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);
break;
default:
- CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %d\n",
+ CommLog_Print(WLOG_WARN, "Unexpected fDtrControl value: %"PRIu32"\n",
lpDCB->fDtrControl);
return FALSE;
}
break;
default:
- CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %d\n",
+ CommLog_Print(WLOG_WARN, "Unexpected fRtsControl value: %"PRIu32"\n",
lpDCB->fRtsControl);
return FALSE;
}
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);
}
if (lpSecurityAttributes != NULL)
{
- CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%lu",
+ CommLog_Print(WLOG_WARN, "unexpected security attributes, nLength=%"PRIu32"",
lpSecurityAttributes->nLength);
}
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);
}
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;
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)
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)
}
}
- 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;
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());
}
#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)
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;
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;
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;
}
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;
}
}
}
- 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;
}
*/
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 */
}
/* 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 */
}
/* 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 */
}
/* 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 */
}
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;
}
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;
}
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;
}
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;
}
// 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 */
}
// 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 */
}
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;
}
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;
}
{
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;
}
{
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;
}
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;
/* 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;
{
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;
}
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);
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))
if (!success)
{
- fprintf(stderr, "SetCommState failure: GetLastError() = 0x%x\n", (int) GetLastError());
+ fprintf(stderr, "SetCommState failure: GetLastError() = 0x%x\n", GetLastError());
return EXIT_FAILURE;
}
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);
{
BOOL result;
TCHAR lpTargetPath[MAX_PATH];
- DWORD tcslen;
+ size_t tcslen;
result = DefineCommDevice(lpDeviceName, _T("/dev/test"));
if ((!expectedResult && result) || (expectedResult && !result)) /* logical XOR */
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;
}
{
if (tcslen > 0)
{
- _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: <none>, result: %d %s\n"),
+ _tprintf(_T("QueryCommDevice failure: device name: %s, expected result: <none>, result: %")_T(PRIuz)_T(" %s\n"),
lpDeviceName, tcslen, lpTargetPath);
return FALSE;
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;
}
}
else
{
- printf("WaitCommEvent failure: GetLastError() = %d\n", (int) dwError);
+ printf("WaitCommEvent failure: GetLastError() = %"PRIu32"\n", dwError);
return -1;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (status != NO_ERROR)
{
- printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
+ printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status);
return -1;
}
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);
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);
if (status != NO_ERROR)
{
- printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
+ printf("CredUIPromptForCredentials unexpected status: 0x%08"PRIX32"\n", status);
return -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
#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; \
}
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");
if (!length)
{
DWORD error = GetLastError();
- printf("MultiByteToWideChar error: 0x%08X\n", error);
+ printf("MultiByteToWideChar error: 0x%08"PRIX32"\n", error);
return -1;
}
if (!length)
{
DWORD error = GetLastError();
- printf("WideCharToMultiByte error: 0x%08X\n", error);
+ printf("WideCharToMultiByte error: 0x%08"PRIX32"\n", error);
return -1;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
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;
}
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;
}
return -1;
}
- printf("Completed %d iterations.\n", *pLoopCount);
+ printf("Completed %"PRId32" iterations.\n", *pLoopCount);
return status;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
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;
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;
}
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;
}
-
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/windows.h>
if (*Addend != 10)
{
- printf("InterlockedIncrement failure: Actual: %ld, Expected: 10\n", (long) *Addend);
+ printf("InterlockedIncrement failure: Actual: %"PRId32", Expected: 10\n", *Addend);
return -1;
}
if (*Addend != 0)
{
- printf("InterlockedDecrement failure: Actual: %ld, Expected: 0\n", (long) *Addend);
+ printf("InterlockedDecrement failure: Actual: %"PRId32", Expected: 0\n", *Addend);
return -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (ntstatus != STATUS_SUCCESS)
{
- printf("_NtCreateFile failure: 0x%08X\n", ntstatus);
+ printf("_NtCreateFile failure: 0x%08"PRIX32"\n", ntstatus);
goto out;
}
if (ntstatus != STATUS_SUCCESS)
{
- printf("_NtClose failure: 0x%08X\n", ntstatus);
+ printf("_NtClose failure: 0x%08"PRIX32"\n", ntstatus);
goto out;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
-
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/path.h>
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;
}
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;
}
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 */
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
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;
}
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;
}
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;
}
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;
}
}
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))
if (!status)
{
- _tprintf(_T("PathIsUNCEx status: 0x%08X\n"), status);
+ _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status);
return -1;
}
if (status)
{
- _tprintf(_T("PathIsUNCEx status: 0x%08X\n"), status);
+ _tprintf(_T("PathIsUNCEx status: 0x%08")_T(PRIX32)_T("\n"), status);
return -1;
}
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++)
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;
}
}
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);
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:
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;
if (!fConnected)
{
- printf("%s: ConnectNamedPipe #%d failed. (%u)\n", __FUNCTION__, i, GetLastError());
+ printf("%s: ConnectNamedPipe #%d failed. (%"PRIu32")\n", __FUNCTION__, i, GetLastError());
goto out;
}
}
#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);
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;
}
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;
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;
}
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 */
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))
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;
}
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;
}
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)
{
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;
}
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))
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;
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;
}
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;
}
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;
}
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++)
}
-#endif
\ No newline at end of file
+#endif
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)
{
#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)
/* 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)
{
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: ");
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__
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;
}
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
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;
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;
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;
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;
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
{
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;
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;
}
#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);
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;
#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);
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));
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)
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);
{
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--)
{
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)
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);
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);
}
}
#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)
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);
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [%08X]",
+ WLog_WARN(TAG, "AcquireCredentialsHandleW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [%08X]",
+ WLog_WARN(TAG, "AcquireCredentialsHandleA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "ExportSecurityContext status %s [%08X]",
+ WLog_WARN(TAG, "ExportSecurityContext status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "FreeCredentialsHandle status %s [%08X]",
+ WLog_WARN(TAG, "FreeCredentialsHandle status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "ImportSecurityContextW status %s [%08X]",
+ WLog_WARN(TAG, "ImportSecurityContextW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "ImportSecurityContextA status %s [%08X]",
+ WLog_WARN(TAG, "ImportSecurityContextA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [%08X]",
+ WLog_WARN(TAG, "QueryCredentialsAttributesW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [%08X]",
+ WLog_WARN(TAG, "QueryCredentialsAttributesA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "AcceptSecurityContext status %s [%08X]",
+ WLog_WARN(TAG, "AcceptSecurityContext status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "ApplyControlToken status %s [%08X]",
+ WLog_WARN(TAG, "ApplyControlToken status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "CompleteAuthToken status %s [%08X]",
+ WLog_WARN(TAG, "CompleteAuthToken status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "DeleteSecurityContext status %s [%08X]",
+ WLog_WARN(TAG, "DeleteSecurityContext status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "ImpersonateSecurityContext status %s [%08X]",
+ WLog_WARN(TAG, "ImpersonateSecurityContext status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "InitializeSecurityContextW status %s [%08X]",
+ WLog_WARN(TAG, "InitializeSecurityContextW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "InitializeSecurityContextA status %s [%08X]",
+ WLog_WARN(TAG, "InitializeSecurityContextA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "QueryContextAttributesW status %s [%08X]",
+ WLog_WARN(TAG, "QueryContextAttributesW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "QueryContextAttributesA status %s [%08X]",
+ WLog_WARN(TAG, "QueryContextAttributesA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "QuerySecurityContextToken status %s [%08X]",
+ WLog_WARN(TAG, "QuerySecurityContextToken status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "SetContextAttributesW status %s [%08X]",
+ WLog_WARN(TAG, "SetContextAttributesW status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "SetContextAttributesA status %s [%08X]",
+ WLog_WARN(TAG, "SetContextAttributesA status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "RevertSecurityContext status %s [%08X]",
+ WLog_WARN(TAG, "RevertSecurityContext status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "DecryptMessage status %s [%08X]",
+ WLog_WARN(TAG, "DecryptMessage status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (status != SEC_E_OK)
{
- WLog_ERR(TAG, "EncryptMessage status %s [%08X]",
+ WLog_ERR(TAG, "EncryptMessage status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "MakeSignature status %s [%08X]",
+ WLog_WARN(TAG, "MakeSignature status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
if (IsSecurityStatusError(status))
{
- WLog_WARN(TAG, "VerifySignature status %s [%08X]",
+ WLog_WARN(TAG, "VerifySignature status %s [0x%08"PRIX32"]",
GetSecurityStatusString(status), status);
}
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++)
{
if (status != SEC_E_OK)
{
- printf("QuerySecurityPackageInfo status: 0x%08X\n", status);
+ printf("QuerySecurityPackageInfo status: 0x%08"PRIX32"\n", status);
return -1;
}
if (status != SEC_E_OK)
{
- printf("AcquireCredentialsHandle status: 0x%08X\n", status);
+ printf("AcquireCredentialsHandle status: 0x%08"PRIX32"\n", status);
sspi_GlobalFinish();
return -1;
}
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);
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;
}
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;
}
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;
}
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;
}
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 */
}
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
&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
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
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,
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))
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,
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)
if (status != SEC_E_OK)
{
- printf("QuerySecurityPackageInfo failure: 0x%08X\n", status);
+ printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status);
return NULL;
}
if (status != SEC_E_OK)
{
- printf("AcquireCredentialsHandle failure: 0x%08X\n", status);
+ printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status);
return NULL;
}
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;
}
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);
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))
if (status != SEC_E_OK)
{
- printf("QuerySecurityPackageInfo failure: 0x%08X\n", status);
+ printf("QuerySecurityPackageInfo failure: 0x%08"PRIX32"\n", status);
return -1;
}
if (status != SEC_E_OK)
{
- printf("AcquireCredentialsHandle failure: 0x%08X\n", status);
+ printf("AcquireCredentialsHandle failure: 0x%08"PRIX32"\n", status);
return -1;
}
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;
}
* 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));
}
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 |
}
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;
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;
}
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);
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))
if (msg)
{
for(i=0; i<used; i++)
- WLog_ERR(TAG, "%2d: %s", i, msg[i]);
+ WLog_ERR(TAG, "%2"PRIdz": %s", i, msg[i]);
}
free (msg);
winpr_backtrace_free(stack);
p.flags = dwFlags;
expectedTrueCount = dwLoops;
expectedFalseCount = dwLoops * (dwThreads - 1);
- printf("%s: >> 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))))
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;
{
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);
}
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;
}
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;
#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;
}
{
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)
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))
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]);
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;
}
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);
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)))
{
{
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;
}
{
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;
}
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);
if (!threads[i])
{
- printf("CreateThread [%i] failure\n", i);
+ printf("CreateThread [%"PRIu32"] failure\n", i);
return -1;
}
}
{
if (!CloseHandle(threads[i]))
{
- printf("CloseHandle [%d] failure\n", i);
+ printf("CloseHandle [%"PRIu32"] failure\n", i);
return -1;
}
}
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;
}
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;
}
}
{
if (!ReleaseMutex(mutex))
{
- printf("%s: ReleaseMutex #%u failed\n", __FUNCTION__, i);
+ printf("%s: ReleaseMutex #%"PRIu32" failed\n", __FUNCTION__, i);
return FALSE;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
if (!hTimerQueue)
{
- printf("CreateTimerQueue failed (%u)\n", GetLastError());
+ printf("CreateTimerQueue failed (%"PRIu32")\n", GetLastError());
return -1;
}
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;
}
}
{
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;
}
}
*/
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);
if (!DeleteTimerQueue(hTimerQueue))
{
- printf("DeleteTimerQueue failed (%u)\n", GetLastError());
+ printf("DeleteTimerQueue failed (%"PRIu32")\n", GetLastError());
return -1;
}
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;
}
apcData = (APC_DATA*) lpArg;
- printf("TimerAPCProc: time: %d\n", CurrentTime - apcData->StartTime);
+ printf("TimerAPCProc: time: %"PRIu32"\n", CurrentTime - apcData->StartTime);
g_Count++;
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;
}
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;
}
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);
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;
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;
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;
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);
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;
}
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));
{
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;
}
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);
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);
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);
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);
}
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;
}
for (i = 0; i < used; i++)
{
- WLog_DBG(TAG, "[%d]: %s", i, msg[i]);
+ WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]);
}
free(msg);
for (i = 0; i < used; i++)
{
- WLog_DBG(TAG, "[%d]: %s", i, msg[i]);
+ WLog_DBG(TAG, "[%"PRIdz"]: %s", i, msg[i]);
}
free(msg);
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);
}
{
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];
}
}
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;
}
/* 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));
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);
if (msg)
{
for (x=0; x<used; x++)
- WLog_LVL(tag, level, "%lu: %s\n", (unsigned long)x, msg[x]);
+ WLog_LVL(tag, level, "%"PRIuz": %s\n", x, msg[x]);
}
winpr_backtrace_free(stack);
}
free(msg);
#endif
} else {
- _snprintf(dmsg, size, "FAILURE: %08X", GetLastError());
+ _snprintf(dmsg, size, "FAILURE: 0x%08"PRIX32"", GetLastError());
}
#else /* defined(_WIN32) */
_snprintf(dmsg, size, "%s", strerror(dw));
if (!buffer)
{
- WLog_ERR(tag, "malloc(%lu) failed with [%d] %s", (unsigned long)blen, errno, strerror(errno));
+ WLog_ERR(tag, "malloc(%"PRIuz") failed with [%d] %s", blen, errno, strerror(errno));
return;
}
line = WINPR_HEXDUMP_LINE_LENGTH;
for (i = 0; i < line; i++)
- pos += trio_snprintf(&buffer[pos], blen - pos, "%02x ", p[i]);
+ pos += trio_snprintf(&buffer[pos], blen - pos, "%02"PRIx8" ", p[i]);
for (; i < WINPR_HEXDUMP_LINE_LENGTH; i++)
pos += trio_snprintf(&buffer[pos], blen - pos, " ");
for (i = 0; i < line; i++)
pos += trio_snprintf(&buffer[pos], blen - pos, "%c",
- (p[i] >= 0x20 && p[i] < 0x7F) ? p[i] : '.');
+ (p[i] >= 0x20 && p[i] < 0x7F) ? (char) p[i] : '.');
WLog_LVL(tag, level, "%s", buffer);
offset += line;
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;
}
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;
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;
}
}
if (msg)
{
for (x=0; x<used; x++)
- printf("%lu: %s\n", (unsigned long)x, msg[x]);
+ printf("%"PRIuz": %s\n", x, msg[x]);
rc = 0;
}
winpr_backtrace_symbols_fd(stack, fileno(stdout));
data = BipBuffer_WriteReserve(bb, 1024 * 2);
- fprintf(stderr, "BipBuffer_BufferSize: %d\n", (int) BipBuffer_BufferSize(bb));
+ fprintf(stderr, "BipBuffer_BufferSize: %"PRIuz"\n", BipBuffer_BufferSize(bb));
BipBuffer_Free(bb);
if (BufferSize != DefaultSize)
{
- printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %d\n", BufferSize, DefaultSize);
+ printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %"PRIu32"\n", BufferSize, DefaultSize);
return -1;
}
if (BufferSize != DefaultSize)
{
- printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %d\n", BufferSize, DefaultSize);
+ printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %"PRIu32"\n", BufferSize, DefaultSize);
return -1;
}
if (BufferSize != 2048)
{
- printf("BufferPool_GetBufferSize failure: Actual: %d Expected: %d\n", BufferSize, 2048);
+ printf("BufferPool_GetBufferSize failure: Actual: %d Expected: 2048\n", BufferSize);
return -1;
}
if (PoolSize != 2)
{
- printf("BufferPool_GetPoolSize failure: Actual: %d Expected: %d\n", PoolSize, 2);
+ printf("BufferPool_GetPoolSize failure: Actual: %"PRIu32" Expected: 2\n", PoolSize);
return -1;
}
if ((width != 1024) || (height != 768))
{
- printf("Unexpected width and height: Actual: (%dx%d), Expected: (%dx%d)\n", width, height, 1024, 768);
+ printf("Unexpected width and height: Actual: (%dx%d), Expected: (1024x768)\n", width, height);
return -1;
}
if (count != 3)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("HashTable_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (count != 2)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 2, count);
+ printf("HashTable_Count: Expected : 2, Actual: %d\n", count);
return -1;
}
if (count != 1)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 1, count);
+ printf("HashTable_Count: Expected : 1, Actual: %d\n", count);
return -1;
}
if (count != 0)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("HashTable_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
if (count != 3)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("HashTable_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (!HashTable_Contains(table, key2))
{
- printf("HashTable_Contains: Expected : %d, Actual: %d\n", TRUE, FALSE);
+ printf("HashTable_Contains: Expected : TRUE, Actual: FALSE\n");
return -1;
}
if (!HashTable_Remove(table, key2))
{
- printf("HashTable_Remove: Expected : %d, Actual: %d\n", TRUE, FALSE);
+ printf("HashTable_Remove: Expected : TRUE, Actual: FALSE\n");
return -1;
}
if (HashTable_Remove(table, key2))
{
- printf("HashTable_Remove: Expected : %d, Actual: %d\n", FALSE, TRUE);
+ printf("HashTable_Remove: Expected : FALSE, Actual: TRUE\n");
return -1;
}
if (count != 0)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("HashTable_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
if (count != 3)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("HashTable_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (count != 2)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 2, count);
+ printf("HashTable_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (count != 1)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 1, count);
+ printf("HashTable_Count: Expected : 1, Actual: %d\n", count);
return -1;
}
if (count != 0)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("HashTable_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
if (count != 3)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("HashTable_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (!HashTable_Contains(table, key2))
{
- printf("HashTable_Contains: Expected : %d, Actual: %d\n", TRUE, FALSE);
+ printf("HashTable_Contains: Expected : TRUE, Actual: FALSE\n");
return -1;
}
if (!HashTable_Remove(table, key2))
{
- printf("HashTable_Remove: Expected : %d, Actual: %d\n", TRUE, FALSE);
+ printf("HashTable_Remove: Expected : TRUE, Actual: FALSE\n");
return -1;
}
if (HashTable_Remove(table, key2))
{
- printf("HashTable_Remove: Expected : %d, Actual: %d\n", FALSE, TRUE);
+ printf("HashTable_Remove: Expected : FALSE, Actual: TRUE\n");
return -1;
}
if (count != 0)
{
- printf("HashTable_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("HashTable_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
-
#include <winpr/crt.h>
#include <winpr/path.h>
#include <winpr/print.h>
if (count != 3)
{
- printf("LinkedList_Count: expected %d, actual: %d\n", 3, count);
+ printf("LinkedList_Count: expected 3, actual: %d\n", count);
return -1;
}
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);
if (count != 1)
{
- printf("LinkedList_Count: expected %d, actual: %d\n", 1, count);
+ printf("LinkedList_Count: expected 1, actual: %d\n", count);
return -1;
}
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);
if (count != 0)
{
- printf("LinkedList_Count: expected %d, actual: %d\n", 0, count);
+ printf("LinkedList_Count: expected 0, actual: %d\n", count);
return -1;
}
if (count != 3)
{
- printf("LinkedList_Count: expected %d, actual: %d\n", 3, count);
+ printf("LinkedList_Count: expected 3, actual: %d\n", count);
return -1;
}
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);
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);
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);
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);
if (count != 3)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("ListDictionary_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
if (count != 2)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 2, count);
+ printf("ListDictionary_Count: Expected : 2, Actual: %d\n", count);
return -1;
}
if (count != 1)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 1, count);
+ printf("ListDictionary_Count: Expected : 1, Actual: %d\n", count);
return -1;
}
if (count != 0)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("ListDictionary_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
if (count != 3)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 3, count);
+ printf("ListDictionary_Count: Expected : 3, Actual: %d\n", count);
return -1;
}
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;
}
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;
}
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;
}
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;
}
if (count != 0)
{
- printf("ListDictionary_Count: Expected : %d, Actual: %d\n", 0, count);
+ printf("ListDictionary_Count: Expected : 0, Actual: %d\n", count);
return -1;
}
if (message.id == WMQ_QUIT)
break;
- printf("Message.Type: %d\n", message.id);
+ printf("Message.Type: %"PRIu32"\n", message.id);
}
}
-
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/stream.h>
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;
}
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;
}
}
-
#include <winpr/crt.h>
#include <winpr/tchar.h>
#include <winpr/path.h>
-
#include <winpr/crt.h>
#include <winpr/tchar.h>
#include <winpr/path.h>
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;
}
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)
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)
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;
}
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);
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
{
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;
}
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;
break;
default:
- printf("TestWndProc: uMsg: 0x%04X\n", uMsg);
+ printf("TestWndProc: uMsg: 0x%08"PRIX32"\n", uMsg);
return DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
}
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
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),
if (!bSuccess)
{
- printf("WTSDisconnectSession failed: %d\n", (int) GetLastError());
+ printf("WTSDisconnectSession failed: %"PRIu32"\n", GetLastError());
return -1;
}
if (hVirtualChannel == INVALID_HANDLE_VALUE)
{
- printf("WTSVirtualChannelOpen failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelOpen opend");
if (!bSuccess)
{
- printf("WTSVirtualChannelWrite failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelWrite written");
if (!bSuccess)
{
- printf("WTSVirtualChannelRead failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelRead read");
if (!bSuccess)
{
- printf("WTSLogoffSession failed: %d\n", (int) GetLastError());
+ printf("WTSLogoffSession failed: %"PRIu32"\n", GetLastError());
return -1;
}
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;
}
if (!bSuccess)
{
- printf("WTSStartRemoteControlSessionEx failed: %d\n", (int) GetLastError());
+ printf("WTSStartRemoteControlSessionEx failed: %"PRIu32"\n", GetLastError());
return -1;
}
if (hVirtualChannel == INVALID_HANDLE_VALUE)
{
- printf("WTSVirtualChannelOpen failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelOpen failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelOpen opend");
if (!bSuccess)
{
- printf("WTSVirtualChannelWrite failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelWrite failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelWrite written");
if (!bSuccess)
{
- printf("WTSVirtualChannelRead failed: %d\n", (int) GetLastError());
+ printf("WTSVirtualChannelRead failed: %"PRIu32"\n", GetLastError());
return -1;
}
printf("WTSVirtualChannelRead read");
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++)
{
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),
if (!bSuccess)
{
- printf("WTSQuerySessionInformation WTSUserName failed: %d\n", (int) GetLastError());
+ printf("WTSQuerySessionInformation WTSUserName failed: %"PRIu32"\n", GetLastError());
return -1;
}
if (!bSuccess)
{
- printf("WTSQuerySessionInformation WTSDomainName failed: %d\n", (int) GetLastError());
+ printf("WTSQuerySessionInformation WTSDomainName failed: %"PRIu32"\n", GetLastError());
return -1;
}
if (!bSuccess)
{
- printf("WTSQuerySessionInformation WTSConnectState failed: %d\n", (int) GetLastError());
+ printf("WTSQuerySessionInformation WTSConnectState failed: %"PRIu32"\n", GetLastError());
return -1;
}
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 */
if (!bSuccess)
{
- printf("WTSQuerySessionInformation WTSClientName failed: %d\n", (int) GetLastError());
+ printf("WTSQuerySessionInformation WTSClientName failed: %"PRIu32"\n", GetLastError());
return -1;
}
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 */
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 */
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");
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);
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);
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
if (!bSuccess)
{
- printf("%s: WTSRegisterSessionNotification failed: %u\n", __FUNCTION__, GetLastError());
+ printf("%s: WTSRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError());
return -1;
}
if (!bSuccess)
{
- printf("%s: WTSUnRegisterSessionNotification failed: %u\n", __FUNCTION__, GetLastError());
+ printf("%s: WTSUnRegisterSessionNotification failed: %"PRIu32"\n", __FUNCTION__, GetLastError());
return -1;
}
if (!bSuccess)
{
- printf("WTSShutdownSystem failed: %d\n", (int) GetLastError());
+ printf("WTSShutdownSystem failed: %"PRIu32"\n", GetLastError());
return -1;
}
if (!bSuccess)
{
- printf("WTSWaitSystemEvent failed: %d\n", (int) GetLastError());
+ printf("WTSWaitSystemEvent failed: %"PRIu32"\n", GetLastError());
return -1;
}
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;
}
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;
}
{
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();
if (format == 0)
{
for (index = 0; index < 16; index++)
- printf("%02x", NtHash[index]);
+ printf("%02"PRIx8"", NtHash[index]);
printf("\n");
}
else if (format == 1)
printf(":");
for (index = 0; index < 16; index++)
- printf("%02x", NtHash[index]);
+ printf("%02"PRIx8"", NtHash[index]);
printf(":::");
printf("\n");