Commit aec5ccfc authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

server: Don't allow an empty desktop name.

parent 42e50e44
......@@ -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 );
......
......@@ -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 )))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment