diff --git a/dlls/advapi32/tests/crypt.c b/dlls/advapi32/tests/crypt.c index 01cc922b57..def6c82c7f 100644 --- a/dlls/advapi32/tests/crypt.c +++ b/dlls/advapi32/tests/crypt.c @@ -70,39 +70,36 @@ static void init_function_pointers(void) { hadvapi32 = GetModuleHandleA("advapi32.dll"); - if(hadvapi32) - { - pCryptAcquireContextA = (void*)GetProcAddress(hadvapi32, "CryptAcquireContextA"); - pCryptEnumProviderTypesA = (void*)GetProcAddress(hadvapi32, "CryptEnumProviderTypesA"); - pCryptEnumProvidersA = (void*)GetProcAddress(hadvapi32, "CryptEnumProvidersA"); - pCryptGetDefaultProviderA = (void*)GetProcAddress(hadvapi32, "CryptGetDefaultProviderA"); - pCryptReleaseContext = (void*)GetProcAddress(hadvapi32, "CryptReleaseContext"); - pCryptSetProviderExA = (void*)GetProcAddress(hadvapi32, "CryptSetProviderExA"); - pCryptCreateHash = (void*)GetProcAddress(hadvapi32, "CryptCreateHash"); - pCryptDestroyHash = (void*)GetProcAddress(hadvapi32, "CryptDestroyHash"); - pCryptGenRandom = (void*)GetProcAddress(hadvapi32, "CryptGenRandom"); - pCryptContextAddRef = (void*)GetProcAddress(hadvapi32, "CryptContextAddRef"); - pCryptGenKey = (void*)GetProcAddress(hadvapi32, "CryptGenKey"); - pCryptDestroyKey = (void*)GetProcAddress(hadvapi32, "CryptDestroyKey"); - pCryptDecrypt = (void*)GetProcAddress(hadvapi32, "CryptDecrypt"); - pCryptDeriveKey = (void*)GetProcAddress(hadvapi32, "CryptDeriveKey"); - pCryptDuplicateHash = (void*)GetProcAddress(hadvapi32, "CryptDuplicateHash"); - pCryptDuplicateKey = (void*)GetProcAddress(hadvapi32, "CryptDuplicateKey"); - pCryptEncrypt = (void*)GetProcAddress(hadvapi32, "CryptEncrypt"); - pCryptExportKey = (void*)GetProcAddress(hadvapi32, "CryptExportKey"); - pCryptGetHashParam = (void*)GetProcAddress(hadvapi32, "CryptGetHashParam"); - pCryptGetKeyParam = (void*)GetProcAddress(hadvapi32, "CryptGetKeyParam"); - pCryptGetProvParam = (void*)GetProcAddress(hadvapi32, "CryptGetProvParam"); - pCryptGetUserKey = (void*)GetProcAddress(hadvapi32, "CryptGetUserKey"); - pCryptHashData = (void*)GetProcAddress(hadvapi32, "CryptHashData"); - pCryptHashSessionKey = (void*)GetProcAddress(hadvapi32, "CryptHashSessionKey"); - pCryptImportKey = (void*)GetProcAddress(hadvapi32, "CryptImportKey"); - pCryptSignHashW = (void*)GetProcAddress(hadvapi32, "CryptSignHashW"); - pCryptSetHashParam = (void*)GetProcAddress(hadvapi32, "CryptSetHashParam"); - pCryptSetKeyParam = (void*)GetProcAddress(hadvapi32, "CryptSetKeyParam"); - pCryptSetProvParam = (void*)GetProcAddress(hadvapi32, "CryptSetProvParam"); - pCryptVerifySignatureW = (void*)GetProcAddress(hadvapi32, "CryptVerifySignatureW"); - } + pCryptAcquireContextA = (void*)GetProcAddress(hadvapi32, "CryptAcquireContextA"); + pCryptEnumProviderTypesA = (void*)GetProcAddress(hadvapi32, "CryptEnumProviderTypesA"); + pCryptEnumProvidersA = (void*)GetProcAddress(hadvapi32, "CryptEnumProvidersA"); + pCryptGetDefaultProviderA = (void*)GetProcAddress(hadvapi32, "CryptGetDefaultProviderA"); + pCryptReleaseContext = (void*)GetProcAddress(hadvapi32, "CryptReleaseContext"); + pCryptSetProviderExA = (void*)GetProcAddress(hadvapi32, "CryptSetProviderExA"); + pCryptCreateHash = (void*)GetProcAddress(hadvapi32, "CryptCreateHash"); + pCryptDestroyHash = (void*)GetProcAddress(hadvapi32, "CryptDestroyHash"); + pCryptGenRandom = (void*)GetProcAddress(hadvapi32, "CryptGenRandom"); + pCryptContextAddRef = (void*)GetProcAddress(hadvapi32, "CryptContextAddRef"); + pCryptGenKey = (void*)GetProcAddress(hadvapi32, "CryptGenKey"); + pCryptDestroyKey = (void*)GetProcAddress(hadvapi32, "CryptDestroyKey"); + pCryptDecrypt = (void*)GetProcAddress(hadvapi32, "CryptDecrypt"); + pCryptDeriveKey = (void*)GetProcAddress(hadvapi32, "CryptDeriveKey"); + pCryptDuplicateHash = (void*)GetProcAddress(hadvapi32, "CryptDuplicateHash"); + pCryptDuplicateKey = (void*)GetProcAddress(hadvapi32, "CryptDuplicateKey"); + pCryptEncrypt = (void*)GetProcAddress(hadvapi32, "CryptEncrypt"); + pCryptExportKey = (void*)GetProcAddress(hadvapi32, "CryptExportKey"); + pCryptGetHashParam = (void*)GetProcAddress(hadvapi32, "CryptGetHashParam"); + pCryptGetKeyParam = (void*)GetProcAddress(hadvapi32, "CryptGetKeyParam"); + pCryptGetProvParam = (void*)GetProcAddress(hadvapi32, "CryptGetProvParam"); + pCryptGetUserKey = (void*)GetProcAddress(hadvapi32, "CryptGetUserKey"); + pCryptHashData = (void*)GetProcAddress(hadvapi32, "CryptHashData"); + pCryptHashSessionKey = (void*)GetProcAddress(hadvapi32, "CryptHashSessionKey"); + pCryptImportKey = (void*)GetProcAddress(hadvapi32, "CryptImportKey"); + pCryptSignHashW = (void*)GetProcAddress(hadvapi32, "CryptSignHashW"); + pCryptSetHashParam = (void*)GetProcAddress(hadvapi32, "CryptSetHashParam"); + pCryptSetKeyParam = (void*)GetProcAddress(hadvapi32, "CryptSetKeyParam"); + pCryptSetProvParam = (void*)GetProcAddress(hadvapi32, "CryptSetProvParam"); + pCryptVerifySignatureW = (void*)GetProcAddress(hadvapi32, "CryptVerifySignatureW"); } static void init_environment(void) diff --git a/dlls/advapi32/tests/crypt_md5.c b/dlls/advapi32/tests/crypt_md5.c index e6c1d63292..23d7d6bdca 100644 --- a/dlls/advapi32/tests/crypt_md5.c +++ b/dlls/advapi32/tests/crypt_md5.c @@ -77,7 +77,7 @@ static void test_md5_ctx(void) { 0x43, 0x03, 0xdd, 0x8c, 0x60, 0xd9, 0x3a, 0x22, 0x0b, 0x28, 0xd0, 0xb2, 0x65, 0x93, 0xd0, 0x36 }; - if (!(module = GetModuleHandleA( "advapi32.dll" ))) return; + module = GetModuleHandleA("advapi32.dll"); pMD5Init = (fnMD5Init)GetProcAddress( module, "MD5Init" ); pMD5Update = (fnMD5Update)GetProcAddress( module, "MD5Update" ); diff --git a/dlls/advapi32/tests/lsa.c b/dlls/advapi32/tests/lsa.c index 8502e17e36..49c61bbf79 100644 --- a/dlls/advapi32/tests/lsa.c +++ b/dlls/advapi32/tests/lsa.c @@ -45,16 +45,14 @@ static BOOL init(void) { hadvapi32 = GetModuleHandle("advapi32.dll"); - if (hadvapi32) { - pLsaClose = (void*)GetProcAddress(hadvapi32, "LsaClose"); - pLsaFreeMemory = (void*)GetProcAddress(hadvapi32, "LsaFreeMemory"); - pLsaOpenPolicy = (void*)GetProcAddress(hadvapi32, "LsaOpenPolicy"); - pLsaQueryInformationPolicy = (void*)GetProcAddress(hadvapi32, "LsaQueryInformationPolicy"); - pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); + pLsaClose = (void*)GetProcAddress(hadvapi32, "LsaClose"); + pLsaFreeMemory = (void*)GetProcAddress(hadvapi32, "LsaFreeMemory"); + pLsaOpenPolicy = (void*)GetProcAddress(hadvapi32, "LsaOpenPolicy"); + pLsaQueryInformationPolicy = (void*)GetProcAddress(hadvapi32, "LsaQueryInformationPolicy"); + pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); - if (pLsaClose && pLsaFreeMemory && pLsaOpenPolicy && pLsaQueryInformationPolicy && pConvertSidToStringSidA) - return TRUE; - } + if (pLsaClose && pLsaFreeMemory && pLsaOpenPolicy && pLsaQueryInformationPolicy && pConvertSidToStringSidA) + return TRUE; return FALSE; } diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index dd986b16cc..ab7fc4b127 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -672,15 +672,18 @@ static void test_AccessCheck(void) DWORD err; NtDllModule = GetModuleHandle("ntdll.dll"); - if (!NtDllModule) { - trace("not running on NT, skipping test\n"); + skip("not running on NT, skipping test\n"); return; } pRtlAdjustPrivilege = (fnRtlAdjustPrivilege) GetProcAddress(NtDllModule, "RtlAdjustPrivilege"); - if (!pRtlAdjustPrivilege) return; + if (!pRtlAdjustPrivilege) + { + skip("missing RtlAdjustPrivilege, skipping test\n"); + return; + } Acl = HeapAlloc(GetProcessHeap(), 0, 256); res = InitializeAcl(Acl, 256, ACL_REVISION); diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index 8940e4aa19..062f6f625a 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -450,12 +450,6 @@ START_TEST(dpa) hcomctl32 = GetModuleHandleA("comctl32.dll"); - if(!hcomctl32) - { - ok(0, "error=%d\n", GetLastError()); - return; - } - if(InitFunctionPtrs(hcomctl32)) test_dpa(); else diff --git a/dlls/comctl32/tests/mru.c b/dlls/comctl32/tests/mru.c index 182f10bba0..f2e78a0bb0 100644 --- a/dlls/comctl32/tests/mru.c +++ b/dlls/comctl32/tests/mru.c @@ -288,8 +288,6 @@ static void test_MRUListA(void) START_TEST(mru) { hComctl32 = GetModuleHandleA("comctl32.dll"); - if (!hComctl32) - return; delete_reg_entries(); if (!create_reg_entries()) diff --git a/dlls/crypt32/tests/crl.c b/dlls/crypt32/tests/crl.c index b281715e0d..d47be6df6a 100644 --- a/dlls/crypt32/tests/crl.c +++ b/dlls/crypt32/tests/crl.c @@ -81,11 +81,7 @@ static BOOL (WINAPI *pCertIsValidCRLForCertificate)(PCCERT_CONTEXT, PCCRL_CONTEX static void init_function_pointers(void) { HMODULE hdll = GetModuleHandleA("crypt32.dll"); - - if(hdll) - { - pCertIsValidCRLForCertificate = (void*)GetProcAddress(hdll, "CertIsValidCRLForCertificate"); - } + pCertIsValidCRLForCertificate = (void*)GetProcAddress(hdll, "CertIsValidCRLForCertificate"); } static void testCreateCRL(void) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 7237ff3a0d..299fae8a47 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -53,11 +53,7 @@ typedef struct _TVERTEX static void init_function_pointers(void) { HMODULE hmod = GetModuleHandleA("ddraw.dll"); - - if(hmod) - { - pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx"); - } + pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx"); } diff --git a/dlls/ddraw/tests/refcount.c b/dlls/ddraw/tests/refcount.c index 916e8f53e3..9da30ecd2c 100644 --- a/dlls/ddraw/tests/refcount.c +++ b/dlls/ddraw/tests/refcount.c @@ -30,11 +30,7 @@ static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN); static void init_function_pointers(void) { HMODULE hmod = GetModuleHandleA("ddraw.dll"); - - if(hmod) - { - pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx"); - } + pDirectDrawCreateEx = (void*)GetProcAddress(hmod, "DirectDrawCreateEx"); } static unsigned long getRefcount(IUnknown *iface) diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index ee1dc5cc3f..b22659b5c9 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -87,16 +87,12 @@ static IsValidLanguageGroupFn pIsValidLanguageGroup; static void InitFunctionPointers(void) { hKernel32 = GetModuleHandleA("kernel32"); - - if (hKernel32) - { - pEnumSystemLanguageGroupsA = (void*)GetProcAddress(hKernel32, "EnumSystemLanguageGroupsA"); - pEnumLanguageGroupLocalesA = (void*)GetProcAddress(hKernel32, "EnumLanguageGroupLocalesA"); - pFoldStringA = (void*)GetProcAddress(hKernel32, "FoldStringA"); - pFoldStringW = (void*)GetProcAddress(hKernel32, "FoldStringW"); - pIsValidLanguageGroup = (void*)GetProcAddress(hKernel32, "IsValidLanguageGroup"); - pEnumUILanguagesA = (void*)GetProcAddress(hKernel32, "EnumUILanguagesA"); - } + pEnumSystemLanguageGroupsA = (void*)GetProcAddress(hKernel32, "EnumSystemLanguageGroupsA"); + pEnumLanguageGroupLocalesA = (void*)GetProcAddress(hKernel32, "EnumLanguageGroupLocalesA"); + pFoldStringA = (void*)GetProcAddress(hKernel32, "FoldStringA"); + pFoldStringW = (void*)GetProcAddress(hKernel32, "FoldStringW"); + pIsValidLanguageGroup = (void*)GetProcAddress(hKernel32, "IsValidLanguageGroup"); + pEnumUILanguagesA = (void*)GetProcAddress(hKernel32, "EnumUILanguagesA"); } #define eq(received, expected, label, type) \ diff --git a/dlls/localspl/tests/localmon.c b/dlls/localspl/tests/localmon.c index a8ace2322e..a89f0dab7a 100644 --- a/dlls/localspl/tests/localmon.c +++ b/dlls/localspl/tests/localmon.c @@ -395,7 +395,7 @@ static void test_XcvDataPort_AddPort(void) */ if (0) { - /* create a Port for a normal, writeable file */ + /* create a Port for a normal, writable file */ SetLastError(0xdeadbeef); res = pXcvDataPort(hXcv, cmd_AddPortW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, NULL); diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 8a7585fbe3..dc5e42d0b0 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -431,8 +431,6 @@ static void test_msidecomposedesc(void) HMODULE hmod; hmod = GetModuleHandle("msi.dll"); - if (!hmod) - return; pMsiDecomposeDescriptorA = (fnMsiDecomposeDescriptorA) GetProcAddress(hmod, "MsiDecomposeDescriptorA"); if (!pMsiDecomposeDescriptorA) diff --git a/dlls/ntdll/tests/change.c b/dlls/ntdll/tests/change.c index 3a3ffa28f9..d3ba58fc1c 100644 --- a/dlls/ntdll/tests/change.c +++ b/dlls/ntdll/tests/change.c @@ -316,16 +316,22 @@ static void test_ntncdf_async(void) START_TEST(change) { HMODULE hntdll = GetModuleHandle("ntdll"); + if (!hntdll) + { + skip("not running on NT, skipping test\n"); + return; + } pNtNotifyChangeDirectoryFile = (fnNtNotifyChangeDirectoryFile) GetProcAddress(hntdll, "NtNotifyChangeDirectoryFile"); pNtCancelIoFile = (fnNtCancelIoFile) GetProcAddress(hntdll, "NtCancelIoFile"); - if (!pNtNotifyChangeDirectoryFile) - return; - if (!pNtCancelIoFile) + if (!pNtNotifyChangeDirectoryFile || !pNtCancelIoFile) + { + skip("missing functions, skipping test\n"); return; + } test_ntncdf(); test_ntncdf_async(); diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index ee49b93a2b..921135aec2 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -130,14 +130,16 @@ static void nt_mailslot_test(void) START_TEST(file) { HMODULE hntdll = GetModuleHandleA("ntdll.dll"); - - if (hntdll) + if (!hntdll) { - pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); - pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); - pNtCreateMailslotFile = (void *)GetProcAddress(hntdll, "NtCreateMailslotFile"); - pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); - - nt_mailslot_test(); + skip("not running on NT, skipping test\n"); + return; } + + pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); + pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); + pNtCreateMailslotFile = (void *)GetProcAddress(hntdll, "NtCreateMailslotFile"); + pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); + + nt_mailslot_test(); } diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index 1e89cf2c56..41471e5e10 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -541,29 +541,32 @@ static void test_symboliclink(void) START_TEST(om) { HMODULE hntdll = GetModuleHandleA("ntdll.dll"); - if (hntdll) + if (!hntdll) { - pRtlCreateUnicodeStringFromAsciiz = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeStringFromAsciiz"); - pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); - pNtCreateEvent = (void *)GetProcAddress(hntdll, "NtCreateEvent"); - pNtCreateMutant = (void *)GetProcAddress(hntdll, "NtCreateMutant"); - pNtOpenMutant = (void *)GetProcAddress(hntdll, "NtOpenMutant"); - pNtOpenFile = (void *)GetProcAddress(hntdll, "NtOpenFile"); - pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); - pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); - pNtCreateNamedPipeFile = (void *)GetProcAddress(hntdll, "NtCreateNamedPipeFile"); - pNtOpenDirectoryObject = (void *)GetProcAddress(hntdll, "NtOpenDirectoryObject"); - pNtCreateDirectoryObject= (void *)GetProcAddress(hntdll, "NtCreateDirectoryObject"); - pNtOpenSymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtOpenSymbolicLinkObject"); - pNtCreateSymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtCreateSymbolicLinkObject"); - pNtCreateSemaphore = (void *)GetProcAddress(hntdll, "NtCreateSemaphore"); - pNtCreateTimer = (void *)GetProcAddress(hntdll, "NtCreateTimer"); - pNtCreateSection = (void *)GetProcAddress(hntdll, "NtCreateSection"); - - test_case_sensitive(); - test_namespace_pipe(); - test_name_collisions(); - test_directory(); - test_symboliclink(); + skip("not running on NT, skipping test\n"); + return; } + + pRtlCreateUnicodeStringFromAsciiz = (void *)GetProcAddress(hntdll, "RtlCreateUnicodeStringFromAsciiz"); + pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); + pNtCreateEvent = (void *)GetProcAddress(hntdll, "NtCreateEvent"); + pNtCreateMutant = (void *)GetProcAddress(hntdll, "NtCreateMutant"); + pNtOpenMutant = (void *)GetProcAddress(hntdll, "NtOpenMutant"); + pNtOpenFile = (void *)GetProcAddress(hntdll, "NtOpenFile"); + pNtClose = (void *)GetProcAddress(hntdll, "NtClose"); + pRtlInitUnicodeString = (void *)GetProcAddress(hntdll, "RtlInitUnicodeString"); + pNtCreateNamedPipeFile = (void *)GetProcAddress(hntdll, "NtCreateNamedPipeFile"); + pNtOpenDirectoryObject = (void *)GetProcAddress(hntdll, "NtOpenDirectoryObject"); + pNtCreateDirectoryObject= (void *)GetProcAddress(hntdll, "NtCreateDirectoryObject"); + pNtOpenSymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtOpenSymbolicLinkObject"); + pNtCreateSymbolicLinkObject = (void *)GetProcAddress(hntdll, "NtCreateSymbolicLinkObject"); + pNtCreateSemaphore = (void *)GetProcAddress(hntdll, "NtCreateSemaphore"); + pNtCreateTimer = (void *)GetProcAddress(hntdll, "NtCreateTimer"); + pNtCreateSection = (void *)GetProcAddress(hntdll, "NtCreateSection"); + + test_case_sensitive(); + test_namespace_pipe(); + test_name_collisions(); + test_directory(); + test_symboliclink(); } diff --git a/dlls/ole32/tests/stg_prop.c b/dlls/ole32/tests/stg_prop.c index 06a4b2b847..5a007e4810 100644 --- a/dlls/ole32/tests/stg_prop.c +++ b/dlls/ole32/tests/stg_prop.c @@ -31,13 +31,9 @@ static HRESULT (WINAPI *pStgCreatePropSetStg)(IStorage *, DWORD, IPropertySetSto static void init_function_pointers(void) { HMODULE hmod = GetModuleHandleA("ole32.dll"); - - if(hmod) - { - pFmtIdToPropStgName = (void*)GetProcAddress(hmod, "FmtIdToPropStgName"); - pPropStgNameToFmtId = (void*)GetProcAddress(hmod, "PropStgNameToFmtId"); - pStgCreatePropSetStg = (void*)GetProcAddress(hmod, "StgCreatePropSetStg"); - } + pFmtIdToPropStgName = (void*)GetProcAddress(hmod, "FmtIdToPropStgName"); + pPropStgNameToFmtId = (void*)GetProcAddress(hmod, "PropStgNameToFmtId"); + pStgCreatePropSetStg = (void*)GetProcAddress(hmod, "StgCreatePropSetStg"); } /* FIXME: this creates an ANSI storage, try to find conditions under which * Unicode translation fails diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index ad710de423..1f2f0f7b6c 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -40,9 +40,7 @@ static int (WINAPI *pSHCreateDirectoryExA)(HWND, LPCSTR, LPSECURITY_ATTRIBUTES); static void InitFunctionPointers(void) { hshell32 = GetModuleHandleA("shell32.dll"); - - if(hshell32) - pSHCreateDirectoryExA = (void*)GetProcAddress(hshell32, "SHCreateDirectoryExA"); + pSHCreateDirectoryExA = (void*)GetProcAddress(hshell32, "SHCreateDirectoryExA"); } /* creates a file with the specified name for tests */ diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 97430eec67..0cf398a11a 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -55,20 +55,14 @@ static void init_function_pointers(void) HRESULT hr; hmod = GetModuleHandleA("shell32.dll"); - if(hmod) - { - pSHBindToParent = (void*)GetProcAddress(hmod, "SHBindToParent"); - pSHGetSpecialFolderPathW = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathW"); - pILFindLastID = (void *)GetProcAddress(hmod, (LPCSTR)16); - pILFree = (void*)GetProcAddress(hmod, (LPSTR)155); - pILIsEqual = (void*)GetProcAddress(hmod, (LPSTR)21); - } + pSHBindToParent = (void*)GetProcAddress(hmod, "SHBindToParent"); + pSHGetSpecialFolderPathW = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathW"); + pILFindLastID = (void *)GetProcAddress(hmod, (LPCSTR)16); + pILFree = (void*)GetProcAddress(hmod, (LPSTR)155); + pILIsEqual = (void*)GetProcAddress(hmod, (LPSTR)21); hmod = GetModuleHandleA("shlwapi.dll"); - if(hmod) - { - pStrRetToBufW = (void*)GetProcAddress(hmod, "StrRetToBufW"); - } + pStrRetToBufW = (void*)GetProcAddress(hmod, "StrRetToBufW"); hr = SHGetMalloc(&ppM); ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr); diff --git a/dlls/shlwapi/tests/shreg.c b/dlls/shlwapi/tests/shreg.c index ff921a36c2..079873b4a2 100644 --- a/dlls/shlwapi/tests/shreg.c +++ b/dlls/shlwapi/tests/shreg.c @@ -381,11 +381,8 @@ START_TEST(shreg) if (!hkey) return; hshlwapi = GetModuleHandleA("shlwapi.dll"); - if (hshlwapi) - { - pSHCopyKeyA=(SHCopyKeyA_func)GetProcAddress(hshlwapi,"SHCopyKeyA"); - pSHRegGetPathA=(SHRegGetPathA_func)GetProcAddress(hshlwapi,"SHRegGetPathA"); - } + pSHCopyKeyA=(SHCopyKeyA_func)GetProcAddress(hshlwapi,"SHCopyKeyA"); + pSHRegGetPathA=(SHRegGetPathA_func)GetProcAddress(hshlwapi,"SHRegGetPathA"); test_SHGetValue(); test_SHQUeryValueEx(); test_SHGetRegPath(); diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index 7f14e69fae..c868e1e01d 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -829,8 +829,6 @@ START_TEST(string) GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimalDelim, 8); hShlwapi = GetModuleHandleA("shlwapi"); - if (!hShlwapi) - return; test_StrChrA(); test_StrChrW(); diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index cc4326b492..94eedee6e9 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -218,9 +218,12 @@ static void do_test( HWND hwnd, int seqnr, const KEV td[] ) int kmctr, i; module = GetModuleHandleA("user32"); - if (!module) return; ptr_SendInput = (void *)GetProcAddress(module, "SendInput"); - if (!ptr_SendInput) return; + if (!ptr_SendInput) + { + skip("skipping SendInput tests\n"); + return; + } buf[0]='\0'; TrackSysKey=0; /* see input.c */ diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index edb881a529..58225b4ec5 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -33,15 +33,11 @@ static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD); static void init_function_pointers(void) { hdll = GetModuleHandleA("user32.dll"); - - if(hdll) - { - pEnumDisplayDevicesA = (void*)GetProcAddress(hdll, "EnumDisplayDevicesA"); - pEnumDisplayMonitors = (void*)GetProcAddress(hdll, "EnumDisplayMonitors"); - pGetMonitorInfoA = (void*)GetProcAddress(hdll, "GetMonitorInfoA"); - pMonitorFromPoint = (void*)GetProcAddress(hdll, "MonitorFromPoint"); - pMonitorFromWindow = (void*)GetProcAddress(hdll, "MonitorFromWindow"); - } + pEnumDisplayDevicesA = (void*)GetProcAddress(hdll, "EnumDisplayDevicesA"); + pEnumDisplayMonitors = (void*)GetProcAddress(hdll, "EnumDisplayMonitors"); + pGetMonitorInfoA = (void*)GetProcAddress(hdll, "GetMonitorInfoA"); + pMonitorFromPoint = (void*)GetProcAddress(hdll, "MonitorFromPoint"); + pMonitorFromWindow = (void*)GetProcAddress(hdll, "MonitorFromWindow"); } static BOOL CALLBACK monitor_enum_proc(HMONITOR hmon, HDC hdc, LPRECT lprc, diff --git a/dlls/user32/tests/resource.c b/dlls/user32/tests/resource.c index 38f1b2bc61..59f86ef56b 100644 --- a/dlls/user32/tests/resource.c +++ b/dlls/user32/tests/resource.c @@ -28,9 +28,7 @@ static UINT (WINAPI *pPrivateExtractIconsA)(LPCTSTR, int, int, int, HICON *, UIN static void init_function_pointers(void) { HMODULE hmod = GetModuleHandleA("user32.dll"); - if (hmod) { - pPrivateExtractIconsA = (void*)GetProcAddress(hmod, "PrivateExtractIconsA"); - } + pPrivateExtractIconsA = (void*)GetProcAddress(hmod, "PrivateExtractIconsA"); } static void test_LoadStringA (void)