Jacek Caban : mshtml: Use mime type reported by moniker if possible.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Jun 3 05:24:45 CDT 2006


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Jun  3 00:48:13 2006 +0200

mshtml: Use mime type reported by moniker if possible.

---

 dlls/mshtml/mshtml_private.h |    1 +
 dlls/mshtml/navigate.c       |   16 ++++++++++++++++
 dlls/mshtml/nsio.c           |    7 +++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 725d041..17e44e6 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -129,6 +129,7 @@ typedef struct {
     nsIInterfaceRequestor *notif_callback;
     nsLoadFlags load_flags;
     nsIURI *original_uri;
+    char *content;
 } nsChannel;
 
 typedef struct {
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 7e38cf3..217b087 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -268,8 +268,24 @@ static HRESULT WINAPI BindStatusCallback
         ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
 {
     BSCallback *This = STATUSCLB_THIS(iface);
+
     TRACE("%p)->(%lu %lu %lu %s)\n", This, ulProgress, ulProgressMax, ulStatusCode,
             debugstr_w(szStatusText));
+
+    switch(ulStatusCode) {
+    case BINDSTATUS_MIMETYPEAVAILABLE: {
+        int len;
+
+        if(!This->nschannel)
+            return S_OK;
+        HeapFree(GetProcessHeap(), 0, This->nschannel->content);
+
+        len = WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, NULL, 0, NULL, NULL);
+        This->nschannel->content = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+        WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, This->nschannel->content, -1, NULL, NULL);
+    }
+    }
+
     return S_OK;
 }
 
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 76f60ba..2a922a3 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -213,6 +213,7 @@ static nsrefcnt NSAPI nsChannel_Release(
             nsIInterfaceRequestor_Release(This->notif_callback);
         if(This->original_uri)
             nsIURI_Release(This->original_uri);
+        HeapFree(GetProcessHeap(), 0, This->content);
         HeapFree(GetProcessHeap(), 0, This);
     }
 
@@ -465,6 +466,11 @@ static nsresult NSAPI nsChannel_GetConte
 
     TRACE("(%p)->(%p)\n", This, aContentType);
 
+    if(This->content) {
+        nsACString_Init(aContentType, This->content);
+        return S_OK;
+    }
+
     if(This->channel)
         return nsIChannel_GetContentType(This->channel, aContentType);
 
@@ -1450,6 +1456,7 @@ static nsresult NSAPI nsIOService_NewCha
     ret->load_group = NULL;
     ret->notif_callback = NULL;
     ret->load_flags = 0;
+    ret->content = NULL;
 
     nsIURI_AddRef(aURI);
     ret->original_uri = aURI;




More information about the wine-cvs mailing list