405a0dd61e13a995309ded4567eae27764cdd52c
[reactos.git] / base / services / schedsvc / precomp.h
1 #ifndef _SCHEDSVC_PCH_
2 #define _SCHEDSVC_PCH_
3
4 #define WIN32_NO_STATUS
5 #define _INC_WINDOWS
6 #define COM_NO_WINDOWS_H
7 #include <limits.h>
8 #include <stdarg.h>
9 #include <stdio.h>
10 #include <windef.h>
11 #include <winbase.h>
12 #include <winreg.h>
13 #include <winsvc.h>
14
15 #include <ndk/rtlfuncs.h>
16
17 #include <atsvc_s.h>
18
19 #include <wine/debug.h>
20
21 #define JOB_NAME_LENGTH 9
22
23 NTSYSAPI
24 ULONG
25 NTAPI
26 RtlRandomEx(
27 PULONG Seed);
28
29 typedef struct _JOB
30 {
31 LIST_ENTRY JobEntry;
32
33 LIST_ENTRY StartEntry;
34 ULARGE_INTEGER StartTime;
35 WCHAR Name[JOB_NAME_LENGTH];
36
37 DWORD JobId;
38 DWORD_PTR JobTime;
39 DWORD DaysOfMonth;
40 UCHAR DaysOfWeek;
41 UCHAR Flags;
42 WCHAR Command[1];
43 } JOB, *PJOB;
44
45
46 extern DWORD dwNextJobId;
47 extern DWORD dwJobCount;
48
49 extern LIST_ENTRY JobListHead;
50 extern RTL_RESOURCE JobListLock;
51
52 extern LIST_ENTRY StartListHead;
53 extern RTL_RESOURCE StartListLock;
54
55 extern HANDLE Events[2];
56
57
58 /* job.c */
59
60 DWORD
61 GetNextJobTimeout(VOID);
62
63 LONG
64 SaveJob(
65 PJOB pJob);
66
67 LONG
68 DeleteJob(
69 PJOB pJob);
70
71 LONG
72 LoadJobs(VOID);
73
74 VOID
75 CalculateNextStartTime(
76 _In_ PJOB pJob);
77
78 VOID
79 InsertJobIntoStartList(
80 _In_ PLIST_ENTRY StartListHead,
81 _In_ PJOB pJob);
82
83 VOID
84 DumpStartList(
85 _In_ PLIST_ENTRY StartListHead);
86
87
88 /* rpcserver.c */
89
90 DWORD
91 WINAPI
92 RpcThreadRoutine(
93 LPVOID lpParameter);
94
95 #endif /* _SCHEDSVC_PCH_ */