Commit e8b8a80b authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

activeds: Use CRT allocation functions.

parent e09dde5c
......@@ -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);
}
/*****************************************************
......
......@@ -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;
......
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