Module: wine Branch: master Commit: e8b8a80b3cbafded6110cd8b555d6c5daeede7c5 URL: https://gitlab.winehq.org/wine/wine/-/commit/e8b8a80b3cbafded6110cd8b555d6c5...
Author: Alex Henrie alexhenrie24@gmail.com Date: Mon Aug 21 21:21:56 2023 -0600
activeds: Use CRT allocation functions.
---
dlls/activeds/activeds_main.c | 19 +++++-------------- dlls/activeds/pathname.c | 9 ++++----- 2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/dlls/activeds/activeds_main.c b/dlls/activeds/activeds_main.c index e04485b4e36..0f13a5629b6 100644 --- a/dlls/activeds/activeds_main.c +++ b/dlls/activeds/activeds_main.c @@ -233,7 +233,7 @@ HRESULT WINAPI ADsGetLastError(LPDWORD perror, LPWSTR errorbuf, DWORD errorbufle */ LPVOID WINAPI AllocADsMem(DWORD cb) { - return HeapAlloc(GetProcessHeap(), 0, cb); + return malloc(cb); }
/***************************************************** @@ -241,7 +241,8 @@ LPVOID WINAPI AllocADsMem(DWORD cb) */ BOOL WINAPI FreeADsMem(LPVOID pMem) { - return HeapFree(GetProcessHeap(), 0, pMem); + free(pMem); + return TRUE; }
/***************************************************** @@ -249,7 +250,7 @@ BOOL WINAPI FreeADsMem(LPVOID pMem) */ LPVOID WINAPI ReallocADsMem(LPVOID pOldMem, DWORD cbOld, DWORD cbNew) { - return HeapReAlloc(GetProcessHeap(), 0, pOldMem, cbNew); + return realloc(pOldMem, cbNew); }
/***************************************************** @@ -257,18 +258,8 @@ LPVOID WINAPI ReallocADsMem(LPVOID pOldMem, DWORD cbOld, DWORD cbNew) */ LPWSTR WINAPI AllocADsStr(LPWSTR pStr) { - LPWSTR ret; - SIZE_T len; - TRACE("(%p)\n", pStr); - - if (!pStr) return NULL; - - len = (wcslen(pStr) + 1) * sizeof(WCHAR); - ret = AllocADsMem(len); - if (ret) memcpy(ret, pStr, len); - - return ret; + return wcsdup(pStr); }
/***************************************************** diff --git a/dlls/activeds/pathname.c b/dlls/activeds/pathname.c index 05db9bc8071..8142e47e244 100644 --- a/dlls/activeds/pathname.c +++ b/dlls/activeds/pathname.c @@ -28,7 +28,6 @@ #include "iads.h" #include "adserr.h"
-#include "wine/heap.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(activeds); @@ -84,7 +83,7 @@ static ULONG WINAPI path_Release(IADsPathname *iface) SysFreeString(path->provider); SysFreeString(path->server); SysFreeString(path->dn); - heap_free(path); + free(path); }
return ref; @@ -416,7 +415,7 @@ static HRESULT Pathname_create(REFIID riid, void **obj) Pathname *path; HRESULT hr;
- path = heap_alloc(sizeof(*path)); + path = malloc(sizeof(*path)); if (!path) return E_OUTOFMEMORY;
path->IADsPathname_iface.lpVtbl = &IADsPathname_vtbl; @@ -489,7 +488,7 @@ static ULONG WINAPI factory_Release(IClassFactory *iface) TRACE("(%p) ref %lu\n", iface, ref);
if (!ref) - heap_free(factory); + free(factory);
return ref; } @@ -528,7 +527,7 @@ static HRESULT factory_constructor(const struct class_info *info, REFIID riid, v class_factory *factory; HRESULT hr;
- factory = heap_alloc(sizeof(*factory)); + factory = malloc(sizeof(*factory)); if (!factory) return E_OUTOFMEMORY;
factory->IClassFactory_iface.lpVtbl = &factory_vtbl;