1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

taskschd: Use CRT functions for remaining heap allocations.

This commit is contained in:
Rémi Bernon 2022-12-01 15:00:12 +01:00 committed by Alexandre Julliard
parent ede777d11d
commit 9f29812504
3 changed files with 19 additions and 21 deletions

View File

@ -58,8 +58,8 @@ static ULONG WINAPI TaskFolder_Release(ITaskFolder *iface)
if (!ref)
{
TRACE("destroying %p\n", iface);
heap_free(folder->path);
heap_free(folder);
free(folder->path);
free(folder);
}
return ref;
@ -211,7 +211,7 @@ WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path)
if (parent) len += lstrlenW(parent);
/* +1 if parent is not '\' terminated */
folder_path = heap_alloc((len + 2) * sizeof(WCHAR));
folder_path = malloc((len + 2) * sizeof(WCHAR));
if (!folder_path) return NULL;
folder_path[0] = 0;
@ -253,7 +253,7 @@ static HRESULT WINAPI TaskFolder_DeleteFolder(ITaskFolder *iface, BSTR name, LON
if (!folder_path) return E_OUTOFMEMORY;
hr = SchRpcDelete(folder_path, 0);
heap_free(folder_path);
free(folder_path);
return hr;
}
@ -304,7 +304,7 @@ static HRESULT WINAPI TaskFolder_DeleteTask(ITaskFolder *iface, BSTR name, LONG
if (!folder_path) return E_OUTOFMEMORY;
hr = SchRpcDelete(folder_path, 0);
heap_free(folder_path);
free(folder_path);
return hr;
}
@ -448,14 +448,14 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
if (FAILED(hr))
{
heap_free(folder_path);
free(folder_path);
return hr;
}
folder = heap_alloc(sizeof(*folder));
folder = malloc(sizeof(*folder));
if (!folder)
{
heap_free(folder_path);
free(folder_path);
return E_OUTOFMEMORY;
}

View File

@ -310,7 +310,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger)
{
DailyTrigger *daily_trigger;
daily_trigger = heap_alloc(sizeof(*daily_trigger));
daily_trigger = malloc(sizeof(*daily_trigger));
if (!daily_trigger)
return E_OUTOFMEMORY;
@ -809,7 +809,7 @@ static HRESULT RegistrationInfo_create(IRegistrationInfo **obj)
{
registration_info *reginfo;
reginfo = heap_alloc_zero(sizeof(*reginfo));
reginfo = calloc(1, sizeof(*reginfo));
if (!reginfo) return E_OUTOFMEMORY;
reginfo->IRegistrationInfo_iface.lpVtbl = &RegistrationInfo_vtbl;
@ -1442,7 +1442,7 @@ static HRESULT TaskSettings_create(ITaskSettings **obj)
{
TaskSettings *taskset;
taskset = heap_alloc(sizeof(*taskset));
taskset = malloc(sizeof(*taskset));
if (!taskset) return E_OUTOFMEMORY;
taskset->ITaskSettings_iface.lpVtbl = &TaskSettings_vtbl;
@ -1650,7 +1650,7 @@ static HRESULT Principal_create(IPrincipal **obj)
{
Principal *principal;
principal = heap_alloc(sizeof(*principal));
principal = malloc(sizeof(*principal));
if (!principal) return E_OUTOFMEMORY;
principal->IPrincipal_iface.lpVtbl = &Principal_vtbl;
@ -1897,7 +1897,7 @@ static HRESULT ExecAction_create(IExecAction **obj)
{
ExecAction *action;
action = heap_alloc(sizeof(*action));
action = malloc(sizeof(*action));
if (!action) return E_OUTOFMEMORY;
action->IExecAction_iface.lpVtbl = &Action_vtbl;
@ -2086,7 +2086,7 @@ static HRESULT Actions_create(IActionCollection **obj)
{
Actions *actions;
actions = heap_alloc(sizeof(*actions));
actions = malloc(sizeof(*actions));
if (!actions) return E_OUTOFMEMORY;
actions->IActionCollection_iface.lpVtbl = &Actions_vtbl;
@ -2242,7 +2242,7 @@ static HRESULT WINAPI TaskDefinition_get_Triggers(ITaskDefinition *iface, ITrigg
{
trigger_collection *collection;
collection = heap_alloc(sizeof(*collection));
collection = malloc(sizeof(*collection));
if (!collection) return E_OUTOFMEMORY;
collection->ITriggerCollection_iface.lpVtbl = &TriggerCollection_vtbl;
@ -3668,7 +3668,7 @@ HRESULT TaskDefinition_create(ITaskDefinition **obj)
{
TaskDefinition *taskdef;
taskdef = heap_alloc_zero(sizeof(*taskdef));
taskdef = calloc(1, sizeof(*taskdef));
if (!taskdef) return E_OUTOFMEMORY;
taskdef->ITaskDefinition_iface.lpVtbl = &TaskDefinition_vtbl;
@ -3998,7 +3998,7 @@ HRESULT TaskService_create(void **obj)
{
TaskService *task_svc;
task_svc = heap_alloc(sizeof(*task_svc));
task_svc = malloc(sizeof(*task_svc));
if (!task_svc) return E_OUTOFMEMORY;
task_svc->ITaskService_iface.lpVtbl = &TaskService_vtbl;
@ -4013,10 +4013,10 @@ HRESULT TaskService_create(void **obj)
void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n)
{
return HeapAlloc(GetProcessHeap(), 0, n);
return malloc(n);
}
void __RPC_USER MIDL_user_free(void __RPC_FAR *p)
{
HeapFree(GetProcessHeap(), 0, p);
free(p);
}

View File

@ -19,8 +19,6 @@
#ifndef __WINE_TASKSCHD_PRIVATE_H__
#define __WINE_TASKSCHD_PRIVATE_H__
#include "wine/heap.h"
HRESULT TaskService_create(void **obj) DECLSPEC_HIDDEN;
HRESULT TaskDefinition_create(ITaskDefinition **obj) DECLSPEC_HIDDEN;
HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **obj, BOOL create) DECLSPEC_HIDDEN;