2015-03-22 21:57:55 +00:00
|
|
|
#ifndef _SCHEDSVC_PCH_
|
|
|
|
#define _SCHEDSVC_PCH_
|
|
|
|
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
2017-04-15 10:33:29 +00:00
|
|
|
#include <limits.h>
|
2015-03-22 21:57:55 +00:00
|
|
|
#include <stdarg.h>
|
2017-04-09 08:47:10 +00:00
|
|
|
#include <stdio.h>
|
2015-03-22 21:57:55 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
#include <winsvc.h>
|
2018-11-04 23:22:30 +00:00
|
|
|
#include <winuser.h>
|
|
|
|
#include <undocuser.h>
|
2015-03-22 21:57:55 +00:00
|
|
|
|
2017-04-01 22:54:30 +00:00
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
|
2015-03-22 21:57:55 +00:00
|
|
|
#include <atsvc_s.h>
|
|
|
|
|
|
|
|
#include <wine/debug.h>
|
|
|
|
|
2017-06-07 17:45:05 +00:00
|
|
|
#define JOB_NAME_LENGTH 9
|
|
|
|
|
2017-04-09 08:47:10 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlRandomEx(
|
|
|
|
PULONG Seed);
|
|
|
|
|
|
|
|
typedef struct _JOB
|
|
|
|
{
|
|
|
|
LIST_ENTRY JobEntry;
|
|
|
|
|
2021-12-25 13:18:53 +00:00
|
|
|
FILETIME StartTime;
|
2017-06-07 17:45:05 +00:00
|
|
|
WCHAR Name[JOB_NAME_LENGTH];
|
2017-04-09 08:47:10 +00:00
|
|
|
|
|
|
|
DWORD JobId;
|
|
|
|
DWORD_PTR JobTime;
|
|
|
|
DWORD DaysOfMonth;
|
|
|
|
UCHAR DaysOfWeek;
|
|
|
|
UCHAR Flags;
|
|
|
|
WCHAR Command[1];
|
|
|
|
} JOB, *PJOB;
|
|
|
|
|
|
|
|
|
|
|
|
extern DWORD dwNextJobId;
|
|
|
|
extern DWORD dwJobCount;
|
|
|
|
|
2017-04-01 22:54:30 +00:00
|
|
|
extern LIST_ENTRY JobListHead;
|
|
|
|
extern RTL_RESOURCE JobListLock;
|
|
|
|
|
2017-04-09 08:47:10 +00:00
|
|
|
extern LIST_ENTRY StartListHead;
|
|
|
|
extern RTL_RESOURCE StartListLock;
|
|
|
|
|
2021-12-25 13:18:53 +00:00
|
|
|
extern HANDLE Events[3];
|
2018-10-27 22:02:18 +00:00
|
|
|
|
2017-04-09 08:47:10 +00:00
|
|
|
|
|
|
|
/* job.c */
|
|
|
|
|
2021-12-25 13:18:53 +00:00
|
|
|
VOID
|
|
|
|
GetNextJobTimeout(
|
|
|
|
HANDLE hTimer);
|
2018-10-27 22:02:18 +00:00
|
|
|
|
2018-10-28 17:12:55 +00:00
|
|
|
VOID
|
2021-12-25 13:18:53 +00:00
|
|
|
RunCurrentJobs(VOID);
|
2018-10-28 17:12:55 +00:00
|
|
|
|
2017-04-09 08:47:10 +00:00
|
|
|
LONG
|
|
|
|
SaveJob(
|
|
|
|
PJOB pJob);
|
|
|
|
|
|
|
|
LONG
|
|
|
|
DeleteJob(
|
|
|
|
PJOB pJob);
|
|
|
|
|
|
|
|
LONG
|
|
|
|
LoadJobs(VOID);
|
|
|
|
|
2017-04-14 21:16:37 +00:00
|
|
|
VOID
|
|
|
|
CalculateNextStartTime(
|
2017-04-15 10:33:29 +00:00
|
|
|
_In_ PJOB pJob);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
InsertJobIntoStartList(
|
|
|
|
_In_ PLIST_ENTRY StartListHead,
|
|
|
|
_In_ PJOB pJob);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
DumpStartList(
|
|
|
|
_In_ PLIST_ENTRY StartListHead);
|
|
|
|
|
2017-04-09 08:47:10 +00:00
|
|
|
|
|
|
|
/* rpcserver.c */
|
|
|
|
|
2015-03-22 21:57:55 +00:00
|
|
|
DWORD
|
|
|
|
WINAPI
|
|
|
|
RpcThreadRoutine(
|
|
|
|
LPVOID lpParameter);
|
|
|
|
|
|
|
|
#endif /* _SCHEDSVC_PCH_ */
|