Jacek Caban : mshtml: Report better status in on_stop_nsrequest.

Alexandre Julliard julliard at winehq.org
Thu Oct 7 11:24:24 CDT 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct  6 21:35:22 2010 +0200

mshtml: Report better status in on_stop_nsrequest.

---

 dlls/mshtml/mshtml_private.h |    9 ++++++++-
 dlls/mshtml/navigate.c       |   18 ++++++++++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index e4e074a..6888f00 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -34,6 +34,9 @@
 
 #include "nsiface.h"
 
+#define NS_ERROR_GENERATE_FAILURE(module,code) \
+    ((nsresult) (((PRUint32)(1<<31)) | ((PRUint32)(module+0x45)<<16) | ((PRUint32)(code))))
+
 #define NS_OK                     ((nsresult)0x00000000L)
 #define NS_ERROR_FAILURE          ((nsresult)0x80004005L)
 #define NS_ERROR_OUT_OF_MEMORY    ((nsresult)0x8007000EL)
@@ -42,7 +45,11 @@
 #define NS_ERROR_NOT_AVAILABLE    ((nsresult)0x80040111L)
 #define NS_ERROR_INVALID_ARG      ((nsresult)0x80070057L) 
 #define NS_ERROR_UNEXPECTED       ((nsresult)0x8000ffffL)
-#define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
+
+#define NS_ERROR_MODULE_NETWORK    6
+
+#define NS_BINDING_ABORTED         NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
+#define NS_ERROR_UNKNOWN_PROTOCOL  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
 
 #define NS_FAILED(res) ((res) & 0x80000000)
 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 2ddadae..fc13a3e 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -992,7 +992,18 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This)
 
 static void on_stop_nsrequest(nsChannelBSC *This, HRESULT result)
 {
-    nsresult nsres;
+    nsresult nsres, request_result;
+
+    switch(result) {
+    case S_OK:
+        request_result = NS_OK;
+        break;
+    case E_ABORT:
+        request_result = NS_BINDING_ABORTED;
+        break;
+    default:
+        request_result = NS_ERROR_FAILURE;
+    }
 
     if(!This->bsc.readed && SUCCEEDED(result)) {
         TRACE("No data read! Calling OnStartRequest\n");
@@ -1001,15 +1012,14 @@ static void on_stop_nsrequest(nsChannelBSC *This, HRESULT result)
 
     if(This->nslistener) {
         nsres = nsIStreamListener_OnStopRequest(This->nslistener,
-                 (nsIRequest*)NSCHANNEL(This->nschannel),
-                 This->nscontext, SUCCEEDED(result) ? NS_OK : NS_ERROR_FAILURE);
+                 (nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext, request_result);
         if(NS_FAILED(nsres))
             WARN("OnStopRequet failed: %08x\n", nsres);
     }
 
     if(This->nschannel->load_group) {
         nsres = nsILoadGroup_RemoveRequest(This->nschannel->load_group,
-                (nsIRequest*)NSCHANNEL(This->nschannel), NULL, NS_OK);
+                (nsIRequest*)NSCHANNEL(This->nschannel), NULL, request_result);
         if(NS_FAILED(nsres))
             ERR("RemoveRequest failed: %08x\n", nsres);
     }




More information about the wine-cvs mailing list