mirror of https://github.com/FreeRDP/FreeRDP
wfreerdp-server: added ability to list displays
This commit is contained in:
parent
165b18d071
commit
a53dfae1dd
|
@ -34,10 +34,21 @@
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int index;
|
||||
wfServer* server;
|
||||
|
||||
server = wfreerdp_server_new();
|
||||
|
||||
//handle args
|
||||
index = 1;
|
||||
//first the args that will cause the program to terminate
|
||||
if (strcmp("--list-screens", argv[index]) == 0)
|
||||
{
|
||||
printf("Detecting screens...\n");
|
||||
get_screen_info();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc == 2)
|
||||
server->port = (DWORD) atoi(argv[1]);
|
||||
|
||||
|
|
|
@ -36,6 +36,27 @@
|
|||
|
||||
cbCallback cbEvent;
|
||||
|
||||
void get_screen_info()
|
||||
{
|
||||
int i;
|
||||
DISPLAY_DEVICE dd;
|
||||
|
||||
memset(&dd, 0, sizeof(DISPLAY_DEVICE));
|
||||
dd.cb = sizeof(DISPLAY_DEVICE);
|
||||
|
||||
for (i=0; ; i++)
|
||||
{
|
||||
if (EnumDisplayDevices(NULL, i, &dd, 0) != 0)
|
||||
{
|
||||
_tprintf(_T("%d) [%d] [%s] [%s]\n"), i, dd.DeviceID, dd.DeviceName, dd.DeviceString);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DWORD WINAPI wf_server_main_loop(LPVOID lpParam)
|
||||
{
|
||||
int i, fds;
|
||||
|
|
|
@ -102,6 +102,8 @@ typedef struct wf_server wfServer;
|
|||
|
||||
typedef void (__stdcall* cbCallback) (int, UINT32);
|
||||
|
||||
FREERDP_API void get_screen_info();
|
||||
|
||||
FREERDP_API BOOL wfreerdp_server_start(wfServer* server);
|
||||
FREERDP_API BOOL wfreerdp_server_stop(wfServer* server);
|
||||
|
||||
|
|
Loading…
Reference in New Issue