ReactOS  0.4.14-dev-342-gdc047f9
schedsvc.c File Reference
#include "precomp.h"
#include <winsvc.h>
Include dependency graph for schedsvc.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wlnotify)
 
VOID WINAPI SchedEventLogoff (PWLX_NOTIFICATION_INFO pInfo)
 
VOID WINAPI SchedStartShell (PWLX_NOTIFICATION_INFO pInfo)
 

Function Documentation

◆ SchedEventLogoff()

VOID WINAPI SchedEventLogoff ( PWLX_NOTIFICATION_INFO  pInfo)

Definition at line 17 of file schedsvc.c.

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 
56 done:
57  if (hService != NULL)
58  CloseServiceHandle(hService);
59 
60  if (hManager != NULL)
61  CloseServiceHandle(hManager);
62 #endif
63 }
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static SERVICE_STATUS ServiceStatus
Definition: schedsvc.c:38
PFNMSGECALLBACK pStatusCallback
Definition: winwlx.h:629
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2103
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define SERVICE_USER_DEFINED_CONTROL
Definition: winsvc.h:61
static const WCHAR L[]
Definition: oid.c:1250
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:619

◆ SchedStartShell()

VOID WINAPI SchedStartShell ( PWLX_NOTIFICATION_INFO  pInfo)

Definition at line 68 of file schedsvc.c.

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 
104 done:
105  if (hService != NULL)
106  CloseServiceHandle(hService);
107 
108  if (hManager != NULL)
109  CloseServiceHandle(hManager);
110 }
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static SERVICE_STATUS ServiceStatus
Definition: schedsvc.c:38
PFNMSGECALLBACK pStatusCallback
Definition: winwlx.h:629
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2103
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define SERVICE_USER_DEFINED_CONTROL
Definition: winsvc.h:61
static const WCHAR L[]
Definition: oid.c:1250
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:619

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wlnotify  )