Huw Davies : server: Don't allow an empty desktop name.

Alexandre Julliard julliard at winehq.org
Wed Jun 24 15:47:35 CDT 2020


Module: wine
Branch: master
Commit: aec5ccfc0666db2d9c9b65694c5e63b9b7d99066
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aec5ccfc0666db2d9c9b65694c5e63b9b7d99066

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Jun 24 11:37:22 2020 +0100

server: Don't allow an empty desktop name.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/winstation.c | 2 --
 server/winstation.c            | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c
index d239ead6e9..76aa8a533b 100644
--- a/dlls/user32/tests/winstation.c
+++ b/dlls/user32/tests/winstation.c
@@ -296,9 +296,7 @@ static void test_handles(void)
 
     SetLastError( 0xdeadbeef );
     d2 = CreateDesktopA( "", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
-    todo_wine
     ok( !d2, "create empty desktop succeeded\n" );
-    todo_wine
     ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() );
 
     SetLastError( 0xdeadbeef );
diff --git a/server/winstation.c b/server/winstation.c
index 43d112334d..2962ea0df4 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -513,6 +513,11 @@ DECL_HANDLER(create_desktop)
     struct unicode_str name = get_req_unicode_str();
 
     reply->handle = 0;
+    if (!name.len)
+    {
+        set_error( STATUS_INVALID_HANDLE );
+        return;
+    }
     if ((winstation = get_process_winstation( current->process, WINSTA_CREATEDESKTOP )))
     {
         if ((desktop = create_desktop( &name, req->attributes, req->flags, winstation )))




More information about the wine-cvs mailing list