ReactOS 0.4.15-dev-7108-g1cf6ce6
schedsvc.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS system libraries
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/wlnotify/schedsvc.c
5 * PURPOSE: Scheduler service logon notifications
6 * PROGRAMMER: Eric Kohl <eric.kohl@reactos.org>
7 */
8
9#include "precomp.h"
10#include <winsvc.h>
11
13
14
15VOID
19{
20#if 0
21 SC_HANDLE hManager = NULL;
22 SC_HANDLE hService = NULL;
24#endif
25
26 TRACE("SchedEventLogoff\n");
27 TRACE("Size: %lu\n", pInfo->Size);
28 TRACE("Flags: %lx\n", pInfo->Flags);
29 TRACE("UserName: %S\n", pInfo->UserName);
30 TRACE("Domain: %S\n", pInfo->Domain);
31 TRACE("WindowStation: %S\n", pInfo->WindowStation);
32 TRACE("hToken: %p\n", pInfo->hToken);
33 TRACE("hDesktop: %p\n", pInfo->hDesktop);
34 TRACE("pStatusCallback: %p\n", pInfo->pStatusCallback);
35
36#if 0
38 if (hManager == NULL)
39 {
40 WARN("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
41 goto done;
42 }
43
44 hService = OpenServiceW(hManager, L"Schedule", SERVICE_USER_DEFINED_CONTROL);
45 if (hManager == NULL)
46 {
47 WARN("OpenServiceW() failed (Error %lu)\n", GetLastError());
48 goto done;
49 }
50
51 if (!ControlService(hService, 129, &ServiceStatus))
52 {
53 WARN("ControlService() failed (Error %lu)\n", GetLastError());
54 }
55
56done:
57 if (hService != NULL)
58 CloseServiceHandle(hService);
59
60 if (hManager != NULL)
61 CloseServiceHandle(hManager);
62#endif
63}
64
65
66VOID
70{
71 SC_HANDLE hManager = NULL;
72 SC_HANDLE hService = NULL;
74
75 TRACE("SchedStartShell\n");
76 TRACE("Size: %lu\n", pInfo->Size);
77 TRACE("Flags: %lx\n", pInfo->Flags);
78 TRACE("UserName: %S\n", pInfo->UserName);
79 TRACE("Domain: %S\n", pInfo->Domain);
80 TRACE("WindowStation: %S\n", pInfo->WindowStation);
81 TRACE("hToken: %p\n", pInfo->hToken);
82 TRACE("hDesktop: %p\n", pInfo->hDesktop);
83 TRACE("pStatusCallback: %p\n", pInfo->pStatusCallback);
84
86 if (hManager == NULL)
87 {
88 WARN("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
89 goto done;
90 }
91
92 hService = OpenServiceW(hManager, L"Schedule", SERVICE_USER_DEFINED_CONTROL);
93 if (hManager == NULL)
94 {
95 WARN("OpenServiceW() failed (Error %lu)\n", GetLastError());
96 goto done;
97 }
98
99 if (!ControlService(hService, 128, &ServiceStatus))
100 {
101 WARN("ControlService() failed (Error %lu)\n", GetLastError());
102 }
103
104done:
105 if (hService != NULL)
106 CloseServiceHandle(hService);
107
108 if (hManager != NULL)
109 CloseServiceHandle(hManager);
110}
111
112/* EOF */
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static SERVICE_STATUS ServiceStatus
Definition: schedsvc.c:38
#define WARN(fmt,...)
Definition: debug.h:112
#define NULL
Definition: types.h:112
VOID WINAPI SchedEventLogoff(PWLX_NOTIFICATION_INFO pInfo)
Definition: schedsvc.c:17
VOID WINAPI SchedStartShell(PWLX_NOTIFICATION_INFO pInfo)
Definition: schedsvc.c:68
#define L(x)
Definition: ntvdm.h:50
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2016
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:622
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2108
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
#define TRACE(s)
Definition: solgame.cpp:4
PFNMSGECALLBACK pStatusCallback
Definition: winwlx.h:629
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WINAPI
Definition: msvc.h:6
#define SERVICE_USER_DEFINED_CONTROL
Definition: winsvc.h:61
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14