[core,client] Add PostFinalDisconnect callback

To have more fine granied control add a new callback.
Now you have the following callback pairs:
* PreConnect <--> PostFinalDisconnect
* PostConnect <--> PostDisconnect
This commit is contained in:
akallabeth 2022-11-24 12:03:44 +01:00 committed by akallabeth
parent 5a24ec2171
commit cb5c98aab0
3 changed files with 29 additions and 2 deletions

View File

@ -1411,6 +1411,18 @@ static void xf_post_disconnect(freerdp* instance)
xf_keyboard_free(xfc);
}
static void xf_post_final_disconnect(freerdp* instance)
{
xfContext* xfc;
rdpContext* context;
if (!instance || !instance->context)
return;
context = instance->context;
xfc = (xfContext*)context;
}
static int xf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
{
xfContext* xfc = (xfContext*)instance->context;
@ -1753,6 +1765,7 @@ static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context)
instance->PreConnect = xf_pre_connect;
instance->PostConnect = xf_post_connect;
instance->PostDisconnect = xf_post_disconnect;
instance->PostFinalDisconnect = xf_post_final_disconnect;
instance->AuthenticateEx = client_cli_authenticate_ex;
instance->ChooseSmartcard = client_cli_choose_smartcard;
instance->VerifyCertificateEx = client_cli_verify_certificate_ex;

View File

@ -460,7 +460,11 @@ owned by rdpRdp */
ALIGN64 pPostDisconnect
PostDisconnect; /**< (offset 55)
Callback for cleaning up
resources allocated by connect callbacks. */
resources allocated by post connect callback.
This will be called before disconnecting and cleaning up the
channels.
*/
ALIGN64 pAuthenticate GatewayAuthenticate; /**< (offset 56)
Callback for gateway authentication.
@ -482,7 +486,14 @@ owned by rdpRdp */
* callback for loading channel configuration. Might be called multiple
* times when redirection occurs. */
UINT64 paddingD[64 - 60]; /* 60 */
ALIGN64 pPostDisconnect
PostFinalDisconnect; /** < (offset 60)
* callback for cleaning up resources allocated in PreConnect
*
* This will be called after all instance related channels and
* threads have been stopped
*/
UINT64 paddingD[64 - 61]; /* 61 */
ALIGN64 pSendChannelData
SendChannelData; /* (offset 64)

View File

@ -549,6 +549,9 @@ BOOL freerdp_disconnect(freerdp* instance)
}
freerdp_channels_close(instance->context->channels, instance);
IFCALL(instance->PostFinalDisconnect, instance);
return rc;
}