mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-30 13:25:54 +08:00
hardend cliprdr
hardend cliprdr server and client also updated all callbacks in the server and client implementations
This commit is contained in:
parent
d33e8a15b5
commit
e5d5cd3c94
@ -4,6 +4,8 @@
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -32,7 +34,7 @@
|
||||
#include "cliprdr_main.h"
|
||||
#include "cliprdr_format.h"
|
||||
|
||||
void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
WIN32ERROR cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
{
|
||||
UINT32 index;
|
||||
UINT32 position;
|
||||
@ -43,9 +45,13 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
CLIPRDR_FORMAT* formats = NULL;
|
||||
CLIPRDR_FORMAT_LIST formatList;
|
||||
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
|
||||
WIN32ERROR error = CHANNEL_RC_OK;
|
||||
|
||||
if (!context->custom)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "context->custom not set!");
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
asciiNames = (msgFlags & CB_ASCII_NAMES) ? TRUE : FALSE;
|
||||
|
||||
@ -70,14 +76,17 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
if ((formatList.numFormats * 36) != dataLen)
|
||||
{
|
||||
WLog_ERR(TAG, "Invalid short format list length: %d", dataLen);
|
||||
return;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
if (formatList.numFormats)
|
||||
formats = (CLIPRDR_FORMAT*) calloc(formatList.numFormats, sizeof(CLIPRDR_FORMAT));
|
||||
|
||||
if (!formats)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "calloc failed!");
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
|
||||
formatList.formats = formats;
|
||||
|
||||
@ -95,6 +104,12 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
if (szFormatName[0])
|
||||
{
|
||||
formats[index].formatName = (char*) malloc(32 + 1);
|
||||
if (!formats[index].formatName)
|
||||
{
|
||||
WLog_ERR(TAG, "calloc failed!");
|
||||
error = CHANNEL_RC_NO_MEMORY;
|
||||
goto error_out;
|
||||
}
|
||||
CopyMemory(formats[index].formatName, szFormatName, 32);
|
||||
formats[index].formatName[32] = '\0';
|
||||
}
|
||||
@ -142,7 +157,10 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
formats = (CLIPRDR_FORMAT*) calloc(formatList.numFormats, sizeof(CLIPRDR_FORMAT));
|
||||
|
||||
if (!formats)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "calloc failed!");
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
|
||||
formatList.formats = formats;
|
||||
|
||||
@ -177,8 +195,12 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
formatList.numFormats);
|
||||
|
||||
if (context->ServerFormatList)
|
||||
context->ServerFormatList(context, &formatList);
|
||||
{
|
||||
if ((error = context->ServerFormatList(context, &formatList)))
|
||||
WLog_ERR(TAG, "ServerFormatList failed with error %d", error);
|
||||
}
|
||||
|
||||
error_out:
|
||||
if (formats)
|
||||
{
|
||||
for (index = 0; index < formatList.numFormats; index++)
|
||||
@ -188,35 +210,47 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 data
|
||||
|
||||
free(formats);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
WIN32ERROR cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
{
|
||||
CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse;
|
||||
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
|
||||
WIN32ERROR error = CHANNEL_RC_OK;
|
||||
|
||||
WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatListResponse");
|
||||
|
||||
if (!context->custom)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "context->custom not set!");
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
formatListResponse.msgType = CB_FORMAT_LIST_RESPONSE;
|
||||
formatListResponse.msgFlags = msgFlags;
|
||||
formatListResponse.dataLen = dataLen;
|
||||
|
||||
if (context->ServerFormatListResponse)
|
||||
context->ServerFormatListResponse(context, &formatListResponse);
|
||||
IFCALLRET(context->ServerFormatListResponse, error, context, &formatListResponse);
|
||||
if (error)
|
||||
WLog_ERR(TAG, "ServerFormatListResponse failed with error %lu!", error);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
WIN32ERROR cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
{
|
||||
CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest;
|
||||
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
|
||||
WIN32ERROR error = CHANNEL_RC_OK;
|
||||
|
||||
WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatDataRequest");
|
||||
|
||||
if (!context->custom)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "context->custom not set!");
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
formatDataRequest.msgType = CB_FORMAT_DATA_REQUEST;
|
||||
formatDataRequest.msgFlags = msgFlags;
|
||||
@ -224,19 +258,27 @@ void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UIN
|
||||
|
||||
Stream_Read_UINT32(s, formatDataRequest.requestedFormatId); /* requestedFormatId (4 bytes) */
|
||||
|
||||
if (context->ServerFormatDataRequest)
|
||||
context->ServerFormatDataRequest(context, &formatDataRequest);
|
||||
|
||||
IFCALLRET(context->ServerFormatDataRequest, error, context, &formatDataRequest);
|
||||
if (error)
|
||||
WLog_ERR(TAG, "ServerFormatDataRequest failed with error %lu!", error);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
WIN32ERROR cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags)
|
||||
{
|
||||
CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse;
|
||||
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
|
||||
WIN32ERROR error = CHANNEL_RC_OK;
|
||||
|
||||
WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatDataResponse");
|
||||
|
||||
if (!context->custom)
|
||||
return;
|
||||
{
|
||||
WLog_ERR(TAG, "context->custom not set!");
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
formatDataResponse.msgType = CB_FORMAT_DATA_RESPONSE;
|
||||
formatDataResponse.msgFlags = msgFlags;
|
||||
@ -246,11 +288,18 @@ void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UI
|
||||
if (dataLen)
|
||||
{
|
||||
formatDataResponse.requestedFormatData = (BYTE*) malloc(dataLen);
|
||||
if (!formatDataResponse.requestedFormatData)
|
||||
{
|
||||
WLog_ERR(TAG, "malloc failed!");
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
Stream_Read(s, formatDataResponse.requestedFormatData, dataLen);
|
||||
}
|
||||
|
||||
if (context->ServerFormatDataResponse)
|
||||
context->ServerFormatDataResponse(context, &formatDataResponse);
|
||||
IFCALLRET(context->ServerFormatDataResponse, error, context, &formatDataResponse);
|
||||
if (error)
|
||||
WLog_ERR(TAG, "ServerFormatDataResponse failed with error %lu!", error);
|
||||
|
||||
free(formatDataResponse.requestedFormatData);
|
||||
return error;
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -21,9 +23,11 @@
|
||||
#ifndef __CLIPRDR_FORMAT_H
|
||||
#define __CLIPRDR_FORMAT_H
|
||||
|
||||
void cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
WIN32ERROR cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
WIN32ERROR cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
WIN32ERROR cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
WIN32ERROR cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags);
|
||||
|
||||
#endif /* __CLIPRDR_FORMAT_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,7 @@
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -22,6 +23,7 @@
|
||||
#define __CLIPRDR_MAIN_H
|
||||
|
||||
#include <winpr/stream.h>
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
#include <freerdp/svc.h>
|
||||
#include <freerdp/addin.h>
|
||||
@ -48,11 +50,12 @@ struct cliprdr_plugin
|
||||
BOOL streamFileClipEnabled;
|
||||
BOOL fileClipNoFilePaths;
|
||||
BOOL canLockClipData;
|
||||
WIN32ERROR error;
|
||||
};
|
||||
typedef struct cliprdr_plugin cliprdrPlugin;
|
||||
|
||||
wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataLen);
|
||||
void cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out);
|
||||
WIN32ERROR cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out);
|
||||
|
||||
CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,8 @@
|
||||
* Android Clipboard Redirection
|
||||
*
|
||||
* Copyright 2013 Felix Long
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,6 +27,7 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/stream.h>
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
#include <freerdp/client/channels.h>
|
||||
#include <freerdp/client/cliprdr.h>
|
||||
@ -117,7 +120,7 @@ int android_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
WIN32ERROR android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
{
|
||||
androidContext* afc = (androidContext*) cliprdr->custom;
|
||||
|
||||
@ -125,10 +128,10 @@ int android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR
|
||||
android_cliprdr_send_client_capabilities(cliprdr);
|
||||
android_cliprdr_send_client_format_list(cliprdr);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities)
|
||||
WIN32ERROR android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities)
|
||||
{
|
||||
UINT32 index;
|
||||
CLIPRDR_CAPABILITY_SET* capabilitySet;
|
||||
@ -149,10 +152,10 @@ int android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_C
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList)
|
||||
WIN32ERROR android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList)
|
||||
{
|
||||
UINT32 index;
|
||||
CLIPRDR_FORMAT* format;
|
||||
@ -171,13 +174,13 @@ int android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FO
|
||||
}
|
||||
|
||||
if (formatList->numFormats < 1)
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
|
||||
afc->numServerFormats = formatList->numFormats;
|
||||
afc->serverFormats = (CLIPRDR_FORMAT*) calloc(afc->numServerFormats, sizeof(CLIPRDR_FORMAT));
|
||||
|
||||
if (!afc->serverFormats)
|
||||
return -1;
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
|
||||
for (index = 0; index < afc->numServerFormats; index++)
|
||||
{
|
||||
@ -204,25 +207,25 @@ int android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FO
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
WIN32ERROR android_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
WIN32ERROR android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
WIN32ERROR android_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
WIN32ERROR android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
{
|
||||
BYTE* data;
|
||||
UINT32 size;
|
||||
@ -250,10 +253,10 @@ int android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CL
|
||||
|
||||
free(data);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
WIN32ERROR android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
{
|
||||
BYTE* data;
|
||||
UINT32 size;
|
||||
@ -272,7 +275,7 @@ int android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, C
|
||||
if (!format)
|
||||
{
|
||||
SetEvent(afc->clipboardRequestEvent);
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
if (format->formatName)
|
||||
@ -311,17 +314,17 @@ int android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, C
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
WIN32ERROR android_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
WIN32ERROR android_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int android_cliprdr_init(androidContext* afc, CliprdrClientContext* cliprdr)
|
||||
|
@ -2,6 +2,8 @@
|
||||
* FreeRDP: A Remote Desktop Protocol Implementation
|
||||
*
|
||||
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -23,6 +25,8 @@
|
||||
#import "freerdp/channels/channels.h"
|
||||
#import "freerdp/client/cliprdr.h"
|
||||
|
||||
#import "winpr/win32error.h"
|
||||
|
||||
int mac_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr);
|
||||
|
||||
void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr);
|
||||
|
@ -2,6 +2,8 @@
|
||||
* FreeRDP: A Remote Desktop Protocol Implementation
|
||||
*
|
||||
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -119,7 +121,7 @@ int mac_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
WIN32ERROR mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
{
|
||||
mfContext* mfc = (mfContext*) cliprdr->custom;
|
||||
|
||||
@ -127,10 +129,10 @@ int mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_REA
|
||||
mac_cliprdr_send_client_capabilities(cliprdr);
|
||||
mac_cliprdr_send_client_format_list(cliprdr);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities)
|
||||
WIN32ERROR mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities)
|
||||
{
|
||||
UINT32 index;
|
||||
CLIPRDR_CAPABILITY_SET* capabilitySet;
|
||||
@ -151,10 +153,10 @@ int mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPAB
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList)
|
||||
WIN32ERROR mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList)
|
||||
{
|
||||
UINT32 index;
|
||||
CLIPRDR_FORMAT* format;
|
||||
@ -173,13 +175,13 @@ int mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT
|
||||
}
|
||||
|
||||
if (formatList->numFormats < 1)
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
|
||||
mfc->numServerFormats = formatList->numFormats;
|
||||
mfc->serverFormats = (CLIPRDR_FORMAT*) calloc(mfc->numServerFormats, sizeof(CLIPRDR_FORMAT));
|
||||
|
||||
if (!mfc->serverFormats)
|
||||
return -1;
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
|
||||
for (index = 0; index < mfc->numServerFormats; index++)
|
||||
{
|
||||
@ -213,25 +215,25 @@ int mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
WIN32ERROR mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
WIN32ERROR mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
WIN32ERROR mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
WIN32ERROR mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
{
|
||||
BYTE* data;
|
||||
UINT32 size;
|
||||
@ -259,10 +261,10 @@ int mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRD
|
||||
|
||||
free(data);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
WIN32ERROR mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
{
|
||||
BYTE* data;
|
||||
UINT32 size;
|
||||
@ -275,7 +277,7 @@ int mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPR
|
||||
if (formatDataResponse->msgFlags & CB_RESPONSE_FAIL)
|
||||
{
|
||||
SetEvent(mfc->clipboardRequestEvent);
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
for (index = 0; index < mfc->numServerFormats; index++)
|
||||
@ -287,7 +289,7 @@ int mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPR
|
||||
if (!format)
|
||||
{
|
||||
SetEvent(mfc->clipboardRequestEvent);
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
if (format->formatName)
|
||||
@ -301,7 +303,7 @@ int mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPR
|
||||
if (!data)
|
||||
{
|
||||
SetEvent(mfc->clipboardRequestEvent);
|
||||
return -1;
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
}
|
||||
|
||||
CopyMemory(data, formatDataResponse->requestedFormatData, size);
|
||||
@ -327,17 +329,17 @@ int mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPR
|
||||
[view->pasteboard_wr setString:str forType:NSStringPboardType];
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
WIN32ERROR mac_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int mac_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
WIN32ERROR mac_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
{
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr)
|
||||
|
@ -4,6 +4,8 @@
|
||||
*
|
||||
* Copyright 2012 Jason Champion
|
||||
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -27,6 +29,7 @@
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/tchar.h>
|
||||
#include <winpr/stream.h>
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
#include <freerdp/log.h>
|
||||
#include <freerdp/client/cliprdr.h>
|
||||
@ -1443,7 +1446,7 @@ int wf_cliprdr_send_client_capabilities(wfClipboard* clipboard)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
static WIN32ERROR wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
{
|
||||
wfClipboard* clipboard = (wfClipboard*) context->custom;
|
||||
|
||||
@ -1451,10 +1454,10 @@ static int wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONIT
|
||||
wf_cliprdr_send_client_capabilities(clipboard);
|
||||
cliprdr_send_format_list(clipboard);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities)
|
||||
static WIN32ERROR wf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities)
|
||||
{
|
||||
UINT32 index;
|
||||
CLIPRDR_CAPABILITY_SET* capabilitySet;
|
||||
@ -1475,10 +1478,10 @@ static int wf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList)
|
||||
static WIN32ERROR wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList)
|
||||
{
|
||||
UINT32 i, j;
|
||||
formatMapping* mapping;
|
||||
@ -1516,7 +1519,7 @@ static int wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
|
||||
else
|
||||
{
|
||||
if (!OpenClipboard(clipboard->hwnd))
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
|
||||
if (EmptyClipboard())
|
||||
{
|
||||
@ -1529,28 +1532,28 @@ static int wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
static WIN32ERROR wf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
{
|
||||
wfClipboard* clipboard = (wfClipboard*) context->custom;
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
WIN32ERROR wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData)
|
||||
{
|
||||
wfClipboard* clipboard = (wfClipboard*) context->custom;
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
WIN32ERROR wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData)
|
||||
{
|
||||
wfClipboard* clipboard = (wfClipboard*) context->custom;
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
static WIN32ERROR wf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
{
|
||||
int size = 0;
|
||||
char* buff = NULL;
|
||||
@ -1577,7 +1580,7 @@ static int wf_cliprdr_server_format_data_request(CliprdrClientContext* context,
|
||||
result = OleGetClipboard(&dataObj);
|
||||
|
||||
if (!SUCCEEDED(result))
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
|
||||
ZeroMemory(&format_etc, sizeof(FORMATETC));
|
||||
ZeroMemory(&stg_medium, sizeof(STGMEDIUM));
|
||||
@ -1707,14 +1710,14 @@ exit:
|
||||
else
|
||||
{
|
||||
if (!OpenClipboard(clipboard->hwnd))
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
|
||||
hClipdata = GetClipboardData(requestedFormatId);
|
||||
|
||||
if (!hClipdata)
|
||||
{
|
||||
CloseClipboard();
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
globlemem = (char*) GlobalLock(hClipdata);
|
||||
@ -1738,10 +1741,10 @@ exit:
|
||||
|
||||
free(buff);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int wf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
static WIN32ERROR wf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
{
|
||||
BYTE* data;
|
||||
HANDLE hMem;
|
||||
@ -1755,10 +1758,10 @@ static int wf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
||||
clipboard->hmem = hMem;
|
||||
SetEvent(clipboard->response_data_event);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
int wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
WIN32ERROR wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
|
||||
{
|
||||
UINT32 uSize = 0;
|
||||
BYTE* pData = NULL;
|
||||
@ -1911,7 +1914,7 @@ int wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPR
|
||||
|
||||
free(pData);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
|
||||
error:
|
||||
if (pData)
|
||||
@ -1929,10 +1932,10 @@ error:
|
||||
WLog_ERR(TAG, "filecontents: send failed response.");
|
||||
cliprdr_send_response_filecontents(clipboard, fileContentsRequest->streamId, 0, NULL);
|
||||
|
||||
return -1;
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
int wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
WIN32ERROR wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
|
||||
{
|
||||
wfClipboard* clipboard = (wfClipboard*) context->custom;
|
||||
|
||||
@ -1942,7 +1945,7 @@ int wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIP
|
||||
|
||||
SetEvent(clipboard->req_fevent);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
void wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr)
|
||||
|
@ -3,6 +3,8 @@
|
||||
* X11 Clipboard Redirection
|
||||
*
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,6 +35,7 @@
|
||||
#include <winpr/image.h>
|
||||
#include <winpr/stream.h>
|
||||
#include <winpr/clipboard.h>
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
#include <freerdp/log.h>
|
||||
#include <freerdp/client/cliprdr.h>
|
||||
@ -783,7 +786,7 @@ int xf_cliprdr_send_client_format_data_request(xfClipboard* clipboard, UINT32 fo
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
static WIN32ERROR xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady)
|
||||
{
|
||||
xfClipboard* clipboard = (xfClipboard*) context->custom;
|
||||
|
||||
@ -791,17 +794,17 @@ static int xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONIT
|
||||
xf_cliprdr_send_client_format_list(clipboard);
|
||||
clipboard->sync = TRUE;
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities)
|
||||
static WIN32ERROR xf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities)
|
||||
{
|
||||
//xfClipboard* clipboard = (xfClipboard*) context->custom;
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList)
|
||||
static WIN32ERROR xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList)
|
||||
{
|
||||
int i, j;
|
||||
CLIPRDR_FORMAT* format;
|
||||
@ -829,7 +832,7 @@ static int xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
|
||||
clipboard->serverFormats = (CLIPRDR_FORMAT*) calloc(clipboard->numServerFormats, sizeof(CLIPRDR_FORMAT));
|
||||
|
||||
if (!clipboard->serverFormats)
|
||||
return -1;
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
|
||||
for (i = 0; i < formatList->numFormats; i++)
|
||||
{
|
||||
@ -859,17 +862,17 @@ static int xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_
|
||||
|
||||
XFlush(xfc->display);
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
static WIN32ERROR xf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
|
||||
{
|
||||
//xfClipboard* clipboard = (xfClipboard*) context->custom;
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
static WIN32ERROR xf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
|
||||
{
|
||||
xfCliprdrFormat* format = NULL;
|
||||
UINT32 formatId = formatDataRequest->requestedFormatId;
|
||||
@ -891,7 +894,7 @@ static int xf_cliprdr_server_format_data_request(CliprdrClientContext* context,
|
||||
if (!format)
|
||||
{
|
||||
xf_cliprdr_send_data_response(clipboard, NULL, 0);
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
clipboard->requestedFormatId = formatId;
|
||||
@ -903,10 +906,10 @@ static int xf_cliprdr_server_format_data_request(CliprdrClientContext* context,
|
||||
|
||||
/* After this point, we expect a SelectionNotify event from the clipboard owner. */
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static int xf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
static WIN32ERROR xf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
{
|
||||
BOOL bSuccess;
|
||||
BYTE* pSrcData;
|
||||
@ -923,7 +926,7 @@ static int xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
||||
xfContext* xfc = clipboard->xfc;
|
||||
|
||||
if (!clipboard->respond)
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
|
||||
format = xf_cliprdr_get_format_by_id(clipboard, clipboard->requestedFormatId);
|
||||
|
||||
@ -975,7 +978,7 @@ static int xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
||||
pSrcData = (BYTE*) malloc(SrcSize);
|
||||
|
||||
if (!pSrcData)
|
||||
return -1;
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
|
||||
CopyMemory(pSrcData, data, SrcSize);
|
||||
|
||||
@ -1004,7 +1007,7 @@ static int xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
||||
free(clipboard->respond);
|
||||
clipboard->respond = NULL;
|
||||
|
||||
return 1;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
xfClipboard* xf_clipboard_new(xfContext* xfc)
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Clipboard Virtual Channel Extension
|
||||
*
|
||||
* Copyright 2011 Vic Lee
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -21,6 +23,7 @@
|
||||
#define FREERDP_CHANNEL_CLIENT_CLIPRDR_H
|
||||
|
||||
#include <freerdp/types.h>
|
||||
#include <winpr/win32error.h>
|
||||
|
||||
#include <freerdp/message.h>
|
||||
#include <freerdp/channels/cliprdr.h>
|
||||
@ -31,26 +34,26 @@
|
||||
|
||||
typedef struct _cliprdr_client_context CliprdrClientContext;
|
||||
|
||||
typedef int (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef int (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef int (*pcCliprdrMonitorReady)(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady);
|
||||
typedef int (*pcCliprdrTempDirectory)(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory);
|
||||
typedef int (*pcCliprdrClientFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef int (*pcCliprdrServerFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef int (*pcCliprdrClientFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef int (*pcCliprdrServerFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef int (*pcCliprdrClientLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef int (*pcCliprdrServerLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef int (*pcCliprdrClientUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef int (*pcCliprdrServerUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef int (*pcCliprdrClientFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef int (*pcCliprdrServerFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef int (*pcCliprdrClientFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef int (*pcCliprdrServerFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef int (*pcCliprdrClientFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef int (*pcCliprdrServerFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef int (*pcCliprdrClientFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef int (*pcCliprdrServerFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef WIN32ERROR (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef WIN32ERROR (*pcCliprdrMonitorReady)(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady);
|
||||
typedef WIN32ERROR (*pcCliprdrTempDirectory)(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrClientLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef WIN32ERROR (*pcCliprdrServerLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef WIN32ERROR (*pcCliprdrClientUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef WIN32ERROR (*pcCliprdrServerUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef WIN32ERROR (*pcCliprdrClientFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef WIN32ERROR (*pcCliprdrServerFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
|
||||
struct _cliprdr_client_context
|
||||
{
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Clipboard Virtual Channel Server Interface
|
||||
*
|
||||
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,33 +35,33 @@
|
||||
|
||||
typedef struct _cliprdr_server_context CliprdrServerContext;
|
||||
|
||||
typedef int (*psCliprdrOpen)(CliprdrServerContext* context);
|
||||
typedef int (*psCliprdrClose)(CliprdrServerContext* context);
|
||||
typedef int (*psCliprdrStart)(CliprdrServerContext* context);
|
||||
typedef int (*psCliprdrStop)(CliprdrServerContext* context);
|
||||
typedef WIN32ERROR (*psCliprdrOpen)(CliprdrServerContext* context);
|
||||
typedef WIN32ERROR (*psCliprdrClose)(CliprdrServerContext* context);
|
||||
typedef WIN32ERROR (*psCliprdrStart)(CliprdrServerContext* context);
|
||||
typedef WIN32ERROR (*psCliprdrStop)(CliprdrServerContext* context);
|
||||
typedef HANDLE (*psCliprdrGetEventHandle)(CliprdrServerContext* context);
|
||||
typedef int (*psCliprdrCheckEventHandle)(CliprdrServerContext* context);
|
||||
typedef WIN32ERROR (*psCliprdrCheckEventHandle)(CliprdrServerContext* context);
|
||||
|
||||
typedef int (*psCliprdrServerCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef int (*psCliprdrClientCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef int (*psCliprdrMonitorReady)(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady);
|
||||
typedef int (*psCliprdrTempDirectory)(CliprdrServerContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory);
|
||||
typedef int (*psCliprdrClientFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef int (*psCliprdrServerFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef int (*psCliprdrClientFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef int (*psCliprdrServerFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef int (*psCliprdrClientLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef int (*psCliprdrServerLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef int (*psCliprdrClientUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef int (*psCliprdrServerUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef int (*psCliprdrClientFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef int (*psCliprdrServerFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef int (*psCliprdrClientFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef int (*psCliprdrServerFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef int (*psCliprdrClientFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef int (*psCliprdrServerFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef int (*psCliprdrClientFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef int (*psCliprdrServerFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef WIN32ERROR (*psCliprdrServerCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef WIN32ERROR (*psCliprdrClientCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities);
|
||||
typedef WIN32ERROR (*psCliprdrMonitorReady)(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady);
|
||||
typedef WIN32ERROR (*psCliprdrTempDirectory)(CliprdrServerContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory);
|
||||
typedef WIN32ERROR (*psCliprdrClientFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef WIN32ERROR (*psCliprdrServerFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList);
|
||||
typedef WIN32ERROR (*psCliprdrClientFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef WIN32ERROR (*psCliprdrServerFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse);
|
||||
typedef WIN32ERROR (*psCliprdrClientLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef WIN32ERROR (*psCliprdrServerLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData);
|
||||
typedef WIN32ERROR (*psCliprdrClientUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef WIN32ERROR (*psCliprdrServerUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData);
|
||||
typedef WIN32ERROR (*psCliprdrClientFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef WIN32ERROR (*psCliprdrServerFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest);
|
||||
typedef WIN32ERROR (*psCliprdrClientFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef WIN32ERROR (*psCliprdrServerFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse);
|
||||
typedef WIN32ERROR (*psCliprdrClientFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef WIN32ERROR (*psCliprdrServerFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest);
|
||||
typedef WIN32ERROR (*psCliprdrClientFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
typedef WIN32ERROR (*psCliprdrServerFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse);
|
||||
|
||||
struct _cliprdr_server_context
|
||||
{
|
||||
|
@ -3,6 +3,8 @@
|
||||
* FreeRDP Mac OS X Server (Audio Input)
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2015 Thincast Technologies GmbH
|
||||
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -34,19 +36,20 @@ static const AUDIO_FORMAT supported_audio_formats[] =
|
||||
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL }
|
||||
};
|
||||
|
||||
static void mf_peer_audin_opening(audin_server_context* context)
|
||||
static WIN32ERROR mf_peer_audin_opening(audin_server_context* context)
|
||||
{
|
||||
context->SelectFormat(context, 0);
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static void mf_peer_audin_open_result(audin_server_context* context, UINT32 result)
|
||||
static WIN32ERROR mf_peer_audin_open_result(audin_server_context* context, UINT32 result)
|
||||
{
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static void mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes)
|
||||
static WIN32ERROR mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes)
|
||||
{
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
void mf_peer_audin_init(mfPeerContext* context)
|
||||
|
Loading…
Reference in New Issue
Block a user