mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[channels,urbdrc] add helper functions for shared header
This commit is contained in:
@@ -425,3 +425,26 @@ void urbdrc_dump_message(wLog* log, BOOL client, BOOL write, wStream* s)
|
||||
WLog_Print(log, WLOG_TRACE, "-------------------------- URBDRC end -----");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* [MS-RDPEUSB] 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */
|
||||
BOOL write_shared_message_header_with_functionid(wStream* s, UINT32 InterfaceId, UINT32 MessageId,
|
||||
UINT32 FunctionId)
|
||||
{
|
||||
if (!Stream_EnsureRemainingCapacity(s, 12))
|
||||
return FALSE;
|
||||
|
||||
Stream_Write_UINT32(s, InterfaceId);
|
||||
Stream_Write_UINT32(s, MessageId);
|
||||
Stream_Write_UINT32(s, FunctionId);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wStream* create_shared_message_header_with_functionid(UINT32 InterfaceId, UINT32 MessageId,
|
||||
UINT32 FunctionId, size_t OutputSize)
|
||||
{
|
||||
wStream* out = Stream_New(NULL, 12ULL + OutputSize);
|
||||
if (!out)
|
||||
return NULL;
|
||||
(void)write_shared_message_header_with_functionid(out, InterfaceId, MessageId, FunctionId);
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ extern "C"
|
||||
|
||||
void urbdrc_dump_message(wLog* log, BOOL client, BOOL write, wStream* s);
|
||||
|
||||
wStream* create_shared_message_header_with_functionid(UINT32 InterfaceId, UINT32 MessageId,
|
||||
UINT32 FunctionId, size_t OutputSize);
|
||||
BOOL write_shared_message_header_with_functionid(wStream* s, UINT32 InterfaceId,
|
||||
UINT32 MessageId, UINT32 FunctionId);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user