Commit 46f1330e authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

msi/tests: Only use functions if they are implemented.

parent 3272fef9
...@@ -41,9 +41,17 @@ static void init_functionpointers(void) ...@@ -41,9 +41,17 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
pMsiSourceListGetInfoA = (void*)GetProcAddress(hmsi, "MsiSourceListGetInfoA"); #define GET_PROC(dll, func) \
pMsiSourceListAddSourceExA = (void*)GetProcAddress(hmsi, "MsiSourceListAddSourceExA"); p ## func = (void *)GetProcAddress(dll, #func); \
pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC(hmsi, MsiSourceListAddSourceExA)
GET_PROC(hmsi, MsiSourceListGetInfoA)
GET_PROC(hadvapi32, ConvertSidToStringSidA)
#undef GET_PROC
} }
/* copied from dlls/msi/registry.c */ /* copied from dlls/msi/registry.c */
...@@ -125,6 +133,12 @@ static void test_MsiSourceListGetInfo(void) ...@@ -125,6 +133,12 @@ static void test_MsiSourceListGetInfo(void)
HKEY userkey, hkey; HKEY userkey, hkey;
DWORD size; DWORD size;
if (!pMsiSourceListGetInfoA)
{
skip("Skipping MsiSourceListGetInfoA tests\n");
return;
}
create_test_guid(prodcode, prod_squashed); create_test_guid(prodcode, prod_squashed);
get_user_sid(&usersid); get_user_sid(&usersid);
...@@ -348,7 +362,7 @@ static void test_MsiSourceListAddSourceEx(void) ...@@ -348,7 +362,7 @@ static void test_MsiSourceListAddSourceEx(void)
if (!pMsiSourceListAddSourceExA) if (!pMsiSourceListAddSourceExA)
{ {
skip("Skipping MsiSourceListAddSourceEx tests\n"); skip("Skipping MsiSourceListAddSourceExA tests\n");
return; return;
} }
......
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