freerdp: add ConnectionResult event

This commit is contained in:
Marc-André Moreau 2013-07-03 16:18:45 -04:00
parent bc631c93a8
commit cbd93f1b3b
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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.