server/shadow: integrate comment from @hardening

Return directly at subsystem->ClientConnect
Also change to argument to accept shadow_client instead of freerdp_peer
This commit is contained in:
zihao.jiang 2015-06-15 19:37:26 +08:00
parent b169dfd930
commit 2335a307cb
2 changed files with 4 additions and 7 deletions

View File

@ -64,8 +64,8 @@ typedef int (*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, int maxMonitors);
typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem, typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem,
const char* user, const char* domain, const char* password); const char* user, const char* domain, const char* password);
typedef int (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, freerdp_peer* peer); typedef BOOL (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client);
typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, freerdp_peer* peer); typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client);
typedef int (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, UINT32 flags); typedef int (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, UINT32 flags);
typedef int (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, UINT16 flags, UINT16 code); typedef int (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, UINT16 flags, UINT16 code);

View File

@ -250,10 +250,7 @@ BOOL shadow_client_post_connect(freerdp_peer* peer)
if (subsystem->ClientConnect) if (subsystem->ClientConnect)
{ {
if (subsystem->ClientConnect(subsystem, peer)) return subsystem->ClientConnect(subsystem, client);
return TRUE;
else
return FALSE;
} }
return TRUE; return TRUE;
@ -1084,7 +1081,7 @@ void* shadow_client_thread(rdpShadowClient* client)
if (peer->connected && subsystem->ClientDisconnect) if (peer->connected && subsystem->ClientDisconnect)
{ {
subsystem->ClientDisconnect(subsystem, peer); subsystem->ClientDisconnect(subsystem, client);
} }
out: out: