wfreerdp-server: more error handling improvements

This commit is contained in:
Corey C 2013-03-12 17:56:45 -04:00
parent 034000b0f1
commit f83aa371aa
3 changed files with 14 additions and 7 deletions

View File

@ -225,7 +225,12 @@ void wf_info_peer_register(wfInfo* wfi, wfPeerContext* context)
if (wfi->peerCount == 0)
wf_dxgi_init(wfi);
#else
wf_mirror_driver_activate(wfi);
if (wf_mirror_driver_activate(wfi) == FALSE)
{
context->socketClose = TRUE;
wf_info_unlock(wfi);
return;
}
#endif
//look trhough the array of peers until an empty slot
for(i=0; i<WF_INFO_MAXPEERS; ++i)

View File

@ -292,7 +292,7 @@ BOOL wf_mirror_driver_cleanup(wfInfo* wfi)
return TRUE;
}
void wf_mirror_driver_activate(wfInfo* wfi)
BOOL wf_mirror_driver_activate(wfInfo* wfi)
{
if (!wfi->mirrorDriverActive)
{
@ -301,28 +301,30 @@ void wf_mirror_driver_activate(wfInfo* wfi)
if (wf_mirror_driver_find_display_device(wfi) == FALSE)
{
printf("Could not find dfmirage mirror driver! Is it installed?\n");
return;
return FALSE;
}
if (wf_mirror_driver_display_device_attach(wfi, 1) == FALSE)
{
printf("Could not attach display device!\n");
return;
return FALSE;
}
if (wf_mirror_driver_update(wfi, FALSE) == FALSE)
{
printf("could not update system with new display settings!\n");
return;
return FALSE;
}
if (wf_mirror_driver_map_memory(wfi) == FALSE)
{
printf("Unable to map memory for mirror driver!\n");
return;
return FALSE;
}
wfi->mirrorDriverActive = TRUE;
}
return TRUE;
}
void wf_mirror_driver_deactivate(wfInfo* wfi)

View File

@ -206,7 +206,7 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int unload);
BOOL wf_mirror_driver_map_memory(wfInfo* wfi);
BOOL wf_mirror_driver_cleanup(wfInfo* wfi);
void wf_mirror_driver_activate(wfInfo* wfi);
BOOL wf_mirror_driver_activate(wfInfo* wfi);
void wf_mirror_driver_deactivate(wfInfo* wfi);
#endif /* WF_MIRAGE_H */