server/shadow: add connect/disconnect anchor in subsystem callback

Other implementation of subsystem may want to track connect/disconnect of each client
This commit is contained in:
zihao.jiang 2015-04-09 01:37:41 +08:00
parent 0278f7f4ba
commit b169dfd930
2 changed files with 17 additions and 0 deletions

View File

@ -64,6 +64,8 @@ typedef int (*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, int maxMonitors);
typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem,
const char* user, const char* domain, const char* password);
typedef int (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, freerdp_peer* peer);
typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, freerdp_peer* peer);
typedef int (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, UINT32 flags);
typedef int (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, UINT16 flags, UINT16 code);
@ -158,6 +160,8 @@ struct _RDP_SHADOW_ENTRY_POINTS
pfnShadowExtendedMouseEvent ExtendedMouseEvent; \
\
pfnShadowAuthenticate Authenticate; \
pfnShadowClientConnect ClientConnect; \
pfnShadowClientDisconnect ClientDisconnect; \
\
rdpShadowServer* server

View File

@ -248,6 +248,14 @@ BOOL shadow_client_post_connect(freerdp_peer* peer)
}
}
if (subsystem->ClientConnect)
{
if (subsystem->ClientConnect(subsystem, peer))
return TRUE;
else
return FALSE;
}
return TRUE;
}
@ -1074,6 +1082,11 @@ void* shadow_client_thread(rdpShadowClient* client)
UpdateSubscriber = NULL;
}
if (peer->connected && subsystem->ClientDisconnect)
{
subsystem->ClientDisconnect(subsystem, peer);
}
out:
peer->Disconnect(peer);