ReactOS 0.4.16-dev-252-g9ccafe8
task.c File Reference
#include "mstask_private.h"
#include "wine/debug.h"
Include dependency graph for task.c:

Go to the source code of this file.

Classes

struct  TaskImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mstask)
 
static TaskImplimpl_from_ITask (ITask *iface)
 
static TaskImplimpl_from_IPersistFile (IPersistFile *iface)
 
static void TaskDestructor (TaskImpl *This)
 
static HRESULT WINAPI MSTASK_ITask_QueryInterface (ITask *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI MSTASK_ITask_AddRef (ITask *iface)
 
static ULONG WINAPI MSTASK_ITask_Release (ITask *iface)
 
static HRESULT WINAPI MSTASK_ITask_CreateTrigger (ITask *iface, WORD *piNewTrigger, ITaskTrigger **ppTrigger)
 
static HRESULT WINAPI MSTASK_ITask_DeleteTrigger (ITask *iface, WORD iTrigger)
 
static HRESULT WINAPI MSTASK_ITask_GetTriggerCount (ITask *iface, WORD *plCount)
 
static HRESULT WINAPI MSTASK_ITask_GetTrigger (ITask *iface, WORD iTrigger, ITaskTrigger **ppTrigger)
 
static HRESULT WINAPI MSTASK_ITask_GetTriggerString (ITask *iface, WORD iTrigger, LPWSTR *ppwszTrigger)
 
static HRESULT WINAPI MSTASK_ITask_GetRunTimes (ITask *iface, const LPSYSTEMTIME pstBegin, const LPSYSTEMTIME pstEnd, WORD *pCount, LPSYSTEMTIME *rgstTaskTimes)
 
static HRESULT WINAPI MSTASK_ITask_GetNextRunTime (ITask *iface, SYSTEMTIME *pstNextRun)
 
static HRESULT WINAPI MSTASK_ITask_SetIdleWait (ITask *iface, WORD wIdleMinutes, WORD wDeadlineMinutes)
 
static HRESULT WINAPI MSTASK_ITask_GetIdleWait (ITask *iface, WORD *pwIdleMinutes, WORD *pwDeadlineMinutes)
 
static HRESULT WINAPI MSTASK_ITask_Run (ITask *iface)
 
static HRESULT WINAPI MSTASK_ITask_Terminate (ITask *iface)
 
static HRESULT WINAPI MSTASK_ITask_EditWorkItem (ITask *iface, HWND hParent, DWORD dwReserved)
 
static HRESULT WINAPI MSTASK_ITask_GetMostRecentRunTime (ITask *iface, SYSTEMTIME *pstLastRun)
 
static HRESULT WINAPI MSTASK_ITask_GetStatus (ITask *iface, HRESULT *phrStatus)
 
static HRESULT WINAPI MSTASK_ITask_GetExitCode (ITask *iface, DWORD *pdwExitCode)
 
static HRESULT WINAPI MSTASK_ITask_SetComment (ITask *iface, LPCWSTR pwszComment)
 
static HRESULT WINAPI MSTASK_ITask_GetComment (ITask *iface, LPWSTR *ppwszComment)
 
static HRESULT WINAPI MSTASK_ITask_SetCreator (ITask *iface, LPCWSTR pwszCreator)
 
static HRESULT WINAPI MSTASK_ITask_GetCreator (ITask *iface, LPWSTR *ppwszCreator)
 
static HRESULT WINAPI MSTASK_ITask_SetWorkItemData (ITask *iface, WORD cBytes, BYTE rgbData[])
 
static HRESULT WINAPI MSTASK_ITask_GetWorkItemData (ITask *iface, WORD *pcBytes, BYTE **ppBytes)
 
static HRESULT WINAPI MSTASK_ITask_SetErrorRetryCount (ITask *iface, WORD wRetryCount)
 
static HRESULT WINAPI MSTASK_ITask_GetErrorRetryCount (ITask *iface, WORD *pwRetryCount)
 
static HRESULT WINAPI MSTASK_ITask_SetErrorRetryInterval (ITask *iface, WORD wRetryInterval)
 
static HRESULT WINAPI MSTASK_ITask_GetErrorRetryInterval (ITask *iface, WORD *pwRetryInterval)
 
static HRESULT WINAPI MSTASK_ITask_SetFlags (ITask *iface, DWORD dwFlags)
 
static HRESULT WINAPI MSTASK_ITask_GetFlags (ITask *iface, DWORD *pdwFlags)
 
static HRESULT WINAPI MSTASK_ITask_SetAccountInformation (ITask *iface, LPCWSTR pwszAccountName, LPCWSTR pwszPassword)
 
static HRESULT WINAPI MSTASK_ITask_GetAccountInformation (ITask *iface, LPWSTR *ppwszAccountName)
 
static HRESULT WINAPI MSTASK_ITask_SetApplicationName (ITask *iface, LPCWSTR pwszApplicationName)
 
static HRESULT WINAPI MSTASK_ITask_GetApplicationName (ITask *iface, LPWSTR *ppwszApplicationName)
 
static HRESULT WINAPI MSTASK_ITask_SetParameters (ITask *iface, LPCWSTR pwszParameters)
 
static HRESULT WINAPI MSTASK_ITask_GetParameters (ITask *iface, LPWSTR *ppwszParameters)
 
static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory (ITask *iface, LPCWSTR pwszWorkingDirectory)
 
static HRESULT WINAPI MSTASK_ITask_GetWorkingDirectory (ITask *iface, LPWSTR *ppwszWorkingDirectory)
 
static HRESULT WINAPI MSTASK_ITask_SetPriority (ITask *iface, DWORD dwPriority)
 
static HRESULT WINAPI MSTASK_ITask_GetPriority (ITask *iface, DWORD *pdwPriority)
 
static HRESULT WINAPI MSTASK_ITask_SetTaskFlags (ITask *iface, DWORD dwFlags)
 
static HRESULT WINAPI MSTASK_ITask_GetTaskFlags (ITask *iface, DWORD *pdwFlags)
 
static HRESULT WINAPI MSTASK_ITask_SetMaxRunTime (ITask *iface, DWORD dwMaxRunTime)
 
static HRESULT WINAPI MSTASK_ITask_GetMaxRunTime (ITask *iface, DWORD *pdwMaxRunTime)
 
static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface (IPersistFile *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI MSTASK_IPersistFile_AddRef (IPersistFile *iface)
 
static ULONG WINAPI MSTASK_IPersistFile_Release (IPersistFile *iface)
 
static HRESULT WINAPI MSTASK_IPersistFile_GetClassID (IPersistFile *iface, CLSID *pClassID)
 
static HRESULT WINAPI MSTASK_IPersistFile_IsDirty (IPersistFile *iface)
 
static HRESULT WINAPI MSTASK_IPersistFile_Load (IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
 
static HRESULT WINAPI MSTASK_IPersistFile_Save (IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
 
static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted (IPersistFile *iface, LPCOLESTR pszFileName)
 
static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile (IPersistFile *iface, LPOLESTR *ppszFileName)
 
HRESULT TaskConstructor (LPCWSTR pwszTaskName, LPVOID *ppObj)
 

Variables

static const ITaskVtbl MSTASK_ITaskVtbl
 
static const IPersistFileVtbl MSTASK_IPersistFileVtbl
 

Function Documentation

◆ impl_from_IPersistFile()

static TaskImpl * impl_from_IPersistFile ( IPersistFile iface)
inlinestatic

Definition at line 42 of file task.c.

43{
44 return CONTAINING_RECORD(iface, TaskImpl, IPersistFile_iface);
45}
Definition: task.c:25
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by MSTASK_IPersistFile_AddRef(), MSTASK_IPersistFile_QueryInterface(), and MSTASK_IPersistFile_Release().

◆ impl_from_ITask()

◆ MSTASK_IPersistFile_AddRef()

static ULONG WINAPI MSTASK_IPersistFile_AddRef ( IPersistFile iface)
static

Definition at line 621 of file task.c.

623{
625 ULONG ref;
626 TRACE("\n");
628 return ref;
629}
#define InterlockedIncrement
Definition: armddk.h:53
static TaskImpl * impl_from_IPersistFile(IPersistFile *iface)
Definition: task.c:42
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ MSTASK_IPersistFile_GetClassID()

static HRESULT WINAPI MSTASK_IPersistFile_GetClassID ( IPersistFile iface,
CLSID pClassID 
)
static

Definition at line 643 of file task.c.

646{
647 FIXME("(%p, %p): stub\n", iface, pClassID);
648 return E_NOTIMPL;
649}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ MSTASK_IPersistFile_GetCurFile()

static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile ( IPersistFile iface,
LPOLESTR ppszFileName 
)
static

Definition at line 686 of file task.c.

689{
690 FIXME("(%p, %p): stub\n", iface, ppszFileName);
691 return E_NOTIMPL;
692}

◆ MSTASK_IPersistFile_IsDirty()

static HRESULT WINAPI MSTASK_IPersistFile_IsDirty ( IPersistFile iface)
static

Definition at line 651 of file task.c.

653{
654 FIXME("(%p): stub\n", iface);
655 return E_NOTIMPL;
656}

◆ MSTASK_IPersistFile_Load()

static HRESULT WINAPI MSTASK_IPersistFile_Load ( IPersistFile iface,
LPCOLESTR  pszFileName,
DWORD  dwMode 
)
static

Definition at line 658 of file task.c.

662{
663 FIXME("(%p, %p, 0x%08x): stub\n", iface, pszFileName, dwMode);
664 return E_NOTIMPL;
665}
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44

◆ MSTASK_IPersistFile_QueryInterface()

static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface ( IPersistFile iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 611 of file task.c.

615{
617 TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppvObject);
618 return ITask_QueryInterface(&This->ITask_iface, riid, ppvObject);
619}
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ MSTASK_IPersistFile_Release()

static ULONG WINAPI MSTASK_IPersistFile_Release ( IPersistFile iface)
static

Definition at line 631 of file task.c.

633{
635 ULONG ref;
636 TRACE("\n");
638 if (ref == 0)
640 return ref;
641}
#define InterlockedDecrement
Definition: armddk.h:52
static void TaskDestructor(TaskImpl *This)
Definition: task.c:47

◆ MSTASK_IPersistFile_Save()

static HRESULT WINAPI MSTASK_IPersistFile_Save ( IPersistFile iface,
LPCOLESTR  pszFileName,
BOOL  fRemember 
)
static

Definition at line 667 of file task.c.

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}
#define WARN(fmt,...)
Definition: precomp.h:61
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32

◆ MSTASK_IPersistFile_SaveCompleted()

static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted ( IPersistFile iface,
LPCOLESTR  pszFileName 
)
static

Definition at line 678 of file task.c.

681{
682 FIXME("(%p, %p): stub\n", iface, pszFileName);
683 return E_NOTIMPL;
684}

◆ MSTASK_ITask_AddRef()

static ULONG WINAPI MSTASK_ITask_AddRef ( ITask iface)
static

Definition at line 88 of file task.c.

90{
92 ULONG ref;
93 TRACE("\n");
95 return ref;
96}
static TaskImpl * impl_from_ITask(ITask *iface)
Definition: task.c:37

◆ MSTASK_ITask_CreateTrigger()

static HRESULT WINAPI MSTASK_ITask_CreateTrigger ( ITask iface,
WORD piNewTrigger,
ITaskTrigger **  ppTrigger 
)
static

Definition at line 110 of file task.c.

114{
115 TRACE("(%p, %p, %p)\n", iface, piNewTrigger, ppTrigger);
116 return TaskTriggerConstructor((LPVOID *)ppTrigger);
117}
HRESULT TaskTriggerConstructor(LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: task_trigger.c:277

◆ MSTASK_ITask_DeleteTrigger()

static HRESULT WINAPI MSTASK_ITask_DeleteTrigger ( ITask iface,
WORD  iTrigger 
)
static

Definition at line 119 of file task.c.

122{
123 FIXME("(%p, %d): stub\n", iface, iTrigger);
124 return E_NOTIMPL;
125}

◆ MSTASK_ITask_EditWorkItem()

static HRESULT WINAPI MSTASK_ITask_EditWorkItem ( ITask iface,
HWND  hParent,
DWORD  dwReserved 
)
static

Definition at line 205 of file task.c.

209{
210 FIXME("(%p, %p, %d): stub\n", iface, hParent, dwReserved);
211 return E_NOTIMPL;
212}
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ MSTASK_ITask_GetAccountInformation()

static HRESULT WINAPI MSTASK_ITask_GetAccountInformation ( ITask iface,
LPWSTR ppwszAccountName 
)
static

Definition at line 397 of file task.c.

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}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble n
Definition: glext.h:7729
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ MSTASK_ITask_GetApplicationName()

static HRESULT WINAPI MSTASK_ITask_GetApplicationName ( ITask iface,
LPWSTR ppwszApplicationName 
)
static

Definition at line 466 of file task.c.

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}

◆ MSTASK_ITask_GetComment()

static HRESULT WINAPI MSTASK_ITask_GetComment ( ITask iface,
LPWSTR ppwszComment 
)
static

Definition at line 268 of file task.c.

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}

◆ MSTASK_ITask_GetCreator()

static HRESULT WINAPI MSTASK_ITask_GetCreator ( ITask iface,
LPWSTR ppwszCreator 
)
static

Definition at line 298 of file task.c.

301{
302 FIXME("(%p, %p): stub\n", iface, ppwszCreator);
303 return E_NOTIMPL;
304}

◆ MSTASK_ITask_GetErrorRetryCount()

static HRESULT WINAPI MSTASK_ITask_GetErrorRetryCount ( ITask iface,
WORD pwRetryCount 
)
static

Definition at line 332 of file task.c.

335{
336 FIXME("(%p, %p): stub\n", iface, pwRetryCount);
337 return E_NOTIMPL;
338}

◆ MSTASK_ITask_GetErrorRetryInterval()

static HRESULT WINAPI MSTASK_ITask_GetErrorRetryInterval ( ITask iface,
WORD pwRetryInterval 
)
static

Definition at line 348 of file task.c.

351{
352 FIXME("(%p, %p): stub\n", iface, pwRetryInterval);
353 return E_NOTIMPL;
354}

◆ MSTASK_ITask_GetExitCode()

static HRESULT WINAPI MSTASK_ITask_GetExitCode ( ITask iface,
DWORD pdwExitCode 
)
static

Definition at line 230 of file task.c.

233{
234 FIXME("(%p, %p): stub\n", iface, pdwExitCode);
235 return E_NOTIMPL;
236}

◆ MSTASK_ITask_GetFlags()

static HRESULT WINAPI MSTASK_ITask_GetFlags ( ITask iface,
DWORD pdwFlags 
)
static

Definition at line 364 of file task.c.

367{
368 FIXME("(%p, %p): stub\n", iface, pdwFlags);
369 return E_NOTIMPL;
370}

◆ MSTASK_ITask_GetIdleWait()

static HRESULT WINAPI MSTASK_ITask_GetIdleWait ( ITask iface,
WORD pwIdleMinutes,
WORD pwDeadlineMinutes 
)
static

Definition at line 182 of file task.c.

186{
187 FIXME("(%p, %p, %p): stub\n", iface, pwIdleMinutes, pwDeadlineMinutes);
188 return E_NOTIMPL;
189}

◆ MSTASK_ITask_GetMaxRunTime()

static HRESULT WINAPI MSTASK_ITask_GetMaxRunTime ( ITask iface,
DWORD pdwMaxRunTime 
)
static

Definition at line 599 of file task.c.

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}

