diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e4e074af3bc..6888f007415 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 2ddadaeeee9..fc13a3ecae0 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); }