Commit 3fd1fc76 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

server: Make enum_desktop enumerate all the desktops on the window station with…

server: Make enum_desktop enumerate all the desktops on the window station with the DESKTOP_ENUMERATE right.
parent 81069001
...@@ -659,28 +659,23 @@ DECL_HANDLER(enum_desktop) ...@@ -659,28 +659,23 @@ DECL_HANDLER(enum_desktop)
{ {
struct winstation *winstation; struct winstation *winstation;
struct desktop *desktop; struct desktop *desktop;
unsigned int index = req->index; unsigned int index = 0;
obj_handle_t handle;
if (!(winstation = (struct winstation *)get_handle_obj( current->process, req->winstation, if (!(winstation = (struct winstation *)get_handle_obj( current->process, req->winstation,
WINSTA_ENUMDESKTOPS, &winstation_ops ))) WINSTA_ENUMDESKTOPS, &winstation_ops )))
return; return;
while ((handle = enumerate_handles( current->process, &desktop_ops, &index ))) LIST_FOR_EACH_ENTRY( desktop, &winstation->desktops, struct desktop, entry )
{ {
if (!(desktop = get_desktop_obj( current->process, handle, DESKTOP_ENUMERATE ))) unsigned int access = DESKTOP_ENUMERATE;
continue; if (req->index > index++) continue;
if (!desktop->obj.name) continue;
if (desktop->winstation == winstation) if (!check_object_access( &desktop->obj, &access )) continue;
{ set_reply_data_obj_name( &desktop->obj );
set_reply_data_obj_name( &desktop->obj ); release_object( winstation );
release_object( desktop ); clear_error();
release_object( winstation ); reply->next = index;
clear_error(); return;
reply->next = index;
return;
}
release_object( desktop );
} }
release_object( winstation ); release_object( 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