[PATCH 4/8] urlmon/tests: CoInternetGetSession not present on W95B

Detlef Riekenberg wine.dev at web.de
Thu Apr 15 17:20:25 CDT 2010


---
 dlls/urlmon/tests/misc.c     |   27 ++++++++++++++++++++++-----
 dlls/urlmon/tests/protocol.c |   29 ++++++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index f9fe2f5..cd8985f 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -65,6 +65,7 @@ DEFINE_EXPECT(unk_Release);
 
 static HRESULT (WINAPI *pCoInternetCompareUrl)(LPCWSTR, LPCWSTR, DWORD);
 static HRESULT (WINAPI *pCoInternetGetSecurityUrl)(LPCWSTR, LPWSTR*, PSUACTION, DWORD);
+static HRESULT (WINAPI *pCoInternetGetSession)(DWORD, IInternetSession **, DWORD);
 
 static void test_CreateFormatEnum(void)
 {
@@ -749,7 +750,12 @@ static void register_protocols(void)
 
     static const WCHAR wszAbout[] = {'a','b','o','u','t',0};
 
-    hres = CoInternetGetSession(0, &session, 0);
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
+    hres = pCoInternetGetSession(0, &session, 0);
     ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
     if(FAILED(hres))
         return;
@@ -922,7 +928,12 @@ static void test_NameSpace(void)
 
     static const WCHAR wszTest[] = {'t','e','s','t',0};
 
-    hres = CoInternetGetSession(0, &session, 0);
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
+    hres = pCoInternetGetSession(0, &session, 0);
     ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
     if(FAILED(hres))
         return;
@@ -1076,7 +1087,12 @@ static void test_MimeFilter(void)
 
     static const WCHAR mimeW[] = {'t','e','s','t','/','m','i','m','e',0};
 
-    hres = CoInternetGetSession(0, &session, 0);
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
+    hres = pCoInternetGetSession(0, &session, 0);
     ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
     if(FAILED(hres))
         return;
@@ -1416,11 +1432,12 @@ START_TEST(misc)
 
     OleInitialize(NULL);
 
-    register_protocols();
-
     hurlmon = GetModuleHandle("urlmon.dll");
     pCoInternetCompareUrl = (void *) GetProcAddress(hurlmon, "CoInternetCompareUrl");
     pCoInternetGetSecurityUrl = (void*) GetProcAddress(hurlmon, "CoInternetGetSecurityUrl");
+    pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
+
+    register_protocols();
 
     test_CreateFormatEnum();
     test_RegisterFormatEnumerator();
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index d54d00d..341a5c3 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -29,6 +29,8 @@
 #include "urlmon.h"
 #include "wininet.h"
 
+static HRESULT (WINAPI *pCoInternetGetSession)(DWORD, IInternetSession **, DWORD);
+
 #define DEFINE_EXPECT(func) \
     static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
@@ -2775,10 +2777,15 @@ static void test_CreateBinding(void)
         {'t','e','s','t',':','/','/','f','i','l','e','.','h','t','m','l',0};
     static const WCHAR wsz_test[] = {'t','e','s','t',0};
 
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
     trace("Testing CreateBinding...\n");
     init_test(BIND_TEST, TEST_BINDING);
 
-    hres = CoInternetGetSession(0, &session, 0);
+    hres = pCoInternetGetSession(0, &session, 0);
     ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
 
     hres = IInternetSession_RegisterNameSpace(session, &ClassFactory, &IID_NULL, wsz_test, 0, NULL, 0);
@@ -2917,7 +2924,12 @@ static void test_binding(int prot, DWORD grf_pi, DWORD test_flags)
 
     init_test(prot, test_flags|TEST_BINDING);
 
-    hres = CoInternetGetSession(0, &session, 0);
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
+    hres = pCoInternetGetSession(0, &session, 0);
     ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
 
     if(test_flags & TEST_EMULATEPROT) {
@@ -3027,7 +3039,13 @@ static void register_filter(void)
 
     static const WCHAR gzipW[] = {'g','z','i','p',0};
 
-    CoInternetGetSession(0, &session, 0);
+    if (!pCoInternetGetSession) {
+        win_skip("CoInternetGetSession not found\n");
+        return;
+    }
+
+    hres = pCoInternetGetSession(0, &session, 0);
+    ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
 
     hres = IInternetSession_RegisterMimeFilter(session, &mimefilter_cf, &IID_IInternetProtocol, gzipW);
     ok(hres == S_OK, "RegisterMimeFilter failed: %08x\n", hres);
@@ -3037,8 +3055,13 @@ static void register_filter(void)
 
 START_TEST(protocol)
 {
+    HMODULE hurlmon;
+
     OleInitialize(NULL);
 
+    hurlmon = GetModuleHandle("urlmon.dll");
+    pCoInternetGetSession = (void*) GetProcAddress(hurlmon, "CoInternetGetSession");
+
     event_complete = CreateEvent(NULL, FALSE, FALSE, NULL);
     event_complete2 = CreateEvent(NULL, FALSE, FALSE, NULL);
     event_continue = CreateEvent(NULL, FALSE, FALSE, NULL);
-- 
1.7.0.4




More information about the wine-patches mailing list