Jacek Caban : mshtml: Use IUri in use_gecko_script.

Alexandre Julliard julliard at winehq.org
Mon Nov 14 13:33:56 CST 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov 10 14:35:50 2011 +0100

mshtml: Use IUri in use_gecko_script.

---

 dlls/mshtml/persist.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index 2ad108d..ef80f8d 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -32,6 +32,9 @@
 #include "shlguid.h"
 #include "idispids.h"
 
+#define NO_SHLWAPI_REG
+#include "shlwapi.h"
+
 #include "wine/debug.h"
 
 #include "mshtml_private.h"
@@ -50,11 +53,9 @@ typedef struct {
 
 static BOOL use_gecko_script(HTMLWindow *window)
 {
-    DWORD zone;
+    DWORD zone, scheme;
     HRESULT hres;
 
-    static const WCHAR aboutW[] = {'a','b','o','u','t',':'};
-
     hres = IInternetSecurityManager_MapUrlToZone(window->secmgr, window->url, &zone, 0);
     if(FAILED(hres)) {
         WARN("Could not map %s to zone: %08x\n", debugstr_w(window->url), hres);
@@ -62,8 +63,11 @@ static BOOL use_gecko_script(HTMLWindow *window)
     }
 
     TRACE("zone %d\n", zone);
-    return zone != URLZONE_LOCAL_MACHINE && zone != URLZONE_TRUSTED
-        && strncmpiW(aboutW, window->url, sizeof(aboutW)/sizeof(WCHAR));
+    if(zone == URLZONE_LOCAL_MACHINE || zone == URLZONE_TRUSTED || !window->uri)
+        return FALSE;
+
+    hres = IUri_GetScheme(window->uri, &scheme);
+    return FAILED(hres) || scheme != URL_SCHEME_ABOUT;
 }
 
 void set_current_mon(HTMLWindow *This, IMoniker *mon)




More information about the wine-cvs mailing list