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