Merge pull request #2941 from akallabeth/clipboard_file_fix
Clipboard file fixes
This commit is contained in:
commit
70b9e994e1
@ -46,7 +46,7 @@ const char* const CB_MSG_TYPE_STRINGS[] =
|
|||||||
"CB_CLIP_CAPS",
|
"CB_CLIP_CAPS",
|
||||||
"CB_FILECONTENTS_REQUEST",
|
"CB_FILECONTENTS_REQUEST",
|
||||||
"CB_FILECONTENTS_RESPONSE",
|
"CB_FILECONTENTS_RESPONSE",
|
||||||
"CB_LOCK_CLIPDATA"
|
"CB_LOCK_CLIPDATA",
|
||||||
"CB_UNLOCK_CLIPDATA"
|
"CB_UNLOCK_CLIPDATA"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -471,9 +471,9 @@ static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s)
|
|||||||
Stream_Read_UINT16(s, msgFlags); /* msgFlags (2 bytes) */
|
Stream_Read_UINT16(s, msgFlags); /* msgFlags (2 bytes) */
|
||||||
Stream_Read_UINT32(s, dataLen); /* dataLen (4 bytes) */
|
Stream_Read_UINT32(s, dataLen); /* dataLen (4 bytes) */
|
||||||
|
|
||||||
DEBUG_CLIPRDR("msgType: %s (%d), msgFlags: %d dataLen: %d",
|
|
||||||
CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen);
|
|
||||||
#ifdef WITH_DEBUG_CLIPRDR
|
#ifdef WITH_DEBUG_CLIPRDR
|
||||||
|
WLog_DBG(TAG, "msgType: %s (%d), msgFlags: %d dataLen: %d",
|
||||||
|
CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen);
|
||||||
winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8);
|
winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), dataLen + 8);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -910,7 +910,7 @@ UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, CLIPRD
|
|||||||
if (fileContentsResponse->dwFlags & FILECONTENTS_SIZE)
|
if (fileContentsResponse->dwFlags & FILECONTENTS_SIZE)
|
||||||
fileContentsResponse->cbRequested = sizeof(UINT64);
|
fileContentsResponse->cbRequested = sizeof(UINT64);
|
||||||
|
|
||||||
s = cliprdr_packet_new(CB_FILECONTENTS_REQUEST, 0,
|
s = cliprdr_packet_new(CB_FILECONTENTS_RESPONSE, fileContentsResponse->msgFlags,
|
||||||
4 + fileContentsResponse->cbRequested);
|
4 + fileContentsResponse->cbRequested);
|
||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
|
@ -137,7 +137,7 @@ struct wf_context
|
|||||||
int yCurrentScroll;
|
int yCurrentScroll;
|
||||||
int yMaxScroll;
|
int yMaxScroll;
|
||||||
|
|
||||||
wfClipboard* clipboard;
|
void* clipboard;
|
||||||
CliprdrClientContext* cliprdr;
|
CliprdrClientContext* cliprdr;
|
||||||
|
|
||||||
FloatBar* floatbar;
|
FloatBar* floatbar;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -19,121 +19,9 @@
|
|||||||
#ifndef __WF_CLIPRDR_H
|
#ifndef __WF_CLIPRDR_H
|
||||||
#define __WF_CLIPRDR_H
|
#define __WF_CLIPRDR_H
|
||||||
|
|
||||||
#define CINTERFACE
|
|
||||||
#define COBJMACROS
|
|
||||||
|
|
||||||
#include <Ole2.h>
|
|
||||||
#include <ShlObj.h>
|
|
||||||
|
|
||||||
typedef struct wf_clipboard wfClipboard;
|
|
||||||
|
|
||||||
#include "wf_client.h"
|
#include "wf_client.h"
|
||||||
|
|
||||||
#include <freerdp/log.h>
|
BOOL wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr);
|
||||||
|
BOOL wf_cliprdr_uninit(wfContext* wfc, CliprdrClientContext* cliprdr);
|
||||||
#ifdef WITH_DEBUG_CLIPRDR
|
|
||||||
#define DEBUG_CLIPRDR(fmt, ...) WLog_DBG(TAG, fmt, ## __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define DEBUG_CLIPRDR(fmt, ...) do { } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct _CliprdrStream
|
|
||||||
{
|
|
||||||
IStream iStream;
|
|
||||||
|
|
||||||
LONG m_lRefCount;
|
|
||||||
LONG m_lIndex;
|
|
||||||
ULARGE_INTEGER m_lSize;
|
|
||||||
ULARGE_INTEGER m_lOffset;
|
|
||||||
void* m_pData;
|
|
||||||
};
|
|
||||||
typedef struct _CliprdrStream CliprdrStream;
|
|
||||||
|
|
||||||
CliprdrStream* CliprdrStream_New(LONG index, void* pData);
|
|
||||||
void CliprdrStream_Delete(CliprdrStream* instance);
|
|
||||||
|
|
||||||
struct _CliprdrDataObject
|
|
||||||
{
|
|
||||||
IDataObject iDataObject;
|
|
||||||
|
|
||||||
LONG m_lRefCount;
|
|
||||||
FORMATETC* m_pFormatEtc;
|
|
||||||
STGMEDIUM* m_pStgMedium;
|
|
||||||
LONG m_nNumFormats;
|
|
||||||
LONG m_nStreams;
|
|
||||||
IStream** m_pStream;
|
|
||||||
void* m_pData;
|
|
||||||
};
|
|
||||||
typedef struct _CliprdrDataObject CliprdrDataObject;
|
|
||||||
|
|
||||||
CliprdrDataObject* CliprdrDataObject_New(FORMATETC* fmtetc, STGMEDIUM* stgmed, int count, void* data);
|
|
||||||
void CliprdrDataObject_Delete(CliprdrDataObject* instance);
|
|
||||||
|
|
||||||
struct _CliprdrEnumFORMATETC
|
|
||||||
{
|
|
||||||
IEnumFORMATETC iEnumFORMATETC;
|
|
||||||
|
|
||||||
LONG m_lRefCount;
|
|
||||||
LONG m_nIndex;
|
|
||||||
LONG m_nNumFormats;
|
|
||||||
FORMATETC* m_pFormatEtc;
|
|
||||||
};
|
|
||||||
typedef struct _CliprdrEnumFORMATETC CliprdrEnumFORMATETC;
|
|
||||||
|
|
||||||
CliprdrEnumFORMATETC* CliprdrEnumFORMATETC_New(int nFormats, FORMATETC* pFormatEtc);
|
|
||||||
void CliprdrEnumFORMATETC_Delete(CliprdrEnumFORMATETC* This);
|
|
||||||
|
|
||||||
struct format_mapping
|
|
||||||
{
|
|
||||||
UINT32 remote_format_id;
|
|
||||||
UINT32 local_format_id;
|
|
||||||
void* name; /* Unicode or ASCII characters with NULL terminator */
|
|
||||||
};
|
|
||||||
typedef struct format_mapping formatMapping;
|
|
||||||
|
|
||||||
struct wf_clipboard
|
|
||||||
{
|
|
||||||
wfContext* wfc;
|
|
||||||
rdpChannels* channels;
|
|
||||||
CliprdrClientContext* context;
|
|
||||||
|
|
||||||
BOOL sync;
|
|
||||||
UINT32 capabilities;
|
|
||||||
|
|
||||||
int map_size;
|
|
||||||
int map_capacity;
|
|
||||||
formatMapping* format_mappings;
|
|
||||||
|
|
||||||
UINT32 requestedFormatId;
|
|
||||||
|
|
||||||
HWND hwnd;
|
|
||||||
HANDLE hmem;
|
|
||||||
HANDLE thread;
|
|
||||||
HANDLE response_data_event;
|
|
||||||
|
|
||||||
/* file clipping */
|
|
||||||
CLIPFORMAT ID_FILEDESCRIPTORW;
|
|
||||||
CLIPFORMAT ID_FILECONTENTS;
|
|
||||||
CLIPFORMAT ID_PREFERREDDROPEFFECT;
|
|
||||||
|
|
||||||
LPDATAOBJECT data_obj;
|
|
||||||
ULONG req_fsize;
|
|
||||||
char* req_fdata;
|
|
||||||
HANDLE req_fevent;
|
|
||||||
|
|
||||||
int nFiles;
|
|
||||||
int file_array_size;
|
|
||||||
WCHAR** file_names;
|
|
||||||
FILEDESCRIPTORW** fileDescriptor;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wf_cliprdr_init(wfContext* wfc, CliprdrClientContext* cliprdr);
|
|
||||||
void wf_cliprdr_uninit(wfContext* wfc, CliprdrClientContext* cliprdr);
|
|
||||||
|
|
||||||
int cliprdr_send_data_request(wfClipboard* clipboard, UINT32 format);
|
|
||||||
int cliprdr_send_lock(wfClipboard* clipboard);
|
|
||||||
int cliprdr_send_unlock(wfClipboard* clipboard);
|
|
||||||
int cliprdr_send_request_filecontents(wfClipboard* clipboard, void* streamid,
|
|
||||||
int index, int flag, DWORD positionhigh, DWORD positionlow, ULONG request);
|
|
||||||
|
|
||||||
#endif /* __WF_CLIPRDR_H */
|
#endif /* __WF_CLIPRDR_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user