◆ MSTASK_ITask_GetMostRecentRunTime()

static HRESULT WINAPI MSTASK_ITask_GetMostRecentRunTime ( ITask iface,
SYSTEMTIME pstLastRun 
)
static

Definition at line 214 of file task.c.

217{
218 FIXME("(%p, %p): stub\n", iface, pstLastRun);
219 return E_NOTIMPL;
220}

◆ MSTASK_ITask_GetNextRunTime()

static HRESULT WINAPI MSTASK_ITask_GetNextRunTime ( ITask iface,
SYSTEMTIME pstNextRun 
)
static

Definition at line 165 of file task.c.

168{
169 FIXME("(%p, %p): stub\n", iface, pstNextRun);
170 return E_NOTIMPL;
171}

◆ MSTASK_ITask_GetParameters()

static HRESULT WINAPI MSTASK_ITask_GetParameters ( ITask iface,
LPWSTR ppwszParameters 
)
static

Definition at line 517 of file task.c.

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}

◆ MSTASK_ITask_GetPriority()

static HRESULT WINAPI MSTASK_ITask_GetPriority ( ITask iface,
DWORD pdwPriority 
)
static

Definition at line 563 of file task.c.

566{
567 FIXME("(%p, %p): stub\n", iface, pdwPriority);
568 return E_NOTIMPL;
569}

