diff --git a/dlls/oleaut32/tests/usrmarshal.c b/dlls/oleaut32/tests/usrmarshal.c index 4fc26f33c63..92d0da3403b 100644 --- a/dlls/oleaut32/tests/usrmarshal.c +++ b/dlls/oleaut32/tests/usrmarshal.c @@ -36,14 +36,12 @@ # define V_U2(A) (*(A)) #endif -static HRESULT (WINAPI *pSafeArrayGetVartype)(SAFEARRAY*,VARTYPE*); - static inline SF_TYPE get_union_type(SAFEARRAY *psa) { VARTYPE vt; HRESULT hr; - hr = pSafeArrayGetVartype(psa, &vt); + hr = SafeArrayGetVartype(psa, &vt); if (FAILED(hr)) { if(psa->fFeatures & FADF_VARIANT) return SF_VARIANT; @@ -131,10 +129,7 @@ static void check_safearray(void *buffer, LPSAFEARRAY lpsa) return; } - if (!pSafeArrayGetVartype) - return; - - if(FAILED(pSafeArrayGetVartype(lpsa, &vt))) + if(FAILED(SafeArrayGetVartype(lpsa, &vt))) vt = 0; sftype = get_union_type(lpsa); @@ -266,12 +261,9 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserUnmarshal(&umcb.Flags, buffer, &lpsa2); ok(lpsa2 != NULL, "LPSAFEARRAY didn't unmarshal\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(lpsa, &vt); - pSafeArrayGetVartype(lpsa2, &vt2); - ok(vt == vt2, "vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(lpsa, &vt); + SafeArrayGetVartype(lpsa2, &vt2); + ok(vt == vt2, "vts differ %x %x\n", vt, vt2); ok(lpsa2->cLocks == 0, "got lock count %u, expected 0\n", lpsa2->cLocks); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); @@ -313,12 +305,9 @@ static void test_marshal_LPSAFEARRAY(void) init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserUnmarshal(&umcb.Flags, buffer, &lpsa2); ok(lpsa2 != NULL, "LPSAFEARRAY didn't unmarshal\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(lpsa, &vt); - pSafeArrayGetVartype(lpsa2, &vt2); - ok(vt == vt2, "vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(lpsa, &vt); + SafeArrayGetVartype(lpsa2, &vt2); + ok(vt == vt2, "vts differ %x %x\n", vt, vt2); ok(lpsa2->cLocks == 0, "got lock count %u, expected 0\n", lpsa2->cLocks); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); LPSAFEARRAY_UserFree(&umcb.Flags, &lpsa2); @@ -387,12 +376,8 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->rgsabound[0].cElements = 48; hr = SafeArrayAllocData(lpsa); ok(hr == S_OK, "saad failed %08x\n", hr); - - if (pSafeArrayGetVartype) - { - hr = pSafeArrayGetVartype(lpsa, &vt); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); - } + hr = SafeArrayGetVartype(lpsa, &vt); + ok(hr == E_INVALIDARG, "ret %08x\n", hr); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); @@ -496,12 +481,8 @@ static void test_marshal_LPSAFEARRAY(void) lpsa->rgsabound[0].cElements = 48; hr = SafeArrayAllocData(lpsa); ok(hr == S_OK, "saad failed %08x\n", hr); - - if (pSafeArrayGetVartype) - { - hr = pSafeArrayGetVartype(lpsa, &vt); - ok(hr == E_INVALIDARG, "ret %08x\n", hr); - } + hr = SafeArrayGetVartype(lpsa, &vt); + ok(hr == E_INVALIDARG, "ret %08x\n", hr); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); size = LPSAFEARRAY_UserSize(&umcb.Flags, 0, &lpsa); @@ -1321,12 +1302,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(V_ARRAY(&v), 1, &bound); SafeArrayGetUBound(V_ARRAY(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(V_ARRAY(&v), &vt); - pSafeArrayGetVartype(V_ARRAY(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(V_ARRAY(&v), &vt); + SafeArrayGetVartype(V_ARRAY(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); VARIANT_UserFree(&umcb.Flags, &v2); HeapFree(GetProcessHeap(), 0, oldbuffer); @@ -1363,12 +1341,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(*V_ARRAYREF(&v), 1, &bound); SafeArrayGetUBound(*V_ARRAYREF(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(*V_ARRAYREF(&v), &vt); - pSafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(*V_ARRAYREF(&v), &vt); + SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); VARIANT_UserFree(&umcb.Flags, &v2); HeapFree(GetProcessHeap(), 0, oldbuffer); @@ -1413,12 +1388,9 @@ static void test_marshal_VARIANT(void) SafeArrayGetUBound(*V_ARRAYREF(&v), 1, &bound); SafeArrayGetUBound(*V_ARRAYREF(&v2), 1, &bound2); ok(bound == bound2, "array ubounds differ\n"); - if (pSafeArrayGetVartype) - { - pSafeArrayGetVartype(*V_ARRAYREF(&v), &vt); - pSafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); - ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); - } + SafeArrayGetVartype(*V_ARRAYREF(&v), &vt); + SafeArrayGetVartype(*V_ARRAYREF(&v2), &vt2); + ok(vt == vt2, "array vts differ %x %x\n", vt, vt2); lpsa2->fFeatures &= ~FADF_STATIC; hr = SafeArrayDestroy(*V_ARRAYREF(&v2)); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1608,14 +1580,6 @@ todo_wine START_TEST(usrmarshal) { - HANDLE hOleaut32 = GetModuleHandleA("oleaut32.dll"); -#define GETPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func) - GETPTR(SafeArrayGetVartype); -#undef GETPTR - - if (!pSafeArrayGetVartype) - win_skip("SafeArrayGetVartype is not available, some tests will be skipped\n"); - CoInitialize(NULL); test_marshal_LPSAFEARRAY();