Commit 38d6ffdb authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

urlmon/tests: Use CRT allocation functions.

parent fdbd8cf0
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "urlmon.h" #include "urlmon.h"
#include "initguid.h" #include "initguid.h"
#include "wine/heap.h"
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B); DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
...@@ -1497,7 +1496,7 @@ static void test_user_agent(void) ...@@ -1497,7 +1496,7 @@ static void test_user_agent(void)
ok(hres == E_OUTOFMEMORY, "ObtainUserAgentString failed: %08lx\n", hres); ok(hres == E_OUTOFMEMORY, "ObtainUserAgentString failed: %08lx\n", hres);
ok(size > 0, "size=%ld, expected non-zero\n", size); ok(size > 0, "size=%ld, expected non-zero\n", size);
str2 = HeapAlloc(GetProcessHeap(), 0, (size+20)*sizeof(CHAR)); str2 = malloc(size + 20);
saved = size; saved = size;
hres = pObtainUserAgentString(0, str2, &size); hres = pObtainUserAgentString(0, str2, &size);
ok(hres == S_OK, "ObtainUserAgentString failed: %08lx\n", hres); ok(hres == S_OK, "ObtainUserAgentString failed: %08lx\n", hres);
...@@ -1681,7 +1680,7 @@ static void test_user_agent(void) ...@@ -1681,7 +1680,7 @@ static void test_user_agent(void)
hres = UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, NULL, 0, 0); hres = UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, NULL, 0, 0);
ok(hres == E_INVALIDARG, "UrlMkSetSessionOption failed: %08lx\n", hres); ok(hres == E_INVALIDARG, "UrlMkSetSessionOption failed: %08lx\n", hres);
HeapFree(GetProcessHeap(), 0, str2); free(str2);
} }
static void test_MkParseDisplayNameEx(void) static void test_MkParseDisplayNameEx(void)
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define CONST_VTABLE #define CONST_VTABLE
#include <wine/test.h> #include <wine/test.h>
#include <wine/heap.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
...@@ -2331,7 +2330,7 @@ static ULONG WINAPI ProtocolUnk_Release(IUnknown *iface) ...@@ -2331,7 +2330,7 @@ static ULONG WINAPI ProtocolUnk_Release(IUnknown *iface)
if(This->outer_ref) if(This->outer_ref)
trace("outer_ref %ld\n", This->outer_ref); trace("outer_ref %ld\n", This->outer_ref);
CHECK_EXPECT(Protocol_destructor); CHECK_EXPECT(Protocol_destructor);
heap_free(This); free(This);
} }
return ref; return ref;
} }
...@@ -2643,7 +2642,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown ...@@ -2643,7 +2642,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
} }
} }
ret = heap_alloc(sizeof(*ret)); ret = malloc(sizeof(*ret));
ret->IUnknown_inner.lpVtbl = &ProtocolUnkVtbl; ret->IUnknown_inner.lpVtbl = &ProtocolUnkVtbl;
ret->IInternetProtocolEx_iface.lpVtbl = &ProtocolVtbl; ret->IInternetProtocolEx_iface.lpVtbl = &ProtocolVtbl;
ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl; ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl;
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "urlmon.h" #include "urlmon.h"
#include "initguid.h" #include "initguid.h"
#include <wine/heap.h>
#define URLZONE_CUSTOM URLZONE_USER_MIN+1 #define URLZONE_CUSTOM URLZONE_USER_MIN+1
#define URLZONE_CUSTOM2 URLZONE_CUSTOM+1 #define URLZONE_CUSTOM2 URLZONE_CUSTOM+1
...@@ -201,7 +200,7 @@ static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey) ...@@ -201,7 +200,7 @@ static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
if (dwMaxLen > ARRAY_SIZE(szNameBuf)) if (dwMaxLen > ARRAY_SIZE(szNameBuf))
{ {
/* Name too big: alloc a buffer for it */ /* Name too big: alloc a buffer for it */
if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR)))) if (!(lpszName = malloc(dwMaxLen)))
{ {
ret = ERROR_NOT_ENOUGH_MEMORY; ret = ERROR_NOT_ENOUGH_MEMORY;
goto cleanup; goto cleanup;
...@@ -235,7 +234,7 @@ static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey) ...@@ -235,7 +234,7 @@ static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
cleanup: cleanup:
/* Free buffer if allocated */ /* Free buffer if allocated */
if (lpszName != szNameBuf) if (lpszName != szNameBuf)
heap_free(lpszName); free(lpszName);
if(lpszSubKey) if(lpszSubKey)
RegCloseKey(hSubKey); RegCloseKey(hSubKey);
return ret; return ret;
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "wininet.h" #include "wininet.h"
#include "strsafe.h" #include "strsafe.h"
#include "initguid.h" #include "initguid.h"
#include <wine/heap.h>
DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C); DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
...@@ -7740,7 +7739,7 @@ static inline LPWSTR a2w(LPCSTR str) { ...@@ -7740,7 +7739,7 @@ static inline LPWSTR a2w(LPCSTR str) {
if(str) { if(str) {
DWORD len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); DWORD len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); ret = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, str, -1, ret, len); MultiByteToWideChar(CP_UTF8, 0, str, -1, ret, len);
} }
...@@ -7750,7 +7749,7 @@ static inline LPWSTR a2w(LPCSTR str) { ...@@ -7750,7 +7749,7 @@ static inline LPWSTR a2w(LPCSTR str) {
static inline DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB) { static inline DWORD strcmp_aw(LPCSTR strA, LPCWSTR strB) {
LPWSTR strAW = a2w(strA); LPWSTR strAW = a2w(strA);
DWORD ret = lstrcmpW(strAW, strB); DWORD ret = lstrcmpW(strAW, strB);
heap_free(strAW); free(strAW);
return ret; return ret;
} }
...@@ -7826,7 +7825,7 @@ static void change_property(IUriBuilder *builder, const uri_builder_property *pr ...@@ -7826,7 +7825,7 @@ static void change_property(IUriBuilder *builder, const uri_builder_property *pr
trace("Unsupported operation for %d on uri_builder_tests[%ld].\n", prop->property, test_index); trace("Unsupported operation for %d on uri_builder_tests[%ld].\n", prop->property, test_index);
} }
heap_free(valueW); free(valueW);
} }
/* /*
...@@ -7888,7 +7887,7 @@ static void test_CreateUri_InvalidUri(void) { ...@@ -7888,7 +7887,7 @@ static void test_CreateUri_InvalidUri(void) {
hr, E_INVALIDARG, i); hr, E_INVALIDARG, i);
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -7964,7 +7963,7 @@ static void test_IUri_GetPropertyBSTR(void) { ...@@ -7964,7 +7963,7 @@ static void test_IUri_GetPropertyBSTR(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8018,7 +8017,7 @@ static void test_IUri_GetPropertyDWORD(void) { ...@@ -8018,7 +8017,7 @@ static void test_IUri_GetPropertyDWORD(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8280,7 +8279,7 @@ static void test_IUri_GetStrProperties(void) { ...@@ -8280,7 +8279,7 @@ static void test_IUri_GetStrProperties(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8369,7 +8368,7 @@ static void test_IUri_GetDwordProperties(void) { ...@@ -8369,7 +8368,7 @@ static void test_IUri_GetDwordProperties(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8416,7 +8415,7 @@ static void test_IUri_GetPropertyLength(void) { ...@@ -8416,7 +8415,7 @@ static void test_IUri_GetPropertyLength(void) {
/* Value may be unicode encoded */ /* Value may be unicode encoded */
expectedValueW = a2w(prop.value); expectedValueW = a2w(prop.value);
expectedLen = lstrlenW(expectedValueW); expectedLen = lstrlenW(expectedValueW);
heap_free(expectedValueW); free(expectedValueW);
/* This won't be necessary once GetPropertyLength is implemented. */ /* This won't be necessary once GetPropertyLength is implemented. */
receivedLen = -1; receivedLen = -1;
...@@ -8436,7 +8435,7 @@ static void test_IUri_GetPropertyLength(void) { ...@@ -8436,7 +8435,7 @@ static void test_IUri_GetPropertyLength(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8509,7 +8508,7 @@ static void test_IUri_GetProperties(void) { ...@@ -8509,7 +8508,7 @@ static void test_IUri_GetProperties(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8562,7 +8561,7 @@ static void test_IUri_HasProperty(void) { ...@@ -8562,7 +8561,7 @@ static void test_IUri_HasProperty(void) {
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -8855,8 +8854,8 @@ static void test_IUri_IsEqual(void) { ...@@ -8855,8 +8854,8 @@ static void test_IUri_IsEqual(void) {
if(uriA) IUri_Release(uriA); if(uriA) IUri_Release(uriA);
if(uriB) IUri_Release(uriB); if(uriB) IUri_Release(uriB);
heap_free(uriA_W); free(uriA_W);
heap_free(uriB_W); free(uriB_W);
} }
} }
...@@ -8927,8 +8926,8 @@ static void test_CreateUriWithFragment(void) { ...@@ -8927,8 +8926,8 @@ static void test_CreateUriWithFragment(void) {
} }
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
heap_free(fragW); free(fragW);
} }
} }
...@@ -10142,7 +10141,7 @@ static void test_IUriBuilder(void) { ...@@ -10142,7 +10141,7 @@ static void test_IUriBuilder(void) {
} }
if(builder) IUriBuilder_Release(builder); if(builder) IUriBuilder_Release(builder);
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -10469,7 +10468,7 @@ static void test_IUriBuilder_RemoveProperties(void) { ...@@ -10469,7 +10468,7 @@ static void test_IUriBuilder_RemoveProperties(void) {
if(builder) IUriBuilder_Release(builder); if(builder) IUriBuilder_Release(builder);
} }
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -10676,10 +10675,10 @@ static void test_CoInternetCombineIUri(void) { ...@@ -10676,10 +10675,10 @@ static void test_CoInternetCombineIUri(void) {
if(result) IUri_Release(result); if(result) IUri_Release(result);
} }
if(relative) IUri_Release(relative); if(relative) IUri_Release(relative);
heap_free(relativeW); free(relativeW);
} }
if(base) IUri_Release(base); if(base) IUri_Release(base);
heap_free(baseW); free(baseW);
} }
} }
...@@ -10963,10 +10962,10 @@ static void test_CoInternetCombineUrlEx(void) { ...@@ -10963,10 +10962,10 @@ static void test_CoInternetCombineUrlEx(void) {
} }
} }
if(result) IUri_Release(result); if(result) IUri_Release(result);
heap_free(relativeW); free(relativeW);
} }
if(base) IUri_Release(base); if(base) IUri_Release(base);
heap_free(baseW); free(baseW);
} }
} }
...@@ -11067,13 +11066,13 @@ static void test_CoInternetParseIUri_InvalidArgs(void) { ...@@ -11067,13 +11066,13 @@ static void test_CoInternetParseIUri_InvalidArgs(void) {
/* a long url that causes a crash on Wine */ /* a long url that causes a crash on Wine */
len = INTERNET_MAX_URL_LENGTH*2; len = INTERNET_MAX_URL_LENGTH*2;
longurl = heap_alloc((len+1)*sizeof(WCHAR)); longurl = malloc((len + 1) * sizeof(WCHAR));
memcpy(longurl, http_urlW, sizeof(http_urlW)); memcpy(longurl, http_urlW, sizeof(http_urlW));
for(i = ARRAY_SIZE(http_urlW)-1; i < len; i++) for(i = ARRAY_SIZE(http_urlW)-1; i < len; i++)
longurl[i] = 'x'; longurl[i] = 'x';
longurl[len] = 0; longurl[len] = 0;
copy = heap_alloc((len+1)*sizeof(WCHAR)); copy = malloc((len + 1) * sizeof(WCHAR));
memcpy(copy, longurl, (len+1)*sizeof(WCHAR)); memcpy(copy, longurl, (len+1)*sizeof(WCHAR));
hr = pCreateUri(longurl, 0, 0, &uri); hr = pCreateUri(longurl, 0, 0, &uri);
...@@ -11088,8 +11087,8 @@ static void test_CoInternetParseIUri_InvalidArgs(void) { ...@@ -11088,8 +11087,8 @@ static void test_CoInternetParseIUri_InvalidArgs(void) {
ok(result == len, "Error: Expected 'result' to be %ld, but was %ld instead.\n", ok(result == len, "Error: Expected 'result' to be %ld, but was %ld instead.\n",
len, result); len, result);
} }
heap_free(longurl); free(longurl);
heap_free(copy); free(copy);
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
} }
...@@ -11129,7 +11128,7 @@ static void test_CoInternetParseIUri(void) { ...@@ -11129,7 +11128,7 @@ static void test_CoInternetParseIUri(void) {
} }
} }
if(uri) IUri_Release(uri); if(uri) IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
...@@ -11355,8 +11354,8 @@ static void test_CreateURLMoniker(void) ...@@ -11355,8 +11354,8 @@ static void test_CreateURLMoniker(void)
IMoniker_Release(mon); IMoniker_Release(mon);
IUri_Release(uri); IUri_Release(uri);
heap_free(url); free(url);
heap_free(base_url); free(base_url);
if(base_uri) if(base_uri)
IUri_Release(base_uri); IUri_Release(base_uri);
if(base_mon) if(base_mon)
...@@ -11606,7 +11605,7 @@ static void test_IPersistStream(void) ...@@ -11606,7 +11605,7 @@ static void test_IPersistStream(void)
IMarshal_Release(marshal); IMarshal_Release(marshal);
IStream_Release(stream); IStream_Release(stream);
IUri_Release(uri); IUri_Release(uri);
heap_free(uriW); free(uriW);
} }
} }
......
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