diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:11 +0000 |
commit | 941f9937e0744d18de4cc0afa71e0caa925d82ac (patch) | |
tree | 67872b86dbf72d73e91188bf8de12594668fe4aa /server/shadow/shadow_lobby.c | |
parent | Adding upstream version 3.3.0+dfsg1. (diff) | |
download | freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip |
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'server/shadow/shadow_lobby.c')
-rw-r--r-- | server/shadow/shadow_lobby.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/server/shadow/shadow_lobby.c b/server/shadow/shadow_lobby.c index 8a9fade..f28408d 100644 --- a/server/shadow/shadow_lobby.c +++ b/server/shadow/shadow_lobby.c @@ -27,9 +27,9 @@ BOOL shadow_client_init_lobby(rdpShadowServer* server) { + BOOL rc = FALSE; int width = 0; int height = 0; - rdtkEngine* engine = NULL; rdtkSurface* surface = NULL; RECTANGLE_16 invalidRect; rdpShadowSurface* lobby = server->lobby; @@ -37,17 +37,14 @@ BOOL shadow_client_init_lobby(rdpShadowServer* server) if (!lobby) return FALSE; - if (!(engine = rdtk_engine_new())) - { + rdtkEngine* engine = rdtk_engine_new(); + if (!engine) return FALSE; - } - if (!(surface = - rdtk_surface_new(engine, lobby->data, lobby->width, lobby->height, lobby->scanline))) - { - rdtk_engine_free(engine); - return FALSE; - } + EnterCriticalSection(&lobby->lock); + surface = rdtk_surface_new(engine, lobby->data, lobby->width, lobby->height, lobby->scanline); + if (!surface) + goto fail; invalidRect.left = 0; invalidRect.top = 0; @@ -77,9 +74,11 @@ BOOL shadow_client_init_lobby(rdpShadowServer* server) rdtk_surface_free(surface); - rdtk_engine_free(engine); - region16_union_rect(&(lobby->invalidRegion), &(lobby->invalidRegion), &invalidRect); - return TRUE; + rc = TRUE; +fail: + LeaveCriticalSection(&lobby->lock); + rdtk_engine_free(engine); + return rc; } |