xref: /reactos/base/services/schedsvc/precomp.h (revision f308c6a2)
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     FILETIME StartTime;
36     WCHAR Name[JOB_NAME_LENGTH];
37 
38     DWORD JobId;
39     DWORD_PTR JobTime;
40     DWORD DaysOfMonth;
41     UCHAR DaysOfWeek;
42     UCHAR Flags;
43     WCHAR Command[1];
44 } JOB, *PJOB;
45 
46 
47 extern DWORD dwNextJobId;
48 extern DWORD dwJobCount;
49 
50 extern LIST_ENTRY JobListHead;
51 extern RTL_RESOURCE JobListLock;
52 
53 extern LIST_ENTRY StartListHead;
54 extern RTL_RESOURCE StartListLock;
55 
56 extern HANDLE Events[3];
57 
58 
59 /* job.c */
60 
61 VOID
62 GetNextJobTimeout(
63     HANDLE hTimer);
64 
65 VOID
66 RunCurrentJobs(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