Go to the source code of this file.
◆ DllMain()
Definition at line 270 of file schedsvc.c.
273{
275 {
278 break;
279
281 break;
282 }
283
285}
static DWORD const fdwReason
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
◆ SchedServiceMain()
Definition at line 198 of file schedsvc.c.
199{
200 DWORD dwWait, dwError;
201
204
205 TRACE(
"SchedServiceMain()\n");
206
211 {
212 ERR(
"RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n",
GetLastError());
213 return;
214 }
215
217
220 {
221 ERR(
"Service stopped (dwError: %lu\n", dwError);
223 return;
224 }
225
227
229
230 for (;;)
231 {
232
233 TRACE(
"Wait for next event!\n");
236 {
237 TRACE(
"Stop event signaled!\n");
238 break;
239 }
241 {
242 TRACE(
"Update event signaled!\n");
243
247 }
249 {
250 TRACE(
"Timeout: Start the next job!\n");
251
256 }
257 }
258
259
263
264
266}
VOID GetNextJobTimeout(HANDLE hTimer)
VOID RunCurrentJobs(VOID)
static WCHAR ServiceName[]
static DWORD ServiceInit(VOID)
static DWORD WINAPI ServiceControlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
static VOID UpdateServiceStatus(DWORD dwState)
static SERVICE_STATUS_HANDLE ServiceStatusHandle
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceShared(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceExclusive(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
NTSYSAPI VOID NTAPI RtlReleaseResource(_In_ PRTL_RESOURCE Resource)
#define UNREFERENCED_PARAMETER(P)
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define SERVICE_START_PENDING
◆ ServiceControlHandler()
Definition at line 76 of file schedsvc.c.
80{
81 TRACE(
"ServiceControlHandler()\n");
82
83 switch (dwControl)
84 {
87 TRACE(
" SERVICE_CONTROL_STOP/SERVICE_CONTROL_SHUTDOWN received\n");
89
94
96 TRACE(
" SERVICE_CONTROL_PAUSE received\n");
99
101 TRACE(
" SERVICE_CONTROL_CONTINUE received\n");
104
106 TRACE(
" SERVICE_CONTROL_INTERROGATE received\n");
110
111#if 0
112 case 128:
113 TRACE(
" Start Shell control received\n");
115
116 case 129:
117 TRACE(
" Logoff control received\n");
119#endif
120
121 default:
122 TRACE(
" Control %lu received\n", dwControl);
124 }
125}
static SERVICE_STATUS ServiceStatus
#define ERROR_CALL_NOT_IMPLEMENTED
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
#define SERVICE_STOP_PENDING
#define SERVICE_CONTROL_SHUTDOWN
#define SERVICE_CONTROL_CONTINUE
#define SERVICE_CONTROL_STOP
#define SERVICE_CONTROL_PAUSE
#define SERVICE_CONTROL_INTERROGATE
Referenced by SchedServiceMain().
◆ ServiceInit()
Definition at line 130 of file schedsvc.c.
131{
134
135
137
138
140
141
143
144
146
147
150 return dwError;
151
152
154 0,
157 0,
160 {
161 ERR(
"Could not create the RPC thread\n");
163 }
164
166
167
170 {
171 ERR(
"Could not create the stop event\n");
173 }
174
175
178 {
179 ERR(
"Could not create the update event\n");
182 }
183
186 {
187 ERR(
"Could not create the timer\n");
191 }
192
194}
DWORD WINAPI RpcThreadRoutine(LPVOID lpParameter)
RTL_RESOURCE StartListLock
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
#define InitializeListHead(ListHead)
NTSYSAPI VOID NTAPI RtlInitializeResource(_In_ PRTL_RESOURCE Resource)
HANDLE WINAPI CreateWaitableTimerW(IN LPSECURITY_ATTRIBUTES lpTimerAttributes OPTIONAL, IN BOOL bManualReset, IN LPCWSTR lpTimerName OPTIONAL)
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
Referenced by SchedServiceMain().
◆ UpdateServiceStatus()
static VOID UpdateServiceStatus |
( |
DWORD |
dwState | ) |
|
|
static |
Definition at line 46 of file schedsvc.c.
47{
50
55 else
57
61
67 else
69
72}
DWORD dwServiceSpecificExitCode
#define SERVICE_ACCEPT_STOP
#define SERVICE_ACCEPT_PAUSE_CONTINUE
#define SERVICE_ACCEPT_SHUTDOWN
#define SERVICE_PAUSE_PENDING
#define SERVICE_CONTINUE_PENDING
#define SERVICE_WIN32_SHARE_PROCESS
Referenced by SchedServiceMain(), and ServiceControlHandler().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
schedsvc |
| ) |
|
◆ Events
Definition at line 40 of file schedsvc.c.
Referenced by dispatch(), NetrJobAdd(), NetrJobDel(), PipeThreadProc(), PrintEvents(), SchedServiceMain(), SerialInterruptService(), ServiceControlHandler(), ServiceInit(), SockGetTdiName(), TdiCall(), TdiSendThread(), and WSPSelect().
◆ ServiceName
WCHAR ServiceName[] = L"Schedule" |
|
static |
◆ ServiceStatus
◆ ServiceStatusHandle