mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,stream] Add Stream_ResetPosition
A helper function that does not require return checks, in contrast to Stream_SetPosition, which might fail.
This commit is contained in:
@@ -975,7 +975,7 @@ static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp,
|
||||
|
||||
encomsp->data_in = nullptr;
|
||||
Stream_SealLength(data_in);
|
||||
Stream_SetPosition(data_in, 0);
|
||||
Stream_ResetPosition(data_in);
|
||||
|
||||
if (!MessageQueue_Post(encomsp->queue, nullptr, 0, (void*)data_in, nullptr))
|
||||
{
|
||||
|
||||
@@ -239,7 +239,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg)
|
||||
if (header->Length >= Stream_GetPosition(s))
|
||||
{
|
||||
Stream_SealLength(s);
|
||||
Stream_SetPosition(s, 0);
|
||||
Stream_ResetPosition(s);
|
||||
|
||||
if ((error = encomsp_server_receive_pdu(context, s)))
|
||||
{
|
||||
@@ -248,7 +248,7 @@ static DWORD WINAPI encomsp_server_thread(LPVOID arg)
|
||||
break;
|
||||
}
|
||||
|
||||
Stream_SetPosition(s, 0);
|
||||
Stream_ResetPosition(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user