1 | /*
|
---|
2 | * Task Scheduler Service interface
|
---|
3 | *
|
---|
4 | * Copyright (C) 2008 Google (Roy Shea)
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
24 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
25 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
26 | * a choice of LGPL license versions is made available with the language indicating
|
---|
27 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
28 | * of the LGPL is applied is otherwise unspecified.
|
---|
29 | */
|
---|
30 |
|
---|
31 | import "oaidl.idl";
|
---|
32 | import "oleidl.idl";
|
---|
33 |
|
---|
34 | #ifndef __WIDL__
|
---|
35 | #define threading(model)
|
---|
36 | #define progid(str)
|
---|
37 | #define vi_progid(str)
|
---|
38 | #endif
|
---|
39 |
|
---|
40 | cpp_quote("#define TASK_SUNDAY 0x1")
|
---|
41 | cpp_quote("#define TASK_MONDAY 0x2")
|
---|
42 | cpp_quote("#define TASK_TUESDAY 0x4")
|
---|
43 | cpp_quote("#define TASK_WEDNESDAY 0x8")
|
---|
44 | cpp_quote("#define TASK_THURSDAY 0x10")
|
---|
45 | cpp_quote("#define TASK_FRIDAY 0x20")
|
---|
46 | cpp_quote("#define TASK_SATURDAY 0x40")
|
---|
47 |
|
---|
48 | cpp_quote("#define TASK_FIRST_WEEK 1")
|
---|
49 | cpp_quote("#define TASK_SECOND_WEEK 2")
|
---|
50 | cpp_quote("#define TASK_THIRD_WEEK 3")
|
---|
51 | cpp_quote("#define TASK_FOURTH_WEEK 4")
|
---|
52 | cpp_quote("#define TASK_LAST_WEEK 5")
|
---|
53 |
|
---|
54 | cpp_quote("#define TASK_JANUARY 0x1")
|
---|
55 | cpp_quote("#define TASK_FEBRUARY 0x2")
|
---|
56 | cpp_quote("#define TASK_MARCH 0x4")
|
---|
57 | cpp_quote("#define TASK_APRIL 0x8")
|
---|
58 | cpp_quote("#define TASK_MAY 0x10")
|
---|
59 | cpp_quote("#define TASK_JUNE 0x20")
|
---|
60 | cpp_quote("#define TASK_JULY 0x40")
|
---|
61 | cpp_quote("#define TASK_AUGUST 0x80")
|
---|
62 | cpp_quote("#define TASK_SEPTEMBER 0x100")
|
---|
63 | cpp_quote("#define TASK_OCTOBER 0x200")
|
---|
64 | cpp_quote("#define TASK_NOVEMBER 0x400")
|
---|
65 | cpp_quote("#define TASK_DECEMBER 0x800")
|
---|
66 |
|
---|
67 | cpp_quote("#define TASK_TRIGGER_FLAG_HAS_END_DATE 0x1")
|
---|
68 | cpp_quote("#define TASK_TRIGGER_FLAG_KILL_AT_DURATION_END 0x2")
|
---|
69 | cpp_quote("#define TASK_TRIGGER_FLAG_DISABLED 0x4")
|
---|
70 |
|
---|
71 | [
|
---|
72 | local,
|
---|
73 | object,
|
---|
74 | uuid(148BD528-A2AB-11CE-B11F-00AA00530503),
|
---|
75 | pointer_default(unique)
|
---|
76 | ]
|
---|
77 | interface IEnumWorkItems : IUnknown
|
---|
78 | {
|
---|
79 | HRESULT Next(
|
---|
80 | [in] ULONG celt,
|
---|
81 | [out] LPWSTR **rgpwszNames,
|
---|
82 | [out] ULONG *pceltFetched);
|
---|
83 |
|
---|
84 | HRESULT Skip(
|
---|
85 | [in] ULONG celt);
|
---|
86 |
|
---|
87 | HRESULT Reset();
|
---|
88 |
|
---|
89 | HRESULT Clone(
|
---|
90 | [out] IEnumWorkItems **ppEnumWorkItems);
|
---|
91 | }
|
---|
92 |
|
---|
93 | cpp_quote("#ifndef _HPROPSHEETPAGE_DEFINED")
|
---|
94 | typedef struct _PSP *HPROPSHEETPAGE;
|
---|
95 | cpp_quote("#define _HPROPSHEETPAGE_DEFINED")
|
---|
96 | cpp_quote("#endif")
|
---|
97 |
|
---|
98 | [
|
---|
99 | local,
|
---|
100 | object,
|
---|
101 | uuid(4086658a-cbbb-11cf-b604-00c04fd8d565),
|
---|
102 | pointer_default(unique)
|
---|
103 | ]
|
---|
104 | interface IProvideTaskPage : IUnknown
|
---|
105 | {
|
---|
106 | typedef enum _TASKPAGE {
|
---|
107 | TASKPAGE_TASK = 0,
|
---|
108 | TASKPAGE_SCHEDULE = 1,
|
---|
109 | TASKPAGE_SETTINGS = 2
|
---|
110 | } TASKPAGE;
|
---|
111 |
|
---|
112 | HRESULT GetPage(
|
---|
113 | [in] TASKPAGE tpType,
|
---|
114 | [in] BOOL fPersistChanges,
|
---|
115 | [out] HPROPSHEETPAGE *phPage);
|
---|
116 | }
|
---|
117 |
|
---|
118 | [
|
---|
119 | local,
|
---|
120 | object,
|
---|
121 | uuid(148BD52B-A2AB-11CE-B11F-00AA00530503),
|
---|
122 | pointer_default(unique)
|
---|
123 | ]
|
---|
124 | interface ITaskTrigger : IUnknown
|
---|
125 | {
|
---|
126 | typedef enum _TASK_TRIGGER_TYPE {
|
---|
127 | TASK_TIME_TRIGGER_ONCE = 0,
|
---|
128 | TASK_TIME_TRIGGER_DAILY = 1,
|
---|
129 | TASK_TIME_TRIGGER_WEEKLY = 2,
|
---|
130 | TASK_TIME_TRIGGER_MONTHLYDATE = 3,
|
---|
131 | TASK_TIME_TRIGGER_MONTHLYDOW = 4,
|
---|
132 | TASK_EVENT_TRIGGER_ON_IDLE = 5,
|
---|
133 | TASK_EVENT_TRIGGER_AT_SYSTEMSTART = 6,
|
---|
134 | TASK_EVENT_TRIGGER_AT_LOGON = 7
|
---|
135 | } TASK_TRIGGER_TYPE, *PTASK_TRIGGER_TYPE;
|
---|
136 |
|
---|
137 | typedef struct _DAILY {
|
---|
138 | WORD DaysInterval;
|
---|
139 | } DAILY;
|
---|
140 |
|
---|
141 | typedef struct _WEEKLY {
|
---|
142 | WORD WeeksInterval;
|
---|
143 | WORD rgfDaysOfTheWeek;
|
---|
144 | } WEEKLY;
|
---|
145 |
|
---|
146 | typedef struct _MONTHLYDATE {
|
---|
147 | DWORD rgfDays;
|
---|
148 | WORD rgfMonths;
|
---|
149 | } MONTHLYDATE;
|
---|
150 |
|
---|
151 | typedef struct _MONTHLYDOW {
|
---|
152 | WORD wWhichWeek;
|
---|
153 | WORD rgfDaysOfTheWeek;
|
---|
154 | WORD rgfMonths;
|
---|
155 | } MONTHLYDOW;
|
---|
156 |
|
---|
157 | typedef union _TRIGGER_TYPE_UNION {
|
---|
158 | DAILY Daily;
|
---|
159 | WEEKLY Weekly;
|
---|
160 | MONTHLYDATE MonthlyDate;
|
---|
161 | MONTHLYDOW MonthlyDOW;
|
---|
162 | } TRIGGER_TYPE_UNION;
|
---|
163 |
|
---|
164 | typedef struct _TASK_TRIGGER {
|
---|
165 | WORD cbTriggerSize;
|
---|
166 | WORD Reserved1;
|
---|
167 | WORD wBeginYear;
|
---|
168 | WORD wBeginMonth;
|
---|
169 | WORD wBeginDay;
|
---|
170 | WORD wEndYear;
|
---|
171 | WORD wEndMonth;
|
---|
172 | WORD wEndDay;
|
---|
173 | WORD wStartHour;
|
---|
174 | WORD wStartMinute;
|
---|
175 | DWORD MinutesDuration;
|
---|
176 | DWORD MinutesInterval;
|
---|
177 | DWORD rgFlags;
|
---|
178 | TASK_TRIGGER_TYPE TriggerType;
|
---|
179 | TRIGGER_TYPE_UNION Type;
|
---|
180 | WORD Reserved2;
|
---|
181 | WORD wRandomMinutesInterval;
|
---|
182 | } TASK_TRIGGER, *PTASK_TRIGGER;
|
---|
183 |
|
---|
184 | HRESULT SetTrigger(
|
---|
185 | [in] const PTASK_TRIGGER pTrigger);
|
---|
186 |
|
---|
187 | HRESULT GetTrigger(
|
---|
188 | [out] PTASK_TRIGGER pTrigger);
|
---|
189 |
|
---|
190 | HRESULT GetTriggerString(
|
---|
191 | [out] LPWSTR *ppwszTrigger);
|
---|
192 | }
|
---|
193 |
|
---|
194 | [
|
---|
195 | local,
|
---|
196 | object,
|
---|
197 | uuid(a6b952f0-a4b1-11d0-997d-00aa006887ec),
|
---|
198 | pointer_default(unique)
|
---|
199 | ]
|
---|
200 | interface IScheduledWorkItem : IUnknown
|
---|
201 | {
|
---|
202 | HRESULT CreateTrigger(
|
---|
203 | [out] WORD *piNewTrigger,
|
---|
204 | [out] ITaskTrigger **ppTrigger);
|
---|
205 |
|
---|
206 | HRESULT DeleteTrigger(
|
---|
207 | [in] WORD iTrigger);
|
---|
208 |
|
---|
209 | HRESULT GetTriggerCount(
|
---|
210 | [out] WORD *plCount);
|
---|
211 |
|
---|
212 | HRESULT GetTrigger(
|
---|
213 | [in] WORD iTrigger,
|
---|
214 | [out] ITaskTrigger **ppTrigger);
|
---|
215 |
|
---|
216 | HRESULT GetTriggerString(
|
---|
217 | [in] WORD iTrigger,
|
---|
218 | [out] LPWSTR *ppwszTrigger);
|
---|
219 |
|
---|
220 | HRESULT GetRunTimes(
|
---|
221 | [in] const LPSYSTEMTIME pstBegin,
|
---|
222 | [in] const LPSYSTEMTIME pstEnd,
|
---|
223 | [in, out] WORD *pCount,
|
---|
224 | [out] LPSYSTEMTIME *rgstTaskTimes);
|
---|
225 |
|
---|
226 | HRESULT GetNextRunTime(
|
---|
227 | [out] SYSTEMTIME *pstNextRun);
|
---|
228 |
|
---|
229 | HRESULT SetIdleWait(
|
---|
230 | [in] WORD wIdleMinutes,
|
---|
231 | [in] WORD wDeadlineMinutes);
|
---|
232 |
|
---|
233 | HRESULT GetIdleWait(
|
---|
234 | [out] WORD *pwIdleMinutes,
|
---|
235 | [out] WORD *pwDeadlineMinutes);
|
---|
236 |
|
---|
237 | HRESULT Run();
|
---|
238 |
|
---|
239 | HRESULT Terminate();
|
---|
240 |
|
---|
241 | HRESULT EditWorkItem(
|
---|
242 | [in] HWND hParent,
|
---|
243 | [in] DWORD dwReserved);
|
---|
244 |
|
---|
245 | HRESULT GetMostRecentRunTime(
|
---|
246 | [out] SYSTEMTIME *pstLastRun);
|
---|
247 |
|
---|
248 | HRESULT GetStatus(
|
---|
249 | [out] HRESULT *phrStatus);
|
---|
250 |
|
---|
251 | HRESULT GetExitCode(
|
---|
252 | [out] DWORD *pdwExitCode);
|
---|
253 |
|
---|
254 | HRESULT SetComment(
|
---|
255 | [in] LPCWSTR pwszComment);
|
---|
256 |
|
---|
257 | HRESULT GetComment(
|
---|
258 | [out] LPWSTR *ppwszComment);
|
---|
259 |
|
---|
260 | HRESULT SetCreator(
|
---|
261 | LPCWSTR pwszCreator);
|
---|
262 |
|
---|
263 | HRESULT GetCreator(
|
---|
264 | [out] LPWSTR *ppwszCreator);
|
---|
265 |
|
---|
266 | HRESULT SetWorkItemData(
|
---|
267 | [in] WORD cBytes,
|
---|
268 | [in] BYTE rgbData[]);
|
---|
269 |
|
---|
270 | HRESULT GetWorkItemData(
|
---|
271 | [out] WORD *pcBytes,
|
---|
272 | [out] BYTE **ppBytes);
|
---|
273 |
|
---|
274 | HRESULT SetErrorRetryCount(
|
---|
275 | WORD wRetryCount);
|
---|
276 |
|
---|
277 | HRESULT GetErrorRetryCount(
|
---|
278 | [out] WORD *pwRetryCount);
|
---|
279 |
|
---|
280 | HRESULT SetErrorRetryInterval(
|
---|
281 | WORD wRetryInterval);
|
---|
282 |
|
---|
283 | HRESULT GetErrorRetryInterval(
|
---|
284 | [out] WORD *pwRetryInterval);
|
---|
285 |
|
---|
286 | HRESULT SetFlags(
|
---|
287 | DWORD dwFlags);
|
---|
288 |
|
---|
289 | HRESULT GetFlags(
|
---|
290 | [out] DWORD *pdwFlags);
|
---|
291 |
|
---|
292 | HRESULT SetAccountInformation(
|
---|
293 | [in] LPCWSTR pwszAccountName,
|
---|
294 | [in] LPCWSTR pwszPassword);
|
---|
295 |
|
---|
296 | HRESULT GetAccountInformation(
|
---|
297 | [out] LPWSTR *ppwszAccountName);
|
---|
298 | }
|
---|
299 |
|
---|
300 | [
|
---|
301 | local,
|
---|
302 | object,
|
---|
303 | uuid(148BD524-A2AB-11CE-B11F-00AA00530503),
|
---|
304 | pointer_default(unique)
|
---|
305 | ]
|
---|
306 | interface ITask : IScheduledWorkItem
|
---|
307 | {
|
---|
308 | HRESULT SetApplicationName(
|
---|
309 | [in] LPCWSTR pwszApplicationName);
|
---|
310 |
|
---|
311 | HRESULT GetApplicationName(
|
---|
312 | [out] LPWSTR *ppwszApplicationName);
|
---|
313 |
|
---|
314 | HRESULT SetParameters(
|
---|
315 | [in] LPCWSTR pwszParameters);
|
---|
316 |
|
---|
317 | HRESULT GetParameters(
|
---|
318 | [out] LPWSTR *ppwszParameters);
|
---|
319 |
|
---|
320 | HRESULT SetWorkingDirectory(
|
---|
321 | [in] LPCWSTR pwszWorkingDirectory);
|
---|
322 |
|
---|
323 | HRESULT GetWorkingDirectory(
|
---|
324 | [in] LPWSTR *ppwszWorkingDirectory);
|
---|
325 |
|
---|
326 | HRESULT SetPriority(
|
---|
327 | [in] DWORD dwPriority);
|
---|
328 |
|
---|
329 | HRESULT GetPriority(
|
---|
330 | [out] DWORD *pdwPriority);
|
---|
331 |
|
---|
332 | HRESULT SetTaskFlags(
|
---|
333 | [in] DWORD dwFlags);
|
---|
334 |
|
---|
335 | HRESULT GetTaskFlags(
|
---|
336 | [out] DWORD *pdwFlags);
|
---|
337 |
|
---|
338 | HRESULT SetMaxRunTime(
|
---|
339 | [in] DWORD dwMaxRunTime);
|
---|
340 |
|
---|
341 | HRESULT GetMaxRunTime(
|
---|
342 | [out] DWORD *pdwMaxRunTime);
|
---|
343 | }
|
---|
344 |
|
---|
345 | [
|
---|
346 | local,
|
---|
347 | object,
|
---|
348 | uuid(148BD527-A2AB-11CE-B11F-00AA00530503),
|
---|
349 | pointer_default(unique)
|
---|
350 | ]
|
---|
351 | interface ITaskScheduler : IUnknown
|
---|
352 | {
|
---|
353 | HRESULT SetTargetComputer(
|
---|
354 | [in] LPCWSTR pwszComputer);
|
---|
355 |
|
---|
356 | HRESULT GetTargetComputer(
|
---|
357 | [out] LPWSTR *ppwszComputer);
|
---|
358 |
|
---|
359 | HRESULT Enum(
|
---|
360 | [out] IEnumWorkItems **ppEnumTasks);
|
---|
361 |
|
---|
362 | HRESULT Activate(
|
---|
363 | [in] LPCWSTR pwszName,
|
---|
364 | [in] REFIID riid,
|
---|
365 | [out] IUnknown **ppunk);
|
---|
366 |
|
---|
367 | HRESULT Delete(
|
---|
368 | [in] LPCWSTR pwszName);
|
---|
369 |
|
---|
370 | HRESULT NewWorkItem(
|
---|
371 | [in] LPCWSTR pwszTaskName,
|
---|
372 | [in] REFCLSID rclsid,
|
---|
373 | [in] REFIID riid,
|
---|
374 | [out] IUnknown **ppunk);
|
---|
375 |
|
---|
376 | HRESULT AddWorkItem(
|
---|
377 | [in] LPCWSTR pwszTaskName,
|
---|
378 | [in] IScheduledWorkItem *pWorkItem);
|
---|
379 |
|
---|
380 | HRESULT IsOfType(
|
---|
381 | [in] LPCWSTR pwszName,
|
---|
382 | [in] REFIID riid);
|
---|
383 | }
|
---|
384 |
|
---|
385 | [
|
---|
386 | threading(both),
|
---|
387 | uuid(148BD52A-A2AB-11CE-B11F-00AA00530503)
|
---|
388 | ]
|
---|
389 | coclass CTaskScheduler
|
---|
390 | {
|
---|
391 | [default] interface ITaskScheduler;
|
---|
392 | };
|
---|
393 |
|
---|
394 |
|
---|
395 | [
|
---|
396 | threading(both),
|
---|
397 | uuid(148BD520-A2AB-11CE-B11F-00AA00530503)
|
---|
398 | ]
|
---|
399 | coclass CTask
|
---|
400 | {
|
---|
401 | [default] interface ITask;
|
---|
402 | };
|
---|