server: Don't allow an empty desktop name.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
42e50e44f4
commit
aec5ccfc06
|
@ -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 )))
|
||||
|
|
Loading…
Reference in New Issue