diff --git a/dll/win32/mshtml/mshtml_private.h b/dll/win32/mshtml/mshtml_private.h index df72fda159c..68aa0cf2b2c 100644 --- a/dll/win32/mshtml/mshtml_private.h +++ b/dll/win32/mshtml/mshtml_private.h @@ -891,6 +891,7 @@ void nsAString_InitDepend(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN; UINT32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN; void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN; +HRESULT map_nsresult(nsresult) DECLSPEC_HIDDEN; HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN; static inline HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p) diff --git a/dll/win32/mshtml/navigate.c b/dll/win32/mshtml/navigate.c index a7b28eb2af0..d43bf29c76e 100644 --- a/dll/win32/mshtml/navigate.c +++ b/dll/win32/mshtml/navigate.c @@ -1041,8 +1041,12 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream) (nsIRequest*)&This->nschannel->nsIHttpChannel_iface, This->nscontext, &This->nsstream->nsIInputStream_iface, This->bsc.readed-This->nsstream->buf_size, This->nsstream->buf_size); - if(NS_FAILED(nsres)) - ERR("OnDataAvailable failed: %08x\n", nsres); +#ifdef __REACTOS__ + if(NS_FAILED(nsres)) { + WARN("OnDataAvailable failed: %08lx\n", nsres); + return map_nsresult(nsres); + } +#endif if(This->nsstream->buf_size == sizeof(This->nsstream->buf)) { ERR("buffer is full\n"); diff --git a/dll/win32/mshtml/nsembed.c b/dll/win32/mshtml/nsembed.c index 7b2020ef36a..bbac128fb0f 100644 --- a/dll/win32/mshtml/nsembed.c +++ b/dll/win32/mshtml/nsembed.c @@ -838,6 +838,36 @@ void nsAString_Finish(nsAString *str) NS_StringContainerFinish(str); } +HRESULT map_nsresult(nsresult nsres) +{ + switch(nsres) { + case NS_OK: + return S_OK; + case NS_ERROR_OUT_OF_MEMORY: + return E_OUTOFMEMORY; + case NS_ERROR_NOT_IMPLEMENTED: + return E_NOTIMPL; + case NS_NOINTERFACE: + return E_NOINTERFACE; + case NS_ERROR_INVALID_POINTER: + return E_POINTER; + case NS_ERROR_INVALID_ARG: + return E_INVALIDARG; + case NS_ERROR_UNEXPECTED: + return E_UNEXPECTED; +#ifndef __REACTOS__ + /* These are not you defined for ReactOS */ + case NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR: + return 0x80700007; /* according to tests */ + case NS_ERROR_DOM_SYNTAX_ERR: + return E_INVALIDARG; /* FIXME: Throw SyntaxError for IE9+ modes */ +#endif + case NS_BINDING_ABORTED: + return E_ABORT; + } + return E_FAIL; +} + HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p) { const PRUnichar *str;