本文整理汇总了C++中Stream_GetRemainingLength函数的典型用法代码示例。如果您正苦于以下问题:C++ Stream_GetRemainingLength函数的具体用法?C++ Stream_GetRemainingLength怎么用?C++ Stream_GetRemainingLength使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Stream_GetRemainingLength函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_recv
BOOL update_recv(rdpUpdate* update, wStream* s)
{
UINT16 updateType;
rdpContext* context = update->context;
if (Stream_GetRemainingLength(s) < 2)
return FALSE;
Stream_Read_UINT16(s, updateType); /* updateType (2 bytes) */
//printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]);
IFCALL(update->BeginPaint, context);
switch (updateType)
{
case UPDATE_TYPE_ORDERS:
if (!update_recv_orders(update, s))
{
/* XXX: Do we have to call EndPaint? */
return FALSE;
}
break;
case UPDATE_TYPE_BITMAP:
if (!update_read_bitmap_update(update, s, &update->bitmap_update))
return FALSE;
IFCALL(update->BitmapUpdate, context, &update->bitmap_update);
break;
case UPDATE_TYPE_PALETTE:
if (!update_read_palette(update, s, &update->palette_update))
return FALSE;
IFCALL(update->Palette, context, &update->palette_update);
break;
case UPDATE_TYPE_SYNCHRONIZE:
update_read_synchronize(update, s);
IFCALL(update->Synchronize, context);
break;
}
IFCALL(update->EndPaint, context);
return TRUE;
}
示例2: rail_read_server_minmaxinfo_order
BOOL rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo)
{
if (Stream_GetRemainingLength(s) < 20)
return FALSE;
Stream_Read_UINT32(s, minmaxinfo->windowId); /* windowId (4 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */
Stream_Read_UINT16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */
return TRUE;
}
示例3: rdp_read_share_data_header
BOOL rdp_read_share_data_header(wStream* s, UINT16* length, BYTE* type, UINT32* shareId,
BYTE* compressedType, UINT16* compressedLength)
{
if (Stream_GetRemainingLength(s) < 12)
return FALSE;
/* Share Data Header */
Stream_Read_UINT32(s, *shareId); /* shareId (4 bytes) */
Stream_Seek_UINT8(s); /* pad1 (1 byte) */
Stream_Seek_UINT8(s); /* streamId (1 byte) */
Stream_Read_UINT16(s, *length); /* uncompressedLength (2 bytes) */
Stream_Read_UINT8(s, *type); /* pduType2, Data PDU Type (1 byte) */
Stream_Read_UINT8(s, *compressedType); /* compressedType (1 byte) */
Stream_Read_UINT16(s, *compressedLength); /* compressedLength (2 bytes) */
return TRUE;
}
示例4: input_recv_event
static BOOL input_recv_event(rdpInput* input, wStream* s)
{
UINT16 messageType;
if (Stream_GetRemainingLength(s) < 6)
return FALSE;
Stream_Seek(s, 4); /* eventTime (4 bytes), ignored by the server */
Stream_Read_UINT16(s, messageType); /* messageType (2 bytes) */
switch (messageType)
{
case INPUT_EVENT_SYNC:
if (!input_recv_sync_event(input, s))
return FALSE;
break;
case INPUT_EVENT_SCANCODE:
if (!input_recv_keyboard_event(input, s))
return FALSE;
break;
case INPUT_EVENT_UNICODE:
if (!input_recv_unicode_keyboard_event(input, s))
return FALSE;
break;
case INPUT_EVENT_MOUSE:
if (!input_recv_mouse_event(input, s))
return FALSE;
break;
case INPUT_EVENT_MOUSEX:
if (!input_recv_extended_mouse_event(input, s))
return FALSE;
break;
default:
fprintf(stderr, "Unknown messageType %u\n", messageType);
/* Each input event uses 6 bytes. */
Stream_Seek(s, 6);
break;
}
return TRUE;
}
示例5: rdp_recv_multitransport_packet
int rdp_recv_multitransport_packet(rdpRdp* rdp, wStream* s)
{
UINT32 requestId;
UINT16 requestedProtocol;
UINT16 reserved;
BYTE securityCookie[16];
if (Stream_GetRemainingLength(s) < 24)
return -1;
Stream_Read_UINT32(s, requestId); /* requestId (4 bytes) */
Stream_Read_UINT16(s, requestedProtocol); /* requestedProtocol (2 bytes) */
Stream_Read_UINT16(s, reserved); /* reserved (2 bytes) */
Stream_Read(s, securityCookie, 16); /* securityCookie (16 bytes) */
return 0;
}
示例6: rdp_recv_client_synchronize_pdu
BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, wStream* s)
{
UINT16 messageType;
rdp->finalize_sc_pdus |= FINALIZE_SC_SYNCHRONIZE_PDU;
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
Stream_Read_UINT16(s, messageType); /* messageType (2 bytes) */
if (messageType != SYNCMSGTYPE_SYNC)
return FALSE;
/* targetUser (2 bytes) */
Stream_Seek_UINT16(s);
return TRUE;
}
示例7: tsmf_ifman_rim_exchange_capability_request
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman)
{
UINT32 CapabilityValue;
if (Stream_GetRemainingLength(ifman->input) < 4)
return ERROR_INVALID_DATA;
Stream_Read_UINT32(ifman->input, CapabilityValue);
DEBUG_TSMF("server CapabilityValue %d", CapabilityValue);
if (!Stream_EnsureRemainingCapacity(ifman->output, 8))
return ERROR_INVALID_DATA;
Stream_Write_UINT32(ifman->output, 1); /* CapabilityValue */
Stream_Write_UINT32(ifman->output, 0); /* Result */
return CHANNEL_RC_OK;
}
示例8: rdp_read_client_auto_reconnect_cookie
BOOL rdp_read_client_auto_reconnect_cookie(rdpRdp* rdp, wStream* s)
{
ARC_CS_PRIVATE_PACKET* autoReconnectCookie;
rdpSettings* settings = rdp->settings;
autoReconnectCookie = settings->ClientAutoReconnectCookie;
if (Stream_GetRemainingLength(s) < 28)
return FALSE;
Stream_Read_UINT32(s, autoReconnectCookie->cbLen); /* cbLen (4 bytes) */
Stream_Read_UINT32(s, autoReconnectCookie->version); /* version (4 bytes) */
Stream_Read_UINT32(s, autoReconnectCookie->logonId); /* LogonId (4 bytes) */
Stream_Read(s, autoReconnectCookie->securityVerifier, 16); /* SecurityVerifier */
return TRUE;
}
示例9: cliprdr_server_receive_temporary_directory
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header)
{
int length;
WCHAR* wszTempDir;
CLIPRDR_TEMP_DIRECTORY tempDirectory;
CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle;
size_t slength;
UINT error = CHANNEL_RC_OK;
if ((slength = Stream_GetRemainingLength(s)) < 520)
{
WLog_ERR(TAG, "Stream_GetRemainingLength returned %d but should at least be 520", slength);
return CHANNEL_RC_NO_MEMORY;
}
wszTempDir = (WCHAR*) Stream_Pointer(s);
if (wszTempDir[260] != 0)
{
WLog_ERR(TAG, "wszTempDir[260] was not 0");
return ERROR_INVALID_DATA;
}
free(cliprdr->temporaryDirectory);
cliprdr->temporaryDirectory = NULL;
ConvertFromUnicode(CP_UTF8, 0, wszTempDir, -1,
&(cliprdr->temporaryDirectory), 0, NULL, NULL);
length = strlen(cliprdr->temporaryDirectory);
if (length > 519)
length = 519;
CopyMemory(tempDirectory.szTempDir, cliprdr->temporaryDirectory, length);
tempDirectory.szTempDir[length] = '\0';
WLog_DBG(TAG, "CliprdrTemporaryDirectory: %s", cliprdr->temporaryDirectory);
IFCALLRET(context->TempDirectory, error, context, &tempDirectory);
if (error)
WLog_ERR(TAG, "TempDirectory failed with error %lu!", error);
return error;
}
示例10: rdpgfx_recv_wire_to_surface_2_pdu
int rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
{
RDPGFX_SURFACE_COMMAND cmd;
RDPGFX_WIRE_TO_SURFACE_PDU_2 pdu;
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface;
if (Stream_GetRemainingLength(s) < 13)
return -1;
Stream_Read_UINT16(s, pdu.surfaceId); /* surfaceId (2 bytes) */
Stream_Read_UINT16(s, pdu.codecId); /* codecId (2 bytes) */
Stream_Read_UINT32(s, pdu.codecContextId); /* codecContextId (4 bytes) */
Stream_Read_UINT8(s, pdu.pixelFormat); /* pixelFormat (1 byte) */
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,
pdu.codecContextId, pdu.pixelFormat, pdu.bitmapDataLength);
cmd.surfaceId = pdu.surfaceId;
cmd.codecId = pdu.codecId;
cmd.contextId = pdu.codecContextId;
cmd.format = pdu.pixelFormat;
cmd.left = 0;
cmd.top = 0;
cmd.right = 0;
cmd.bottom = 0;
cmd.width = 0;
cmd.height = 0;
cmd.length = pdu.bitmapDataLength;
cmd.data = pdu.bitmapData;
if (context && context->SurfaceCommand)
{
context->SurfaceCommand(context, &cmd);
}
return 1;
}
示例11: read_dismiss_hovering_contact
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
static UINT read_dismiss_hovering_contact(RdpeiServerContext *context, wStream *s) {
BYTE contactId;
UINT error = CHANNEL_RC_OK;
if (Stream_GetRemainingLength(s) < 1)
{
WLog_ERR(TAG, "Not enought data!");
return ERROR_INVALID_DATA;
}
Stream_Read_UINT8(s, contactId);
IFCALLRET(context->onTouchReleased, error, context, contactId);
if (error)
WLog_ERR(TAG, "context->onTouchReleased failed with error %lu", error);
return error;
}
示例12: drdynvc_process_data_first
static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s)
{
int status;
UINT32 Length;
UINT32 ChannelId;
ChannelId = drdynvc_read_variable_uint(s, cbChId);
Length = drdynvc_read_variable_uint(s, Sp);
DEBUG_DVC("ChannelId=%d Length=%d", ChannelId, Length);
status = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length);
if (status)
return status;
return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId,
Stream_Pointer(s), Stream_GetRemainingLength(s));
}
示例13: rfx_process_message_frame_begin
static BOOL rfx_process_message_frame_begin(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s)
{
UINT32 frameIdx;
UINT16 numRegions;
if (Stream_GetRemainingLength(s) < 6)
{
DEBUG_WARN("RfxMessageFrameBegin packet too small");
return FALSE;
}
Stream_Read_UINT32(s, 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);
return TRUE;
}
示例14: rdp_recv_set_error_info_data_pdu
BOOL rdp_recv_set_error_info_data_pdu(rdpRdp* rdp, wStream* s)
{
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
Stream_Read_UINT32(s, rdp->errorInfo); /* errorInfo (4 bytes) */
if (rdp->errorInfo != ERRINFO_SUCCESS)
{
rdpClient* client = rdp->instance->context->client;
rdp_print_errinfo(rdp->errorInfo);
IFCALL(client->OnErrorInfo, rdp->instance, rdp->errorInfo);
}
return TRUE;
}
示例15: rail_read_server_localmovesize_order
BOOL rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localMoveSize)
{
UINT16 isMoveSizeStart;
if (Stream_GetRemainingLength(s) < 12)
return FALSE;
Stream_Read_UINT32(s, localMoveSize->windowId); /* windowId (4 bytes) */
Stream_Read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
localMoveSize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE;
Stream_Read_UINT16(s, localMoveSize->moveSizeType); /* moveSizeType (2 bytes) */
Stream_Read_UINT16(s, localMoveSize->posX); /* posX (2 bytes) */
Stream_Read_UINT16(s, localMoveSize->posY); /* posY (2 bytes) */
return TRUE;
}