◆ MSTASK_ITask_GetRunTimes()

static HRESULT WINAPI MSTASK_ITask_GetRunTimes ( ITask iface,
const LPSYSTEMTIME  pstBegin,
const LPSYSTEMTIME  pstEnd,
WORD pCount,
LPSYSTEMTIME rgstTaskTimes 
)
static

Definition at line 153 of file task.c.

159{
160 FIXME("(%p, %p, %p, %p, %p): stub\n", iface, pstBegin, pstEnd, pCount,
161 rgstTaskTimes);
162 return E_NOTIMPL;
163}

◆ MSTASK_ITask_GetStatus()

static HRESULT WINAPI MSTASK_ITask_GetStatus ( ITask iface,
HRESULT phrStatus 
)
static

Definition at line 222 of file task.c.

225{
226 FIXME("(%p, %p): stub\n", iface, phrStatus);
227 return E_NOTIMPL;
228}

◆ MSTASK_ITask_GetTaskFlags()

static HRESULT WINAPI MSTASK_ITask_GetTaskFlags ( ITask iface,
DWORD pdwFlags 
)
static

Definition at line 579 of file task.c.

582{
583 FIXME("(%p, %p): stub\n", iface, pdwFlags);
584 return E_NOTIMPL;
585}

◆ MSTASK_ITask_GetTrigger()

