FreeRDP
Loading...
Searching...
No Matches
wts_services.h
Go to the documentation of this file.
1
20#ifndef FREERDP_WTS_SERVICES_H
21#define FREERDP_WTS_SERVICES_H
22
23#include <winpr/com.h>
24
66#ifdef __cplusplus
67extern "C"
68{
69#endif
70
77
78 /* ======================= IWTSPluginServiceProvider ======================= */
79
80 /* obtained by QueryInterface on the IWTSVirtualChannelManager given to IWTSPlugin::Initialize
81 */
82 WINPR_COM_DEFINE_GUID(IID_IWTSPluginServiceProvider, 0xd3e07363, 0x087c, 0x476c, 0x86, 0xa7,
83 0xdb, 0xb1, 0x5f, 0x46, 0xdd, 0xb4);
84
86 {
87 wIUnknownVtbl iunknown;
88
89 /* the service key is passed BY VALUE (SDK and mstscax agree; on x64 it ends up behind a
90 * pointer anyway, on x86 the 16 bytes are on the stack). The service returned is not
91 * necessarily of the type the key suggests: callers QueryInterface it */
92 HRESULT(WINPR_COM_CALL* GetService)
93 (IWTSPluginServiceProvider* This, GUID ServiceId, wIUnknown** ppunkObject);
95
97 {
99 };
100
101 /* ======================= bitmap render service ======================= */
102
103 /* GetService key (SDK) */
104 WINPR_COM_DEFINE_GUID(RDCLIENT_BITMAP_RENDER_SERVICE, 0xe4cc08cb, 0x942e, 0x4b19, 0x85, 0x04,
105 0xbd, 0x5a, 0x89, 0xa7, 0x47, 0xf5);
106
107 WINPR_COM_DEFINE_GUID(IID_IWTSBitmapRenderService, 0xea326091, 0x05fe, 0x40c1, 0xb4, 0x9c, 0x3d,
108 0x2e, 0xf4, 0x62, 0x6a, 0x0e);
109 WINPR_COM_DEFINE_GUID(IID_IWTSBitmapRenderer, 0x5b7acc97, 0xf3c9, 0x46f7, 0x8c, 0x5b, 0xfa,
110 0x68, 0x5d, 0x34, 0x41, 0xb1);
111 WINPR_COM_DEFINE_GUID(IID_IWTSBitmapRendererCallback, 0xd782928e, 0xfe4e, 0x4e77, 0xae, 0x90,
112 0x9c, 0xd0, 0xb3, 0xe3, 0xb3, 0x53);
113
114 typedef struct
115 {
116 DWORD dwFramesDelivered;
117 DWORD dwFramesDropped;
119
121 typedef struct
122 {
123 LONG left;
124 LONG top;
125 LONG right;
126 LONG bottom;
127 } WTS_RECT;
128
130 {
131 wIUnknownVtbl iunknown;
132
133 /* imageFormat: a Media Foundation subtype; GUID_NULL for BGRA32 */
134 HRESULT(WINPR_COM_CALL* Render)
135 (IWTSBitmapRenderer* This, GUID imageFormat, DWORD dwWidth, DWORD dwHeight, LONG cbStride,
136 DWORD cbImageBuffer, BYTE* pImageBuffer);
137 HRESULT(WINPR_COM_CALL* GetRendererStatistics)
139 HRESULT(WINPR_COM_CALL* RemoveMapping)(IWTSBitmapRenderer* This);
141
143 {
144 const IWTSBitmapRendererVtbl* lpVtbl;
145 };
146
148 {
149 wIUnknownVtbl iunknown;
150
151 /* RECT by value (SDK), left/top/right/bottom */
152 HRESULT(WINPR_COM_CALL* OnTargetSizeChanged)
153 (IWTSBitmapRendererCallback* This, WTS_RECT rcNewSize);
155
157 {
158 const IWTSBitmapRendererCallbackVtbl* lpVtbl;
159 };
160
162 {
163 wIUnknownVtbl iunknown;
164
165 /* mappingId: a MS-RDPEGT geometry mapping id, given by the server */
166 HRESULT(WINPR_COM_CALL* GetMappedRenderer)
167 (IWTSBitmapRenderService* This, UINT64 mappingId,
168 IWTSBitmapRendererCallback* pMappedRendererCallback,
169 IWTSBitmapRenderer** ppMappedRenderer);
171
173 {
174 const IWTSBitmapRenderServiceVtbl* lpVtbl;
175 };
176
177 /* ======================= window info service (rdclientax.dll only) =======================
178 *
179 * Implemented in rdclientax.dll (WTSWindowInfoService). Behaviour of Microsoft's
180 * implementation, which a compatible one should keep:
181 * - GetService creates a new service object on each call;
182 * - one subscriber per service object: a second Subscribe fails with
183 * HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), Unsubscribe without one with
184 * HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
185 * - Subscribe/Unsubscribe are synchronous (run on the client's core thread, waited for);
186 * - OnWindowChanged gets a copy of the new WTS_WINDOW_INFO, valid during the call only. */
187
188 /* GetService key (named by us, undocumented) */
189 WINPR_COM_DEFINE_GUID(RDCLIENT_WINDOW_INFO_SERVICE, 0xa9a17a6b, 0xcdb3, 0x4e81, 0xb5, 0xc8,
190 0xbd, 0x63, 0x82, 0x2a, 0x8d, 0x6c);
191 /* what the service is then queried for */
192 WINPR_COM_DEFINE_GUID(IID_IWTSWindowInfoService, 0x2a002c7b, 0x0120, 0x4d04, 0xbf, 0xb1, 0x3c,
193 0x73, 0x11, 0x0c, 0x85, 0x81);
194
195 typedef enum
196 {
197 WTS_RDP_SESSION_TYPE_DESKTOP = 0,
198 WTS_RDP_SESSION_TYPE_REMOTEAPP = 1, /* the client's "RailMode" property */
199 } WTS_RDP_SESSION_TYPE;
200
202 typedef struct
203 {
204 /* desktop: the client window showing the session; RemoteApp: the local window of the
205 * remote window asked for */
206 HWND hwnd;
207 /* desktop: size of the remote desktop; RemoteApp: client size of the local window */
208 INT32 remoteHeight;
209 INT32 remoteWidth;
210 /* client area of hwnd */
211 INT32 viewWidth;
212 INT32 viewHeight;
213 /* scrollbar positions (0 if none, always 0 in RemoteApp) */
214 INT32 scrollX;
215 INT32 scrollY;
216 /* desktop: viewWidth / remoteWidth, 1.0 when scrollbars are shown; RemoteApp: 0 */
217 float scale;
219
221 {
222 wIUnknownVtbl iunknown;
223
224 /* windowInfo: the new window info, valid during the call only */
225 HRESULT(WINPR_COM_CALL* OnWindowChanged)
226 (IWTSWindowChangedCallback* This, const WTS_WINDOW_INFO* windowInfo);
228
230 {
231 const IWTSWindowChangedCallbackVtbl* lpVtbl;
232 };
233
235 {
236 wIUnknownVtbl iunknown;
237
238 /* remoteHwnd: the remote window, only used in RemoteApp sessions */
239 HRESULT(WINPR_COM_CALL* GetWindowInfo)
240 (IWTSWindowInfoService* This, UINT64 remoteHwnd, WTS_WINDOW_INFO* windowInfo);
241 /* the client's own process id */
242 HRESULT(WINPR_COM_CALL* GetProcessId)(IWTSWindowInfoService* This, DWORD* processId);
243 /* a WTS_RDP_SESSION_TYPE */
244 HRESULT(WINPR_COM_CALL* GetRdpSessionType)
245 (IWTSWindowInfoService* This, UINT32* sessionType);
246 /* remoteHwnd (0 for a desktop session) is not used by Microsoft's client */
247 HRESULT(WINPR_COM_CALL* SubscribeWindowChanged)
248 (IWTSWindowInfoService* This, UINT64 remoteHwnd, IWTSWindowChangedCallback* callback);
249 HRESULT(WINPR_COM_CALL* UnsubscribeWindowChanged)(IWTSWindowInfoService* This);
251
253 {
254 const IWTSWindowInfoServiceVtbl* lpVtbl;
255 };
256
257#ifdef __cplusplus
258}
259#endif
260
261#endif /* FREERDP_WTS_SERVICES_H */
#define WINPR_COM_DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
defines a GUID constant visible in the including file only (nothing to link)
Definition com.h:122
#define WINPR_COM_CALL
the calling convention of COM methods (STDMETHODCALLTYPE)
Definition com.h:73
IUnknown, C form.
Definition com.h:111
the vtable of IUnknown, the first entries of every COM vtable
Definition com.h:85
same layout as Win32's RECT, which winpr doesn't have on POSIX
40 bytes on x64