本文整理汇总了C++中DEBUG_CLIPRDR函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG_CLIPRDR函数的具体用法?C++ DEBUG_CLIPRDR怎么用?C++ DEBUG_CLIPRDR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEBUG_CLIPRDR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DEBUG_CLIPRDR
static void *cliprdr_thread_func(void *arg)
{
cliprdrContext *cliprdr = (cliprdrContext *)arg;
BOOL mcode;
MSG msg;
int ret;
HRESULT result;
if ((ret = create_cliprdr_window(cliprdr)) != 0)
{
DEBUG_CLIPRDR("error: create clipboard window failed.");
return NULL;
}
while ((mcode = GetMessage(&msg, 0, 0, 0) != 0))
{
if (mcode == -1)
{
DEBUG_CLIPRDR("error: clipboard thread GetMessage failed.");
break;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return NULL;
}
示例2: cliprdr_thread_func
static void* cliprdr_thread_func(void* arg)
{
int ret;
MSG msg;
BOOL mcode;
wfClipboard* clipboard = (wfClipboard*) arg;
OleInitialize(0);
if ((ret = create_cliprdr_window(clipboard)) != 0)
{
DEBUG_CLIPRDR("error: create clipboard window failed.");
return NULL;
}
while ((mcode = GetMessage(&msg, 0, 0, 0)) != 0)
{
if (mcode == -1)
{
DEBUG_CLIPRDR("error: clipboard thread GetMessage failed.");
break;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
OleUninitialize();
return NULL;
}
示例3: cliprdr_process_clip_caps
static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s, uint16 length, uint16 flags)
{
int i;
uint16 lengthCapability;
uint16 cCapabilitiesSets;
uint16 capabilitySetType;
stream_read_uint16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */
stream_seek_uint16(s); /* pad1 (2 bytes) */
DEBUG_CLIPRDR("cCapabilitiesSets %d", cCapabilitiesSets);
for (i = 0; i < cCapabilitiesSets; i++)
{
stream_read_uint16(s, capabilitySetType); /* capabilitySetType (2 bytes) */
stream_read_uint16(s, lengthCapability); /* lengthCapability (2 bytes) */
switch (capabilitySetType)
{
case CB_CAPSTYPE_GENERAL:
cliprdr_process_general_capability(cliprdr, s);
break;
default:
DEBUG_WARN("unknown cliprdr capability set: %d", capabilitySetType);
break;
}
}
}
示例4: cliprdr_process_general_capability
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, STREAM* s)
{
uint32 version;
uint32 generalFlags;
stream_read_uint32(s, version); /* version (4 bytes) */
stream_read_uint32(s, generalFlags); /* generalFlags (4 bytes) */
DEBUG_CLIPRDR("Version: %d", version);
#ifdef WITH_DEBUG_CLIPRDR
cliprdr_print_general_capability_flags(generalFlags);
#endif
if (generalFlags & CB_USE_LONG_FORMAT_NAMES)
cliprdr->use_long_format_names = true;
if (generalFlags & CB_STREAM_FILECLIP_ENABLED)
cliprdr->stream_fileclip_enabled = true;
if (generalFlags & CB_FILECLIP_NO_FILE_PATHS)
cliprdr->fileclip_no_file_paths = true;
if (generalFlags & CB_CAN_LOCK_CLIPDATA)
cliprdr->can_lock_clipdata = true;
cliprdr->received_caps = true;
}
示例5: cliprdr_send_format_list_response
static void cliprdr_send_format_list_response(cliprdrPlugin* cliprdr)
{
wStream* s;
DEBUG_CLIPRDR("Sending Clipboard Format List Response");
s = cliprdr_packet_new(CB_FORMAT_LIST_RESPONSE, CB_RESPONSE_OK, 0);
cliprdr_packet_send(cliprdr, s);
}
示例6: wf_cliprdr_get_file_contents
static BOOL wf_cliprdr_get_file_contents(WCHAR* file_name, BYTE* buffer,
int positionLow, int positionHigh, int nRequested, unsigned int* puSize)
{
HANDLE hFile;
DWORD nGet;
if (!file_name || !buffer || !puSize)
{
WLog_ERR(TAG, "get file contents Invalid Arguments.");
return FALSE;
}
hFile = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
return FALSE;
}
SetFilePointer(hFile, positionLow, (PLONG) &positionHigh, FILE_BEGIN);
if (!ReadFile(hFile, buffer, nRequested, &nGet, NULL))
{
DWORD err = GetLastError();
DEBUG_CLIPRDR("ReadFile failed with 0x%x.", err);
}
CloseHandle(hFile);
*puSize = nGet;
return TRUE;
}
示例7: create_cliprdr_window
static int create_cliprdr_window(cliprdrContext *cliprdr)
{
WNDCLASSEX wnd_cls;
ZeroMemory(&wnd_cls, sizeof(WNDCLASSEX));
wnd_cls.cbSize = sizeof(WNDCLASSEX);
wnd_cls.style = CS_OWNDC;
wnd_cls.lpfnWndProc = cliprdr_proc;
wnd_cls.cbClsExtra = 0;
wnd_cls.cbWndExtra = 0;
wnd_cls.hIcon = NULL;
wnd_cls.hCursor = NULL;
wnd_cls.hbrBackground = NULL;
wnd_cls.lpszMenuName = NULL;
wnd_cls.lpszClassName = L"ClipboardHiddenMessageProcessor";
wnd_cls.hInstance = GetModuleHandle(NULL);
wnd_cls.hIconSm = NULL;
RegisterClassEx(&wnd_cls);
cliprdr->hwndClipboard = CreateWindowEx(WS_EX_LEFT,
L"ClipboardHiddenMessageProcessor",
L"rdpclip",
0, 0, 0, 0, 0, HWND_MESSAGE, NULL, GetModuleHandle(NULL), cliprdr);
if (cliprdr->hwndClipboard == NULL)
{
DEBUG_CLIPRDR("error: CreateWindowEx failed with %x.", GetLastError());
return -1;
}
return 0;
}
示例8: cliprdr_process_general_capability
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s)
{
UINT32 version;
UINT32 generalFlags;
RDP_CB_CLIP_CAPS *caps_event;
Stream_Read_UINT32(s, version); /* version (4 bytes) */
Stream_Read_UINT32(s, generalFlags); /* generalFlags (4 bytes) */
DEBUG_CLIPRDR("Version: %d", version);
#ifdef WITH_DEBUG_CLIPRDR
cliprdr_print_general_capability_flags(generalFlags);
#endif
caps_event = (RDP_CB_CLIP_CAPS *)freerdp_event_new(CliprdrChannel_Class, CliprdrChannel_ClipCaps, NULL, NULL);
caps_event->capabilities = generalFlags;
if (generalFlags & CB_USE_LONG_FORMAT_NAMES)
cliprdr->use_long_format_names = TRUE;
if (generalFlags & CB_STREAM_FILECLIP_ENABLED)
cliprdr->stream_fileclip_enabled = TRUE;
if (generalFlags & CB_FILECLIP_NO_FILE_PATHS)
cliprdr->fileclip_no_file_paths = TRUE;
if (generalFlags & CB_CAN_LOCK_CLIPDATA)
cliprdr->can_lock_clipdata = TRUE;
cliprdr->received_caps = TRUE;
svc_plugin_send_event((rdpSvcPlugin *)cliprdr, (wMessage *)caps_event);
}
示例9: cliprdr_process_clip_caps
static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16 length, UINT16 flags)
{
int i;
UINT16 lengthCapability;
UINT16 cCapabilitiesSets;
UINT16 capabilitySetType;
Stream_Read_UINT16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */
Stream_Seek_UINT16(s); /* pad1 (2 bytes) */
DEBUG_CLIPRDR("cCapabilitiesSets %d", cCapabilitiesSets);
for (i = 0; i < cCapabilitiesSets; i++)
{
Stream_Read_UINT16(s, capabilitySetType); /* capabilitySetType (2 bytes) */
Stream_Read_UINT16(s, lengthCapability); /* lengthCapability (2 bytes) */
switch (capabilitySetType)
{
case CB_CAPSTYPE_GENERAL:
cliprdr_process_general_capability(cliprdr, s);
break;
default:
WLog_ERR(TAG, "unknown cliprdr capability set: %d", capabilitySetType);
break;
}
}
}
示例10: cliprdr_process_unlock_clipdata_event
static void cliprdr_process_unlock_clipdata_event(cliprdrPlugin* plugin, RDP_CB_UNLOCK_CLIPDATA_EVENT* event)
{
wStream* s;
DEBUG_CLIPRDR("Sending UnLock Request");
s = cliprdr_packet_new(CB_UNLOCK_CLIPDATA, 0, 4);
Stream_Write_UINT32(s, event->clipDataId);
cliprdr_packet_send(plugin, s);
}
示例11: cliprdr_process_tempdir_event
static void cliprdr_process_tempdir_event(cliprdrPlugin* plugin, RDP_CB_TEMPDIR_EVENT* event)
{
wStream* s;
DEBUG_CLIPRDR("Sending Temporary Directory.");
s = cliprdr_packet_new(CB_TEMP_DIRECTORY, 0, 520);
Stream_Write(s, event->dirname, 520);
cliprdr_packet_send(plugin, s);
}
示例12: cliprdr_process_format_list_event
void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIST_EVENT* cb_event)
{
int i;
wStream* s;
DEBUG_CLIPRDR("Sending Clipboard Format List");
if (cb_event->raw_format_data)
{
s = cliprdr_packet_new(CB_FORMAT_LIST, 0, cb_event->raw_format_data_size);
Stream_Write(s, cb_event->raw_format_data, cb_event->raw_format_data_size);
}
else
{
wStream* body = Stream_New(NULL, 64);
for (i = 0; i < cb_event->num_formats; i++)
{
const char* name;
int name_length;
switch (cb_event->formats[i])
{
case CB_FORMAT_HTML:
name = CFSTR_HTML; name_length = sizeof(CFSTR_HTML);
break;
case CB_FORMAT_PNG:
name = CFSTR_PNG; name_length = sizeof(CFSTR_PNG);
break;
case CB_FORMAT_JPEG:
name = CFSTR_JPEG; name_length = sizeof(CFSTR_JPEG);
break;
case CB_FORMAT_GIF:
name = CFSTR_GIF; name_length = sizeof(CFSTR_GIF);
break;
default:
name = "\0\0";
name_length = 2;
break;
}
if (!cliprdr->use_long_format_names)
name_length = 32;
Stream_EnsureRemainingCapacity(body, 4 + name_length);
Stream_Write_UINT32(body, cb_event->formats[i]);
Stream_Write(body, name, name_length);
}
Stream_SealLength(body);
s = cliprdr_packet_new(CB_FORMAT_LIST, 0, Stream_Length(body));
Stream_Write(s, Stream_Buffer(body), Stream_Length(body));
Stream_Free(body, TRUE);
}
cliprdr_packet_send(cliprdr, s);
}
示例13: cliprdr_process_format_list_event
void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIST_EVENT* cb_event)
{
int i;
wStream* s;
DEBUG_CLIPRDR("Sending Clipboard Format List");
if (cb_event->raw_format_data)
{
s = cliprdr_packet_new(CB_FORMAT_LIST, 0, cb_event->raw_format_data_size);
stream_write(s, cb_event->raw_format_data, cb_event->raw_format_data_size);
}
else
{
wStream* body = stream_new(0);
for (i = 0; i < cb_event->num_formats; i++)
{
const char* name;
int name_length;
switch (cb_event->formats[i])
{
case CB_FORMAT_HTML:
name = CFSTR_HTML; name_length = sizeof(CFSTR_HTML);
break;
case CB_FORMAT_PNG:
name = CFSTR_PNG; name_length = sizeof(CFSTR_PNG);
break;
case CB_FORMAT_JPEG:
name = CFSTR_JPEG; name_length = sizeof(CFSTR_JPEG);
break;
case CB_FORMAT_GIF:
name = CFSTR_GIF; name_length = sizeof(CFSTR_GIF);
break;
default:
name = "\0\0";
name_length = 2;
break;
}
if (!cliprdr->use_long_format_names)
name_length = 32;
stream_extend(body, stream_get_size(body) + 4 + name_length);
stream_write_UINT32(body, cb_event->formats[i]);
stream_write(body, name, name_length);
}
s = cliprdr_packet_new(CB_FORMAT_LIST, 0, stream_get_size(body));
stream_write(s, stream_get_head(body), stream_get_size(body));
stream_free(body);
}
cliprdr_packet_send(cliprdr, s);
}
示例14: cliprdr_process_general_capability
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s)
{
UINT32 version;
UINT32 generalFlags;
CLIPRDR_CAPABILITIES capabilities;
CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet;
CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr);
UINT error = CHANNEL_RC_OK;
if (!context)
{
WLog_ERR(TAG, "cliprdr_get_client_interface failed!");
return ERROR_INTERNAL_ERROR;
}
Stream_Read_UINT32(s, version); /* version (4 bytes) */
Stream_Read_UINT32(s, generalFlags); /* generalFlags (4 bytes) */
DEBUG_CLIPRDR("Version: %d", version);
#ifdef WITH_DEBUG_CLIPRDR
cliprdr_print_general_capability_flags(generalFlags);
#endif
if (cliprdr->useLongFormatNames)
cliprdr->useLongFormatNames = (generalFlags & CB_USE_LONG_FORMAT_NAMES) ? TRUE : FALSE;
if (cliprdr->streamFileClipEnabled)
cliprdr->streamFileClipEnabled = (generalFlags & CB_STREAM_FILECLIP_ENABLED) ? TRUE : FALSE;
if (cliprdr->fileClipNoFilePaths)
cliprdr->fileClipNoFilePaths = (generalFlags & CB_FILECLIP_NO_FILE_PATHS) ? TRUE : FALSE;
if (cliprdr->canLockClipData)
cliprdr->canLockClipData = (generalFlags & CB_CAN_LOCK_CLIPDATA) ? TRUE : FALSE;
cliprdr->capabilitiesReceived = TRUE;
if (!context->custom)
{
WLog_ERR(TAG, "context->custom not set!");
return ERROR_INTERNAL_ERROR;
}
capabilities.cCapabilitiesSets = 1;
capabilities.capabilitySets = (CLIPRDR_CAPABILITY_SET*) &(generalCapabilitySet);
generalCapabilitySet.capabilitySetType = CB_CAPSTYPE_GENERAL;
generalCapabilitySet.capabilitySetLength = 12;
generalCapabilitySet.version = version;
generalCapabilitySet.generalFlags = generalFlags;
IFCALLRET(context->ServerCapabilities, error, context, &capabilities);
if (error)
WLog_ERR(TAG, "ServerCapabilities failed with error %lu!", error);
return error;
}
示例15: cliprdr_process_format_data_request_event
void cliprdr_process_format_data_request_event(cliprdrPlugin* cliprdr, RDP_CB_DATA_REQUEST_EVENT* cb_event)
{
wStream* s;
DEBUG_CLIPRDR("Sending Format Data Request");
s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, 0, 4);
Stream_Write_UINT32(s, cb_event->format);
cliprdr_packet_send(cliprdr, s);
}