Author: ekohl
Date: Sun Aug 23 15:48:52 2015
New Revision: 68803
URL:
http://svn.reactos.org/svn/reactos?rev=68803&view=rev
Log:
[WINLOGON]
Implement calls to the notification DLLs.
Modified:
trunk/reactos/base/system/winlogon/notify.c
trunk/reactos/base/system/winlogon/sas.c
trunk/reactos/base/system/winlogon/screensaver.c
trunk/reactos/base/system/winlogon/winlogon.c
trunk/reactos/base/system/winlogon/winlogon.h
Modified: trunk/reactos/base/system/winlogon/notify.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/notif…
==============================================================================
--- trunk/reactos/base/system/winlogon/notify.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/notify.c [iso-8859-1] Sun Aug 23 15:48:52 2015
@@ -15,23 +15,6 @@
// void Event_Handler_Function_Name(PWLX_NOTIFICATION_INFO pInfo);
typedef VOID (WINAPI *PWLX_NOTIFY_HANDLER)(PWLX_NOTIFICATION_INFO pInfo);
-
-typedef enum _NOTIFICATION_TYPE
-{
- LogonHandler,
- LogoffHandler,
- LockHandler,
- UnlockHandler,
- StartupHandler,
- ShutdownHandler,
- StartScreenSaverHandler,
- StopScreenSaverHandler,
- DisconnectHandler,
- ReconnectHandler,
- StartShellHandler,
- PostShellHandler,
- LastHandler
-} NOTIFICATION_TYPE, *PNOTIFICATION_TYPE;
static PSTR FuncNames[LastHandler] =
{
@@ -204,6 +187,75 @@
VOID
+CallNotificationDlls(
+ PWLSESSION pSession,
+ NOTIFICATION_TYPE Type)
+{
+ PLIST_ENTRY ListEntry;
+ PNOTIFICATION_ITEM NotificationDll;
+ WLX_NOTIFICATION_INFO Info;
+
+ TRACE("CallNotificationDlls()\n");
+
+ Info.Size = sizeof(WLX_NOTIFICATION_INFO);
+
+ switch (Type)
+ {
+ case LogoffHandler:
+ case ShutdownHandler:
+ Info.Flags = 3;
+ break;
+
+ default:
+ Info.Flags = 0;
+ break;
+ }
+
+ Info.UserName = NULL; //UserName;
+ Info.Domain = NULL; //Domain;
+ Info.WindowStation = pSession->InteractiveWindowStationName;
+ Info.hToken = pSession->UserToken;
+
+ switch (Type)
+ {
+ case LogonHandler:
+ case StartShellHandler:
+ Info.hDesktop = pSession->ApplicationDesktop;
+ break;
+
+ case StartScreenSaverHandler:
+ Info.hDesktop = pSession->ApplicationDesktop;
+ break;
+
+ default:
+ Info.hDesktop = pSession->WinlogonDesktop;
+ break;
+ }
+
+ Info.pStatusCallback = NULL;
+
+ ListEntry = NotificationDllListHead.Flink;
+ while (ListEntry != &NotificationDllListHead)
+ {
+TRACE("ListEntry %p\n", ListEntry);
+
+ NotificationDll = CONTAINING_RECORD(ListEntry,
+ NOTIFICATION_ITEM,
+ ListEntry);
+TRACE("NotificationDll: %p\n", NotificationDll);
+ if (NotificationDll != NULL)
+ {
+TRACE("NotificationDll->Handler: %p\n", NotificationDll->Handler[Type]);
+ if (NotificationDll->Handler[Type] != NULL)
+ NotificationDll->Handler[Type](&Info);
+ }
+
+ ListEntry = ListEntry->Flink;
+ }
+}
+
+
+VOID
CleanupNotifications(VOID)
{
PLIST_ENTRY ListEntry;
@@ -217,14 +269,14 @@
ListEntry);
if (NotificationDll != NULL)
{
-
-
-
+ FreeLibrary(NotificationDll->hInstance);
}
ListEntry = ListEntry->Flink;
RemoveEntryList(&NotificationDll->ListEntry);
+
+ RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll);
}
}
Modified: trunk/reactos/base/system/winlogon/sas.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c…
==============================================================================
--- trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] Sun Aug 23 15:48:52 2015
@@ -446,6 +446,8 @@
goto cleanup;
}
+ CallNotificationDlls(Session, LogonHandler);
+
DisplayStatusMessage(Session, Session->WinlogonDesktop,
IDS_APPLYINGYOURPERSONALSETTINGS);
UpdatePerUserSystemParameters(0, TRUE);
@@ -464,6 +466,8 @@
//MessageBoxW(0, StatusMsg, NULL, MB_ICONERROR);
goto cleanup;
}
+
+ CallNotificationDlls(Session, StartShellHandler);
if (!InitializeScreenSaver(Session))
WARN("WL: Failed to initialize screen saver\n");
@@ -783,10 +787,14 @@
DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_SAVEYOURSETTINGS);
UnloadUserProfile(Session->UserToken, Session->hProfileInfo);
+
+ CallNotificationDlls(Session, LogoffHandler);
+
CloseHandle(Session->UserToken);
UpdatePerUserSystemParameters(0, FALSE);
Session->LogonState = STATE_LOGGED_OFF;
Session->UserToken = NULL;
+
return STATUS_SUCCESS;
}
@@ -894,6 +902,8 @@
return STATUS_UNSUCCESSFUL;
}
+ CallNotificationDlls(Session, ShutdownHandler);
+
/* Destroy SAS window */
UninitializeSAS(Session);
@@ -932,6 +942,7 @@
if (!HandleLogon(Session))
{
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+ CallNotificationDlls(Session, LogonHandler);
}
}
break;
@@ -957,6 +968,7 @@
SwitchDesktop(Session->WinlogonDesktop);
Session->LogonState = STATE_LOCKED;
Session->Gina.Functions.WlxDisplayLockedNotice(Session->Gina.Context);
+ CallNotificationDlls(Session, LockHandler);
}
break;
case WLX_SAS_ACTION_LOGOFF: /* 0x04 */
@@ -999,6 +1011,7 @@
case WLX_SAS_ACTION_UNLOCK_WKSTA: /* 0x08 */
SwitchDesktop(Session->ApplicationDesktop);
Session->LogonState = STATE_LOGGED_ON;
+ CallNotificationDlls(Session, UnlockHandler);
break;
default:
WARN("Unknown SAS action 0x%lx\n", wlxAction);
Modified: trunk/reactos/base/system/winlogon/screensaver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/scree…
==============================================================================
--- trunk/reactos/base/system/winlogon/screensaver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/screensaver.c [iso-8859-1] Sun Aug 23 15:48:52
2015
@@ -348,6 +348,8 @@
SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, TRUE, NULL, 0);
+ CallNotificationDlls(Session, StartScreenSaverHandler);
+
/* Wait the end of the process or some other activity */
ResetEvent(Session->hUserActivity);
HandleArray[0] = ProcessInformation.hProcess;
@@ -363,6 +365,8 @@
CloseHandle(ProcessInformation.hProcess);
+ CallNotificationDlls(Session, StopScreenSaverHandler);
+
cleanup:
RevertToSelf();
if (hKey)
Modified: trunk/reactos/base/system/winlogon/winlogon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
==============================================================================
--- trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/winlogon.c [iso-8859-1] Sun Aug 23 15:48:52 2015
@@ -434,6 +434,8 @@
}
#endif
+ CallNotificationDlls(WLSession, StartupHandler);
+
/* Create a hidden window to get SAS notifications */
if (!InitializeSAS(WLSession))
{
Modified: trunk/reactos/base/system/winlogon/winlogon.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/winlo…
==============================================================================
--- trunk/reactos/base/system/winlogon/winlogon.h [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/winlogon.h [iso-8859-1] Sun Aug 23 15:48:52 2015
@@ -240,6 +240,23 @@
WLX_PROFILE_V2_0 *Profile;
} WLSESSION, *PWLSESSION;
+typedef enum _NOTIFICATION_TYPE
+{
+ LogonHandler,
+ LogoffHandler,
+ LockHandler,
+ UnlockHandler,
+ StartupHandler,
+ ShutdownHandler,
+ StartScreenSaverHandler,
+ StopScreenSaverHandler,
+ DisconnectHandler,
+ ReconnectHandler,
+ StartShellHandler,
+ PostShellHandler,
+ LastHandler
+} NOTIFICATION_TYPE, *PNOTIFICATION_TYPE;
+
extern HINSTANCE hAppInstance;
extern PWLSESSION WLSession;
@@ -265,6 +282,11 @@
VOID
CleanupNotifications(VOID);
+
+VOID
+CallNotificationDlls(
+ PWLSESSION pSession,
+ NOTIFICATION_TYPE Type);
/* rpcserver.c */
BOOL