FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
gfxredir_common.c
1
20#include <freerdp/config.h>
21
22#include <winpr/crt.h>
23#include <winpr/assert.h>
24#include <winpr/stream.h>
25#include <freerdp/channels/log.h>
26
27#define TAG CHANNELS_TAG("gfxredir.common")
28
29#include "gfxredir_common.h"
30
36UINT gfxredir_read_header(wStream* s, GFXREDIR_HEADER* header)
37{
38 WINPR_ASSERT(header);
39 if (!Stream_CheckAndLogRequiredLength(TAG, s, 8))
40 return ERROR_INVALID_DATA;
41
42 Stream_Read_UINT32(s, header->cmdId);
43 Stream_Read_UINT32(s, header->length);
44 return CHANNEL_RC_OK;
45}
46
52UINT gfxredir_write_header(wStream* s, const GFXREDIR_HEADER* header)
53{
54 WINPR_ASSERT(header);
55 Stream_Write_UINT32(s, header->cmdId);
56 Stream_Write_UINT32(s, header->length);
57 return CHANNEL_RC_OK;
58}