FreeRDP
disp_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("disp.common")
27 
28 #include "disp_common.h"
29 
35 UINT disp_read_header(wStream* s, DISPLAY_CONTROL_HEADER* header)
36 {
37  if (!Stream_CheckAndLogRequiredLength(TAG, s, 8))
38  return ERROR_INVALID_DATA;
39 
40  Stream_Read_UINT32(s, header->type);
41  Stream_Read_UINT32(s, header->length);
42  return CHANNEL_RC_OK;
43 }
44 
50 UINT disp_write_header(wStream* s, const DISPLAY_CONTROL_HEADER* header)
51 {
52  Stream_Write_UINT32(s, header->type);
53  Stream_Write_UINT32(s, header->length);
54  return CHANNEL_RC_OK;
55 }