Commit 9f298125 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

taskschd: Use CRT functions for remaining heap allocations.

parent ede777d1
...@@ -58,8 +58,8 @@ static ULONG WINAPI TaskFolder_Release(ITaskFolder *iface) ...@@ -58,8 +58,8 @@ static ULONG WINAPI TaskFolder_Release(ITaskFolder *iface)
if (!ref) if (!ref)
{ {
TRACE("destroying %p\n", iface); TRACE("destroying %p\n", iface);
heap_free(folder->path); free(folder->path);
heap_free(folder); free(folder);
} }
return ref; return ref;
...@@ -211,7 +211,7 @@ WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path) ...@@ -211,7 +211,7 @@ WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path)
if (parent) len += lstrlenW(parent); if (parent) len += lstrlenW(parent);
/* +1 if parent is not '\' terminated */ /* +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; if (!folder_path) return NULL;
folder_path[0] = 0; folder_path[0] = 0;
...@@ -253,7 +253,7 @@ static HRESULT WINAPI TaskFolder_DeleteFolder(ITaskFolder *iface, BSTR name, LON ...@@ -253,7 +253,7 @@ static HRESULT WINAPI TaskFolder_DeleteFolder(ITaskFolder *iface, BSTR name, LON
if (!folder_path) return E_OUTOFMEMORY; if (!folder_path) return E_OUTOFMEMORY;
hr = SchRpcDelete(folder_path, 0); hr = SchRpcDelete(folder_path, 0);
heap_free(folder_path); free(folder_path);
return hr; return hr;
} }
...@@ -304,7 +304,7 @@ static HRESULT WINAPI TaskFolder_DeleteTask(ITaskFolder *iface, BSTR name, LONG ...@@ -304,7 +304,7 @@ static HRESULT WINAPI TaskFolder_DeleteTask(ITaskFolder *iface, BSTR name, LONG
if (!folder_path) return E_OUTOFMEMORY; if (!folder_path) return E_OUTOFMEMORY;
hr = SchRpcDelete(folder_path, 0); hr = SchRpcDelete(folder_path, 0);
heap_free(folder_path); free(folder_path);
return hr; return hr;
} }
...@@ -448,14 +448,14 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder ** ...@@ -448,14 +448,14 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
if (FAILED(hr)) if (FAILED(hr))
{ {
heap_free(folder_path); free(folder_path);
return hr; return hr;
} }
folder = heap_alloc(sizeof(*folder)); folder = malloc(sizeof(*folder));
if (!folder) if (!folder)
{ {
heap_free(folder_path); free(folder_path);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
......
...@@ -310,7 +310,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger) ...@@ -310,7 +310,7 @@ static HRESULT DailyTrigger_create(ITrigger **trigger)
{ {
DailyTrigger *daily_trigger; DailyTrigger *daily_trigger;
daily_trigger = heap_alloc(sizeof(*daily_trigger)); daily_trigger = malloc(sizeof(*daily_trigger));
if (!daily_trigger) if (!daily_trigger)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -809,7 +809,7 @@ static HRESULT RegistrationInfo_create(IRegistrationInfo **obj) ...@@ -809,7 +809,7 @@ static HRESULT RegistrationInfo_create(IRegistrationInfo **obj)
{ {
registration_info *reginfo; registration_info *reginfo;
reginfo = heap_alloc_zero(sizeof(*reginfo)); reginfo = calloc(1, sizeof(*reginfo));
if (!reginfo) return E_OUTOFMEMORY; if (!reginfo) return E_OUTOFMEMORY;
reginfo->IRegistrationInfo_iface.lpVtbl = &RegistrationInfo_vtbl; reginfo->IRegistrationInfo_iface.lpVtbl = &RegistrationInfo_vtbl;
...@@ -1442,7 +1442,7 @@ static HRESULT TaskSettings_create(ITaskSettings **obj) ...@@ -1442,7 +1442,7 @@ static HRESULT TaskSettings_create(ITaskSettings **obj)
{ {
TaskSettings *taskset; TaskSettings *taskset;
taskset = heap_alloc(sizeof(*taskset)); taskset = malloc(sizeof(*taskset));
if (!taskset) return E_OUTOFMEMORY; if (!taskset) return E_OUTOFMEMORY;
taskset->ITaskSettings_iface.lpVtbl = &TaskSettings_vtbl; taskset->ITaskSettings_iface.lpVtbl = &TaskSettings_vtbl;
...@@ -1650,7 +1650,7 @@ static HRESULT Principal_create(IPrincipal **obj) ...@@ -1650,7 +1650,7 @@ static HRESULT Principal_create(IPrincipal **obj)
{ {
Principal *principal; Principal *principal;
principal = heap_alloc(sizeof(*principal)); principal = malloc(sizeof(*principal));
if (!principal) return E_OUTOFMEMORY; if (!principal) return E_OUTOFMEMORY;
principal->IPrincipal_iface.lpVtbl = &Principal_vtbl; principal->IPrincipal_iface.lpVtbl = &Principal_vtbl;
...@@ -1897,7 +1897,7 @@ static HRESULT ExecAction_create(IExecAction **obj) ...@@ -1897,7 +1897,7 @@ static HRESULT ExecAction_create(IExecAction **obj)
{ {
ExecAction *action; ExecAction *action;
action = heap_alloc(sizeof(*action)); action = malloc(sizeof(*action));
if (!action) return E_OUTOFMEMORY; if (!action) return E_OUTOFMEMORY;
action->IExecAction_iface.lpVtbl = &Action_vtbl; action->IExecAction_iface.lpVtbl = &Action_vtbl;
...@@ -2086,7 +2086,7 @@ static HRESULT Actions_create(IActionCollection **obj) ...@@ -2086,7 +2086,7 @@ static HRESULT Actions_create(IActionCollection **obj)
{ {
Actions *actions; Actions *actions;
actions = heap_alloc(sizeof(*actions)); actions = malloc(sizeof(*actions));
if (!actions) return E_OUTOFMEMORY; if (!actions) return E_OUTOFMEMORY;
actions->IActionCollection_iface.lpVtbl = &Actions_vtbl; actions->IActionCollection_iface.lpVtbl = &Actions_vtbl;
...@@ -2242,7 +2242,7 @@ static HRESULT WINAPI TaskDefinition_get_Triggers(ITaskDefinition *iface, ITrigg ...@@ -2242,7 +2242,7 @@ static HRESULT WINAPI TaskDefinition_get_Triggers(ITaskDefinition *iface, ITrigg
{ {
trigger_collection *collection; trigger_collection *collection;
collection = heap_alloc(sizeof(*collection)); collection = malloc(sizeof(*collection));
if (!collection) return E_OUTOFMEMORY; if (!collection) return E_OUTOFMEMORY;
collection->ITriggerCollection_iface.lpVtbl = &TriggerCollection_vtbl; collection->ITriggerCollection_iface.lpVtbl = &TriggerCollection_vtbl;
...@@ -3668,7 +3668,7 @@ HRESULT TaskDefinition_create(ITaskDefinition **obj) ...@@ -3668,7 +3668,7 @@ HRESULT TaskDefinition_create(ITaskDefinition **obj)
{ {
TaskDefinition *taskdef; TaskDefinition *taskdef;
taskdef = heap_alloc_zero(sizeof(*taskdef)); taskdef = calloc(1, sizeof(*taskdef));
if (!taskdef) return E_OUTOFMEMORY; if (!taskdef) return E_OUTOFMEMORY;
taskdef->ITaskDefinition_iface.lpVtbl = &TaskDefinition_vtbl; taskdef->ITaskDefinition_iface.lpVtbl = &TaskDefinition_vtbl;
...@@ -3998,7 +3998,7 @@ HRESULT TaskService_create(void **obj) ...@@ -3998,7 +3998,7 @@ HRESULT TaskService_create(void **obj)
{ {
TaskService *task_svc; TaskService *task_svc;
task_svc = heap_alloc(sizeof(*task_svc)); task_svc = malloc(sizeof(*task_svc));
if (!task_svc) return E_OUTOFMEMORY; if (!task_svc) return E_OUTOFMEMORY;
task_svc->ITaskService_iface.lpVtbl = &TaskService_vtbl; task_svc->ITaskService_iface.lpVtbl = &TaskService_vtbl;
...@@ -4013,10 +4013,10 @@ HRESULT TaskService_create(void **obj) ...@@ -4013,10 +4013,10 @@ HRESULT TaskService_create(void **obj)
void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n) 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) void __RPC_USER MIDL_user_free(void __RPC_FAR *p)
{ {
HeapFree(GetProcessHeap(), 0, p); free(p);
} }
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#ifndef __WINE_TASKSCHD_PRIVATE_H__ #ifndef __WINE_TASKSCHD_PRIVATE_H__
#define __WINE_TASKSCHD_PRIVATE_H__ #define __WINE_TASKSCHD_PRIVATE_H__
#include "wine/heap.h"
HRESULT TaskService_create(void **obj) DECLSPEC_HIDDEN; HRESULT TaskService_create(void **obj) DECLSPEC_HIDDEN;
HRESULT TaskDefinition_create(ITaskDefinition **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; HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **obj, BOOL create) DECLSPEC_HIDDEN;
......
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