2 * Copyright (C) 2008 Google (Roy Shea)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "mstask_private.h"
20 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(mstask);
24 static void TaskSchedulerDestructor(TaskSchedulerImpl *This)
27 HeapFree(GetProcessHeap(), 0, This);
30 static HRESULT WINAPI MSTASK_ITaskScheduler_QueryInterface(
31 ITaskScheduler* iface,
35 TaskSchedulerImpl * This = (TaskSchedulerImpl *)iface;
37 TRACE("IID: %s\n", debugstr_guid(riid));
39 if (IsEqualGUID(riid, &IID_IUnknown) ||
40 IsEqualGUID(riid, &IID_ITaskScheduler))
42 *ppvObject = &This->lpVtbl;
43 ITaskScheduler_AddRef(iface);
51 static ULONG WINAPI MSTASK_ITaskScheduler_AddRef(
52 ITaskScheduler* iface)
54 TaskSchedulerImpl *This = (TaskSchedulerImpl *)iface;
56 return InterlockedIncrement(&This->ref);
59 static ULONG WINAPI MSTASK_ITaskScheduler_Release(
60 ITaskScheduler* iface)
62 TaskSchedulerImpl * This = (TaskSchedulerImpl *)iface;
65 ref = InterlockedDecrement(&This->ref);
67 TaskSchedulerDestructor(This);
71 static HRESULT WINAPI MSTASK_ITaskScheduler_SetTargetComputer(
72 ITaskScheduler* iface,
75 FIXME("%p, %s: stub\n", iface, debugstr_w(pwszComputer));
79 static HRESULT WINAPI MSTASK_ITaskScheduler_GetTargetComputer(
80 ITaskScheduler* iface,
81 LPWSTR *ppwszComputer)
83 FIXME("%p, %p: stub\n", iface, ppwszComputer);
87 static HRESULT WINAPI MSTASK_ITaskScheduler_Enum(
88 ITaskScheduler* iface,
89 IEnumWorkItems **ppEnumTasks)
91 FIXME("%p, %p: stub\n", iface, ppEnumTasks);
95 static HRESULT WINAPI MSTASK_ITaskScheduler_Activate(
96 ITaskScheduler* iface,
101 FIXME("%p, %s, %s, %p: stub\n", iface, debugstr_w(pwszName),
102 debugstr_guid(riid), ppunk);
106 static HRESULT WINAPI MSTASK_ITaskScheduler_Delete(
107 ITaskScheduler* iface,
110 FIXME("%p, %s: stub\n", iface, debugstr_w(pwszName));
114 static HRESULT WINAPI MSTASK_ITaskScheduler_NewWorkItem(
115 ITaskScheduler* iface,
116 LPCWSTR pwszTaskName,
121 FIXME("%p, %s, %s, %s, %p: stub\n", iface, debugstr_w(pwszTaskName),
122 debugstr_guid(rclsid) ,debugstr_guid(riid), ppunk);
126 static HRESULT WINAPI MSTASK_ITaskScheduler_AddWorkItem(
127 ITaskScheduler* iface,
128 LPCWSTR pwszTaskName,
129 IScheduledWorkItem *pWorkItem)
131 FIXME("%p, %s, %p: stub\n", iface, debugstr_w(pwszTaskName), pWorkItem);
135 static HRESULT WINAPI MSTASK_ITaskScheduler_IsOfType(
136 ITaskScheduler* iface,
140 FIXME("%p, %s, %s: stub\n", iface, debugstr_w(pwszName),
141 debugstr_guid(riid));
145 static const ITaskSchedulerVtbl MSTASK_ITaskSchedulerVtbl =
147 MSTASK_ITaskScheduler_QueryInterface,
148 MSTASK_ITaskScheduler_AddRef,
149 MSTASK_ITaskScheduler_Release,
150 MSTASK_ITaskScheduler_SetTargetComputer,
151 MSTASK_ITaskScheduler_GetTargetComputer,
152 MSTASK_ITaskScheduler_Enum,
153 MSTASK_ITaskScheduler_Activate,
154 MSTASK_ITaskScheduler_Delete,
155 MSTASK_ITaskScheduler_NewWorkItem,
156 MSTASK_ITaskScheduler_AddWorkItem,
157 MSTASK_ITaskScheduler_IsOfType
160 HRESULT TaskSchedulerConstructor(LPVOID *ppObj)
162 TaskSchedulerImpl *This;
163 TRACE("(%p)\n", ppObj);
165 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
167 return E_OUTOFMEMORY;
169 This->lpVtbl = &MSTASK_ITaskSchedulerVtbl;
172 *ppObj = &This->lpVtbl;