FreeRDP
gfxredir_common.c
1 
20 #include <freerdp/config.h>
21 
22 #include <winpr/crt.h>
23 #include <winpr/stream.h>
24 #include <freerdp/channels/log.h>
25 
26 #define TAG CHANNELS_TAG("gfxredir.common")
27 
28 #include "gfxredir_common.h"
29 
35 UINT gfxredir_read_header(wStream* s, GFXREDIR_HEADER* header)
36 {
37  if (!Stream_CheckAndLogRequiredLength(TAG, s, 8))
38  return ERROR_INVALID_DATA;
39 
40  Stream_Read_UINT32(s, header->cmdId);
41  Stream_Read_UINT32(s, header->length);
42  return CHANNEL_RC_OK;
43 }
44 
50 UINT gfxredir_write_header(wStream* s, const GFXREDIR_HEADER* header)
51 {
52  Stream_Write_UINT32(s, header->cmdId);
53  Stream_Write_UINT32(s, header->length);
54  return CHANNEL_RC_OK;
55 }