Author: ekohl
Date: Sat Sep 23 22:29:36 2017
New Revision: 75936
URL:
http://svn.reactos.org/svn/reactos?rev=75936&view=rev
Log:
[WLNOTIFY]
- Add Notifications for the Scheduler Service.
Added:
trunk/reactos/dll/win32/wlnotify/schedsvc.c (with props)
Modified:
trunk/reactos/dll/win32/wlnotify/CMakeLists.txt
trunk/reactos/dll/win32/wlnotify/wlnotify.spec
Modified: trunk/reactos/dll/win32/wlnotify/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wlnotify/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/wlnotify/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wlnotify/CMakeLists.txt [iso-8859-1] Sat Sep 23 22:29:36 2017
@@ -2,6 +2,7 @@
spec2def(wlnotify.dll wlnotify.spec ADD_IMPORTLIB)
list(APPEND SOURCE
+ schedsvc.c
test.c
wlnotify.c
precomp.h)
@@ -12,6 +13,6 @@
${CMAKE_CURRENT_BINARY_DIR}/wlnotify.def)
set_module_type(wlnotify win32dll UNICODE ENTRYPOINT DllMain 12)
-add_importlibs(wlnotify kernel32 ntdll)
+add_importlibs(wlnotify advapi32 kernel32 ntdll)
add_pch(wlnotify precomp.h SOURCE)
add_cd_file(TARGET wlnotify DESTINATION reactos/system32 FOR all)
Added: trunk/reactos/dll/win32/wlnotify/schedsvc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wlnotify/schedsv…
==============================================================================
--- trunk/reactos/dll/win32/wlnotify/schedsvc.c (added)
+++ trunk/reactos/dll/win32/wlnotify/schedsvc.c [iso-8859-1] Sat Sep 23 22:29:36 2017
@@ -0,0 +1,109 @@
+/*
+ * 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(a)reactos.org>
+ */
+
+#include "precomp.h"
+#include <winsvc.h>
+
+#define _NDEBUG
+#include <debug.h>
+
+
+VOID
+WINAPI
+SchedEventLogoff(
+ PWLX_NOTIFICATION_INFO pInfo)
+{
+ SC_HANDLE hManager = NULL;
+ SC_HANDLE hService = NULL;
+ SERVICE_STATUS ServiceStatus;
+
+ DPRINT("SchedStartShellEvent\n");
+ DPRINT("Size: %lu\n", pInfo->Size);
+ DPRINT("Flags: %lx\n", pInfo->Flags);
+ DPRINT("UserName: %S\n", pInfo->UserName);
+ DPRINT("Domain: %S\n", pInfo->Domain);
+ DPRINT("WindowStation: %S\n", pInfo->WindowStation);
+ DPRINT("hToken: %p\n", pInfo->hToken);
+ DPRINT("hDesktop: %p\n", pInfo->hDesktop);
+ DPRINT("pStatusCallback: %p\n", pInfo->pStatusCallback);
+
+ hManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT);
+ if (hManager == NULL)
+ {
+ DPRINT1("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
+ goto done;
+ }
+
+ hService = OpenServiceW(hManager, L"Schedule",
SERVICE_USER_DEFINED_CONTROL);
+ if (hManager == NULL)
+ {
+ DPRINT1("OpenServiceW() failed (Error %lu)\n", GetLastError());
+ goto done;
+ }
+
+ if (!ControlService(hService, 129, &ServiceStatus))
+ {
+ DPRINT1("ControlService() failed (Error %lu)\n", GetLastError());
+ }
+
+done:
+ if (hService != NULL)
+ CloseServiceHandle(hService);
+
+ if (hManager != NULL)
+ CloseServiceHandle(hManager);
+}
+
+
+VOID
+WINAPI
+SchedStartShell(
+ PWLX_NOTIFICATION_INFO pInfo)
+{
+ SC_HANDLE hManager = NULL;
+ SC_HANDLE hService = NULL;
+ SERVICE_STATUS ServiceStatus;
+
+ DPRINT("SchedStartShellEvent\n");
+ DPRINT("Size: %lu\n", pInfo->Size);
+ DPRINT("Flags: %lx\n", pInfo->Flags);
+ DPRINT("UserName: %S\n", pInfo->UserName);
+ DPRINT("Domain: %S\n", pInfo->Domain);
+ DPRINT("WindowStation: %S\n", pInfo->WindowStation);
+ DPRINT("hToken: %p\n", pInfo->hToken);
+ DPRINT("hDesktop: %p\n", pInfo->hDesktop);
+ DPRINT("pStatusCallback: %p\n", pInfo->pStatusCallback);
+
+ hManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT);
+ if (hManager == NULL)
+ {
+ DPRINT1("OpenSCManagerW() failed (Error %lu)\n", GetLastError());
+ goto done;
+ }
+
+ hService = OpenServiceW(hManager, L"Schedule",
SERVICE_USER_DEFINED_CONTROL);
+ if (hManager == NULL)
+ {
+ DPRINT1("OpenServiceW() failed (Error %lu)\n", GetLastError());
+ goto done;
+ }
+
+ if (!ControlService(hService, 128, &ServiceStatus))
+ {
+ DPRINT1("ControlService() failed (Error %lu)\n", GetLastError());
+ }
+
+done:
+ if (hService != NULL)
+ CloseServiceHandle(hService);
+
+ if (hManager != NULL)
+ CloseServiceHandle(hManager);
+}
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/wlnotify/schedsvc.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/wlnotify/wlnotify.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wlnotify/wlnotif…
==============================================================================
--- trunk/reactos/dll/win32/wlnotify/wlnotify.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wlnotify/wlnotify.spec [iso-8859-1] Sat Sep 23 22:29:36 2017
@@ -1,3 +1,23 @@
+;@ stub RegisterTicketExpiredNotificationEvent
+;@ stub SCardResumeCertProp
+;@ stub SCardStartCertProp
+;@ stub SCardStopCertProp
+;@ stub SCardSuspendCertProp
+@ stdcall SchedEventLogoff(ptr)
+@ stdcall SchedStartShell(ptr)
+;@ stub SensDisconnectEvent
+;@ stub SensLockEvent
+;@ stub SensLogoffEvent
+;@ stub SensLogonEvent
+;@ stub SensPostShellEvent
+;@ stub SensReconnectEvent
+;@ stub SensShutdownEvent
+;@ stub SensStartScreenSaverEvent
+;@ stub SensStartShellEvent
+;@ stub SensStartupEvent
+;@ stub SensStopScreenSaverEvent
+;@ stub SensUnlockEvent
+;@ stub ShowNotificationBallonW
@ stdcall TestDisconnectEvent(ptr)
@ stdcall TestLockEvent(ptr)
@ stdcall TestLogoffEvent(ptr)
@@ -10,3 +30,13 @@
@ stdcall TestStartupEvent(ptr)
@ stdcall TestStopScreenSaverEvent(ptr)
@ stdcall TestUnlockEvent(ptr)
+;@ stub TSEventDisconnect
+;@ stub TSEventLogoff
+;@ stub TSEventLogon
+;@ stub TSEventPostShell
+;@ stub TSEventReconnect
+;@ stub TSEventShutdown
+;@ stub TSEventStartShell
+;@ stub TSEventStartup
+;@ stub TermsrvCreateTempDir
+;@ stub UnregisterTicketExpiredNotificationEvent