Commit 197c2409 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

oleaut32/tests: Workaround use after free warnings.

parent c8d6f212
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
DEFINE_GUID(UUID_test_struct, 0x4029f190, 0xca4a, 0x4611, 0xae,0xb9,0x67,0x39,0x83,0xcb,0x96,0xdd); DEFINE_GUID(UUID_test_struct, 0x4029f190, 0xca4a, 0x4611, 0xae,0xb9,0x67,0x39,0x83,0xcb,0x96,0xdd);
static void (WINAPI *pSysFreeString)(BSTR);
/* Some Visual C++ versions choke on __uint64 to float conversions. /* Some Visual C++ versions choke on __uint64 to float conversions.
* To fix this you need either VC++ 6.0 plus the processor pack * To fix this you need either VC++ 6.0 plus the processor pack
* or Visual C++ >=7.0. * or Visual C++ >=7.0.
...@@ -5843,9 +5845,9 @@ static void test_bstr_cache(void) ...@@ -5843,9 +5845,9 @@ static void test_bstr_cache(void)
str = SysAllocString(testW); str = SysAllocString(testW);
/* This should put the string into cache */ /* This should put the string into cache */
SysFreeString(str); pSysFreeString(str);
/* The string is in cache, this won't touch it */ /* The string is in cache, this won't touch it */
SysFreeString(str); pSysFreeString(str);
ok(SysStringLen(str) == 4, "unexpected len\n"); ok(SysStringLen(str) == 4, "unexpected len\n");
ok(!lstrcmpW(str, testW), "string changed\n"); ok(!lstrcmpW(str, testW), "string changed\n");
...@@ -5874,8 +5876,8 @@ static void test_bstr_cache(void) ...@@ -5874,8 +5876,8 @@ static void test_bstr_cache(void)
str2 = SysAllocStringLen(NULL, 16); str2 = SysAllocStringLen(NULL, 16);
ok(str2 == strs[1], "str2 != strs[1]\n"); ok(str2 == strs[1], "str2 != strs[1]\n");
SysFreeString(str); pSysFreeString(str);
SysFreeString(str2); pSysFreeString(str2);
SysFreeString(str); SysFreeString(str);
SysFreeString(str2); SysFreeString(str2);
} }
...@@ -6047,6 +6049,7 @@ static void test_recinfo(void) ...@@ -6047,6 +6049,7 @@ static void test_recinfo(void)
START_TEST(vartype) START_TEST(vartype)
{ {
hOleaut32 = GetModuleHandleA("oleaut32.dll"); hOleaut32 = GetModuleHandleA("oleaut32.dll");
pSysFreeString = (void *)GetProcAddress(hOleaut32, "SysFreeString");
has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL; has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL;
has_locales = has_i8 && GetProcAddress(hOleaut32, "GetVarConversionLocaleSetting") != NULL; has_locales = has_i8 && GetProcAddress(hOleaut32, "GetVarConversionLocaleSetting") != NULL;
......
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