mirror of https://github.com/FreeRDP/FreeRDP
freerdp: add ConnectionResult event
This commit is contained in:
parent
bc631c93a8
commit
cbd93f1b3b
|
@ -68,6 +68,10 @@ DEFINE_EVENT_BEGIN(Terminate)
|
|||
int code;
|
||||
DEFINE_EVENT_END(Terminate)
|
||||
|
||||
DEFINE_EVENT_BEGIN(ConnectionResult)
|
||||
int result;
|
||||
DEFINE_EVENT_END(ConnectionResult)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,7 @@ BOOL freerdp_connect(freerdp* instance)
|
|||
rdpRdp* rdp;
|
||||
rdpSettings* settings;
|
||||
BOOL status = FALSE;
|
||||
ConnectionResultEventArgs e;
|
||||
|
||||
/* We always set the return code to 0 before we start the connect sequence*/
|
||||
connectErrorCode = 0;
|
||||
|
@ -169,6 +170,10 @@ BOOL freerdp_connect(freerdp* instance)
|
|||
|
||||
SetEvent(rdp->transport->connectedEvent);
|
||||
|
||||
EventArgsInit(&e, "freerdp");
|
||||
e.result = status ? 0 : -1;
|
||||
PubSub_OnConnectionResult(instance->context->pubSub, instance->context, &e);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -331,6 +336,7 @@ static wEventType FreeRDP_Events[] =
|
|||
DEFINE_EVENT_ENTRY(ErrorInfo)
|
||||
DEFINE_EVENT_ENTRY(ParamChange)
|
||||
DEFINE_EVENT_ENTRY(Terminate)
|
||||
DEFINE_EVENT_ENTRY(ConnectionResult)
|
||||
};
|
||||
|
||||
/** Allocator function for a rdp context.
|
||||
|
|
Loading…
Reference in New Issue