static HRESULT WINAPI MSTASK_ITask_GetTrigger ( ITask iface,
WORD  iTrigger,
ITaskTrigger **  ppTrigger 
)
static

Definition at line 135 of file task.c.

139{
140 FIXME("(%p, %d, %p): stub\n", iface, iTrigger, ppTrigger);
141 return E_NOTIMPL;
142}

◆ MSTASK_ITask_GetTriggerCount()

static HRESULT WINAPI MSTASK_ITask_GetTriggerCount ( ITask iface,
WORD plCount 
)
static

Definition at line 127 of file task.c.

130{
131 FIXME("(%p, %p): stub\n", iface, plCount);
132 return E_NOTIMPL;
133}

◆ MSTASK_ITask_GetTriggerString()

static HRESULT WINAPI MSTASK_ITask_GetTriggerString ( ITask iface,
WORD  iTrigger,
LPWSTR ppwszTrigger 
)
static

Definition at line 144 of file task.c.

148{
149 FIXME("(%p, %d, %p): stub\n", iface, iTrigger, ppwszTrigger);
150 return E_NOTIMPL;
151}

◆ MSTASK_ITask_GetWorkingDirectory()

static HRESULT WINAPI MSTASK_ITask_GetWorkingDirectory ( ITask iface,
LPWSTR ppwszWorkingDirectory 
)
static

