Commit 3de1c55d authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

shlwapi/tests: Use GetModuleHandleA instead of LoadLibraryA.

parent d00d54eb
......@@ -214,33 +214,30 @@ static HRESULT (WINAPI *pSHLWAPI_214)(_IDummyStream*,ULARGE_INTEGER*);
static void InitFunctionPtrs(void)
{
SHLWAPI_hshlwapi = LoadLibraryA("shlwapi.dll");
ok(SHLWAPI_hshlwapi != 0, "LoadLibrary failed\n");
if (SHLWAPI_hshlwapi)
{
pSHLWAPI_17 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)17);
ok(pSHLWAPI_17 != 0, "No Ordinal 17\n");
pSHLWAPI_18 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)18);
ok(pSHLWAPI_18 != 0, "No Ordinal 18\n");
pSHLWAPI_19 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)19);
ok(pSHLWAPI_19 != 0, "No Ordinal 19\n");
pSHLWAPI_20 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)20);
ok(pSHLWAPI_20 != 0, "No Ordinal 20\n");
pSHLWAPI_21 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)21);
ok(pSHLWAPI_21 != 0, "No Ordinal 21\n");
pSHLWAPI_22 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)22);
ok(pSHLWAPI_22 != 0, "No Ordinal 22\n");
pSHLWAPI_166 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)166);
ok(pSHLWAPI_166 != 0, "No Ordinal 166\n");
pSHLWAPI_184 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)184);
ok(pSHLWAPI_184 != 0, "No Ordinal 184\n");
pSHLWAPI_212 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)212);
ok(pSHLWAPI_212 != 0, "No Ordinal 212\n");
pSHLWAPI_213 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)213);
ok(pSHLWAPI_213 != 0, "No Ordinal 213\n");
pSHLWAPI_214 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)214);
ok(pSHLWAPI_214 != 0, "No Ordinal 214\n");
}
SHLWAPI_hshlwapi = GetModuleHandleA("shlwapi.dll");
pSHLWAPI_17 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)17);
ok(pSHLWAPI_17 != 0, "No Ordinal 17\n");
pSHLWAPI_18 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)18);
ok(pSHLWAPI_18 != 0, "No Ordinal 18\n");
pSHLWAPI_19 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)19);
ok(pSHLWAPI_19 != 0, "No Ordinal 19\n");
pSHLWAPI_20 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)20);
ok(pSHLWAPI_20 != 0, "No Ordinal 20\n");
pSHLWAPI_21 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)21);
ok(pSHLWAPI_21 != 0, "No Ordinal 21\n");
pSHLWAPI_22 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)22);
ok(pSHLWAPI_22 != 0, "No Ordinal 22\n");
pSHLWAPI_166 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)166);
ok(pSHLWAPI_166 != 0, "No Ordinal 166\n");
pSHLWAPI_184 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)184);
ok(pSHLWAPI_184 != 0, "No Ordinal 184\n");
pSHLWAPI_212 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)212);
ok(pSHLWAPI_212 != 0, "No Ordinal 212\n");
pSHLWAPI_213 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)213);
ok(pSHLWAPI_213 != 0, "No Ordinal 213\n");
pSHLWAPI_214 = (void *)GetProcAddress( SHLWAPI_hshlwapi, (LPSTR)214);
ok(pSHLWAPI_214 != 0, "No Ordinal 214\n");
}
static void InitDummyStream(_IDummyStream* iface)
......@@ -637,7 +634,4 @@ START_TEST(clist)
test_SHLWAPI_213();
test_SHLWAPI_214();
}
if (SHLWAPI_hshlwapi)
FreeLibrary(SHLWAPI_hshlwapi);
}
......@@ -182,17 +182,10 @@ static void test_CLSIDFromProgIDWrap(void)
START_TEST(clsid)
{
hShlwapi = LoadLibraryA("shlwapi.dll");
ok(hShlwapi != 0, "LoadLibraryA failed\n");
if (hShlwapi)
{
pSHLWAPI_269 = (void*)GetProcAddress(hShlwapi, (LPSTR)269);
pSHLWAPI_23 = (void*)GetProcAddress(hShlwapi, (LPSTR)23);
}
hShlwapi = GetModuleHandleA("shlwapi.dll");
pSHLWAPI_269 = (void*)GetProcAddress(hShlwapi, (LPSTR)269);
pSHLWAPI_23 = (void*)GetProcAddress(hShlwapi, (LPSTR)23);
test_ClassIDs();
test_CLSIDFromProgIDWrap();
if (hShlwapi)
FreeLibrary(hShlwapi);
}
......@@ -433,10 +433,7 @@ static void test_GetShellSecurityDescriptor(void)
START_TEST(ordinal)
{
hShlwapi = LoadLibraryA("shlwapi.dll");
ok(hShlwapi != 0, "LoadLibraryA failed\n");
if (!hShlwapi)
return;
hShlwapi = GetModuleHandleA("shlwapi.dll");
pGetAcceptLanguagesA = (void*)GetProcAddress(hShlwapi, (LPSTR)14);
pSHSearchMapInt = (void*)GetProcAddress(hShlwapi, (LPSTR)198);
......@@ -450,6 +447,4 @@ START_TEST(ordinal)
test_alloc_shared();
test_fdsa();
test_GetShellSecurityDescriptor();
FreeLibrary(hShlwapi);
}
......@@ -1833,8 +1833,7 @@ static void test_PathUnquoteSpaces(void)
START_TEST(path)
{
hShlwapi = LoadLibraryA("shlwapi.dll");
if (!hShlwapi) return;
hShlwapi = GetModuleHandleA("shlwapi.dll");
test_UrlHash();
test_UrlGetPart();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment