From 70bd727609f4ed541499f2de77fbc2c190accae1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 15 Apr 2008 14:32:43 -0700 Subject: [PATCH] server: Make enum_winstations enumerate all the window stations with WINSTA_ENUMERATE right --- server/winstation.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/server/winstation.c b/server/winstation.c index 720bb12..bb968e4 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -37,6 +37,7 @@ #include "process.h" #include "user.h" #include "file.h" +#include "security.h" #include "wine/unicode.h" @@ -637,20 +638,30 @@ DECL_HANDLER(set_user_object_info) DECL_HANDLER(enum_winstation) { unsigned int index = req->index; - obj_handle_t handle; - struct object *obj; + int n = -1; + struct winstation *winsta; - while ((handle = enumerate_handles( current->process, &winstation_ops, &index ))) + LIST_FOR_EACH_ENTRY( winsta, &winstation_list, struct winstation, entry ) { - if (!(obj = get_handle_obj( current->process, handle, WINSTA_ENUMERATE, &winstation_ops ))) - continue; - set_reply_data_obj_name( obj ); - release_object( obj ); - clear_error(); - reply->next = index; + if (index == ++n) + { + unsigned int access = WINSTA_ENUMERATE; + if (check_object_access( (struct object *)winsta, &access )) + break; + + ++index; + } + } + + if (index != n) + { + set_error( STATUS_NO_MORE_ENTRIES ); return; } - set_error( STATUS_NO_MORE_ENTRIES ); + + set_reply_data_obj_name( (struct object *)winsta ); + reply->next = index+1; + clear_error(); } -- 1.5.4.1