Definition at line 547 of file task.c.

550{
551 FIXME("(%p, %p): stub\n", iface, ppwszWorkingDirectory);
552 return E_NOTIMPL;
553}

◆ MSTASK_ITask_GetWorkItemData()

static HRESULT WINAPI MSTASK_ITask_GetWorkItemData ( ITask iface,
WORD pcBytes,
BYTE **  ppBytes 
)
static

Definition at line 315 of file task.c.

319{
320 FIXME("(%p, %p, %p): stub\n", iface, pcBytes, ppBytes);
321 return E_NOTIMPL;
322}

◆ MSTASK_ITask_QueryInterface()

static HRESULT WINAPI MSTASK_ITask_QueryInterface ( ITask iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 58 of file task.c.

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
70 IsEqualGUID(riid, &IID_ITask))
71 {
72 *ppvObject = &This->ITask_iface;
73 ITask_AddRef(iface);
74 return S_OK;
75 }
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}
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
const GUID IID_IPersistFile
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365

◆ MSTASK_ITask_Release()

static ULONG WINAPI MSTASK_ITask_Release ( ITask iface)
static

Definition at line 98 of file task.c.

100{
101 TaskImpl * This = impl_from_ITask(iface);
102 ULONG ref;
103 TRACE("\n");
105 if (ref == 0)
107 return ref;
108}

