Added function ReachedState to peer

This callback exposes the state the RDP peer has reached.
This commit is contained in:
akallabeth 2022-06-23 09:23:07 +02:00 committed by akallabeth
parent 40723606e4
commit 9613bd9bc6
2 changed files with 3 additions and 0 deletions

View File

@ -73,6 +73,7 @@ typedef int (*psPeerVirtualChannelWrite)(freerdp_peer* peer, HANDLE hChannel, co
typedef void* (*psPeerVirtualChannelGetData)(freerdp_peer* peer, HANDLE hChannel); typedef void* (*psPeerVirtualChannelGetData)(freerdp_peer* peer, HANDLE hChannel);
typedef int (*psPeerVirtualChannelSetData)(freerdp_peer* peer, HANDLE hChannel, void* data); typedef int (*psPeerVirtualChannelSetData)(freerdp_peer* peer, HANDLE hChannel, void* data);
typedef BOOL (*psPeerSetState)(freerdp_peer* peer, CONNECTION_STATE state); typedef BOOL (*psPeerSetState)(freerdp_peer* peer, CONNECTION_STATE state);
typedef BOOL (*psPeerReachedState)(freerdp_peer* peer, CONNECTION_STATE state);
/** @brief the result of the license callback */ /** @brief the result of the license callback */
typedef enum typedef enum
@ -169,6 +170,7 @@ struct rdp_freerdp_peer
* \note Must be called after \b Initialize as that also modifies the state. * \note Must be called after \b Initialize as that also modifies the state.
*/ */
ALIGN64 psPeerSetState SetState; ALIGN64 psPeerSetState SetState;
ALIGN64 psPeerReachedState ReachedState;
ALIGN64 psSspiNtlmHashCallback SspiNtlmHashCallback; ALIGN64 psSspiNtlmHashCallback SspiNtlmHashCallback;
}; };

View File

@ -574,6 +574,7 @@ static int peer_recv_callback_internal(rdpTransport* transport, wStream* s, void
settings = client->context->settings; settings = client->context->settings;
WINPR_ASSERT(settings); WINPR_ASSERT(settings);
IFCALL(client->ReachedState, client, rdp_get_state(rdp));
switch (rdp_get_state(rdp)) switch (rdp_get_state(rdp))
{ {
case CONNECTION_STATE_INITIAL: case CONNECTION_STATE_INITIAL: