本文整理汇总了C++中MessageQueue_Event函数的典型用法代码示例。如果您正苦于以下问题:C++ MessageQueue_Event函数的具体用法?C++ MessageQueue_Event怎么用?C++ MessageQueue_Event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MessageQueue_Event函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WTSVirtualChannelManagerGetFileDescriptor
void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, int* fds_count)
{
void* fd;
WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer;
fd = GetEventWaitObject(MessageQueue_Event(vcm->queue));
if (fd)
{
fds[*fds_count] = fd;
(*fds_count)++;
}
#if 0
if (vcm->drdynvc_channel)
{
fd = GetEventWaitObject(vcm->drdynvc_channel->receiveEvent);
if (fd)
{
fds[*fds_count] = fd;
(*fds_count)++;
}
}
#endif
}
示例2: freerdp_channels_get_event_handle
HANDLE freerdp_channels_get_event_handle(freerdp* instance)
{
HANDLE event = NULL;
rdpChannels* channels;
channels = instance->context->channels;
event = MessageQueue_Event(channels->queue);
return event;
}
示例3: freerdp_get_input_queue_event_handle
HANDLE freerdp_get_input_queue_event_handle(freerdp* instance)
{
HANDLE event = NULL;
if (instance->input->queue)
event = MessageQueue_Event(instance->input->queue);
return event;
}
示例4: freerdp_channels_check_fds
/**
* called only from main thread
*/
BOOL freerdp_channels_check_fds(rdpChannels* channels, freerdp* instance)
{
if (WaitForSingleObject(MessageQueue_Event(channels->queue), 0) == WAIT_OBJECT_0)
{
freerdp_channels_process_sync(channels, instance);
}
return TRUE;
}
示例5: smartcard_context_thread
void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext)
{
DWORD nCount;
DWORD status;
HANDLE hEvents[2];
wMessage message;
SMARTCARD_DEVICE* smartcard;
SMARTCARD_OPERATION* operation;
smartcard = pContext->smartcard;
nCount = 0;
hEvents[nCount++] = MessageQueue_Event(pContext->IrpQueue);
while (1)
{
status = WaitForMultipleObjects(nCount, hEvents, FALSE, INFINITE);
if (WaitForSingleObject(MessageQueue_Event(pContext->IrpQueue), 0) == WAIT_OBJECT_0)
{
if (!MessageQueue_Peek(pContext->IrpQueue, &message, TRUE))
break;
if (message.id == WMQ_QUIT)
break;
operation = (SMARTCARD_OPERATION*) message.wParam;
if (operation)
{
status = smartcard_irp_device_control_call(smartcard, operation);
Queue_Enqueue(smartcard->CompletedIrpQueue, (void*) operation->irp);
free(operation);
}
}
}
ExitThread(0);
return NULL;
}
示例6: freerdp_get_message_queue_event_handle
HANDLE freerdp_get_message_queue_event_handle(freerdp* instance, DWORD id)
{
HANDLE event = NULL;
wMessageQueue* queue = NULL;
queue = freerdp_get_message_queue(instance, id);
if (queue)
event = MessageQueue_Event(queue);
return event;
}
示例7: freerdp_channels_process_pending_messages
int freerdp_channels_process_pending_messages(freerdp* instance)
{
rdpChannels* channels;
channels = instance->context->channels;
if (WaitForSingleObject(MessageQueue_Event(channels->queue), 0) == WAIT_OBJECT_0)
{
return freerdp_channels_process_sync(channels, instance);
}
return TRUE;
}
示例8: freerdp_channels_get_fds
/**
* called only from main thread
*/
BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** read_fds,
int* read_count, void** write_fds, int* write_count)
{
void* pfd;
pfd = GetEventWaitObject(MessageQueue_Event(channels->queue));
if (pfd)
{
read_fds[*read_count] = pfd;
(*read_count)++;
}
return TRUE;
}
示例9: freerds_client_get_event_handles
int freerds_client_get_event_handles(rdsBackend* backend, HANDLE* events, DWORD* nCount)
{
rdsBackendConnector* connector = (rdsBackendConnector*) backend;
if (connector)
{
if (connector->ServerQueue)
{
events[*nCount] = MessageQueue_Event(connector->ServerQueue);
(*nCount)++;
}
}
return 0;
}
示例10: freerds_client_check_event_handles
int freerds_client_check_event_handles(rdsBackend* backend)
{
int status = 0;
rdsBackendConnector* connector = (rdsBackendConnector*) backend;
if (!connector)
return 0;
while (WaitForSingleObject(MessageQueue_Event(connector->ServerQueue), 0) == WAIT_OBJECT_0)
{
status = freerds_message_server_queue_process_pending_messages(connector);
}
return status;
}
示例11: FreeRDP_WTSVirtualChannelQuery
BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, PVOID* ppBuffer, DWORD* pBytesReturned)
{
void* pfd;
BOOL bval;
void* fds[10];
HANDLE hEvent;
int fds_count = 0;
BOOL status = FALSE;
rdpPeerChannel* channel = (rdpPeerChannel*) hChannelHandle;
ZeroMemory(fds, sizeof(fds));
hEvent = MessageQueue_Event(channel->queue);
switch ((UINT32) WtsVirtualClass)
{
case WTSVirtualFileHandle:
pfd = GetEventWaitObject(hEvent);
if (pfd)
{
fds[fds_count] = pfd;
(fds_count)++;
}
*ppBuffer = malloc(sizeof(void*));
CopyMemory(*ppBuffer, &fds[0], sizeof(void*));
*pBytesReturned = sizeof(void*);
status = TRUE;
break;
case WTSVirtualEventHandle:
*ppBuffer = malloc(sizeof(HANDLE));
CopyMemory(*ppBuffer, &(hEvent), sizeof(HANDLE));
*pBytesReturned = sizeof(void*);
status = TRUE;
break;
case WTSVirtualChannelReady:
if (channel->channelType == RDP_PEER_CHANNEL_TYPE_SVC)
{
bval = TRUE;
status = TRUE;
}
else
{
switch (channel->dvc_open_state)
{
case DVC_OPEN_STATE_NONE:
bval = FALSE;
status = TRUE;
break;
case DVC_OPEN_STATE_SUCCEEDED:
bval = TRUE;
status = TRUE;
break;
default:
bval = FALSE;
status = FALSE;
break;
}
}
*ppBuffer = malloc(sizeof(BOOL));
CopyMemory(*ppBuffer, &bval, sizeof(BOOL));
*pBytesReturned = sizeof(BOOL);
break;
default:
break;
}
return status;
}
示例12: shadow_client_thread
void* shadow_client_thread(rdpShadowClient* client)
{
DWORD status;
DWORD nCount;
wMessage message;
wMessage pointerPositionMsg;
wMessage pointerAlphaMsg;
wMessage audioVolumeMsg;
HANDLE events[32];
HANDLE ClientEvent;
HANDLE ChannelEvent;
void* UpdateSubscriber;
HANDLE UpdateEvent;
freerdp_peer* peer;
rdpContext* context;
rdpSettings* settings;
rdpShadowServer* server;
rdpShadowScreen* screen;
rdpShadowEncoder* encoder;
rdpShadowSubsystem* subsystem;
wMessageQueue* MsgQueue = client->MsgQueue;
server = client->server;
screen = server->screen;
encoder = client->encoder;
subsystem = server->subsystem;
context = (rdpContext*) client;
peer = context->peer;
settings = peer->settings;
peer->Capabilities = shadow_client_capabilities;
peer->PostConnect = shadow_client_post_connect;
peer->Activate = shadow_client_activate;
shadow_input_register_callbacks(peer->input);
peer->Initialize(peer);
peer->update->RefreshRect = (pRefreshRect)shadow_client_refresh_rect;
peer->update->SuppressOutput = (pSuppressOutput)shadow_client_suppress_output;
peer->update->SurfaceFrameAcknowledge = (pSurfaceFrameAcknowledge)shadow_client_surface_frame_acknowledge;
if ((!client->vcm) || (!subsystem->updateEvent))
goto out;
UpdateSubscriber = shadow_multiclient_get_subscriber(subsystem->updateEvent);
if (!UpdateSubscriber)
goto out;
UpdateEvent = shadow_multiclient_getevent(UpdateSubscriber);
ClientEvent = peer->GetEventHandle(peer);
ChannelEvent = WTSVirtualChannelManagerGetEventHandle(client->vcm);
while (1)
{
nCount = 0;
events[nCount++] = UpdateEvent;
events[nCount++] = ClientEvent;
events[nCount++] = ChannelEvent;
events[nCount++] = MessageQueue_Event(MsgQueue);
status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
if (WaitForSingleObject(UpdateEvent, 0) == WAIT_OBJECT_0)
{
if (client->activated)
{
int index;
int numRects = 0;
const RECTANGLE_16* rects;
int width, height;
/* Check resize */
shadow_client_calc_desktop_size(server, &width, &height);
if (settings->DesktopWidth != (UINT32)width || settings->DesktopHeight != (UINT32)height)
{
/* Screen size changed, do resize */
settings->DesktopWidth = width;
settings->DesktopHeight = height;
/**
* Unset client activated flag to avoid sending update message during
* resize. DesktopResize will reactive the client and
* shadow_client_activate would be invoked later.
*/
client->activated = FALSE;
/* Send Resize */
peer->update->DesktopResize(peer->update->context); // update_send_desktop_resize
/* Clear my invalidRegion. shadow_client_activate refreshes fullscreen */
region16_clear(&(client->invalidRegion));
WLog_ERR(TAG, "Client from %s is resized (%dx%[email protected]%d)",
peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth);
}
else
{
/* Send frame */
//.........这里部分代码省略.........
示例13: smartcard_thread_func
static void* smartcard_thread_func(void* arg)
{
IRP* irp;
DWORD nCount;
DWORD status;
HANDLE hEvents[2];
wMessage message;
SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) arg;
nCount = 0;
hEvents[nCount++] = MessageQueue_Event(smartcard->IrpQueue);
hEvents[nCount++] = Queue_Event(smartcard->CompletedIrpQueue);
while (1)
{
status = WaitForMultipleObjects(nCount, hEvents, FALSE, INFINITE);
if (WaitForSingleObject(MessageQueue_Event(smartcard->IrpQueue), 0) == WAIT_OBJECT_0)
{
if (!MessageQueue_Peek(smartcard->IrpQueue, &message, TRUE))
break;
if (message.id == WMQ_QUIT)
{
while (WaitForSingleObject(Queue_Event(smartcard->CompletedIrpQueue), 0) == WAIT_OBJECT_0)
{
irp = (IRP*) Queue_Dequeue(smartcard->CompletedIrpQueue);
if (irp)
{
if (irp->thread)
{
WaitForSingleObject(irp->thread, INFINITE);
CloseHandle(irp->thread);
irp->thread = NULL;
}
smartcard_complete_irp(smartcard, irp);
}
}
break;
}
irp = (IRP*) message.wParam;
if (irp)
{
smartcard_process_irp(smartcard, irp);
}
}
if (WaitForSingleObject(Queue_Event(smartcard->CompletedIrpQueue), 0) == WAIT_OBJECT_0)
{
irp = (IRP*) Queue_Dequeue(smartcard->CompletedIrpQueue);
if (irp)
{
if (irp->thread)
{
WaitForSingleObject(irp->thread, INFINITE);
CloseHandle(irp->thread);
irp->thread = NULL;
}
smartcard_complete_irp(smartcard, irp);
}
}
}
ExitThread(0);
return NULL;
}
示例14: freerds_connection_main_thread
void* freerds_connection_main_thread(void* arg)
{
DWORD status;
DWORD nCount;
HANDLE events[32];
HANDLE ClientEvent;
HANDLE ChannelEvent;
HANDLE LocalTermEvent;
HANDLE GlobalTermEvent;
HANDLE NotificationEvent;
rdsConnection* connection;
rdpSettings* settings;
rdsBackendConnector* connector = NULL;
freerdp_peer* client = (freerdp_peer*) arg;
BOOL disconnected = FALSE;
#ifndef WIN32
sigset_t set;
int ret;
#endif
fprintf(stderr, "We've got a client %s\n", client->hostname);
connection = (rdsConnection*) client->context;
settings = client->settings;
app_context_add_connection(connection);
freerds_generate_certificate(settings);
settings->RdpSecurity = FALSE;
settings->TlsSecurity = TRUE;
/**
* Disable NLA Security for now.
* TODO: make this a configurable option.
*/
settings->NlaSecurity = FALSE;
client->Capabilities = freerds_peer_capabilities;
client->PostConnect = freerds_peer_post_connect;
client->Activate = freerds_peer_activate;
client->Initialize(client);
freerds_input_register_callbacks(client->input);
client->update->SurfaceFrameAcknowledge = freerds_update_frame_acknowledge;
client->update->SuppressOutput = freerds_suppress_output;
ClientEvent = client->GetEventHandle(client);
ChannelEvent = WTSVirtualChannelManagerGetEventHandle(connection->vcm);
GlobalTermEvent = g_get_term_event();
LocalTermEvent = connection->TermEvent;
NotificationEvent = MessageQueue_Event(connection->notifications);
#ifndef WIN32
sigemptyset(&set);
sigaddset(&set, SIGPIPE);
ret = pthread_sigmask(SIG_BLOCK, &set, NULL);
if (0 != ret)
fprintf(stderr, "couldn't block SIGPIPE\n");
#endif
while (1)
{
nCount = 0;
events[nCount++] = ClientEvent;
events[nCount++] = ChannelEvent;
events[nCount++] = GlobalTermEvent;
events[nCount++] = LocalTermEvent;
events[nCount++] = NotificationEvent;
if (client->activated)
{
connector = (rdsBackendConnector*) connection->connector;
if (connector && connector->GetEventHandles)
connector->GetEventHandles((rdsBackend *)connector, events, &nCount);
}
status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
if (WaitForSingleObject(GlobalTermEvent, 0) == WAIT_OBJECT_0)
{
fprintf(stderr, "GlobalTermEvent\n");
break;
}
if (WaitForSingleObject(LocalTermEvent, 0) == WAIT_OBJECT_0)
{
fprintf(stderr, "LocalTermEvent\n");
break;
}
if (WaitForSingleObject(ClientEvent, 0) == WAIT_OBJECT_0)
{
if (client->CheckFileDescriptor(client) != TRUE)
{
fprintf(stderr, "Failed to check freerdp file descriptor\n");
break;
}
}
//.........这里部分代码省略.........
示例15: WTSVirtualChannelManagerGetEventHandle
HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer)
{
WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*) hServer;
return MessageQueue_Event(vcm->queue);
}