◆ MSTASK_ITask_Run()

static HRESULT WINAPI MSTASK_ITask_Run ( ITask iface)
static

Definition at line 191 of file task.c.

193{
194 FIXME("(%p): stub\n", iface);
195 return E_NOTIMPL;
196}

◆ MSTASK_ITask_SetAccountInformation()

static HRESULT WINAPI MSTASK_ITask_SetAccountInformation ( ITask iface,
LPCWSTR  pwszAccountName,
LPCWSTR  pwszPassword 
)
static

Definition at line 372 of file task.c.

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}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ MSTASK_ITask_SetApplicationName()

static HRESULT WINAPI MSTASK_ITask_SetApplicationName ( ITask iface,
LPCWSTR  pwszApplicationName 
)
static

Definition at line 419 of file task.c.

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}
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:1298
static char * tmp_name
Definition: cache.c:24

◆ MSTASK_ITask_SetComment()

static HRESULT WINAPI MSTASK_ITask_SetComment ( ITask iface,
LPCWSTR  pwszComment 
)
static

Definition at line 238 of file task.c.

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}

◆ MSTASK_ITask_SetCreator()

static HRESULT WINAPI MSTASK_ITask_SetCreator ( ITask iface,
LPCWSTR  pwszCreator 
)
static

Definition at line 290 of file task.c.

293{
294 FIXME("(%p, %p): stub\n", iface, pwszCreator);
295 return E_NOTIMPL;
296}

◆ MSTASK_ITask_SetErrorRetryCount()

static HRESULT WINAPI MSTASK_ITask_SetErrorRetryCount ( ITask iface,
WORD  wRetryCount 
)
static

Definition at line 324 of file task.c.

327{
328 FIXME("(%p, %d): stub\n", iface, wRetryCount);
329 return E_NOTIMPL;
330}

◆ MSTASK_ITask_SetErrorRetryInterval()

static HRESULT WINAPI MSTASK_ITask_SetErrorRetryInterval ( ITask iface,
WORD  wRetryInterval 
)
static

Definition at line 340 of file task.c.

343{
344 FIXME("(%p, %d): stub\n", iface, wRetryInterval);
345 return E_NOTIMPL;
346}

◆ MSTASK_ITask_SetFlags()

static HRESULT WINAPI MSTASK_ITask_SetFlags ( ITask iface,
DWORD  dwFlags 
)
static

Definition at line 356 of file task.c.

359{
360 FIXME("(%p, 0x%08x): stub\n", iface, dwFlags);
361 return E_NOTIMPL;
362}
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ MSTASK_ITask_SetIdleWait()

static HRESULT WINAPI MSTASK_ITask_SetIdleWait ( ITask iface,
WORD  wIdleMinutes,
WORD  wDeadlineMinutes 
)
static

Definition at line 173 of file task.c.

177{
178 FIXME("(%p, %d, %d): stub\n", iface, wIdleMinutes, wDeadlineMinutes);
179 return E_NOTIMPL;
180}

◆ MSTASK_ITask_SetMaxRunTime()

