Merge pull request #10695 from akallabeth/cov-fixes

Cov fixes
This commit is contained in:
akallabeth 2024-10-01 12:56:14 +02:00 committed by GitHub
commit 3fe99c87a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 52 additions and 59 deletions

View File

@ -177,7 +177,7 @@ static UINT ainput_server_send_version(ainput_server* ainput)
Stream_Write_UINT32(s, AINPUT_VERSION_MINOR); /* Version (4 bytes) */
WINPR_ASSERT(Stream_GetPosition(s) <= UINT32_MAX);
if (!WTSVirtualChannelWrite(ainput->ainput_channel, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(ainput->ainput_channel, Stream_BufferAs(s, char),
(ULONG)Stream_GetPosition(s), &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");
@ -467,7 +467,7 @@ static UINT ainput_process_message(ainput_server* ainput)
goto out;
}
if (WTSVirtualChannelRead(ainput->ainput_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(ainput->ainput_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &ActualBytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");

View File

@ -379,7 +379,7 @@ static DWORD WINAPI audin_server_thread_func(LPVOID arg)
break;
WINPR_ASSERT(Stream_Capacity(s) <= UINT32_MAX);
if (WTSVirtualChannelRead(audin->audin_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(audin->audin_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_Print(audin->log, WLOG_ERROR, "WTSVirtualChannelRead failed!");
@ -572,7 +572,7 @@ static UINT audin_server_packet_send(audin_server_context* context, wStream* s)
if (pos > UINT32_MAX)
return ERROR_INVALID_PARAMETER;
if (!WTSVirtualChannelWrite(audin->audin_channel, (PCHAR)Stream_Buffer(s), (UINT32)pos,
if (!WTSVirtualChannelWrite(audin->audin_channel, Stream_BufferAs(s, char), (UINT32)pos,
&written))
{
WLog_Print(audin->log, WLOG_ERROR, "WTSVirtualChannelWrite failed!");

View File

@ -102,7 +102,7 @@ static UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s
goto fail;
}
status = WTSVirtualChannelWrite(cliprdr->ChannelHandle, (PCHAR)Stream_Buffer(s), (UINT32)pos,
status = WTSVirtualChannelWrite(cliprdr->ChannelHandle, Stream_BufferAs(s, char), (UINT32)pos,
&written);
rc = status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
fail:

View File

@ -315,7 +315,7 @@ static UINT disp_server_handle_messages(DispServerContext* context)
if (cap > UINT32_MAX)
return CHANNEL_RC_NO_BUFFER;
if (WTSVirtualChannelRead(priv->disp_channel, 0, (PCHAR)Stream_Buffer(s), (ULONG)cap,
if (WTSVirtualChannelRead(priv->disp_channel, 0, Stream_BufferAs(s, char), (ULONG)cap,
&BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -499,7 +499,7 @@ static UINT disp_server_packet_send(DispServerContext* context, wStream* s)
goto out;
}
if (!WTSVirtualChannelWrite(context->priv->disp_channel, (PCHAR)Stream_Buffer(s), pos,
if (!WTSVirtualChannelWrite(context->priv->disp_channel, Stream_BufferAs(s, char), pos,
&written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -97,7 +97,7 @@ static DWORD WINAPI drdynvc_server_thread(LPVOID arg)
}
if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0,
(PCHAR) Stream_Buffer(s), Stream_Capacity(s), &BytesReturned))
Stream_BufferAs(s, char), Stream_Capacity(s), &BytesReturned))
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
break;

View File

@ -952,7 +952,7 @@ static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints,
}
Stream_Write_UINT8(drive->device.data, '\0');
drive->device.name = (const char*)Stream_Buffer(drive->device.data);
drive->device.name = Stream_BufferAs(drive->device.data, char);
if (!drive->device.name)
goto out_error;

View File

@ -256,7 +256,7 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg)
break;
}
if (WTSVirtualChannelRead(echo->echo_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(echo->echo_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -264,8 +264,7 @@ static DWORD WINAPI echo_server_thread_func(LPVOID arg)
break;
}
IFCALLRET(echo->context.Response, error, &echo->context, (BYTE*)Stream_Buffer(s),
BytesReturned);
IFCALLRET(echo->context.Response, error, &echo->context, Stream_Buffer(s), BytesReturned);
if (error)
{

View File

@ -251,7 +251,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg)
const size_t cap = Stream_Capacity(s);
if ((cap > UINT32_MAX) ||
!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s),
!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, Stream_BufferAs(s, char),
(ULONG)cap, &BytesReturned))
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -261,7 +261,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg)
if (Stream_GetPosition(s) >= ENCOMSP_ORDER_HEADER_SIZE)
{
header = (ENCOMSP_ORDER_HEADER*)Stream_Buffer(s);
header = Stream_BufferAs(s, ENCOMSP_ORDER_HEADER);
if (header->Length >= Stream_GetPosition(s))
{

View File

@ -296,7 +296,7 @@ static UINT location_process_message(location_server* location)
goto out;
}
if (WTSVirtualChannelRead(location->location_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(location->location_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -544,7 +544,7 @@ static UINT location_server_packet_send(LocationServerContext* context, wStream*
const size_t pos = Stream_GetPosition(s);
if (pos > UINT32_MAX)
return ERROR_OUTOFMEMORY;
if (!WTSVirtualChannelWrite(location->location_channel, (PCHAR)Stream_Buffer(s), (ULONG)pos,
if (!WTSVirtualChannelWrite(location->location_channel, Stream_BufferAs(s, char), (ULONG)pos,
&written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -46,7 +46,7 @@ static UINT rail_send(RailServerContext* context, wStream* s, ULONG length)
if (!context)
return CHANNEL_RC_BAD_INIT_HANDLE;
if (!WTSVirtualChannelWrite(context->priv->rail_channel, (PCHAR)Stream_Buffer(s), length,
if (!WTSVirtualChannelWrite(context->priv->rail_channel, Stream_BufferAs(s, char), length,
&written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -230,7 +230,7 @@ static UINT rdpdr_seal_send_free_request(RdpdrServerContext* context, wStream* s
rdpdr_packetid_string(header.PacketId), header.PacketId);
}
winpr_HexLogDump(context->priv->log, WLOG_DEBUG, Stream_Buffer(s), Stream_Length(s));
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
(ULONG)length, &written);
Stream_Free(s, TRUE);
return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
@ -2078,7 +2078,7 @@ static DWORD WINAPI rdpdr_server_thread(LPVOID arg)
}
capacity = MIN(Stream_Capacity(s), UINT32_MAX);
if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelRead(context->priv->ChannelHandle, 0, Stream_BufferAs(s, char),
(ULONG)capacity, &BytesReturned))
{
WLog_Print(context->priv->log, WLOG_ERROR, "WTSVirtualChannelRead failed!");

View File

@ -287,7 +287,7 @@ static UINT enumerator_process_message(enumerator_server* enumerator)
goto out;
}
if (WTSVirtualChannelRead(enumerator->enumerator_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(enumerator->enumerator_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -531,7 +531,7 @@ static UINT enumerator_server_packet_send(CamDevEnumServerContext* context, wStr
UINT error = CHANNEL_RC_OK;
ULONG written = 0;
if (!WTSVirtualChannelWrite(enumerator->enumerator_channel, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(enumerator->enumerator_channel, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -426,7 +426,7 @@ static UINT device_process_message(device_server* device)
goto out;
}
if (WTSVirtualChannelRead(device->device_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(device->device_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -704,7 +704,7 @@ static UINT device_server_packet_send(CameraDeviceServerContext* context, wStrea
WINPR_ASSERT(context);
WINPR_ASSERT(s);
if (!WTSVirtualChannelWrite(device->device_channel, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(device->device_channel, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -626,7 +626,7 @@ UINT rdpei_server_send_sc_ready(RdpeiServerContext* context, UINT32 version, UIN
if (pos > UINT32_MAX)
return ERROR_INTERNAL_ERROR;
if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream),
if (!WTSVirtualChannelWrite(priv->channelHandle, Stream_BufferAs(priv->outputStream, char),
(ULONG)pos, &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");
@ -673,7 +673,7 @@ UINT rdpei_server_suspend(RdpeiServerContext* context)
if (pos > UINT32_MAX)
return ERROR_INTERNAL_ERROR;
if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream),
if (!WTSVirtualChannelWrite(priv->channelHandle, Stream_BufferAs(priv->outputStream, char),
(ULONG)pos, &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");
@ -720,7 +720,7 @@ UINT rdpei_server_resume(RdpeiServerContext* context)
if (pos > UINT32_MAX)
return CHANNEL_RC_NO_BUFFER;
if (!WTSVirtualChannelWrite(priv->channelHandle, (PCHAR)Stream_Buffer(priv->outputStream),
if (!WTSVirtualChannelWrite(priv->channelHandle, Stream_BufferAs(priv->outputStream, char),
(ULONG)pos, &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -252,7 +252,7 @@ static UINT mouse_cursor_process_message(mouse_cursor_server* mouse_cursor)
goto out;
}
if (WTSVirtualChannelRead(mouse_cursor->mouse_cursor_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(mouse_cursor->mouse_cursor_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");
@ -514,7 +514,7 @@ static UINT mouse_cursor_server_packet_send(MouseCursorServerContext* context, w
const size_t pos = Stream_GetPosition(s);
if (pos > UINT32_MAX)
return ERROR_OUTOFMEMORY;
if (!WTSVirtualChannelWrite(mouse_cursor->mouse_cursor_channel, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(mouse_cursor->mouse_cursor_channel, Stream_BufferAs(s, char),
(ULONG)pos, &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");

View File

@ -138,7 +138,7 @@ static UINT rdpgfx_server_packet_send(RdpgfxServerContext* context, wStream* s)
goto out;
}
if (!WTSVirtualChannelWrite(context->priv->rdpgfx_channel, (PCHAR)Stream_Buffer(fs),
if (!WTSVirtualChannelWrite(context->priv->rdpgfx_channel, Stream_BufferAs(fs, char),
Stream_GetPosition(fs), &written))
{
WLog_Print(context->priv->log, WLOG_ERROR, "WTSVirtualChannelWrite failed!");
@ -1836,7 +1836,7 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context)
return CHANNEL_RC_NO_MEMORY;
}
if (WTSVirtualChannelRead(priv->rdpgfx_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(priv->rdpgfx_channel, 0, Stream_BufferAs(s, char),
Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_Print(context->priv->log, WLOG_ERROR, "WTSVirtualChannelRead failed!");

View File

@ -324,12 +324,6 @@ static BOOL rdpsnd_oss_set_volume(rdpsndDevicePlugin* device, UINT32 value)
unsigned left = (((value & 0xFFFF) * 100) / 0xFFFF);
unsigned right = ((((value >> 16) & 0xFFFF) * 100) / 0xFFFF);
if (left > 100)
left = 100;
if (right > 100)
right = 100;
left |= (right << 8);
if (ioctl(oss->mixer_handle, MIXER_WRITE(SOUND_MIXER_VOLUME), &left) == -1)

View File

@ -87,7 +87,7 @@ static UINT rdpsnd_server_send_formats(RdpsndServerContext* context)
Stream_SetPosition(s, pos);
WINPR_ASSERT(context->priv);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written);
Stream_SetPosition(s, 0);
fail:
@ -456,7 +456,7 @@ static UINT rdpsnd_server_training(RdpsndServerContext* context, UINT16 timestam
Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, end - 4);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), end,
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char), end,
&written);
Stream_SetPosition(s, 0);
@ -537,7 +537,7 @@ static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, UINT16 wTi
Stream_Write_UINT16(s, end - start + 8);
Stream_SetPosition(s, end);
if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
start + 4, &written))
{
WLog_ERR(TAG, "WTSVirtualChannelWrite failed!");
@ -637,7 +637,7 @@ static UINT rdpsnd_server_send_wave2_pdu(RdpsndServerContext* context, UINT16 fo
Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, end - 4);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s), end,
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char), end,
&written);
if (!status || (end != written))
@ -776,7 +776,7 @@ static UINT rdpsnd_server_set_volume(RdpsndServerContext* context, UINT16 left,
Stream_Write_UINT16(s, right);
len = Stream_GetPosition(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
(ULONG)len, &written);
Stream_SetPosition(s, 0);
return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
@ -827,7 +827,7 @@ static UINT rdpsnd_server_close(RdpsndServerContext* context)
Stream_SetPosition(s, 2);
Stream_Write_UINT16(s, pos - 4);
Stream_SetPosition(s, pos);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written);
Stream_SetPosition(s, 0);
return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;

View File

@ -38,7 +38,7 @@ static UINT remdesk_virtual_channel_write(RemdeskServerContext* context, wStream
{
BOOL status = 0;
ULONG BytesWritten = 0;
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR)Stream_Buffer(s),
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, Stream_BufferAs(s, char),
Stream_Length(s), &BytesWritten);
return (status) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
}
@ -595,7 +595,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg)
break;
}
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(context->priv->ChannelHandle, 0, Stream_BufferAs(s, char),
Stream_Capacity(s), &BytesReturned))
{
if (BytesReturned)
@ -613,7 +613,7 @@ static DWORD WINAPI remdesk_server_thread(LPVOID arg)
if (Stream_GetPosition(s) >= 8)
{
pHeader = (UINT32*)Stream_Buffer(s);
pHeader = Stream_BufferAs(s, UINT32);
PduLength = pHeader[0] + pHeader[1] + 8;
if (PduLength >= Stream_GetPosition(s))

View File

@ -174,7 +174,7 @@ static UINT telemetry_process_message(telemetry_server* telemetry)
goto out;
}
if (WTSVirtualChannelRead(telemetry->telemetry_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(telemetry->telemetry_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
WLog_ERR(TAG, "WTSVirtualChannelRead failed!");

View File

@ -518,8 +518,8 @@ static BOOL freerdp_dsp_decode_mp3(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
if (!Stream_EnsureCapacity(context->common.buffer, 2 * buffer_size))
return FALSE;
pcm_l = (short*)Stream_Buffer(context->common.buffer);
pcm_r = (short*)Stream_Buffer(context->common.buffer) + buffer_size;
pcm_l = Stream_BufferAs(context->common.buffer, short);
pcm_r = Stream_BufferAs(context->common.buffer, short) + buffer_size;
rc = hip_decode(context->hip, (unsigned char*)/* API is not modifying content */ src, size,
pcm_l, pcm_r);
@ -593,7 +593,7 @@ static BOOL freerdp_dsp_encode_faac(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
{
if (!Stream_EnsureRemainingCapacity(out, context->faacMaxOutputBytes))
return FALSE;
rc = faacEncEncode(context->faac, (int32_t*)Stream_Buffer(context->common.buffer),
rc = faacEncEncode(context->faac, Stream_BufferAs(context->common.buffer, int32_t),
context->faacInputSamples, Stream_Pointer(out),
Stream_GetRemainingCapacity(out));
if (rc < 0)

View File

@ -2523,7 +2523,7 @@ int progressive_compress(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive,
if (!Stream_EnsureCapacity(progressive->rects, numRects * sizeof(RFX_RECT)))
return -5;
rects = (RFX_RECT*)Stream_Buffer(progressive->rects);
rects = Stream_BufferAs(progressive->rects, RFX_RECT);
if (invalidRegion)
{
const RECTANGLE_16* region_rects = region16_rects(invalidRegion, NULL);

View File

@ -1427,8 +1427,8 @@ HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength)
if (payloadOffset)
{
size_t count = 0;
char* buffer = (char*)Stream_Buffer(response->data);
char* line = (char*)Stream_Buffer(response->data);
char* buffer = Stream_BufferAs(response->data, char);
char* line = Stream_BufferAs(response->data, char);
char* context = NULL;
while ((line = string_strnstr(line, "\r\n", payloadOffset - (line - buffer) - 2UL)))

View File

@ -150,7 +150,7 @@ int websocket_write(BIO* bio, const BYTE* buf, int isize, WEBSOCKET_OPCODE opcod
winpr_RAND(&maskingKey, sizeof(maskingKey));
payloadSize = isize;
if ((isize < 0) || (isize > UINT16_MAX))
if ((isize < 0) || (isize > UINT32_MAX))
return -1;
if (payloadSize < 126)

View File

@ -1411,7 +1411,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualNam
if (!wts_write_drdynvc_create_request(s, channel->channelId, pVirtualName))
goto fail;
if (!WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR)Stream_Buffer(s),
if (!WTSVirtualChannelWrite(vcm->drdynvc_channel, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written))
goto fail;
@ -1469,7 +1469,7 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelClose(HANDLE hChannelHandle)
else
{
wts_write_drdynvc_header(s, CLOSE_REQUEST_PDU, channel->channelId);
ret = WTSVirtualChannelWrite(vcm->drdynvc_channel, (PCHAR)Stream_Buffer(s),
ret = WTSVirtualChannelWrite(vcm->drdynvc_channel, Stream_BufferAs(s, char),
Stream_GetPosition(s), &written);
Stream_Free(s, TRUE);
}

View File

@ -653,7 +653,7 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg)
Stream_SetPosition(s, 0);
if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(context->debug_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
if (BytesReturned == 0)
@ -662,7 +662,7 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg)
if (!Stream_EnsureRemainingCapacity(s, BytesReturned))
break;
if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR)Stream_Buffer(s),
if (WTSVirtualChannelRead(context->debug_channel, 0, Stream_BufferAs(s, char),
(ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)
{
/* should not happen */

View File

@ -262,7 +262,7 @@ static UINT rdpdr_seal_send_free_request(pf_channel_server_context* context, wSt
WINPR_ASSERT(len <= UINT32_MAX);
rdpdr_dump_send_packet(context->log, WLOG_TRACE, s, proxy_client_tx);
status = WTSVirtualChannelWrite(context->handle, (char*)Stream_Buffer(s), (ULONG)len, NULL);
status = WTSVirtualChannelWrite(context->handle, Stream_BufferAs(s, char), (ULONG)len, NULL);
return (status) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
}

View File

@ -758,7 +758,7 @@ static BOOL kerberos_rd_tgt_token(const sspi_gss_data* token, char** target, krb
return FALSE;
s = WinPrAsn1DecGetStream(&dec2);
ticket->data = (char*)Stream_Buffer(&s);
ticket->data = Stream_BufferAs(&s, char);
ticket->length = Stream_Length(&s);
return TRUE;
}