From a839e2ec4572dad3b790f20a925adcab0e4875b9 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 10 Oct 2010 15:11:22 +0200 Subject: [PATCH] shlwapi: Skip more tests on too old shlwapi.dll. --- dlls/shlwapi/tests/clist.c | 13 +++++++++++-- dlls/shlwapi/tests/clsid.c | 7 +++++++ dlls/shlwapi/tests/ordinal.c | 6 ++++++ dlls/shlwapi/tests/path.c | 6 ++++++ dlls/shlwapi/tests/shreg.c | 7 +++++++ 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dlls/shlwapi/tests/clist.c b/dlls/shlwapi/tests/clist.c index 3b979fdec8a..0c1704d5818 100644 --- a/dlls/shlwapi/tests/clist.c +++ b/dlls/shlwapi/tests/clist.c @@ -212,10 +212,16 @@ static HRESULT (WINAPI *pSHLWAPI_213)(_IDummyStream*); static HRESULT (WINAPI *pSHLWAPI_214)(_IDummyStream*,ULARGE_INTEGER*); -static void InitFunctionPtrs(void) +static BOOL InitFunctionPtrs(void) { SHLWAPI_hshlwapi = GetModuleHandleA("shlwapi.dll"); + /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */ + if(!GetProcAddress(SHLWAPI_hshlwapi, "SHCreateStreamOnFileEx")){ + win_skip("Too old shlwapi version\n"); + return FALSE; + } + pSHLWAPI_17 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)17); ok(pSHLWAPI_17 != 0, "No Ordinal 17\n"); pSHLWAPI_18 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)18); @@ -238,6 +244,8 @@ static void InitFunctionPtrs(void) ok(pSHLWAPI_213 != 0, "No Ordinal 213\n"); pSHLWAPI_214 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)214); ok(pSHLWAPI_214 != 0, "No Ordinal 214\n"); + + return TRUE; } static void InitDummyStream(_IDummyStream* iface) @@ -623,7 +631,8 @@ static void test_SHLWAPI_214(void) START_TEST(clist) { - InitFunctionPtrs(); + if(!InitFunctionPtrs()) + return; test_CList(); diff --git a/dlls/shlwapi/tests/clsid.c b/dlls/shlwapi/tests/clsid.c index 85550fc1b08..ed37c795a40 100644 --- a/dlls/shlwapi/tests/clsid.c +++ b/dlls/shlwapi/tests/clsid.c @@ -185,6 +185,13 @@ static void test_CLSIDFromProgIDWrap(void) START_TEST(clsid) { hShlwapi = GetModuleHandleA("shlwapi.dll"); + + /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */ + if(!GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx")){ + win_skip("Too old shlwapi version\n"); + return; + } + pSHLWAPI_269 = (void*)GetProcAddress(hShlwapi, (LPSTR)269); pSHLWAPI_23 = (void*)GetProcAddress(hShlwapi, (LPSTR)23); diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index 7b0203194dd..dfee9bf5e69 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -2770,6 +2770,12 @@ START_TEST(ordinal) is_win2k_and_lower = GetProcAddress(hShlwapi, "StrChrNW") == 0; is_win9x = GetProcAddress(hShlwapi, (LPSTR)99) == 0; /* StrCpyNXA */ + /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */ + if(!GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx")){ + win_skip("Too old shlwapi version\n"); + return; + } + init_pointers(); hmlang = LoadLibraryA("mlang.dll"); diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index 9b4b15e7dc8..e5f5c7c60d0 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -1362,6 +1362,12 @@ START_TEST(path) { HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll"); + /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */ + if(!GetProcAddress(hShlwapi, "SHCreateStreamOnFileEx")){ + win_skip("Too old shlwapi version\n"); + return; + } + pPathCreateFromUrlA = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlA"); pPathCreateFromUrlW = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlW"); pPathCombineW = (void*)GetProcAddress(hShlwapi, "PathCombineW"); diff --git a/dlls/shlwapi/tests/shreg.c b/dlls/shlwapi/tests/shreg.c index 5fb3dacf14f..11ebae9f4d8 100644 --- a/dlls/shlwapi/tests/shreg.c +++ b/dlls/shlwapi/tests/shreg.c @@ -452,6 +452,13 @@ START_TEST(shreg) if (!hkey) return; hshlwapi = GetModuleHandleA("shlwapi.dll"); + + /* SHCreateStreamOnFileEx was introduced in shlwapi v6.0 */ + if(!GetProcAddress(hshlwapi, "SHCreateStreamOnFileEx")){ + win_skip("Too old shlwapi version\n"); + return; + } + pSHCopyKeyA=(SHCopyKeyA_func)GetProcAddress(hshlwapi,"SHCopyKeyA"); pSHRegGetPathA=(SHRegGetPathA_func)GetProcAddress(hshlwapi,"SHRegGetPathA"); pSHRegGetValueA=(SHRegGetValueA_func)GetProcAddress(hshlwapi,"SHRegGetValueA"); -- 2.11.4.GIT