Signed-off-by: Huw Davies huw@codeweavers.com --- 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 d239ead6e98..76aa8a533b9 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 43d112334d4..2962ea0df4a 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 )))