Module: wine Branch: master Commit: dcc049ad4c5eae2ca892cb48352010a41ea82ea4 URL: https://gitlab.winehq.org/wine/wine/-/commit/dcc049ad4c5eae2ca892cb48352010a...
Author: Alex Henrie alexhenrie24@gmail.com Date: Thu Aug 17 20:56:25 2023 -0600
oledb32: Use CRT allocation functions.
---
dlls/oledb32/convert.c | 5 ++--- dlls/oledb32/dslocator.c | 9 ++++----- dlls/oledb32/errorinfo.c | 11 +++++------ dlls/oledb32/tests/marshal.c | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c index e634db237f0..540ceac1d2d 100644 --- a/dlls/oledb32/convert.c +++ b/dlls/oledb32/convert.c @@ -31,7 +31,6 @@ #include "oledb_private.h"
#include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(oledb);
@@ -102,7 +101,7 @@ static ULONG WINAPI convert_Release(IDataConvert* iface)
ref = InterlockedDecrement(&This->ref); if(ref == 0) - heap_free(This); + free(This);
return ref; } @@ -1705,7 +1704,7 @@ HRESULT create_oledb_convert(IUnknown *outer, void **obj)
if(outer) return CLASS_E_NOAGGREGATION;
- This = heap_alloc(sizeof(*This)); + This = malloc(sizeof(*This)); if(!This) return E_OUTOFMEMORY;
This->IDataConvert_iface.lpVtbl = &convert_vtbl; diff --git a/dlls/oledb32/dslocator.c b/dlls/oledb32/dslocator.c index 5746b51d55c..6991be65f65 100644 --- a/dlls/oledb32/dslocator.c +++ b/dlls/oledb32/dslocator.c @@ -35,7 +35,6 @@ #include "resource.h"
#include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(oledb);
@@ -49,7 +48,7 @@ struct datasource
static struct datasource *create_datasource(WCHAR *guid) { - struct datasource *data = heap_alloc_zero(sizeof(struct datasource)); + struct datasource *data = calloc(1, sizeof(struct datasource)); if (data) { CLSIDFromString(guid, &data->clsid); @@ -75,7 +74,7 @@ static void destroy_datasource(struct datasource *data) if (data->provider) IDBProperties_Release(data->provider);
- heap_free(data); + free(data); }
static BOOL initialize_datasource(struct datasource *data) @@ -191,7 +190,7 @@ static ULONG WINAPI dslocator_Release(IDataSourceLocator *iface)
if (!ref) { - heap_free(This); + free(This); }
return ref; @@ -775,7 +774,7 @@ HRESULT create_dslocator(IUnknown *outer, void **obj)
if(outer) return CLASS_E_NOAGGREGATION;
- This = heap_alloc(sizeof(*This)); + This = malloc(sizeof(*This)); if(!This) return E_OUTOFMEMORY;
This->IDataSourceLocator_iface.lpVtbl = &DSLocatorVtbl; diff --git a/dlls/oledb32/errorinfo.c b/dlls/oledb32/errorinfo.c index 6857caeb368..2a5d53c52ab 100644 --- a/dlls/oledb32/errorinfo.c +++ b/dlls/oledb32/errorinfo.c @@ -31,7 +31,6 @@
#include "oledb_private.h"
-#include "wine/heap.h" #include "wine/list.h"
#include "wine/debug.h" @@ -124,8 +123,8 @@ static ULONG WINAPI errorrecords_Release(IErrorInfo* iface) CoTaskMemFree(dispparams->rgvarg); CoTaskMemFree(dispparams->rgdispidNamedArgs); } - heap_free(This->records); - heap_free(This); + free(This->records); + free(This); } return ref; } @@ -276,7 +275,7 @@ static HRESULT WINAPI errorrec_AddErrorRecord(IErrorRecords *iface, ERRORINFO *p if (!This->records) { const unsigned int initial_size = 16; - if (!(This->records = heap_alloc(initial_size * sizeof(*This->records)))) + if (!(This->records = malloc(initial_size * sizeof(*This->records)))) return E_OUTOFMEMORY;
This->allocated = initial_size; @@ -285,7 +284,7 @@ static HRESULT WINAPI errorrec_AddErrorRecord(IErrorRecords *iface, ERRORINFO *p { struct ErrorEntry *new_ptr;
- new_ptr = heap_realloc(This->records, 2 * This->allocated * sizeof(*This->records)); + new_ptr = realloc(This->records, 2 * This->allocated * sizeof(*This->records)); if (!new_ptr) return E_OUTOFMEMORY;
@@ -419,7 +418,7 @@ HRESULT create_error_info(IUnknown *outer, void **obj)
if(outer) return CLASS_E_NOAGGREGATION;
- This = heap_alloc(sizeof(*This)); + This = malloc(sizeof(*This)); if(!This) return E_OUTOFMEMORY;
This->IErrorInfo_iface.lpVtbl = &ErrorInfoVtbl; diff --git a/dlls/oledb32/tests/marshal.c b/dlls/oledb32/tests/marshal.c index 88af99a0659..758d7b50432 100644 --- a/dlls/oledb32/tests/marshal.c +++ b/dlls/oledb32/tests/marshal.c @@ -81,7 +81,7 @@ static DWORD CALLBACK host_object_proc(LPVOID p) DispatchMessageW(&msg); }
- HeapFree(GetProcessHeap(), 0, data); + free(data);
CoUninitialize();
@@ -92,7 +92,7 @@ static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object, { DWORD tid = 0; HANDLE marshal_event = CreateEventW(NULL, FALSE, FALSE, NULL); - struct host_object_data *data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + struct host_object_data *data = malloc(sizeof(*data));
data->stream = stream; data->iid = *riid;