1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/* BSD-2-Clause license
*
* Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>.
*
*/
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "webrdp_core_api.h"
#include "webrdp_module_api.h"
#include "rdp_backend_api.h"
#include "rdp_rail.h"
static UINT
RailServerSystemParam(
RailClientContext *context, const RAIL_SYSPARAM_ORDER *sysparam)
{
return CHANNEL_RC_OK;
}
static UINT
RailServerHandshake(
RailClientContext *context, const RAIL_HANDSHAKE_ORDER *handshake)
{
return client_rail_server_start_cmd(context);
}
static UINT
RailServerHandshakeEx(
RailClientContext *context, const RAIL_HANDSHAKE_EX_ORDER *handshakeEx)
{
return client_rail_server_start_cmd(context);
}
static UINT
RailServerLocalMoveSize(
RailClientContext *context, const RAIL_LOCALMOVESIZE_ORDER *localMoveSize)
{
return CHANNEL_RC_OK;
}
static UINT
RailServerMinMaxInfo(
RailClientContext *context, const RAIL_MINMAXINFO_ORDER *minMaxInfo)
{
return CHANNEL_RC_OK;
}
static UINT
RailServerLanguageBarInfo(
RailClientContext *context, const RAIL_LANGBAR_INFO_ORDER *langBarInfo)
{
return CHANNEL_RC_OK;
}
static UINT
RailServerExecuteResult(
RailClientContext *context, const RAIL_EXEC_RESULT_ORDER *execResult)
{
my_rdp_context *c = (my_rdp_context *)context;
if (execResult->execResult != RAIL_EXEC_S_OK)
{
const char *msg
= "rdp_module: rail: RailServerExecuteResult failure";
c->my_internals->core->api_utils->log_msg(
(const uint8_t *)msg, strlen(msg), wrdp_log_level_error, 0);
}
return CHANNEL_RC_OK;
}
static UINT
RailServerGetAppIdResponse(
RailClientContext *context, const RAIL_GET_APPID_RESP_ORDER *getAppIdResp)
{
return CHANNEL_RC_OK;
}
static BOOL
WindowCreate(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const WINDOW_STATE_ORDER *window_state)
{
return TRUE;
}
static BOOL
WindowUpdate(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const WINDOW_STATE_ORDER *window_state)
{
return TRUE;
}
static BOOL
WindowIcon(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const WINDOW_ICON_ORDER *window_icon)
{
return TRUE;
}
static BOOL
WindowCachedIcon(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const WINDOW_CACHED_ICON_ORDER *window_cached_icon)
{
return TRUE;
}
static BOOL
WindowDelete(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo)
{
return TRUE;
}
static BOOL
NotifyIconCreate(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const NOTIFY_ICON_STATE_ORDER *notify_icon_state)
{
return TRUE;
}
static BOOL
NotifyIconUpdate(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const NOTIFY_ICON_STATE_ORDER *notify_icon_state)
{
return TRUE;
}
static BOOL
NotifyIconDelete(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo)
{
return TRUE;
}
static BOOL
MonitoredDesktop(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo,
const MONITORED_DESKTOP_ORDER *monitored_desktop)
{
return TRUE;
}
static BOOL
NonMonitoredDesktop(rdpContext *context, const WINDOW_ORDER_INFO *orderInfo)
{
return TRUE;
}
static void
rdp_rail_register_update_callbacks(rdpUpdate *update)
{
rdpWindowUpdate *window = update->window;
window->WindowCreate = WindowCreate;
window->WindowUpdate = WindowUpdate;
window->WindowDelete = WindowDelete;
window->WindowIcon = WindowIcon;
window->WindowCachedIcon = WindowCachedIcon;
window->NotifyIconCreate = NotifyIconCreate;
window->NotifyIconUpdate = NotifyIconUpdate;
window->NotifyIconDelete = NotifyIconDelete;
window->MonitoredDesktop = MonitoredDesktop;
window->NonMonitoredDesktop = NonMonitoredDesktop;
}
void
rdp_rail_init(my_rdp_context *context, RailClientContext *rail)
{
if (!context || !rail)
return;
rdp_rail_register_update_callbacks(context->context.update);
rail->custom = (void *)context;
rail->ServerExecuteResult = RailServerExecuteResult;
rail->ServerSystemParam = RailServerSystemParam;
rail->ServerHandshake = RailServerHandshake;
rail->ServerHandshakeEx = RailServerHandshakeEx;
rail->ServerLocalMoveSize = RailServerLocalMoveSize;
rail->ServerMinMaxInfo = RailServerMinMaxInfo;
rail->ServerLanguageBarInfo = RailServerLanguageBarInfo;
rail->ServerGetAppIdResponse = RailServerGetAppIdResponse;
}
void
rdp_rail_uninit(my_rdp_context *context, RailClientContext *rail)
{
}
|