Jacek Caban : urlmon: Added special URLACTION_SCRIPT_OVERRIDE_SAFETY handling.

Alexandre Julliard julliard at winehq.org
Fri Mar 14 08:29:39 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Mar 14 12:42:42 2008 +0100

urlmon: Added special URLACTION_SCRIPT_OVERRIDE_SAFETY handling.

---

 dlls/urlmon/sec_mgr.c    |    6 ++++++
 dlls/urlmon/tests/misc.c |   19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index 525a37a..049ed2a 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -176,6 +176,12 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s
     LONG res;
     HRESULT hres;
 
+    switch(action) {
+    case URLACTION_SCRIPT_OVERRIDE_SAFETY:
+        *(DWORD*)policy = URLPOLICY_DISALLOW;
+        return S_OK;
+    }
+
     switch(zone_reg) {
     case URLZONEREG_DEFAULT:
     case URLZONEREG_HKCU:
diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index 77b00ad..96612b0 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -856,6 +856,23 @@ static void test_url_action(IInternetSecurityManager *secmgr, IInternetZoneManag
     }
 }
 
+static void test_special_url_action(IInternetSecurityManager *secmgr, IInternetZoneManager *zonemgr, DWORD action)
+{
+    DWORD policy;
+    HRESULT hres;
+
+    policy = 0xdeadbeef;
+    hres = IInternetZoneManager_GetZoneActionPolicy(zonemgr, 3, action, (BYTE*)&policy,
+            sizeof(DWORD), URLZONEREG_DEFAULT);
+    ok(hres == S_OK, "GetZoneActionPolicy failed: %08x\n", hres);
+    ok(policy == URLPOLICY_DISALLOW, "(%x) policy=%x, expected URLPOLIVY_DISALLOW\n", action, policy);
+
+    policy = 0xdeadbeef;
+    hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url1, action, (BYTE*)&policy,
+            sizeof(WCHAR), NULL, 0, 0, 0);
+    ok(hres == S_FALSE, "ProcessUrlAction(%x) failed: %08x, expected S_FALSE\n", action, hres);
+}
+
 static void test_polices(void)
 {
     IInternetZoneManager *zonemgr = NULL;
@@ -872,6 +889,8 @@ static void test_polices(void)
     test_url_action(secmgr, zonemgr, URLACTION_CHANNEL_SOFTDIST_PERMISSIONS);
     test_url_action(secmgr, zonemgr, 0xdeadbeef);
 
+    test_special_url_action(secmgr, zonemgr, URLACTION_SCRIPT_OVERRIDE_SAFETY);
+
     IInternetSecurityManager_Release(secmgr);
     IInternetZoneManager_Release(zonemgr);
 }




More information about the wine-cvs mailing list