2017-09-23 22:29:36 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: dll/win32/wlnotify/schedsvc.c
|
|
|
|
* PURPOSE: Scheduler service logon notifications
|
|
|
|
* PROGRAMMER: Eric Kohl <eric.kohl@reactos.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
|
|
|
#include <winsvc.h>
|
|
|
|
|
2018-08-18 20:19:14 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(wlnotify);
|
2017-09-23 22:29:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
VOID
|
|
|
|
WINAPI
|
|
|
|
SchedEventLogoff(
|
|
|
|
PWLX_NOTIFICATION_INFO pInfo)
|
|
|
|
{
|
2018-09-19 14:35:12 +00:00
|
|
|
#if 0
|
2017-09-23 22:29:36 +00:00
|
|
|
SC_HANDLE hManager = NULL;
|
|
|
|
SC_HANDLE hService = NULL;
|
|
|
|
SERVICE_STATUS ServiceStatus;
|
2018-09-19 14:35:12 +00:00
|
|
|
#endif
|
2017-09-23 22:29:36 +00:00
|
|
|
|
2018-08-18 20:19:14 +00:00
|
|
|
TRACE("SchedEventLogoff\n");
|
|
|
|
TRACE("Size: %lu\n", pInfo->Size);
|
|
|
|
TRACE("Flags: %lx\n", pInfo->Flags);
|
|
|
|
TRACE("UserName: %S\n", pInfo->UserName);
|
|
|
|
TRACE("Domain: %S\n", pInfo->Domain);
|
|
|
|
TRACE("WindowStation: %S\n", pInfo->WindowStation);
|
|
|
|
TRACE("hToken: %p\n", pInfo->hToken);
|
|
|
|
TRACE("hDesktop: %p\n", pInfo->hDesktop);
|
|
|
|
TRACE("pStatusCallback: %p\n", pInfo->pStatusCallback);
|
2017-09-23 22:29:36 +00:00
|
|
|
|
2018-09-19 14:35:12 +00:00
|
|
|
#if 0
|
2017-09-23 22:29:36 +00:00
|
|
|
hManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT);
|
|
|
|
if (hManager == NULL)
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
hService = OpenServiceW(hManager, L"Schedule", SERVICE_USER_DEFINED_CONTROL);
|
|
|
|
if (hManager == NULL)
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("OpenServiceW() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ControlService(hService, 129, &ServiceStatus))
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("ControlService() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
if (hService != NULL)
|
|
|
|
CloseServiceHandle(hService);
|
|
|
|
|
|
|
|
if (hManager != NULL)
|
|
|
|
CloseServiceHandle(hManager);
|
2018-09-19 14:35:12 +00:00
|
|
|
#endif
|
2017-09-23 22:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
VOID
|
|
|
|
WINAPI
|
|
|
|
SchedStartShell(
|
|
|
|
PWLX_NOTIFICATION_INFO pInfo)
|
|
|
|
{
|
|
|
|
SC_HANDLE hManager = NULL;
|
|
|
|
SC_HANDLE hService = NULL;
|
|
|
|
SERVICE_STATUS ServiceStatus;
|
|
|
|
|
2018-08-18 20:19:14 +00:00
|
|
|
TRACE("SchedStartShell\n");
|
|
|
|
TRACE("Size: %lu\n", pInfo->Size);
|
|
|
|
TRACE("Flags: %lx\n", pInfo->Flags);
|
|
|
|
TRACE("UserName: %S\n", pInfo->UserName);
|
|
|
|
TRACE("Domain: %S\n", pInfo->Domain);
|
|
|
|
TRACE("WindowStation: %S\n", pInfo->WindowStation);
|
|
|
|
TRACE("hToken: %p\n", pInfo->hToken);
|
|
|
|
TRACE("hDesktop: %p\n", pInfo->hDesktop);
|
|
|
|
TRACE("pStatusCallback: %p\n", pInfo->pStatusCallback);
|
2017-09-23 22:29:36 +00:00
|
|
|
|
|
|
|
hManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT);
|
|
|
|
if (hManager == NULL)
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
hService = OpenServiceW(hManager, L"Schedule", SERVICE_USER_DEFINED_CONTROL);
|
|
|
|
if (hManager == NULL)
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("OpenServiceW() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ControlService(hService, 128, &ServiceStatus))
|
|
|
|
{
|
2018-08-18 20:19:14 +00:00
|
|
|
WARN("ControlService() failed (Error %lu)\n", GetLastError());
|
2017-09-23 22:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
if (hService != NULL)
|
|
|
|
CloseServiceHandle(hService);
|
|
|
|
|
|
|
|
if (hManager != NULL)
|
|
|
|
CloseServiceHandle(hManager);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|