static void cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, LPVOID pData, UINT32 dataLength) { UINT32 status; status = cliprdr->channelEntryPoints.pVirtualChannelOpen(cliprdr->InitHandle, &cliprdr->OpenHandle, cliprdr->channelDef.name, cliprdr_virtual_channel_open_event); cliprdr_add_open_handle_data(cliprdr->OpenHandle, cliprdr); if (status != CHANNEL_RC_OK) { WLog_ERR(TAG, "cliprdr_virtual_channel_event_connected: open failed: status: %d", status); return; } cliprdr->MsgPipe = MessagePipe_New(); cliprdr->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) cliprdr_virtual_channel_client_thread, (void*) cliprdr, 0, NULL); }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, LPVOID pData, UINT32 dataLength) { UINT32 status; UINT error; status = cliprdr->channelEntryPoints.pVirtualChannelOpen(cliprdr->InitHandle, &cliprdr->OpenHandle, cliprdr->channelDef.name, cliprdr_virtual_channel_open_event); if (status != CHANNEL_RC_OK) { WLog_ERR(TAG, "pVirtualChannelOpen failed with %s [%08X]", WTSErrorToString(status), status); return status; } if ((error = cliprdr_add_open_handle_data(cliprdr->OpenHandle, cliprdr))) { WLog_ERR(TAG, "cliprdr_add_open_handle_data failed with error %lu", error); return error; } cliprdr->queue = MessageQueue_New(NULL); if (!cliprdr->queue) { WLog_ERR(TAG, "MessageQueue_New failed!"); return ERROR_NOT_ENOUGH_MEMORY; } if (!(cliprdr->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) cliprdr_virtual_channel_client_thread, (void*) cliprdr, 0, NULL))) { WLog_ERR(TAG, "CreateThread failed!"); MessageQueue_Free(cliprdr->queue); cliprdr->queue = NULL; return ERROR_INTERNAL_ERROR; } return CHANNEL_RC_OK; }