Commit 98241dfa authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

mstask: Switch to using heap wrappers.

parent 7b6b34d0
...@@ -82,10 +82,10 @@ static void TaskDestructor(TaskImpl *This) ...@@ -82,10 +82,10 @@ static void TaskDestructor(TaskImpl *This)
if (This->action) if (This->action)
IExecAction_Release(This->action); IExecAction_Release(This->action);
ITaskDefinition_Release(This->task); ITaskDefinition_Release(This->task);
HeapFree(GetProcessHeap(), 0, This->task_name); heap_free(This->task_name);
HeapFree(GetProcessHeap(), 0, This->accountName); heap_free(This->accountName);
HeapFree(GetProcessHeap(), 0, This->trigger); heap_free(This->trigger);
HeapFree(GetProcessHeap(), 0, This); heap_free(This);
InterlockedDecrement(&dll_ref); InterlockedDecrement(&dll_ref);
} }
...@@ -505,11 +505,11 @@ static HRESULT WINAPI MSTASK_ITask_SetAccountInformation( ...@@ -505,11 +505,11 @@ static HRESULT WINAPI MSTASK_ITask_SetAccountInformation(
FIXME("Partial stub ignores passwords\n"); FIXME("Partial stub ignores passwords\n");
n = (lstrlenW(pwszAccountName) + 1); n = (lstrlenW(pwszAccountName) + 1);
tmp_account_name = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR)); tmp_account_name = heap_alloc(n * sizeof(WCHAR));
if (!tmp_account_name) if (!tmp_account_name)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
lstrcpyW(tmp_account_name, pwszAccountName); lstrcpyW(tmp_account_name, pwszAccountName);
HeapFree(GetProcessHeap(), 0, This->accountName); heap_free(This->accountName);
This->accountName = tmp_account_name; This->accountName = tmp_account_name;
return S_OK; return S_OK;
} }
...@@ -554,7 +554,7 @@ static HRESULT WINAPI MSTASK_ITask_SetApplicationName(ITask *iface, LPCWSTR appn ...@@ -554,7 +554,7 @@ static HRESULT WINAPI MSTASK_ITask_SetApplicationName(ITask *iface, LPCWSTR appn
LPWSTR tmp_name; LPWSTR tmp_name;
HRESULT hr; HRESULT hr;
tmp_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); tmp_name = heap_alloc(len * sizeof(WCHAR));
if (!tmp_name) if (!tmp_name)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
len = SearchPathW(NULL, appname, NULL, len, tmp_name, NULL); len = SearchPathW(NULL, appname, NULL, len, tmp_name, NULL);
...@@ -563,7 +563,7 @@ static HRESULT WINAPI MSTASK_ITask_SetApplicationName(ITask *iface, LPCWSTR appn ...@@ -563,7 +563,7 @@ static HRESULT WINAPI MSTASK_ITask_SetApplicationName(ITask *iface, LPCWSTR appn
else else
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
HeapFree(GetProcessHeap(), 0, tmp_name); heap_free(tmp_name);
return hr; return hr;
} }
...@@ -1332,7 +1332,7 @@ failed: ...@@ -1332,7 +1332,7 @@ failed:
DeleteFileW(task_name); DeleteFileW(task_name);
else if (remember) else if (remember)
{ {
HeapFree(GetProcessHeap(), 0, This->task_name); heap_free(This->task_name);
This->task_name = heap_strdupW(task_name); This->task_name = heap_strdupW(task_name);
} }
return hr; return hr;
...@@ -1442,7 +1442,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *name, ITask **task) ...@@ -1442,7 +1442,7 @@ HRESULT TaskConstructor(ITaskService *service, const WCHAR *name, ITask **task)
hr = ITaskService_NewTask(service, 0, &taskdef); hr = ITaskService_NewTask(service, 0, &taskdef);
if (hr != S_OK) return hr; if (hr != S_OK) return hr;
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); This = heap_alloc(sizeof(*This));
if (!This) if (!This)
{ {
ITaskDefinition_Release(taskdef); ITaskDefinition_Release(taskdef);
......
...@@ -59,7 +59,7 @@ static void TaskSchedulerDestructor(TaskSchedulerImpl *This) ...@@ -59,7 +59,7 @@ static void TaskSchedulerDestructor(TaskSchedulerImpl *This)
{ {
TRACE("%p\n", This); TRACE("%p\n", This);
ITaskService_Release(This->service); ITaskService_Release(This->service);
HeapFree(GetProcessHeap(), 0, This); heap_free(This);
InterlockedDecrement(&dll_ref); InterlockedDecrement(&dll_ref);
} }
...@@ -97,7 +97,7 @@ static ULONG WINAPI EnumWorkItems_Release(IEnumWorkItems *iface) ...@@ -97,7 +97,7 @@ static ULONG WINAPI EnumWorkItems_Release(IEnumWorkItems *iface)
if (ref == 0) if (ref == 0)
{ {
HeapFree(GetProcessHeap(), 0, This); heap_free(This);
InterlockedDecrement(&dll_ref); InterlockedDecrement(&dll_ref);
} }
...@@ -148,7 +148,7 @@ static HRESULT create_task_enum(IEnumWorkItems **ret) ...@@ -148,7 +148,7 @@ static HRESULT create_task_enum(IEnumWorkItems **ret)
*ret = NULL; *ret = NULL;
tasks = HeapAlloc(GetProcessHeap(), 0, sizeof(*tasks)); tasks = heap_alloc(sizeof(*tasks));
if (!tasks) if (!tasks)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -402,7 +402,7 @@ HRESULT TaskSchedulerConstructor(LPVOID *ppObj) ...@@ -402,7 +402,7 @@ HRESULT TaskSchedulerConstructor(LPVOID *ppObj)
return hr; return hr;
} }
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); This = heap_alloc(sizeof(*This));
if (!This) if (!This)
{ {
ITaskService_Release(service); ITaskService_Release(service);
......
...@@ -86,7 +86,7 @@ static ULONG WINAPI MSTASK_ITaskTrigger_Release( ...@@ -86,7 +86,7 @@ static ULONG WINAPI MSTASK_ITaskTrigger_Release(
ref = InterlockedDecrement(&This->ref); ref = InterlockedDecrement(&This->ref);
if (ref == 0) if (ref == 0)
{ {
HeapFree(GetProcessHeap(), 0, This); heap_free(This);
InterlockedDecrement(&dll_ref); InterlockedDecrement(&dll_ref);
} }
return ref; return ref;
...@@ -288,7 +288,7 @@ HRESULT TaskTriggerConstructor(LPVOID *ppObj) ...@@ -288,7 +288,7 @@ HRESULT TaskTriggerConstructor(LPVOID *ppObj)
SYSTEMTIME time; SYSTEMTIME time;
TRACE("(%p)\n", ppObj); TRACE("(%p)\n", ppObj);
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); This = heap_alloc(sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
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