Alexandre Julliard : server: Return an error for invalid requests instead of killing the client process .

Alexandre Julliard julliard at wine.codeweavers.com
Sun May 28 11:33:29 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 4ec9e110b0c7d9966382d6d3ace1fa28ea6c1085
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=4ec9e110b0c7d9966382d6d3ace1fa28ea6c1085

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sun May 28 18:27:02 2006 +0200

server: Return an error for invalid requests instead of killing the client process.

---

 server/request.c |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/server/request.c b/server/request.c
index c1a32f1..c6b4472 100644
--- a/server/request.c
+++ b/server/request.c
@@ -52,9 +52,12 @@ #ifdef HAVE_POLL_H
 #include <poll.h>
 #endif
 
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
 #include "windef.h"
 #include "winbase.h"
 #include "wincon.h"
+#include "winternl.h"
 #include "wine/library.h"
 
 #include "file.h"
@@ -277,23 +280,22 @@ static void call_req_handler( struct thr
     if (debug_level) trace_request();
 
     if (req < REQ_NB_REQUESTS)
-    {
         req_handlers[req]( &current->req, &reply );
-        if (current)
+    else
+        set_error( STATUS_NOT_IMPLEMENTED );
+
+    if (current)
+    {
+        if (current->reply_fd)
         {
-            if (current->reply_fd)
-            {
-                reply.reply_header.error = current->error;
-                reply.reply_header.reply_size = current->reply_size;
-                if (debug_level) trace_reply( req, &reply );
-                send_reply( &reply );
-            }
-            else fatal_protocol_error( current, "no reply fd for request %d\n", req );
+            reply.reply_header.error = current->error;
+            reply.reply_header.reply_size = current->reply_size;
+            if (debug_level) trace_reply( req, &reply );
+            send_reply( &reply );
         }
-        current = NULL;
-        return;
+        else fatal_protocol_error( current, "no reply fd for request %d\n", req );
     }
-    fatal_protocol_error( current, "bad request %d\n", req );
+    current = NULL;
 }
 
 /* read a request from a thread */




More information about the wine-cvs mailing list