Commit 201ed085 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

rpcss: Use CRT memory allocation functions.

parent 7918bfc5
......@@ -57,7 +57,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry)
I_RpcFree(entry->endpoint);
I_RpcFree(entry->address);
list_remove(&entry->entry);
HeapFree(GetProcessHeap(), 0, entry);
free(entry);
}
static struct registered_ept_entry *find_ept_entry(
......@@ -106,7 +106,7 @@ void __cdecl ept_insert(handle_t h,
for (i = 0; i < num_ents; i++)
{
struct registered_ept_entry *entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
struct registered_ept_entry *entry = malloc(sizeof(*entry));
if (!entry)
{
/* FIXME: cleanup code to delete added entries */
......@@ -121,7 +121,7 @@ void __cdecl ept_insert(handle_t h,
{
WINE_WARN("TowerExplode failed %lu\n", rpc_status);
*status = rpc_status;
HeapFree(GetProcessHeap(), 0, entry);
free(entry);
break; /* FIXME: more cleanup? */
}
......
......@@ -61,10 +61,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry)
{
if (!InterlockedDecrement(&rot_entry->refs))
{
HeapFree(GetProcessHeap(), 0, rot_entry->object);
HeapFree(GetProcessHeap(), 0, rot_entry->moniker);
HeapFree(GetProcessHeap(), 0, rot_entry->moniker_data);
HeapFree(GetProcessHeap(), 0, rot_entry);
free(rot_entry->object);
free(rot_entry->moniker);
free(rot_entry->moniker_data);
free(rot_entry);
}
}
......@@ -88,12 +88,11 @@ HRESULT __cdecl IrotRegister(
return E_INVALIDARG;
}
rot_entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*rot_entry));
if (!rot_entry)
if (!(rot_entry = calloc(1, sizeof(*rot_entry))))
return E_OUTOFMEMORY;
rot_entry->refs = 1;
rot_entry->object = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
rot_entry->object = malloc(FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
if (!rot_entry->object)
{
rot_entry_release(rot_entry);
......@@ -104,7 +103,7 @@ HRESULT __cdecl IrotRegister(
rot_entry->last_modified = *time;
rot_entry->moniker = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
rot_entry->moniker = malloc(FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
if (!rot_entry->moniker)
{
rot_entry_release(rot_entry);
......@@ -113,8 +112,7 @@ HRESULT __cdecl IrotRegister(
rot_entry->moniker->ulCntData = mk->ulCntData;
memcpy(&rot_entry->moniker->abData, mk->abData, mk->ulCntData);
rot_entry->moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]));
if (!rot_entry->moniker_data)
if (!(rot_entry->moniker_data = malloc(FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]))))
{
rot_entry_release(rot_entry);
return E_OUTOFMEMORY;
......@@ -370,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle)
void * __RPC_USER MIDL_user_allocate(SIZE_T size)
{
return HeapAlloc(GetProcessHeap(), 0, size);
return malloc(size);
}
void __RPC_USER MIDL_user_free(void * p)
{
HeapFree(GetProcessHeap(), 0, p);
free(p);
}
......@@ -31,7 +31,6 @@
#include "irpcss.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
......@@ -58,14 +57,14 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
struct registered_class *entry;
static LONG next_cookie;
if (!(entry = heap_alloc_zero(sizeof(*entry))))
if (!(entry = calloc(1, sizeof(*entry))))
return E_OUTOFMEMORY;
entry->clsid = *clsid;
entry->single_use = !(flags & (REGCLS_MULTIPLEUSE | REGCLS_MULTI_SEPARATE));
if (!(entry->object = heap_alloc(FIELD_OFFSET(MInterfacePointer, abData[object->ulCntData]))))
if (!(entry->object = malloc(FIELD_OFFSET(MInterfacePointer, abData[object->ulCntData]))))
{
heap_free(entry);
free(entry);
return E_OUTOFMEMORY;
}
entry->object->ulCntData = object->ulCntData;
......@@ -82,8 +81,8 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
static void scm_revoke_class(struct registered_class *_class)
{
list_remove(&_class->entry);
heap_free(_class->object);
heap_free(_class);
free(_class->object);
free(_class);
}
HRESULT __cdecl irpcss_server_revoke(handle_t h, unsigned int cookie)
......
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