ReactOS  0.4.15-dev-1070-ge1a01de
task.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Google (Roy Shea)
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #include "mstask_private.h"
20 #include "wine/debug.h"
21 
23 
24 typedef struct
25 {
35 } TaskImpl;
36 
37 static inline TaskImpl *impl_from_ITask(ITask *iface)
38 {
39  return CONTAINING_RECORD(iface, TaskImpl, ITask_iface);
40 }
41 
43 {
44  return CONTAINING_RECORD(iface, TaskImpl, IPersistFile_iface);
45 }
46 
48 {
49  TRACE("%p\n", This);
50  HeapFree(GetProcessHeap(), 0, This->accountName);
51  HeapFree(GetProcessHeap(), 0, This->comment);
52  HeapFree(GetProcessHeap(), 0, This->parameters);
53  HeapFree(GetProcessHeap(), 0, This->taskName);
56 }
57 
59  ITask* iface,
60  REFIID riid,
61  void **ppvObject)
62 {
63  TaskImpl * This = impl_from_ITask(iface);
64 
65  TRACE("IID: %s\n", debugstr_guid(riid));
66  if (ppvObject == NULL)
67  return E_POINTER;
68 
69  if (IsEqualGUID(riid, &IID_IUnknown) ||
70  IsEqualGUID(riid, &IID_ITask))
71  {
72  *ppvObject = &This->ITask_iface;
73  ITask_AddRef(iface);
74  return S_OK;
75  }
76  else if (IsEqualGUID(riid, &IID_IPersistFile))
77  {
78  *ppvObject = &This->IPersistFile_iface;
79  ITask_AddRef(iface);
80  return S_OK;
81  }
82 
83  WARN("Unknown interface: %s\n", debugstr_guid(riid));
84  *ppvObject = NULL;
85  return E_NOINTERFACE;
86 }
87 
89  ITask* iface)
90 {
91  TaskImpl *This = impl_from_ITask(iface);
92  ULONG ref;
93  TRACE("\n");
94  ref = InterlockedIncrement(&This->ref);
95  return ref;
96 }
97 
99  ITask* iface)
100 {
101  TaskImpl * This = impl_from_ITask(iface);
102  ULONG ref;
103  TRACE("\n");
104  ref = InterlockedDecrement(&This->ref);
105  if (ref == 0)
107  return ref;
108 }
109 
111  ITask* iface,
112  WORD *piNewTrigger,
113  ITaskTrigger **ppTrigger)
114 {
115  TRACE("(%p, %p, %p)\n", iface, piNewTrigger, ppTrigger);
116  return TaskTriggerConstructor((LPVOID *)ppTrigger);
117 }
118 
120  ITask* iface,
121  WORD iTrigger)
122 {
123  FIXME("(%p, %d): stub\n", iface, iTrigger);
124  return E_NOTIMPL;
125 }
126 
128  ITask* iface,
129  WORD *plCount)
130 {
131  FIXME("(%p, %p): stub\n", iface, plCount);
132  return E_NOTIMPL;
133 }
134 
136  ITask* iface,
137  WORD iTrigger,
138  ITaskTrigger **ppTrigger)
139 {
140  FIXME("(%p, %d, %p): stub\n", iface, iTrigger, ppTrigger);
141  return E_NOTIMPL;
142 }
143 
145  ITask* iface,
146  WORD iTrigger,
147  LPWSTR *ppwszTrigger)
148 {
149  FIXME("(%p, %d, %p): stub\n", iface, iTrigger, ppwszTrigger);
150  return E_NOTIMPL;
151 }
152 
154  ITask* iface,
155  const LPSYSTEMTIME pstBegin,
156  const LPSYSTEMTIME pstEnd,
157  WORD *pCount,
158  LPSYSTEMTIME *rgstTaskTimes)
159 {
160  FIXME("(%p, %p, %p, %p, %p): stub\n", iface, pstBegin, pstEnd, pCount,
161  rgstTaskTimes);
162  return E_NOTIMPL;
163 }
164 
166  ITask* iface,
167  SYSTEMTIME *pstNextRun)
168 {
169  FIXME("(%p, %p): stub\n", iface, pstNextRun);
170  return E_NOTIMPL;
171 }
172 
174  ITask* iface,
175  WORD wIdleMinutes,
176  WORD wDeadlineMinutes)
177 {
178  FIXME("(%p, %d, %d): stub\n", iface, wIdleMinutes, wDeadlineMinutes);
179  return E_NOTIMPL;
180 }
181 
183  ITask* iface,
184  WORD *pwIdleMinutes,
185  WORD *pwDeadlineMinutes)
186 {
187  FIXME("(%p, %p, %p): stub\n", iface, pwIdleMinutes, pwDeadlineMinutes);
188  return E_NOTIMPL;
189 }
190 
192  ITask* iface)
193 {
194  FIXME("(%p): stub\n", iface);
195  return E_NOTIMPL;
196 }
197 
199  ITask* iface)
200 {
201  FIXME("(%p): stub\n", iface);
202  return E_NOTIMPL;
203 }
204 
206  ITask* iface,
207  HWND hParent,
209 {
210  FIXME("(%p, %p, %d): stub\n", iface, hParent, dwReserved);
211  return E_NOTIMPL;
212 }
213 
215  ITask* iface,
216  SYSTEMTIME *pstLastRun)
217 {
218  FIXME("(%p, %p): stub\n", iface, pstLastRun);
219  return E_NOTIMPL;
220 }
221 
223  ITask* iface,
224  HRESULT *phrStatus)
225 {
226  FIXME("(%p, %p): stub\n", iface, phrStatus);
227  return E_NOTIMPL;
228 }
229 
231  ITask* iface,
232  DWORD *pdwExitCode)
233 {
234  FIXME("(%p, %p): stub\n", iface, pdwExitCode);
235  return E_NOTIMPL;
236 }
237 
239  ITask* iface,
240  LPCWSTR pwszComment)
241 {
242  DWORD n;
243  TaskImpl *This = impl_from_ITask(iface);
244  LPWSTR tmp_comment;
245 
246  TRACE("(%p, %s)\n", iface, debugstr_w(pwszComment));
247 
248  /* Empty comment */
249  if (pwszComment[0] == 0)
250  {
251  HeapFree(GetProcessHeap(), 0, This->comment);
252  This->comment = NULL;
253  return S_OK;
254  }
255 
256  /* Set to pwszComment */
257  n = (lstrlenW(pwszComment) + 1);
258  tmp_comment = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
259  if (!tmp_comment)
260  return E_OUTOFMEMORY;
261  lstrcpyW(tmp_comment, pwszComment);
262  HeapFree(GetProcessHeap(), 0, This->comment);
263  This->comment = tmp_comment;
264 
265  return S_OK;
266 }
267 
269  ITask* iface,
270  LPWSTR *ppwszComment)
271 {
272  DWORD n;
273  TaskImpl *This = impl_from_ITask(iface);
274 
275  TRACE("(%p, %p)\n", iface, ppwszComment);
276 
277  n = This->comment ? lstrlenW(This->comment) + 1 : 1;
278  *ppwszComment = CoTaskMemAlloc(n * sizeof(WCHAR));
279  if (!*ppwszComment)
280  return E_OUTOFMEMORY;
281 
282  if (!This->comment)
283  *ppwszComment[0] = 0;
284  else
285  lstrcpyW(*ppwszComment, This->comment);
286 
287  return S_OK;
288 }
289 
291  ITask* iface,
292  LPCWSTR pwszCreator)
293 {
294  FIXME("(%p, %p): stub\n", iface, pwszCreator);
295  return E_NOTIMPL;
296 }
297 
299  ITask* iface,
300  LPWSTR *ppwszCreator)
301 {
302  FIXME("(%p, %p): stub\n", iface, ppwszCreator);
303  return E_NOTIMPL;
304 }
305 
307  ITask* iface,
308  WORD cBytes,
309  BYTE rgbData[])
310 {
311  FIXME("(%p, %d, %p): stub\n", iface, cBytes, rgbData);
312  return E_NOTIMPL;
313 }
314 
316  ITask* iface,
317  WORD *pcBytes,
318  BYTE **ppBytes)
319 {
320  FIXME("(%p, %p, %p): stub\n", iface, pcBytes, ppBytes);
321  return E_NOTIMPL;
322 }
323 
325  ITask* iface,
326  WORD wRetryCount)
327 {
328  FIXME("(%p, %d): stub\n", iface, wRetryCount);
329  return E_NOTIMPL;
330 }
331 
333  ITask* iface,
334  WORD *pwRetryCount)
335 {
336  FIXME("(%p, %p): stub\n", iface, pwRetryCount);
337  return E_NOTIMPL;
338 }
339 
341  ITask* iface,
342  WORD wRetryInterval)
343 {
344  FIXME("(%p, %d): stub\n", iface, wRetryInterval);
345  return E_NOTIMPL;
346 }
347 
349  ITask* iface,
350  WORD *pwRetryInterval)
351 {
352  FIXME("(%p, %p): stub\n", iface, pwRetryInterval);
353  return E_NOTIMPL;
354 }
355 
357  ITask* iface,
358  DWORD dwFlags)
359 {
360  FIXME("(%p, 0x%08x): stub\n", iface, dwFlags);
361  return E_NOTIMPL;
362 }
363 
365  ITask* iface,
366  DWORD *pdwFlags)
367 {
368  FIXME("(%p, %p): stub\n", iface, pdwFlags);
369  return E_NOTIMPL;
370 }
371 
373  ITask* iface,
374  LPCWSTR pwszAccountName,
375  LPCWSTR pwszPassword)
376 {
377  DWORD n;
378  TaskImpl *This = impl_from_ITask(iface);
379  LPWSTR tmp_account_name;
380 
381  TRACE("(%p, %s, %s): partial stub\n", iface, debugstr_w(pwszAccountName),
382  debugstr_w(pwszPassword));
383 
384  if (pwszPassword)
385  FIXME("Partial stub ignores passwords\n");
386 
387  n = (lstrlenW(pwszAccountName) + 1);
388  tmp_account_name = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
389  if (!tmp_account_name)
390  return E_OUTOFMEMORY;
391  lstrcpyW(tmp_account_name, pwszAccountName);
392  HeapFree(GetProcessHeap(), 0, This->accountName);
393  This->accountName = tmp_account_name;
394  return S_OK;
395 }
396 
398  ITask* iface,
399  LPWSTR *ppwszAccountName)
400 {
401  DWORD n;
402  TaskImpl *This = impl_from_ITask(iface);
403 
404  TRACE("(%p, %p): partial stub\n", iface, ppwszAccountName);
405 
406  /* This implements the WinXP behavior when accountName has not yet
407  * set. Win2K behaves differently, returning SCHED_E_CANNOT_OPEN_TASK */
408  if (!This->accountName)
410 
411  n = (lstrlenW(This->accountName) + 1);
412  *ppwszAccountName = CoTaskMemAlloc(n * sizeof(WCHAR));
413  if (!*ppwszAccountName)
414  return E_OUTOFMEMORY;
415  lstrcpyW(*ppwszAccountName, This->accountName);
416  return S_OK;
417 }
418 
420  ITask* iface,
421  LPCWSTR pwszApplicationName)
422 {
423  DWORD n;
424  TaskImpl *This = impl_from_ITask(iface);
426 
427  TRACE("(%p, %s)\n", iface, debugstr_w(pwszApplicationName));
428 
429  /* Empty application name */
430  if (pwszApplicationName[0] == 0)
431  {
432  HeapFree(GetProcessHeap(), 0, This->applicationName);
433  This->applicationName = NULL;
434  return S_OK;
435  }
436 
437  /* Attempt to set pwszApplicationName to a path resolved application name */
438  n = SearchPathW(NULL, pwszApplicationName, NULL, 0, NULL, NULL);
439  if (n)
440  {
441  tmp_name = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
442  if (!tmp_name)
443  return E_OUTOFMEMORY;
444  n = SearchPathW(NULL, pwszApplicationName, NULL, n, tmp_name, NULL);
445  if (n)
446  {
447  HeapFree(GetProcessHeap(), 0, This->applicationName);
448  This->applicationName = tmp_name;
449  return S_OK;
450  }
451  else
453  }
454 
455  /* If unable to path resolve name, simply set to pwszApplicationName */
456  n = (lstrlenW(pwszApplicationName) + 1);
457  tmp_name = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
458  if (!tmp_name)
459  return E_OUTOFMEMORY;
460  lstrcpyW(tmp_name, pwszApplicationName);
461  HeapFree(GetProcessHeap(), 0, This->applicationName);
462  This->applicationName = tmp_name;
463  return S_OK;
464 }
465 
467  ITask* iface,
468  LPWSTR *ppwszApplicationName)
469 {
470  DWORD n;
471  TaskImpl *This = impl_from_ITask(iface);
472 
473  TRACE("(%p, %p)\n", iface, ppwszApplicationName);
474 
475  n = This->applicationName ? lstrlenW(This->applicationName) + 1 : 1;
476  *ppwszApplicationName = CoTaskMemAlloc(n * sizeof(WCHAR));
477  if (!*ppwszApplicationName)
478  return E_OUTOFMEMORY;
479 
480  if (!This->applicationName)
481  *ppwszApplicationName[0] = 0;
482  else
483  lstrcpyW(*ppwszApplicationName, This->applicationName);
484 
485  return S_OK;
486 }
487 
489  ITask* iface,
490  LPCWSTR pwszParameters)
491 {
492  DWORD n;
493  TaskImpl *This = impl_from_ITask(iface);
494  LPWSTR tmp_parameters;
495 
496  TRACE("(%p, %s)\n", iface, debugstr_w(pwszParameters));
497 
498  /* Empty parameter list */
499  if (pwszParameters[0] == 0)
500  {
501  HeapFree(GetProcessHeap(), 0, This->parameters);
502  This->parameters = NULL;
503  return S_OK;
504  }
505 
506  /* Set to pwszParameters */
507  n = (lstrlenW(pwszParameters) + 1);
508  tmp_parameters = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
509  if (!tmp_parameters)
510  return E_OUTOFMEMORY;
511  lstrcpyW(tmp_parameters, pwszParameters);
512  HeapFree(GetProcessHeap(), 0, This->parameters);
513  This->parameters = tmp_parameters;
514  return S_OK;
515 }
516 
518  ITask* iface,
519  LPWSTR *ppwszParameters)
520 {
521  DWORD n;
522  TaskImpl *This = impl_from_ITask(iface);
523 
524  TRACE("(%p, %p)\n", iface, ppwszParameters);
525 
526  n = This->parameters ? lstrlenW(This->parameters) + 1 : 1;
527  *ppwszParameters = CoTaskMemAlloc(n * sizeof(WCHAR));
528  if (!*ppwszParameters)
529  return E_OUTOFMEMORY;
530 
531  if (!This->parameters)
532  *ppwszParameters[0] = 0;
533  else
534  lstrcpyW(*ppwszParameters, This->parameters);
535 
536  return S_OK;
537 }
538 
540  ITask* iface,
541  LPCWSTR pwszWorkingDirectory)
542 {
543  FIXME("(%p, %s): stub\n", iface, debugstr_w(pwszWorkingDirectory));
544  return E_NOTIMPL;
545 }
546 
548  ITask* iface,
549  LPWSTR *ppwszWorkingDirectory)
550 {
551  FIXME("(%p, %p): stub\n", iface, ppwszWorkingDirectory);
552  return E_NOTIMPL;
553 }
554 
556  ITask* iface,
557  DWORD dwPriority)
558 {
559  FIXME("(%p, 0x%08x): stub\n", iface, dwPriority);
560  return E_NOTIMPL;
561 }
562 
564  ITask* iface,
565  DWORD *pdwPriority)
566 {
567  FIXME("(%p, %p): stub\n", iface, pdwPriority);
568  return E_NOTIMPL;
569 }
570 
572  ITask* iface,
573  DWORD dwFlags)
574 {
575  FIXME("(%p, 0x%08x): stub\n", iface, dwFlags);
576  return E_NOTIMPL;
577 }
578 
580  ITask* iface,
581  DWORD *pdwFlags)
582 {
583  FIXME("(%p, %p): stub\n", iface, pdwFlags);
584  return E_NOTIMPL;
585 }
586 
588  ITask* iface,
589  DWORD dwMaxRunTime)
590 {
591  TaskImpl *This = impl_from_ITask(iface);
592 
593  TRACE("(%p, %d)\n", iface, dwMaxRunTime);
594 
595  This->maxRunTime = dwMaxRunTime;
596  return S_OK;
597 }
598 
600  ITask* iface,
601  DWORD *pdwMaxRunTime)
602 {
603  TaskImpl *This = impl_from_ITask(iface);
604 
605  TRACE("(%p, %p)\n", iface, pdwMaxRunTime);
606 
607  *pdwMaxRunTime = This->maxRunTime;
608  return S_OK;
609 }
610 
612  IPersistFile* iface,
613  REFIID riid,
614  void **ppvObject)
615 {
617  TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppvObject);
618  return ITask_QueryInterface(&This->ITask_iface, riid, ppvObject);
619 }
620 
622  IPersistFile* iface)
623 {
625  ULONG ref;
626  TRACE("\n");
627  ref = InterlockedIncrement(&This->ref);
628  return ref;
629 }
630 
632  IPersistFile* iface)
633 {
635  ULONG ref;
636  TRACE("\n");
637  ref = InterlockedDecrement(&This->ref);
638  if (ref == 0)
640  return ref;
641 }
642 
644  IPersistFile* iface,
645  CLSID *pClassID)
646 {
647  FIXME("(%p, %p): stub\n", iface, pClassID);
648  return E_NOTIMPL;
649 }
650 
652  IPersistFile* iface)
653 {
654  FIXME("(%p): stub\n", iface);
655  return E_NOTIMPL;
656 }
657 
659  IPersistFile* iface,
660  LPCOLESTR pszFileName,
661  DWORD dwMode)
662 {
663  FIXME("(%p, %p, 0x%08x): stub\n", iface, pszFileName, dwMode);
664  return E_NOTIMPL;
665 }
666 
668  IPersistFile* iface,
669  LPCOLESTR pszFileName,
670  BOOL fRemember)
671 {
672  FIXME("(%p, %p, %d): stub\n", iface, pszFileName, fRemember);
673  WARN("Returning S_OK but not writing to disk: %s %d\n",
674  debugstr_w(pszFileName), fRemember);
675  return S_OK;
676 }
677 
679  IPersistFile* iface,
680  LPCOLESTR pszFileName)
681 {
682  FIXME("(%p, %p): stub\n", iface, pszFileName);
683  return E_NOTIMPL;
684 }
685 
687  IPersistFile* iface,
688  LPOLESTR *ppszFileName)
689 {
690  FIXME("(%p, %p): stub\n", iface, ppszFileName);
691  return E_NOTIMPL;
692 }
693 
694 
695 static const ITaskVtbl MSTASK_ITaskVtbl =
696 {
741 };
742 
743 static const IPersistFileVtbl MSTASK_IPersistFileVtbl =
744 {
754 };
755 
756 HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
757 {
758  TaskImpl *This;
759  int n;
760 
761  TRACE("(%s, %p)\n", debugstr_w(pwszTaskName), ppObj);
762 
763  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
764  if (!This)
765  return E_OUTOFMEMORY;
766 
767  This->ITask_iface.lpVtbl = &MSTASK_ITaskVtbl;
768  This->IPersistFile_iface.lpVtbl = &MSTASK_IPersistFileVtbl;
769  This->ref = 1;
770  n = (lstrlenW(pwszTaskName) + 1) * sizeof(WCHAR);
771  This->taskName = HeapAlloc(GetProcessHeap(), 0, n);
772  if (!This->taskName)
773  {
775  return E_OUTOFMEMORY;
776  }
777  lstrcpyW(This->taskName, pwszTaskName);
778  This->applicationName = NULL;
779  This->parameters = NULL;
780  This->comment = NULL;
781  This->accountName = NULL;
782 
783  /* Default time is 3 days = 259200000 ms */
784  This->maxRunTime = 259200000;
785 
786  *ppObj = &This->ITask_iface;
788  return S_OK;
789 }
static HRESULT WINAPI MSTASK_ITask_GetTrigger(ITask *iface, WORD iTrigger, ITaskTrigger **ppTrigger)
Definition: task.c:135
static HRESULT WINAPI MSTASK_ITask_SetMaxRunTime(ITask *iface, DWORD dwMaxRunTime)
Definition: task.c:587
static ULONG WINAPI MSTASK_ITask_Release(ITask *iface)
Definition: task.c:98
#define REFIID
Definition: guiddef.h:118
static TaskImpl * impl_from_ITask(ITask *iface)
Definition: task.c:37
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static HRESULT WINAPI MSTASK_ITask_Terminate(ITask *iface)
Definition: task.c:198
static HRESULT WINAPI MSTASK_ITask_GetComment(ITask *iface, LPWSTR *ppwszComment)
Definition: task.c:268
LPWSTR applicationName
Definition: task.c:30
REFIID riid
Definition: precomp.h:44
static void TaskDestructor(TaskImpl *This)
Definition: task.c:47
static HRESULT WINAPI MSTASK_ITask_GetFlags(ITask *iface, DWORD *pdwFlags)
Definition: task.c:364
static HRESULT WINAPI MSTASK_ITask_SetParameters(ITask *iface, LPCWSTR pwszParameters)
Definition: task.c:488
#define WARN(fmt,...)
Definition: debug.h:112
static HRESULT WINAPI MSTASK_ITask_GetErrorRetryInterval(ITask *iface, WORD *pwRetryInterval)
Definition: task.c:348
static HRESULT WINAPI MSTASK_ITask_GetTriggerCount(ITask *iface, WORD *plCount)
Definition: task.c:127
GLdouble n
Definition: glext.h:7729
static HRESULT WINAPI MSTASK_ITask_Run(ITask *iface)
Definition: task.c:191
static ULONG WINAPI MSTASK_ITask_AddRef(ITask *iface)
Definition: task.c:88
static HRESULT WINAPI MSTASK_ITask_GetStatus(ITask *iface, HRESULT *phrStatus)
Definition: task.c:222
static LPOLESTR
Definition: stg_prop.c:27
#define lstrlenW
Definition: compat.h:498
ITask ITask_iface
Definition: task.c:26
Definition: send.c:48
static ULONG WINAPI MSTASK_IPersistFile_Release(IPersistFile *iface)
Definition: task.c:631
IPersistFile IPersistFile_iface
Definition: task.c:27
static const ITaskVtbl MSTASK_ITaskVtbl
Definition: task.c:695
static HRESULT WINAPI MSTASK_ITask_GetRunTimes(ITask *iface, const LPSYSTEMTIME pstBegin, const LPSYSTEMTIME pstEnd, WORD *pCount, LPSYSTEMTIME *rgstTaskTimes)
Definition: task.c:153
static HRESULT WINAPI MSTASK_ITask_EditWorkItem(ITask *iface, HWND hParent, DWORD dwReserved)
Definition: task.c:205
static HRESULT WINAPI MSTASK_ITask_SetPriority(ITask *iface, DWORD dwPriority)
Definition: task.c:555
static HRESULT WINAPI MSTASK_ITask_GetWorkingDirectory(ITask *iface, LPWSTR *ppwszWorkingDirectory)
Definition: task.c:547
static HRESULT WINAPI MSTASK_ITask_SetWorkItemData(ITask *iface, WORD cBytes, BYTE rgbData[])
Definition: task.c:306
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
static HRESULT WINAPI MSTASK_ITask_SetIdleWait(ITask *iface, WORD wIdleMinutes, WORD wDeadlineMinutes)
Definition: task.c:173
long LONG
Definition: pedump.c:60
static HRESULT WINAPI MSTASK_IPersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
Definition: task.c:658
static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *ppszFileName)
Definition: task.c:686
static HRESULT WINAPI MSTASK_ITask_GetErrorRetryCount(ITask *iface, WORD *pwRetryCount)
Definition: task.c:332
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:111
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI MSTASK_ITask_GetTriggerString(ITask *iface, WORD iTrigger, LPWSTR *ppwszTrigger)
Definition: task.c:144
#define debugstr_guid
Definition: kernel32.h:35
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static HRESULT WINAPI MSTASK_ITask_SetComment(ITask *iface, LPCWSTR pwszComment)
Definition: task.c:238
LPWSTR comment
Definition: task.c:32
WINE_DEFAULT_DEBUG_CHANNEL(mstask)
static char * tmp_name
Definition: cache.c:24
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
static HRESULT WINAPI MSTASK_ITask_SetErrorRetryCount(ITask *iface, WORD wRetryCount)
Definition: task.c:324
static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
Definition: task.c:667
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
LONG dll_ref
Definition: mstask_main.c:31
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
static TaskImpl * impl_from_IPersistFile(IPersistFile *iface)
Definition: task.c:42
static HRESULT WINAPI MSTASK_ITask_GetIdleWait(ITask *iface, WORD *pwIdleMinutes, WORD *pwDeadlineMinutes)
Definition: task.c:182
static HRESULT WINAPI MSTASK_ITask_SetFlags(ITask *iface, DWORD dwFlags)
Definition: task.c:356
static HRESULT WINAPI MSTASK_ITask_SetAccountInformation(ITask *iface, LPCWSTR pwszAccountName, LPCWSTR pwszPassword)
Definition: task.c:372
static HRESULT WINAPI MSTASK_ITask_GetNextRunTime(ITask *iface, SYSTEMTIME *pstNextRun)
Definition: task.c:165
static HRESULT WINAPI MSTASK_ITask_GetWorkItemData(ITask *iface, WORD *pcBytes, BYTE **ppBytes)
Definition: task.c:315
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory(ITask *iface, LPCWSTR pwszWorkingDirectory)
Definition: task.c:539
HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj)
Definition: task.c:756
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
static HRESULT WINAPI MSTASK_ITask_GetPriority(ITask *iface, DWORD *pdwPriority)
Definition: task.c:563
static HRESULT WINAPI MSTASK_ITask_SetTaskFlags(ITask *iface, DWORD dwFlags)
Definition: task.c:571
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static HRESULT WINAPI MSTASK_ITask_DeleteTrigger(ITask *iface, WORD iTrigger)
Definition: task.c:119
LPWSTR parameters
Definition: task.c:31
DWORD maxRunTime
Definition: task.c:33
unsigned char BYTE
Definition: xxhash.c:193
static ULONG WINAPI MSTASK_IPersistFile_AddRef(IPersistFile *iface)
Definition: task.c:621
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1297
static HRESULT WINAPI MSTASK_ITask_GetMaxRunTime(ITask *iface, DWORD *pdwMaxRunTime)
Definition: task.c:599
static HRESULT WINAPI MSTASK_ITask_GetAccountInformation(ITask *iface, LPWSTR *ppwszAccountName)
Definition: task.c:397
#define S_OK
Definition: intsafe.h:51
static HRESULT WINAPI MSTASK_ITask_GetParameters(ITask *iface, LPWSTR *ppwszParameters)
Definition: task.c:517
LPWSTR taskName
Definition: task.c:29
#define InterlockedIncrement
Definition: armddk.h:53
static HRESULT WINAPI MSTASK_ITask_QueryInterface(ITask *iface, REFIID riid, void **ppvObject)
Definition: task.c:58
#define lstrcpyW
Definition: compat.h:497
static HRESULT WINAPI MSTASK_IPersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
Definition: task.c:643
#define E_NOTIMPL
Definition: ddrawi.h:99
static HRESULT WINAPI MSTASK_ITask_SetApplicationName(ITask *iface, LPCWSTR pwszApplicationName)
Definition: task.c:419
HRESULT TaskTriggerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: task_trigger.c:277
Definition: task.c:24
static HRESULT WINAPI MSTASK_IPersistFile_IsDirty(IPersistFile *iface)
Definition: task.c:651
static HRESULT WINAPI MSTASK_ITask_GetMostRecentRunTime(ITask *iface, SYSTEMTIME *pstLastRun)
Definition: task.c:214
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static HRESULT WINAPI MSTASK_ITask_GetCreator(ITask *iface, LPWSTR *ppwszCreator)
Definition: task.c:298
LPWSTR accountName
Definition: task.c:34
const GUID IID_IPersistFile
static HRESULT WINAPI MSTASK_ITask_CreateTrigger(ITask *iface, WORD *piNewTrigger, ITaskTrigger **ppTrigger)
Definition: task.c:110
static HRESULT WINAPI MSTASK_ITask_GetExitCode(ITask *iface, DWORD *pdwExitCode)
Definition: task.c:230
static HRESULT WINAPI MSTASK_ITask_SetErrorRetryInterval(ITask *iface, WORD wRetryInterval)
Definition: task.c:340
static const IPersistFileVtbl MSTASK_IPersistFileVtbl
Definition: task.c:743
static HRESULT WINAPI MSTASK_ITask_GetTaskFlags(ITask *iface, DWORD *pdwFlags)
Definition: task.c:579
unsigned int ULONG
Definition: retypes.h:1
LONG ref
Definition: task.c:28
static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
Definition: task.c:611
static HRESULT WINAPI MSTASK_ITask_SetCreator(ITask *iface, LPCWSTR pwszCreator)
Definition: task.c:290
static HRESULT WINAPI MSTASK_ITask_GetApplicationName(ITask *iface, LPWSTR *ppwszApplicationName)
Definition: task.c:466
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
Definition: task.c:678
#define HeapFree(x, y, z)
Definition: compat.h:483