2 #include <winpr/cast.h>
4 #include <freerdp/freerdp.h>
5 #include <freerdp/client/rail.h>
9 UINT client_rail_server_start_cmd(RailClientContext* context)
12 char argsAndFile[520] = { 0 };
17 WINPR_ASSERT(context);
20 WINPR_ASSERT(rail->rdpcontext);
22 const rdpSettings* settings = rail->rdpcontext->settings;
23 WINPR_ASSERT(settings);
25 clientStatus.flags = TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE;
28 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_AUTORECONNECT;
30 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_ZORDER_SYNC;
31 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_WINDOW_RESIZE_MARGIN_SUPPORTED;
32 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_APPBAR_REMOTING_SUPPORTED;
33 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_POWER_DISPLAY_REQUEST_SUPPORTED;
34 clientStatus.flags |= TS_RAIL_CLIENTSTATUS_BIDIRECTIONAL_CLOAK_SUPPORTED;
35 status = context->ClientInformation(context, &clientStatus);
37 if (status != CHANNEL_RC_OK)
43 langBarInfo.languageBarStatus = 0x00000008;
44 status = context->ClientLanguageBarInfo(context, &langBarInfo);
50 case ERROR_BAD_CONFIGURATION:
58 sysparam.params |= SPI_MASK_SET_HIGH_CONTRAST;
59 sysparam.highContrast.colorScheme.string = NULL;
60 sysparam.highContrast.colorScheme.length = 0;
61 sysparam.highContrast.flags = 0x7E;
62 sysparam.params |= SPI_MASK_SET_MOUSE_BUTTON_SWAP;
63 sysparam.mouseButtonSwap = FALSE;
64 sysparam.params |= SPI_MASK_SET_KEYBOARD_PREF;
65 sysparam.keyboardPref = FALSE;
66 sysparam.params |= SPI_MASK_SET_DRAG_FULL_WINDOWS;
67 sysparam.dragFullWindows = FALSE;
68 sysparam.params |= SPI_MASK_SET_KEYBOARD_CUES;
69 sysparam.keyboardCues = FALSE;
70 sysparam.params |= SPI_MASK_SET_WORK_AREA;
71 sysparam.workArea.left = 0;
72 sysparam.workArea.top = 0;
77 sysparam.workArea.right = WINPR_ASSERTING_INT_CAST(UINT16, w);
78 sysparam.workArea.bottom = WINPR_ASSERTING_INT_CAST(UINT16, h);
79 sysparam.dragFullWindows = FALSE;
80 status = context->ClientSystemParam(context, &sysparam);
82 if (status != CHANNEL_RC_OK)
85 const char* RemoteApplicationFile =
87 const char* RemoteApplicationCmdLine =
89 if (RemoteApplicationFile && RemoteApplicationCmdLine)
91 (void)_snprintf(argsAndFile, ARRAYSIZE(argsAndFile),
"%s %s", RemoteApplicationCmdLine,
92 RemoteApplicationFile);
93 exec.RemoteApplicationArguments = argsAndFile;
95 else if (RemoteApplicationFile)
96 exec.RemoteApplicationArguments = RemoteApplicationFile;
98 exec.RemoteApplicationArguments = RemoteApplicationCmdLine;
99 exec.RemoteApplicationProgram =
101 exec.RemoteApplicationWorkingDir =
103 return context->ClientExecute(context, &exec);
FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.
FREERDP_API const char * freerdp_settings_get_string(const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a immutable string settings value.