wfreerdp-server: added support for getting number of peers and hostname
This commit is contained in:
parent
4c790d8253
commit
e7a751c930
@ -178,3 +178,36 @@ FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
FREERDP_API UINT32 wfreerdp_server_num_peers()
|
||||
{
|
||||
wfInfo* wfi;
|
||||
|
||||
wfi = wf_info_get_instance();
|
||||
return wfi->peerCount;
|
||||
}
|
||||
|
||||
FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr)
|
||||
{
|
||||
wfInfo* wfi;
|
||||
freerdp_peer* peer;
|
||||
|
||||
wfi = wf_info_get_instance();
|
||||
peer = wfi->peers[pId];
|
||||
|
||||
|
||||
if (peer)
|
||||
{
|
||||
UINT32 sLen;
|
||||
|
||||
sLen = strnlen_s(peer->hostname, 50);
|
||||
swprintf(dstStr, 50, L"%hs", peer->hostname);
|
||||
return sLen;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("nonexistent peer\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -94,4 +94,8 @@ FREERDP_API void wfreerdp_server_free(wfServer* server);
|
||||
|
||||
FREERDP_API BOOL wfreerdp_server_is_running(wfServer* server);
|
||||
|
||||
FREERDP_API UINT32 wfreerdp_server_num_peers();
|
||||
|
||||
FREERDP_API UINT32 wfreerdp_server_get_peer_hostname(int pId, wchar_t * dstStr);
|
||||
|
||||
#endif /* WF_INTERFACE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user