2019-05-14 21:02:31 +03:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* rdp2tcp Virtual Channel Extension
|
|
|
|
*
|
|
|
|
* Copyright 2017 Artur Zaprzala
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2021-06-09 15:03:34 +03:00
|
|
|
#include <winpr/assert.h>
|
2019-05-14 21:02:31 +03:00
|
|
|
|
|
|
|
#include <winpr/file.h>
|
|
|
|
#include <winpr/pipe.h>
|
|
|
|
#include <winpr/thread.h>
|
|
|
|
|
2023-03-14 12:39:18 +03:00
|
|
|
#include <freerdp/freerdp.h>
|
2019-05-14 21:02:31 +03:00
|
|
|
#include <freerdp/svc.h>
|
2021-08-25 11:02:46 +03:00
|
|
|
#include <freerdp/channels/rdp2tcp.h>
|
2019-05-14 21:02:31 +03:00
|
|
|
|
2019-06-25 11:52:22 +03:00
|
|
|
#include <freerdp/log.h>
|
2021-08-25 11:02:46 +03:00
|
|
|
#define TAG CLIENT_TAG(RDP2TCP_DVC_CHANNEL_NAME)
|
2019-06-25 11:52:22 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
static int const debug = 0;
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
typedef struct
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
HANDLE hStdOutputRead;
|
|
|
|
HANDLE hStdInputWrite;
|
|
|
|
HANDLE hProcess;
|
|
|
|
HANDLE copyThread;
|
|
|
|
HANDLE writeComplete;
|
|
|
|
DWORD openHandle;
|
2019-05-15 20:12:33 +03:00
|
|
|
void* initHandle;
|
2019-05-14 21:02:31 +03:00
|
|
|
CHANNEL_ENTRY_POINTS_FREERDP_EX channelEntryPoints;
|
2019-05-15 20:12:33 +03:00
|
|
|
char buffer[16 * 1024];
|
2020-11-18 09:51:45 +03:00
|
|
|
char* commandline;
|
2019-05-14 21:02:31 +03:00
|
|
|
} Plugin;
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static int init_external_addin(Plugin* plugin)
|
|
|
|
{
|
2019-05-15 22:33:35 +03:00
|
|
|
SECURITY_ATTRIBUTES saAttr;
|
2021-05-28 18:50:09 +03:00
|
|
|
STARTUPINFOA siStartInfo; /* Using ANSI type to match CreateProcessA */
|
2019-05-15 22:33:35 +03:00
|
|
|
PROCESS_INFORMATION procInfo;
|
|
|
|
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
|
|
|
saAttr.bInheritHandle = TRUE;
|
|
|
|
saAttr.lpSecurityDescriptor = NULL;
|
|
|
|
siStartInfo.cb = sizeof(STARTUPINFO);
|
|
|
|
siStartInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
|
|
|
siStartInfo.dwFlags = STARTF_USESTDHANDLES;
|
2019-05-14 21:02:31 +03:00
|
|
|
|
|
|
|
// Create pipes
|
2019-05-15 20:12:33 +03:00
|
|
|
if (!CreatePipe(&plugin->hStdOutputRead, &siStartInfo.hStdOutput, &saAttr, 0))
|
|
|
|
{
|
2019-06-25 11:52:22 +03:00
|
|
|
WLog_ERR(TAG, "stdout CreatePipe");
|
2019-05-14 21:02:31 +03:00
|
|
|
return -1;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (!SetHandleInformation(plugin->hStdOutputRead, HANDLE_FLAG_INHERIT, 0))
|
|
|
|
{
|
2019-06-25 11:52:22 +03:00
|
|
|
WLog_ERR(TAG, "stdout SetHandleInformation");
|
2019-05-14 21:02:31 +03:00
|
|
|
return -1;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (!CreatePipe(&siStartInfo.hStdInput, &plugin->hStdInputWrite, &saAttr, 0))
|
|
|
|
{
|
2019-06-25 11:52:22 +03:00
|
|
|
WLog_ERR(TAG, "stdin CreatePipe");
|
2019-05-14 21:02:31 +03:00
|
|
|
return -1;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (!SetHandleInformation(plugin->hStdInputWrite, HANDLE_FLAG_INHERIT, 0))
|
|
|
|
{
|
2019-06-25 11:52:22 +03:00
|
|
|
WLog_ERR(TAG, "stdin SetHandleInformation");
|
2019-05-14 21:02:31 +03:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute plugin
|
2020-11-18 09:51:45 +03:00
|
|
|
plugin->commandline = _strdup(plugin->channelEntryPoints.pExtendedData);
|
|
|
|
if (!CreateProcessA(NULL,
|
|
|
|
plugin->commandline, // command line
|
|
|
|
NULL, // process security attributes
|
|
|
|
NULL, // primary thread security attributes
|
|
|
|
TRUE, // handles are inherited
|
|
|
|
0, // creation flags
|
|
|
|
NULL, // use parent's environment
|
|
|
|
NULL, // use parent's current directory
|
|
|
|
&siStartInfo, // STARTUPINFO pointer
|
|
|
|
&procInfo // receives PROCESS_INFORMATION
|
|
|
|
))
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2019-06-25 11:52:22 +03:00
|
|
|
WLog_ERR(TAG, "fork for addin");
|
2019-05-14 21:02:31 +03:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin->hProcess = procInfo.hProcess;
|
2024-09-16 05:58:36 +03:00
|
|
|
(void)CloseHandle(procInfo.hThread);
|
|
|
|
(void)CloseHandle(siStartInfo.hStdOutput);
|
|
|
|
(void)CloseHandle(siStartInfo.hStdInput);
|
2019-05-14 21:02:31 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static void dumpData(char* data, unsigned length)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
unsigned const limit = 98;
|
2019-05-15 20:12:33 +03:00
|
|
|
unsigned l = length > limit ? limit / 2 : length;
|
|
|
|
|
2024-01-30 12:25:38 +03:00
|
|
|
for (unsigned i = 0; i < l; ++i)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
printf("%02hhx", data[i]);
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (length > limit)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
printf("...");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2024-01-30 12:25:38 +03:00
|
|
|
for (unsigned i = length - l; i < length; ++i)
|
2019-05-14 21:02:31 +03:00
|
|
|
printf("%02hhx", data[i]);
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
puts("");
|
|
|
|
}
|
|
|
|
|
2019-05-15 22:33:35 +03:00
|
|
|
static DWORD WINAPI copyThread(void* data)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2022-12-06 12:32:08 +03:00
|
|
|
DWORD status = WAIT_OBJECT_0;
|
2019-05-15 20:12:33 +03:00
|
|
|
Plugin* plugin = (Plugin*)data;
|
2024-08-26 17:33:59 +03:00
|
|
|
size_t const bufsize = 16ULL * 1024ULL;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2022-12-06 12:32:08 +03:00
|
|
|
while (status == WAIT_OBJECT_0)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2022-12-06 12:32:08 +03:00
|
|
|
|
|
|
|
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = { 0 };
|
2024-01-23 18:49:54 +03:00
|
|
|
DWORD dwRead = 0;
|
2019-05-15 20:12:33 +03:00
|
|
|
char* buffer = malloc(bufsize);
|
|
|
|
|
|
|
|
if (!buffer)
|
|
|
|
{
|
2024-08-26 16:39:33 +03:00
|
|
|
(void)fprintf(stderr, "rdp2tcp copyThread: malloc failed\n");
|
2019-10-28 16:28:11 +03:00
|
|
|
goto fail;
|
2019-05-14 21:02:31 +03:00
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
// if (!ReadFile(plugin->hStdOutputRead, plugin->buffer, sizeof plugin->buffer, &dwRead,
|
|
|
|
// NULL))
|
2019-05-14 21:02:31 +03:00
|
|
|
if (!ReadFile(plugin->hStdOutputRead, buffer, bufsize, &dwRead, NULL))
|
2019-10-28 16:28:11 +03:00
|
|
|
{
|
|
|
|
free(buffer);
|
|
|
|
goto fail;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (debug > 1)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
printf(">%8u ", (unsigned)dwRead);
|
|
|
|
dumpData(buffer, dwRead);
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
if (plugin->channelEntryPoints.pVirtualChannelWriteEx(
|
|
|
|
plugin->initHandle, plugin->openHandle, buffer, dwRead, buffer) != CHANNEL_RC_OK)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2019-10-28 16:28:11 +03:00
|
|
|
free(buffer);
|
2024-08-26 16:39:33 +03:00
|
|
|
(void)fprintf(stderr, "rdp2tcp copyThread failed %i\n", (int)dwRead);
|
2019-10-28 16:28:11 +03:00
|
|
|
goto fail;
|
2019-05-14 21:02:31 +03:00
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2022-12-06 12:32:08 +03:00
|
|
|
handles[0] = plugin->writeComplete;
|
|
|
|
handles[1] = freerdp_abort_event(plugin->channelEntryPoints.context);
|
|
|
|
status = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
|
2022-12-09 13:27:17 +03:00
|
|
|
if (status == WAIT_OBJECT_0)
|
2024-09-16 05:53:18 +03:00
|
|
|
(void)ResetEvent(plugin->writeComplete);
|
2019-05-14 21:02:31 +03:00
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-10-28 16:28:11 +03:00
|
|
|
fail:
|
|
|
|
ExitThread(0);
|
2019-05-14 21:02:31 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static void closeChannel(Plugin* plugin)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp closing channel");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2021-09-06 17:46:01 +03:00
|
|
|
WINPR_ASSERT(plugin);
|
|
|
|
WINPR_ASSERT(plugin->channelEntryPoints.pVirtualChannelCloseEx);
|
2019-05-14 21:02:31 +03:00
|
|
|
plugin->channelEntryPoints.pVirtualChannelCloseEx(plugin->initHandle, plugin->openHandle);
|
|
|
|
}
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static void dataReceived(Plugin* plugin, void* pData, UINT32 dataLength, UINT32 totalLength,
|
|
|
|
UINT32 dataFlags)
|
|
|
|
{
|
2024-01-23 18:49:54 +03:00
|
|
|
DWORD dwWritten = 0;
|
2019-05-14 21:02:31 +03:00
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
if (dataFlags & CHANNEL_FLAG_SUSPEND)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp Channel Suspend");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
return;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (dataFlags & CHANNEL_FLAG_RESUME)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp Channel Resume");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
return;
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (debug > 1)
|
|
|
|
{
|
|
|
|
printf("<%c%3u/%3u ", dataFlags & CHANNEL_FLAG_FIRST ? ' ' : '+', totalLength, dataLength);
|
2019-05-14 21:02:31 +03:00
|
|
|
dumpData(pData, dataLength);
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (dataFlags & CHANNEL_FLAG_FIRST)
|
|
|
|
{
|
2019-05-14 21:02:31 +03:00
|
|
|
if (!WriteFile(plugin->hStdInputWrite, &totalLength, sizeof(totalLength), &dwWritten, NULL))
|
|
|
|
closeChannel(plugin);
|
|
|
|
}
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
if (!WriteFile(plugin->hStdInputWrite, pData, dataLength, &dwWritten, NULL))
|
|
|
|
closeChannel(plugin);
|
|
|
|
}
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHandle, UINT event,
|
2019-11-06 17:24:51 +03:00
|
|
|
LPVOID pData, UINT32 dataLength, UINT32 totalLength,
|
|
|
|
UINT32 dataFlags)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
|
|
|
Plugin* plugin = (Plugin*)lpUserParam;
|
|
|
|
|
|
|
|
switch (event)
|
|
|
|
{
|
|
|
|
case CHANNEL_EVENT_DATA_RECEIVED:
|
2019-05-14 21:02:31 +03:00
|
|
|
dataReceived(plugin, pData, dataLength, totalLength, dataFlags);
|
|
|
|
break;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-10-28 17:13:42 +03:00
|
|
|
case CHANNEL_EVENT_WRITE_CANCELLED:
|
2019-10-28 18:43:47 +03:00
|
|
|
free(pData);
|
2019-10-28 17:13:42 +03:00
|
|
|
break;
|
2019-05-14 21:02:31 +03:00
|
|
|
case CHANNEL_EVENT_WRITE_COMPLETE:
|
2024-09-16 05:50:45 +03:00
|
|
|
(void)SetEvent(plugin->writeComplete);
|
2019-10-28 18:43:47 +03:00
|
|
|
free(pData);
|
2019-05-14 21:02:31 +03:00
|
|
|
break;
|
2024-10-30 21:56:36 +03:00
|
|
|
default:
|
|
|
|
break;
|
2019-05-14 21:02:31 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-18 09:51:45 +03:00
|
|
|
static void channel_terminated(Plugin* plugin)
|
|
|
|
{
|
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp terminated");
|
|
|
|
|
|
|
|
if (!plugin)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (plugin->copyThread)
|
2024-09-16 06:08:35 +03:00
|
|
|
(void)TerminateThread(plugin->copyThread, 0);
|
2020-11-18 09:51:45 +03:00
|
|
|
if (plugin->writeComplete)
|
2024-09-16 05:58:36 +03:00
|
|
|
(void)CloseHandle(plugin->writeComplete);
|
2020-11-18 09:51:45 +03:00
|
|
|
|
2024-09-16 05:58:36 +03:00
|
|
|
(void)CloseHandle(plugin->hStdInputWrite);
|
|
|
|
(void)CloseHandle(plugin->hStdOutputRead);
|
2020-11-18 09:51:45 +03:00
|
|
|
TerminateProcess(plugin->hProcess, 0);
|
2024-09-16 05:58:36 +03:00
|
|
|
(void)CloseHandle(plugin->hProcess);
|
2020-11-18 09:51:45 +03:00
|
|
|
free(plugin->commandline);
|
|
|
|
free(plugin);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void channel_initialized(Plugin* plugin)
|
|
|
|
{
|
|
|
|
plugin->writeComplete = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
|
|
plugin->copyThread = CreateThread(NULL, 0, copyThread, plugin, 0, NULL);
|
|
|
|
}
|
|
|
|
|
2019-05-15 20:12:33 +03:00
|
|
|
static VOID VCAPITYPE VirtualChannelInitEventEx(LPVOID lpUserParam, LPVOID pInitHandle, UINT event,
|
2019-11-06 17:24:51 +03:00
|
|
|
LPVOID pData, UINT dataLength)
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
|
|
|
Plugin* plugin = (Plugin*)lpUserParam;
|
|
|
|
|
|
|
|
switch (event)
|
|
|
|
{
|
2020-11-18 09:51:45 +03:00
|
|
|
case CHANNEL_EVENT_INITIALIZED:
|
|
|
|
channel_initialized(plugin);
|
|
|
|
break;
|
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
case CHANNEL_EVENT_CONNECTED:
|
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp connected");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2021-09-06 16:50:50 +03:00
|
|
|
WINPR_ASSERT(plugin);
|
|
|
|
WINPR_ASSERT(plugin->channelEntryPoints.pVirtualChannelOpenEx);
|
2019-11-06 17:24:51 +03:00
|
|
|
if (plugin->channelEntryPoints.pVirtualChannelOpenEx(
|
2021-08-25 11:02:46 +03:00
|
|
|
pInitHandle, &plugin->openHandle, RDP2TCP_DVC_CHANNEL_NAME,
|
2019-11-06 17:24:51 +03:00
|
|
|
VirtualChannelOpenEventEx) != CHANNEL_RC_OK)
|
2019-05-14 21:02:31 +03:00
|
|
|
return;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
break;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
case CHANNEL_EVENT_DISCONNECTED:
|
|
|
|
if (debug)
|
|
|
|
puts("rdp2tcp disconnected");
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
break;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
case CHANNEL_EVENT_TERMINATED:
|
2020-11-18 09:51:45 +03:00
|
|
|
channel_terminated(plugin);
|
2019-05-14 21:02:31 +03:00
|
|
|
break;
|
2024-10-30 21:56:36 +03:00
|
|
|
default:
|
|
|
|
break;
|
2019-05-14 21:02:31 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
#define VirtualChannelEntryEx rdp2tcp_VirtualChannelEntryEx
|
|
|
|
#else
|
|
|
|
#define VirtualChannelEntryEx FREERDP_API VirtualChannelEntryEx
|
|
|
|
#endif
|
2023-08-25 14:41:09 +03:00
|
|
|
FREERDP_ENTRY_POINT(BOOL VCAPITYPE VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS pEntryPoints,
|
|
|
|
PVOID pInitHandle))
|
2019-05-15 20:12:33 +03:00
|
|
|
{
|
2024-01-23 18:49:54 +03:00
|
|
|
CHANNEL_ENTRY_POINTS_FREERDP_EX* pEntryPointsEx = NULL;
|
2019-05-15 22:33:35 +03:00
|
|
|
CHANNEL_DEF channelDef;
|
2019-05-15 20:12:33 +03:00
|
|
|
Plugin* plugin = (Plugin*)calloc(1, sizeof(Plugin));
|
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
if (!plugin)
|
|
|
|
return FALSE;
|
|
|
|
|
2019-05-15 22:33:35 +03:00
|
|
|
pEntryPointsEx = (CHANNEL_ENTRY_POINTS_FREERDP_EX*)pEntryPoints;
|
2021-06-09 15:03:34 +03:00
|
|
|
WINPR_ASSERT(pEntryPointsEx->cbSize >= sizeof(CHANNEL_ENTRY_POINTS_FREERDP_EX) &&
|
|
|
|
pEntryPointsEx->MagicNumber == FREERDP_CHANNEL_MAGIC_NUMBER);
|
2019-05-14 21:02:31 +03:00
|
|
|
plugin->initHandle = pInitHandle;
|
|
|
|
plugin->channelEntryPoints = *pEntryPointsEx;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
if (init_external_addin(plugin) < 0)
|
2021-04-27 11:04:47 +03:00
|
|
|
{
|
|
|
|
free(plugin);
|
2019-05-14 21:02:31 +03:00
|
|
|
return FALSE;
|
2021-04-27 11:04:47 +03:00
|
|
|
}
|
2019-05-14 21:02:31 +03:00
|
|
|
|
2021-08-25 11:02:46 +03:00
|
|
|
strncpy(channelDef.name, RDP2TCP_DVC_CHANNEL_NAME, sizeof(channelDef.name));
|
2019-05-15 22:33:35 +03:00
|
|
|
channelDef.options =
|
2019-11-06 17:24:51 +03:00
|
|
|
CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
|
|
|
if (pEntryPointsEx->pVirtualChannelInitEx(plugin, NULL, pInitHandle, &channelDef, 1,
|
2019-11-06 17:24:51 +03:00
|
|
|
VIRTUAL_CHANNEL_VERSION_WIN2000,
|
|
|
|
VirtualChannelInitEventEx) != CHANNEL_RC_OK)
|
2019-05-14 21:02:31 +03:00
|
|
|
return FALSE;
|
2019-05-15 20:12:33 +03:00
|
|
|
|
2019-05-14 21:02:31 +03:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// vim:ts=4
|