server: Make enum_desktop enumerate all the desktops on the window station with the DESKTOP_ENUMERATE right.

This commit is contained in:
Maarten Lankhorst 2008-04-15 16:38:58 -07:00 committed by Alexandre Julliard
parent 81069001ea
commit 3fd1fc7600

View file

@ -659,28 +659,23 @@ DECL_HANDLER(enum_desktop)
{
struct winstation *winstation;
struct desktop *desktop;
unsigned int index = req->index;
obj_handle_t handle;
unsigned int index = 0;
if (!(winstation = (struct winstation *)get_handle_obj( current->process, req->winstation,
WINSTA_ENUMDESKTOPS, &winstation_ops )))
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 )))
continue;
if (desktop->winstation == winstation)
{
set_reply_data_obj_name( &desktop->obj );
release_object( desktop );
release_object( winstation );
clear_error();
reply->next = index;
return;
}
release_object( desktop );
unsigned int access = DESKTOP_ENUMERATE;
if (req->index > index++) continue;
if (!desktop->obj.name) continue;
if (!check_object_access( &desktop->obj, &access )) continue;
set_reply_data_obj_name( &desktop->obj );
release_object( winstation );
clear_error();
reply->next = index;
return;
}
release_object( winstation );