Jacek Caban : mshtml: Use FindMimeFromData to find MIME if moniker doesn' t report it.

Alexandre Julliard julliard at winehq.org
Tue Dec 29 09:06:42 CST 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Dec 28 21:19:29 2009 +0100

mshtml: Use FindMimeFromData to find MIME if moniker doesn't report it.

---

 dlls/mshtml/navigate.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index e17d48d..7cfc10e 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -952,6 +952,21 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
                && (BYTE)This->nsstream->buf[1] == 0xfe)
                 This->nschannel->charset = heap_strdupA(UTF16_STR);
 
+            if(!This->nschannel->content_type) {
+                WCHAR *mime;
+
+                hres = FindMimeFromData(NULL, NULL, This->nsstream->buf, This->nsstream->buf_size, NULL, 0, &mime, 0);
+                if(FAILED(hres))
+                    return hres;
+
+                TRACE("Found MIME %s\n", debugstr_w(mime));
+
+                This->nschannel->content_type = heap_strdupWtoA(mime);
+                CoTaskMemFree(mime);
+                if(!This->nschannel->content_type)
+                    return E_OUTOFMEMORY;
+            }
+
             on_start_nsrequest(This);
 
             if(This->window)




More information about the wine-cvs mailing list