Maarten Lankhorst : server: Make enum_winstations enumerate all the window stations with WINSTA_ENUMERATE right .

Alexandre Julliard julliard at winehq.org
Thu Apr 17 07:38:46 CDT 2008


Module: wine
Branch: master
Commit: 81069001ea65cd517b62e2a80cd28e35be044794
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=81069001ea65cd517b62e2a80cd28e35be044794

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Tue Apr 15 14:32:43 2008 -0700

server: Make enum_winstations enumerate all the window stations with WINSTA_ENUMERATE right.

---

 server/winstation.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/winstation.c b/server/winstation.c
index 720bb12..cde4923 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"
 
 
@@ -636,16 +637,15 @@ DECL_HANDLER(set_user_object_info)
 /* enumerate window stations */
 DECL_HANDLER(enum_winstation)
 {
-    unsigned int index = req->index;
-    obj_handle_t handle;
-    struct object *obj;
+    unsigned int index = 0;
+    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 );
+        unsigned int access = WINSTA_ENUMERATE;
+        if (req->index > index++) continue;
+        if (!check_object_access( &winsta->obj, &access )) continue;
+        set_reply_data_obj_name( &winsta->obj );
         clear_error();
         reply->next = index;
         return;




More information about the wine-cvs mailing list