Jacek Caban : urlmon: Fixed sec_mgr.c tests failing on some recent Windows.

Alexandre Julliard julliard at winehq.org
Tue Mar 18 14:15:06 CDT 2014


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Mar 18 15:51:59 2014 +0100

urlmon: Fixed sec_mgr.c tests failing on some recent Windows.

---

 dlls/urlmon/tests/sec_mgr.c |   36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c
index f952780..91e1a3f 100644
--- a/dlls/urlmon/tests/sec_mgr.c
+++ b/dlls/urlmon/tests/sec_mgr.c
@@ -65,6 +65,11 @@
         expect_ ## func = called_ ## func = FALSE; \
     }while(0)
 
+#define SET_CALLED(func) \
+    do { \
+        expect_ ## func = called_ ## func = FALSE; \
+    }while(0)
+
 DEFINE_EXPECT(ParseUrl_SECURITY_URL_input);
 DEFINE_EXPECT(ParseUrl_SECURITY_URL_input2);
 DEFINE_EXPECT(ParseUrl_SECURITY_URL_expected);
@@ -509,15 +514,26 @@ static void test_url_action(IInternetSecurityManager *secmgr, IInternetZoneManag
      */
     res = RegOpenKeyA(HKEY_CURRENT_USER,
             "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
-    if(res != ERROR_SUCCESS) {
-        ok(0, "Could not open zone key\n");
+    ok(res == ERROR_SUCCESS, "Could not open zone key\n");
+    if(res != ERROR_SUCCESS)
         return;
-    }
 
     wsprintfA(buf, "%X", action);
     size = sizeof(DWORD);
     res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
     RegCloseKey(hkey);
+
+    /* Try settings from HKEY_LOCAL_MACHINE. */
+    if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
+        res = RegOpenKeyA(HKEY_LOCAL_MACHINE,
+                "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey);
+        ok(res == ERROR_SUCCESS, "Could not open zone key\n");
+
+        size = sizeof(DWORD);
+        res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)&reg_policy, &size);
+        RegCloseKey(hkey);
+    }
+
     if(res != ERROR_SUCCESS || size != sizeof(DWORD)) {
         policy = 0xdeadbeef;
         hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy,
@@ -1213,10 +1229,10 @@ static void test_GetZoneAttributes(void)
     ok((pZA->cbSize == 0xffffffff) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)),
         "got cbSize = 0x%x (expected 0xffffffff)\n", pZA->cbSize);
 
-    /* IE8 no longer fail on invalid zones */
+    /* IE8 up to IE10 don't fail on invalid zones */
     memset(buffer, -1, sizeof(buffer));
     hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0xdeadbeef, pZA);
-    ok(hr == S_OK || (hr == E_FAIL),
+    ok(hr == S_OK || hr == E_FAIL || hr == E_POINTER,
         "got 0x%x (expected S_OK or E_FAIL)\n", hr);
 
     hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, NULL);
@@ -1958,6 +1974,16 @@ static void test_CoInternetIsFeatureZoneElevationEnabled(void)
             testcases[i].policy_flags = URLPOLICY_ALLOW;
     }
 
+    /* IE10 does not seem to use passed ISecurityManager */
+    SET_EXPECT(ProcessUrlAction);
+    pCoInternetIsFeatureZoneElevationEnabled(url1, url1, &security_manager, 0);
+    i = called_ProcessUrlAction;
+    SET_CALLED(ProcessUrlAction);
+    if(!i) {
+        skip("CoInternetIsFeatureZoneElevationEnabled does not use passed ISecurityManager\n");
+        return;
+    }
+
     for(i=0; i<sizeof(testcases)/sizeof(testcases[0]); i++) {
         url_from = a2w(testcases[i].url_from);
         url_to = a2w(testcases[i].url_to);




More information about the wine-cvs mailing list