FreeRDP
Loading...
Searching...
No Matches
client/rail_main.c
1
26#include <freerdp/config.h>
27
28#include <winpr/crt.h>
29
30#include <freerdp/types.h>
31#include <freerdp/constants.h>
32#include <freerdp/freerdp.h>
33
34#include "rail_orders.h"
35#include "rail_main.h"
36
37#include "../../../channels/client/addin.h"
38
39RailClientContext* rail_get_client_interface(railPlugin* rail)
40{
41 RailClientContext* pInterface = nullptr;
42
43 if (!rail)
44 return nullptr;
45
46 pInterface = (RailClientContext*)rail->channelEntryPoints.pInterface;
47 return pInterface;
48}
49
55static UINT rail_send(railPlugin* rail, wStream* s)
56{
57 UINT status = 0;
58
59 if (!rail)
60 {
61 Stream_Free(s, TRUE);
62 return CHANNEL_RC_BAD_INIT_HANDLE;
63 }
64
65 status = rail->channelEntryPoints.pVirtualChannelWriteEx(
66 rail->InitHandle, rail->OpenHandle, Stream_Buffer(s), (UINT32)Stream_GetPosition(s), s);
67
68 if (status != CHANNEL_RC_OK)
69 {
70 Stream_Free(s, TRUE);
71 WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08" PRIX32 "]",
72 WTSErrorToString(status), status);
73 }
74
75 return status;
76}
77
83UINT rail_send_channel_data(railPlugin* rail, wStream* src)
84{
85 if (!rail || !src)
86 {
87 Stream_Free(src, TRUE);
88 return ERROR_INVALID_PARAMETER;
89 }
90
91 return rail_send(rail, src);
92}
93
103static UINT rail_client_execute(RailClientContext* context, const RAIL_EXEC_ORDER* exec)
104{
105 const char* exeOrFile = nullptr;
106 UINT error = 0;
107 railPlugin* rail = nullptr;
108 UINT16 flags = 0;
109 RAIL_UNICODE_STRING ruExeOrFile = WINPR_C_ARRAY_INIT;
110 RAIL_UNICODE_STRING ruWorkingDir = WINPR_C_ARRAY_INIT;
111 RAIL_UNICODE_STRING ruArguments = WINPR_C_ARRAY_INIT;
112
113 if (!context || !exec)
114 return ERROR_INVALID_PARAMETER;
115
116 rail = (railPlugin*)context->handle;
117 exeOrFile = exec->RemoteApplicationProgram;
118 flags = exec->flags;
119
120 if (!exeOrFile)
121 return ERROR_INVALID_PARAMETER;
122
123 if (!utf8_string_to_rail_string(exec->RemoteApplicationProgram,
124 &ruExeOrFile) || /* RemoteApplicationProgram */
125 !utf8_string_to_rail_string(exec->RemoteApplicationWorkingDir,
126 &ruWorkingDir) || /* ShellWorkingDirectory */
127 !utf8_string_to_rail_string(exec->RemoteApplicationArguments,
128 &ruArguments)) /* RemoteApplicationCmdLine */
129 error = ERROR_INTERNAL_ERROR;
130 else
131 error = rail_send_client_exec_order(rail, flags, &ruExeOrFile, &ruWorkingDir, &ruArguments);
132
133 free(ruExeOrFile.string);
134 free(ruWorkingDir.string);
135 free(ruArguments.string);
136 return error;
137}
138
144static UINT rail_client_activate(RailClientContext* context, const RAIL_ACTIVATE_ORDER* activate)
145{
146 railPlugin* rail = nullptr;
147
148 if (!context || !activate)
149 return ERROR_INVALID_PARAMETER;
150
151 rail = (railPlugin*)context->handle;
152 return rail_send_client_activate_order(rail, activate);
153}
154
160static UINT rail_send_client_sysparam(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam)
161{
162 wStream* s = nullptr;
163 size_t length = RAIL_SYSPARAM_ORDER_LENGTH;
164 railPlugin* rail = nullptr;
165 UINT error = 0;
166 BOOL extendedSpiSupported = 0;
167
168 if (!context || !sysparam)
169 return ERROR_INVALID_PARAMETER;
170
171 rail = (railPlugin*)context->handle;
172
173 switch (sysparam->param)
174 {
175 case SPI_SET_DRAG_FULL_WINDOWS:
176 case SPI_SET_KEYBOARD_CUES:
177 case SPI_SET_KEYBOARD_PREF:
178 case SPI_SET_MOUSE_BUTTON_SWAP:
179 length += 1;
180 break;
181
182 case SPI_SET_WORK_AREA:
183 case SPI_DISPLAY_CHANGE:
184 case SPI_TASKBAR_POS:
185 length += 8;
186 break;
187
188 case SPI_SET_HIGH_CONTRAST:
189 length += sysparam->highContrast.colorSchemeLength + 10;
190 break;
191
192 case SPI_SETFILTERKEYS:
193 length += 20;
194 break;
195
196 case SPI_SETSTICKYKEYS:
197 case SPI_SETCARETWIDTH:
198 case SPI_SETTOGGLEKEYS:
199 length += 4;
200 break;
201
202 default:
203 return ERROR_BAD_ARGUMENTS;
204 }
205
206 s = rail_pdu_init(length);
207
208 if (!s)
209 {
210 WLog_ERR(TAG, "rail_pdu_init failed!");
211 return CHANNEL_RC_NO_MEMORY;
212 }
213
214 extendedSpiSupported = rail_is_extended_spi_supported(rail->channelFlags);
215 if ((error = rail_write_sysparam_order(s, sysparam, extendedSpiSupported)))
216 {
217 WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %" PRIu32 "!", error);
218 Stream_Free(s, TRUE);
219 return error;
220 }
221
222 return rail_send_pdu(rail, s, TS_RAIL_ORDER_SYSPARAM);
223}
224
230static UINT rail_client_system_param(RailClientContext* context,
231 const RAIL_SYSPARAM_ORDER* sysInParam)
232{
233 UINT error = CHANNEL_RC_OK;
234 RAIL_SYSPARAM_ORDER sysparam;
235
236 if (!context || !sysInParam)
237 return ERROR_INVALID_PARAMETER;
238
239 sysparam = *sysInParam;
240
241 if (sysparam.params & SPI_MASK_SET_HIGH_CONTRAST)
242 {
243 sysparam.param = SPI_SET_HIGH_CONTRAST;
244
245 if ((error = rail_send_client_sysparam(context, &sysparam)))
246 {
247 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
248 return error;
249 }
250 }
251
252 if (sysparam.params & SPI_MASK_TASKBAR_POS)
253 {
254 sysparam.param = SPI_TASKBAR_POS;
255
256 if ((error = rail_send_client_sysparam(context, &sysparam)))
257 {
258 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
259 return error;
260 }
261 }
262
263 if (sysparam.params & SPI_MASK_SET_MOUSE_BUTTON_SWAP)
264 {
265 sysparam.param = SPI_SET_MOUSE_BUTTON_SWAP;
266
267 if ((error = rail_send_client_sysparam(context, &sysparam)))
268 {
269 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
270 return error;
271 }
272 }
273
274 if (sysparam.params & SPI_MASK_SET_KEYBOARD_PREF)
275 {
276 sysparam.param = SPI_SET_KEYBOARD_PREF;
277
278 if ((error = rail_send_client_sysparam(context, &sysparam)))
279 {
280 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
281 return error;
282 }
283 }
284
285 if (sysparam.params & SPI_MASK_SET_DRAG_FULL_WINDOWS)
286 {
287 sysparam.param = SPI_SET_DRAG_FULL_WINDOWS;
288
289 if ((error = rail_send_client_sysparam(context, &sysparam)))
290 {
291 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
292 return error;
293 }
294 }
295
296 if (sysparam.params & SPI_MASK_SET_KEYBOARD_CUES)
297 {
298 sysparam.param = SPI_SET_KEYBOARD_CUES;
299
300 if ((error = rail_send_client_sysparam(context, &sysparam)))
301 {
302 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
303 return error;
304 }
305 }
306
307 if (sysparam.params & SPI_MASK_SET_WORK_AREA)
308 {
309 sysparam.param = SPI_SET_WORK_AREA;
310
311 if ((error = rail_send_client_sysparam(context, &sysparam)))
312 {
313 WLog_ERR(TAG, "rail_send_client_sysparam failed with error %" PRIu32 "!", error);
314 return error;
315 }
316 }
317
318 return error;
319}
320
326static UINT rail_client_system_command(RailClientContext* context,
327 const RAIL_SYSCOMMAND_ORDER* syscommand)
328{
329 railPlugin* rail = nullptr;
330
331 if (!context || !syscommand)
332 return ERROR_INVALID_PARAMETER;
333
334 rail = (railPlugin*)context->handle;
335 return rail_send_client_syscommand_order(rail, syscommand);
336}
337
343static UINT rail_client_handshake(RailClientContext* context, const RAIL_HANDSHAKE_ORDER* handshake)
344{
345 if (!context || !handshake)
346 return ERROR_INVALID_PARAMETER;
347
348 railPlugin* rail = (railPlugin*)context->handle;
349 WINPR_ASSERT(rail);
350 WLog_Print(rail->log, WLOG_DEBUG, "build=0x%08" PRIx32, handshake->buildNumber);
351 return rail_send_handshake_order(rail, handshake);
352}
353
354static UINT rail_server_handshake(RailClientContext* context, const RAIL_HANDSHAKE_ORDER* handshake)
355{
356 WINPR_ASSERT(context);
357 WINPR_ASSERT(handshake);
358
359 railPlugin* rail = (railPlugin*)context->handle;
360 WINPR_ASSERT(rail);
361
362 WLog_Print(rail->log, WLOG_DEBUG, "build=0x%08" PRIx32, handshake->buildNumber);
363
364 const UINT32 buildnumber =
365 freerdp_settings_get_uint32(rail->rdpcontext->settings, FreeRDP_ClientBuild);
366 const RAIL_HANDSHAKE_ORDER clientHandshake = { buildnumber };
367 return context->ClientHandshake(context, &clientHandshake);
368}
369
370static UINT rail_server_handshake_ex(RailClientContext* context,
371 const RAIL_HANDSHAKE_EX_ORDER* handshakeEx)
372{
373 WINPR_ASSERT(context);
374 WINPR_ASSERT(handshakeEx);
375
376 railPlugin* rail = (railPlugin*)context->handle;
377 WINPR_ASSERT(rail);
378
379 const RAIL_HANDSHAKE_ORDER handshake = { handshakeEx->buildNumber };
380
381 char buffer[128] = WINPR_C_ARRAY_INIT;
382 WLog_Print(
383 rail->log, WLOG_DEBUG, "build=0x%08" PRIx32 ", flags=%s", handshakeEx->buildNumber,
384 rail_handshake_ex_flags_to_string(handshakeEx->railHandshakeFlags, buffer, sizeof(buffer)));
385 return rail_server_handshake(context, &handshake);
386}
387
393static UINT rail_client_notify_event(RailClientContext* context,
394 const RAIL_NOTIFY_EVENT_ORDER* notifyEvent)
395{
396 railPlugin* rail = nullptr;
397
398 if (!context || !notifyEvent)
399 return ERROR_INVALID_PARAMETER;
400
401 rail = (railPlugin*)context->handle;
402 return rail_send_client_notify_event_order(rail, notifyEvent);
403}
404
410static UINT rail_client_window_move(RailClientContext* context,
411 const RAIL_WINDOW_MOVE_ORDER* windowMove)
412{
413 railPlugin* rail = nullptr;
414
415 if (!context || !windowMove)
416 return ERROR_INVALID_PARAMETER;
417
418 rail = (railPlugin*)context->handle;
419 return rail_send_client_window_move_order(rail, windowMove);
420}
421
427static UINT rail_client_information(RailClientContext* context,
428 const RAIL_CLIENT_STATUS_ORDER* clientStatus)
429{
430 railPlugin* rail = nullptr;
431
432 if (!context || !clientStatus)
433 return ERROR_INVALID_PARAMETER;
434
435 rail = (railPlugin*)context->handle;
436 return rail_send_client_status_order(rail, clientStatus);
437}
438
444static UINT rail_client_system_menu(RailClientContext* context, const RAIL_SYSMENU_ORDER* sysmenu)
445{
446 railPlugin* rail = nullptr;
447
448 if (!context || !sysmenu)
449 return ERROR_INVALID_PARAMETER;
450
451 rail = (railPlugin*)context->handle;
452 return rail_send_client_sysmenu_order(rail, sysmenu);
453}
454
460static UINT rail_client_language_bar_info(RailClientContext* context,
461 const RAIL_LANGBAR_INFO_ORDER* langBarInfo)
462{
463 railPlugin* rail = nullptr;
464
465 if (!context || !langBarInfo)
466 return ERROR_INVALID_PARAMETER;
467
468 rail = (railPlugin*)context->handle;
469 return rail_send_client_langbar_info_order(rail, langBarInfo);
470}
471
472static UINT rail_client_language_ime_info(RailClientContext* context,
473 const RAIL_LANGUAGEIME_INFO_ORDER* langImeInfo)
474{
475 railPlugin* rail = nullptr;
476
477 if (!context || !langImeInfo)
478 return ERROR_INVALID_PARAMETER;
479
480 rail = (railPlugin*)context->handle;
481 return rail_send_client_languageime_info_order(rail, langImeInfo);
482}
483
489static UINT rail_client_get_appid_request(RailClientContext* context,
490 const RAIL_GET_APPID_REQ_ORDER* getAppIdReq)
491{
492 railPlugin* rail = nullptr;
493
494 if (!context || !getAppIdReq || !context->handle)
495 return ERROR_INVALID_PARAMETER;
496
497 rail = (railPlugin*)context->handle;
498 return rail_send_client_get_appid_req_order(rail, getAppIdReq);
499}
500
501static UINT rail_client_compartment_info(RailClientContext* context,
502 const RAIL_COMPARTMENT_INFO_ORDER* compartmentInfo)
503{
504 railPlugin* rail = nullptr;
505
506 if (!context || !compartmentInfo || !context->handle)
507 return ERROR_INVALID_PARAMETER;
508
509 rail = (railPlugin*)context->handle;
510 return rail_send_client_compartment_info_order(rail, compartmentInfo);
511}
512
513static UINT rail_client_cloak(RailClientContext* context, const RAIL_CLOAK* cloak)
514{
515 railPlugin* rail = nullptr;
516
517 if (!context || !cloak || !context->handle)
518 return ERROR_INVALID_PARAMETER;
519
520 rail = (railPlugin*)context->handle;
521 return rail_send_client_cloak_order(rail, cloak);
522}
523
524static UINT rail_client_snap_arrange(RailClientContext* context, const RAIL_SNAP_ARRANGE* snap)
525{
526 railPlugin* rail = nullptr;
527
528 if (!context || !snap || !context->handle)
529 return ERROR_INVALID_PARAMETER;
530
531 rail = (railPlugin*)context->handle;
532 return rail_send_client_snap_arrange_order(rail, snap);
533}
534
535static UINT rail_client_text_scale(RailClientContext* context, UINT32 textScale)
536{
537 if (!context || !context->handle)
538 return ERROR_INVALID_PARAMETER;
539
540 railPlugin* rail = (railPlugin*)context->handle;
541 return rail_send_client_text_scale_order(rail, textScale);
542}
543
544static UINT rail_client_caret_blink_rate(RailClientContext* context, UINT32 rate)
545{
546 if (!context || !context->handle)
547 return ERROR_INVALID_PARAMETER;
548
549 railPlugin* rail = (railPlugin*)context->handle;
550 return rail_send_client_caret_blink_rate_order(rail, rate);
551}
552
553static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWORD openHandle,
554 UINT event, LPVOID pData,
555 UINT32 dataLength, UINT32 totalLength,
556 UINT32 dataFlags)
557{
558 UINT error = CHANNEL_RC_OK;
559 railPlugin* rail = (railPlugin*)lpUserParam;
560
561 switch (event)
562 {
563 case CHANNEL_EVENT_DATA_RECEIVED:
564 if (!rail || (rail->OpenHandle != openHandle))
565 {
566 WLog_ERR(TAG, "error no match");
567 return;
568 }
569
570 if ((error = channel_client_post_message(rail->MsgsHandle, pData, dataLength,
571 totalLength, dataFlags)))
572 {
573 WLog_ERR(TAG,
574 "rail_virtual_channel_event_data_received"
575 " failed with error %" PRIu32 "!",
576 error);
577 }
578
579 break;
580
581 case CHANNEL_EVENT_WRITE_CANCELLED:
582 case CHANNEL_EVENT_WRITE_COMPLETE:
583 {
584 wStream* s = (wStream*)pData;
585 Stream_Free(s, TRUE);
586 }
587 break;
588
589 case CHANNEL_EVENT_USER:
590 break;
591 default:
592 break;
593 }
594
595 if (error && rail && rail->rdpcontext)
596 setChannelError(rail->rdpcontext, error,
597 "rail_virtual_channel_open_event reported an error");
598}
599
605static UINT rail_virtual_channel_event_connected(railPlugin* rail, WINPR_ATTR_UNUSED LPVOID pData,
606 WINPR_ATTR_UNUSED UINT32 dataLength)
607{
608 WINPR_ASSERT(rail);
609
610 rail->MsgsHandle = channel_client_create_handler(rail->rdpcontext, rail, rail_order_recv,
611 RAIL_SVC_CHANNEL_NAME);
612 if (!rail->MsgsHandle)
613 return ERROR_INTERNAL_ERROR;
614
615 return rail->channelEntryPoints.pVirtualChannelOpenEx(rail->InitHandle, &rail->OpenHandle,
616 rail->channelDef.name,
617 rail_virtual_channel_open_event_ex);
618}
619
625static UINT rail_virtual_channel_event_disconnected(railPlugin* rail)
626{
627 UINT rc = 0;
628
629 channel_client_quit_handler(rail->MsgsHandle);
630 if (rail->OpenHandle == 0)
631 return CHANNEL_RC_OK;
632
633 WINPR_ASSERT(rail->channelEntryPoints.pVirtualChannelCloseEx);
634 rc = rail->channelEntryPoints.pVirtualChannelCloseEx(rail->InitHandle, rail->OpenHandle);
635
636 if (CHANNEL_RC_OK != rc)
637 {
638 WLog_ERR(TAG, "pVirtualChannelCloseEx failed with %s [%08" PRIX32 "]", WTSErrorToString(rc),
639 rc);
640 return rc;
641 }
642
643 rail->OpenHandle = 0;
644
645 return CHANNEL_RC_OK;
646}
647
648static void rail_virtual_channel_event_terminated(railPlugin* rail)
649{
650 rail->InitHandle = nullptr;
651 free(rail->context);
652 free(rail);
653}
654
655static VOID VCAPITYPE rail_virtual_channel_init_event_ex(LPVOID lpUserParam, LPVOID pInitHandle,
656 UINT event, LPVOID pData, UINT dataLength)
657{
658 UINT error = CHANNEL_RC_OK;
659 railPlugin* rail = (railPlugin*)lpUserParam;
660
661 if (!rail || (rail->InitHandle != pInitHandle))
662 {
663 WLog_ERR(TAG, "error no match");
664 return;
665 }
666
667 switch (event)
668 {
669 case CHANNEL_EVENT_CONNECTED:
670 if ((error = rail_virtual_channel_event_connected(rail, pData, dataLength)))
671 WLog_ERR(TAG, "rail_virtual_channel_event_connected failed with error %" PRIu32 "!",
672 error);
673
674 break;
675
676 case CHANNEL_EVENT_DISCONNECTED:
677 if ((error = rail_virtual_channel_event_disconnected(rail)))
678 WLog_ERR(TAG,
679 "rail_virtual_channel_event_disconnected failed with error %" PRIu32 "!",
680 error);
681
682 break;
683
684 case CHANNEL_EVENT_TERMINATED:
685 rail_virtual_channel_event_terminated(rail);
686 break;
687
688 case CHANNEL_EVENT_ATTACHED:
689 case CHANNEL_EVENT_DETACHED:
690 default:
691 break;
692 }
693
694 if (error && rail->rdpcontext)
695 setChannelError(rail->rdpcontext, error,
696 "rail_virtual_channel_init_event_ex reported an error");
697}
698
699/* rail is always built-in */
700#define VirtualChannelEntryEx rail_VirtualChannelEntryEx
701
702FREERDP_ENTRY_POINT(BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPoints,
703 PVOID pInitHandle))
704{
705 UINT rc = 0;
706 railPlugin* rail = nullptr;
707 RailClientContext* context = nullptr;
708 CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx = nullptr;
709 BOOL isFreerdp = FALSE;
710 rail = (railPlugin*)calloc(1, sizeof(railPlugin));
711
712 if (!rail)
713 {
714 WLog_ERR(TAG, "calloc failed!");
715 return FALSE;
716 }
717
718 rail->channelDef.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |
719 CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL;
720 (void)sprintf_s(rail->channelDef.name, ARRAYSIZE(rail->channelDef.name), RAIL_SVC_CHANNEL_NAME);
721 pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints;
722
723 if ((pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX)) &&
724 (pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER))
725 {
726 context = (RailClientContext*)calloc(1, sizeof(RailClientContext));
727
728 if (!context)
729 {
730 WLog_ERR(TAG, "calloc failed!");
731 free(rail);
732 return FALSE;
733 }
734
735 context->handle = (void*)rail;
736 context->custom = nullptr;
737 context->ClientExecute = rail_client_execute;
738 context->ClientActivate = rail_client_activate;
739 context->ClientSystemParam = rail_client_system_param;
740 context->ClientSystemCommand = rail_client_system_command;
741 context->ClientHandshake = rail_client_handshake;
742 context->ServerHandshake = rail_server_handshake;
743 context->ServerHandshakeEx = rail_server_handshake_ex;
744 context->ClientNotifyEvent = rail_client_notify_event;
745 context->ClientWindowMove = rail_client_window_move;
746 context->ClientInformation = rail_client_information;
747 context->ClientSystemMenu = rail_client_system_menu;
748 context->ClientLanguageBarInfo = rail_client_language_bar_info;
749 context->ClientLanguageIMEInfo = rail_client_language_ime_info;
750 context->ClientGetAppIdRequest = rail_client_get_appid_request;
751 context->ClientSnapArrange = rail_client_snap_arrange;
752 context->ClientCloak = rail_client_cloak;
753 context->ClientCompartmentInfo = rail_client_compartment_info;
754 context->ClientTextScale = rail_client_text_scale;
755 context->ClientCaretBlinkRate = rail_client_caret_blink_rate;
756 rail->rdpcontext = pEntryPointsEx->context;
757 rail->context = context;
758 isFreerdp = TRUE;
759 }
760
761 rail->log = WLog_Get("com.freerdp.channels.rail.client");
762 WLog_Print(rail->log, WLOG_DEBUG, "VirtualChannelEntryEx");
763 CopyMemory(&(rail->channelEntryPoints), pEntryPoints, sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX));
764 rail->InitHandle = pInitHandle;
765 rc = rail->channelEntryPoints.pVirtualChannelInitEx(
766 rail, context, pInitHandle, &rail->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000,
767 rail_virtual_channel_init_event_ex);
768
769 if (CHANNEL_RC_OK != rc)
770 {
771 WLog_ERR(TAG, "failed with %s [%08" PRIX32 "]", WTSErrorToString(rc), rc);
772 goto error_out;
773 }
774
775 rail->channelEntryPoints.pInterface = context;
776 return TRUE;
777error_out:
778
779 if (isFreerdp)
780 free(rail->context);
781
782 free(rail);
783 return FALSE;
784}
WINPR_ATTR_NODISCARD FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
Definition svc.h:60