FreeRDP
channels/gfxredir.h
1 
20 #ifndef FREERDP_CHANNEL_GFXREDIR_H
21 #define FREERDP_CHANNEL_GFXREDIR_H
22 
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30 
31 #define GFXREDIR_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::RemoteAppGraphicsRedirection"
32 
33 /* GFXREDIR_LEGACY_CAPS_PDU.version */
34 #define GFXREDIR_CHANNEL_VERSION_LEGACY 1
35 
36 #define GFXREDIR_CHANNEL_VERSION_MAJOR 2
37 #define GFXREDIR_CHANNEL_VERSION_MINOR 0
38 
39 /* GFXREDIR_CAPS_VERSION1 */
40 #define GFXREDIR_CMDID_LEGACY_CAPS 0x00000001
41 #define GFXREDIR_CMDID_ERROR 0x00000006
42 #define GFXREDIR_CMDID_CAPS_ADVERTISE 0x00000008
43 #define GFXREDIR_CMDID_CAPS_CONFIRM 0x00000009
44 /* GFXREDIR_CAPS_VERSION2_0 */
45 #define GFXREDIR_CMDID_OPEN_POOL 0x0000000a
46 #define GFXREDIR_CMDID_CLOSE_POOL 0x0000000b
47 #define GFXREDIR_CMDID_CREATE_BUFFER 0x0000000c
48 #define GFXREDIR_CMDID_DESTROY_BUFFER 0x0000000d
49 #define GFXREDIR_CMDID_PRESENT_BUFFER 0x0000000e
50 #define GFXREDIR_CMDID_PRESENT_BUFFER_ACK 0x0000000f
51 
52 /* GFXREDIR_HEADER */
53 #define GFXREDIR_HEADER_SIZE 8
54 
55 /* GFXREDIR_CAPS_HEADER */
56 #define GFXREDIR_CAPS_HEADER_SIZE 12
57 /* GFXREDIR_CAPS_HEADER.signature */
58 #define GFXREDIR_CAPS_SIGNATURE 0x53504143 /* = 'SPAC' */
59 /* GFXREDIR_CAPS_HEADER.version */
60 #define GFXREDIR_CAPS_VERSION1 0x1
61 #define GFXREDIR_CAPS_VERSION2_0 0x2000
62 
63 /* GFXREDIR_CREATE_BUFFER_PDU.format */
64 #define GFXREDIR_BUFFER_PIXEL_FORMAT_XRGB_8888 1
65 #define GFXREDIR_BUFFER_PIXEL_FORMAT_ARGB_8888 2
66 
67 /* GFXREDIR_PRESENT_BUFFER_PDU.numOpaqueRects */
68 #define GFXREDIR_MAX_OPAQUE_RECTS 0x10
69 
70 typedef struct
71 {
72  UINT32 cmdId;
73  UINT32 length;
75 
76 typedef struct
77 {
78  UINT16 version; // GFXREDIR_CHANNEL_VERSION_LEGACY
80 
81 typedef struct
82 {
83  UINT32 signature; // GFXREDIR_CAPS_SIGNATURE
84  UINT32 version; // GFXREDIR_CAPS_VERSION
85  UINT32 length; // GFXREDIR_CAPS_HEADER_SIZE + size of capsData
87 
88 typedef struct
89 {
90  GFXREDIR_CAPS_HEADER header;
91  UINT32 supportedFeatures; /* Reserved for future extensions */
93 
94 typedef struct
95 {
96  UINT32 errorCode;
98 
99 typedef struct
100 {
101  UINT32 length; // length of caps;
102  const BYTE* caps; // points variable length array of GFXREDIR_CAPS_HEADER.
104 
105 typedef struct
106 {
107  UINT32 version; // confirmed version, must be one of advertised by client.
108  UINT32 length; // GFXREDIR_CAPS_HEADER_SIZE + size of capsData.
109  const BYTE* capsData; // confirmed capsData from selected GFXREDIR_CAPS_HEADER.capsData.
111 
112 typedef struct
113 {
114  UINT64 poolId;
115  UINT64 poolSize;
116  UINT32 sectionNameLength; // number of charactor, must include null terminated char.
117  const unsigned short* sectionName; // Windows-style 2 bytes wchar_t with null-terminated.
119 
120 typedef struct
121 {
122  UINT64 poolId;
124 
125 typedef struct
126 {
127  UINT64 poolId;
128  UINT64 bufferId;
129  UINT64 offset;
130  UINT32 stride;
131  UINT32 width;
132  UINT32 height;
133  UINT32 format; // GFXREDIR_BUFFER_PIXEL_FORMAT_
135 
136 typedef struct
137 {
138  UINT64 bufferId;
140 
141 typedef struct
142 {
143  UINT64 timestamp;
144  UINT64 presentId;
145  UINT64 windowId;
146  UINT64 bufferId;
147  UINT32 orientation; // 0, 90, 180 or 270.
148  UINT32 targetWidth;
149  UINT32 targetHeight;
150  RECTANGLE_32 dirtyRect;
151  UINT32 numOpaqueRects;
152  RECTANGLE_32* opaqueRects;
154 
155 typedef struct
156 {
157  UINT64 windowId;
158  UINT64 presentId;
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 
165 #endif /* FREERDP_CHANNEL_GFXREDIR_H */