static HRESULT WINAPI MSTASK_ITask_SetMaxRunTime ( ITask iface,
DWORD  dwMaxRunTime 
)
static

Definition at line 587 of file task.c.

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}

◆ MSTASK_ITask_SetParameters()

static HRESULT WINAPI MSTASK_ITask_SetParameters ( ITask iface,
LPCWSTR  pwszParameters 
)
static

Definition at line 488 of file task.c.

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}

◆ MSTASK_ITask_SetPriority()

static HRESULT WINAPI MSTASK_ITask_SetPriority ( ITask iface,
DWORD  dwPriority 
)
static

Definition at line 555 of file task.c.

558{
559 FIXME("(%p, 0x%08x): stub\n", iface, dwPriority);
560 return E_NOTIMPL;
561}

◆ MSTASK_ITask_SetTaskFlags()

static HRESULT WINAPI MSTASK_ITask_SetTaskFlags ( ITask iface,
DWORD  dwFlags 
)
static

Definition at line 571 of file task.c.

574{
575 FIXME("(%p, 0x%08x): stub\n", iface, dwFlags);
576 return E_NOTIMPL;
577}

◆ MSTASK_ITask_SetWorkingDirectory()

static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory ( ITask iface,
LPCWSTR  pwszWorkingDirectory 
)
static

Definition at line 539 of file task.c.

542{
543 FIXME("(%p, %s): stub\n", iface, debugstr_w(pwszWorkingDirectory));
544 return E_NOTIMPL;
545}

◆ MSTASK_ITask_SetWorkItemData()

static HRESULT WINAPI MSTASK_ITask_SetWorkItemData ( ITask iface,
WORD  cBytes,
BYTE  rgbData[] 
)
static

Definition at line 306 of file task.c.

310{
311 FIXME("(%p, %d, %p): stub\n", iface, cBytes, rgbData);
312 return E_NOTIMPL;
313}

◆ MSTASK_ITask_Terminate()

static HRESULT WINAPI MSTASK_ITask_Terminate ( ITask iface)
static

Definition at line 198 of file task.c.

200{
201 FIXME("(%p): stub\n", iface);
202 return E_NOTIMPL;
203}

◆ TaskConstructor()

HRESULT TaskConstructor ( LPCWSTR  pwszTaskName,
LPVOID ppObj 
)

Definition at line 756 of file task.c.

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 const IPersistFileVtbl MSTASK_IPersistFileVtbl
Definition: task.c:743
static const ITaskVtbl MSTASK_ITaskVtbl
Definition: task.c:695
LONG dll_ref
Definition: mstask_main.c:31

Referenced by MSTASK_ITaskScheduler_NewWorkItem().

◆ TaskDestructor()

static void TaskDestructor ( TaskImpl This)
static

Definition at line 47 of file task.c.

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}

Referenced by MSTASK_IPersistFile_Release(), and MSTASK_ITask_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mstask  )

Variable Documentation

◆ MSTASK_IPersistFileVtbl

const IPersistFileVtbl MSTASK_IPersistFileVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI MSTASK_IPersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
Definition: task.c:678
static HRESULT WINAPI MSTASK_IPersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
Definition: task.c:658
static HRESULT WINAPI MSTASK_IPersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
Definition: task.c:667
static HRESULT WINAPI MSTASK_IPersistFile_IsDirty(IPersistFile *iface)
Definition: task.c:651
static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
Definition: task.c:611
static ULONG WINAPI MSTASK_IPersistFile_Release(IPersistFile *iface)
Definition: task.c:631
static ULONG WINAPI MSTASK_IPersistFile_AddRef(IPersistFile *iface)
Definition: task.c:621
static HRESULT WINAPI MSTASK_IPersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *ppszFileName)
Definition: task.c:686
static HRESULT WINAPI MSTASK_IPersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
Definition: task.c:643

Definition at line 743 of file task.c.

Referenced by TaskConstructor().

◆ MSTASK_ITaskVtbl

const ITaskVtbl MSTASK_ITaskVtbl
static

Definition at line 695 of file task.c.

Referenced by TaskConstructor().