Commit c0cc85f7 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

setupapi/tests: Use GetModuleHandleA instead of LoadLibraryA.

parent b90c6e27
......@@ -39,14 +39,11 @@ static HKEY (WINAPI *pSetupDiOpenClassRegKeyExA)(GUID*,REGSAM,DWORD,PCSTR,PV
static void init_function_pointers(void)
{
hSetupAPI = LoadLibraryA("setupapi.dll");
hSetupAPI = GetModuleHandleA("setupapi.dll");
if (hSetupAPI)
{
pSetupDiCreateDeviceInfoListExW = (void *)GetProcAddress(hSetupAPI, "SetupDiCreateDeviceInfoListExW");
pSetupDiDestroyDeviceInfoList = (void *)GetProcAddress(hSetupAPI, "SetupDiDestroyDeviceInfoList");
pSetupDiOpenClassRegKeyExA = (void *)GetProcAddress(hSetupAPI, "SetupDiOpenClassRegKeyExA");
}
}
static void test_SetupDiCreateDeviceInfoListEx(void)
......@@ -129,8 +126,6 @@ static void test_SetupDiOpenClassRegKeyExA(void)
START_TEST(devinst)
{
init_function_pointers();
if (!hSetupAPI)
return;
if (pSetupDiCreateDeviceInfoListExW && pSetupDiDestroyDeviceInfoList)
test_SetupDiCreateDeviceInfoListEx();
......
......@@ -36,9 +36,7 @@ static LPCWSTR (WINAPI *pSetupGetField)(PINFCONTEXT,DWORD);
static void init_function_pointers(void)
{
hSetupAPI = LoadLibraryA("setupapi.dll");
if (!hSetupAPI)
return;
hSetupAPI = GetModuleHandleA("setupapi.dll");
pSetupGetField = (void *)GetProcAddress(hSetupAPI, "pSetupGetField");
}
......
......@@ -38,10 +38,8 @@ CHAR WIN_DIR[MAX_PATH];
static void init_function_pointers(void)
{
hSetupAPI = LoadLibraryA("setupapi.dll");
hSetupAPI = GetModuleHandleA("setupapi.dll");
if (hSetupAPI)
{
pSetupCloseInfFile = (void *)GetProcAddress(hSetupAPI, "SetupCloseInfFile");
pSetupGetInfInformationA = (void *)GetProcAddress(hSetupAPI, "SetupGetInfInformationA");
pSetupOpenInfFileA = (void *)GetProcAddress(hSetupAPI, "SetupOpenInfFileA");
......@@ -49,7 +47,6 @@ static void init_function_pointers(void)
pSetupGetSourceFileLocationA = (void *)GetProcAddress(hSetupAPI, "SetupGetSourceFileLocationA");
pSetupGetSourceInfoA = (void *)GetProcAddress(hSetupAPI, "SetupGetSourceInfoA");
pSetupGetTargetPathA = (void *)GetProcAddress(hSetupAPI, "SetupGetTargetPathA");
}
}
static void get_directories(void)
......
......@@ -59,9 +59,7 @@ HANDLE table, table2; /* Handles pointing to our tables */
static void load_it_up(void)
{
hdll = LoadLibraryA("setupapi.dll");
if (!hdll)
return;
hdll = GetModuleHandleA("setupapi.dll");
pStringTableInitialize = (void*)GetProcAddress(hdll, "StringTableInitialize");
if (!pStringTableInitialize)
......@@ -192,6 +190,4 @@ START_TEST(stringtable)
/* assume we can always distroy */
pStringTableDestroy(table);
pStringTableDestroy(table2);
FreeLibrary(hdll);
}
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