Author: ekohl
Date: Tue Jan 14 22:27:34 2014
New Revision: 61630
URL:
http://svn.reactos.org/svn/reactos?rev=61630&view=rev
Log:
[WINLOGON]
- Use the states STATE_INIT and SATE_LOGGED_OFF_SAS.
- State machine clean-up.
Modified:
trunk/reactos/base/system/winlogon/sas.c
trunk/reactos/base/system/winlogon/winlogon.c
trunk/reactos/base/system/winlogon/winlogon.h
trunk/reactos/base/system/winlogon/wlx.c
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] Tue Jan 14 22:27:34 2014
@@ -844,22 +844,28 @@
switch (wlxAction)
{
case WLX_SAS_ACTION_LOGON: /* 0x01 */
- if (HandleLogon(Session))
- {
- SwitchDesktop(Session->ApplicationDesktop);
- Session->LogonState = STATE_LOGGED_ON;
- }
- else
-
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+ if (Session->LogonState == STATE_LOGGED_OFF_SAS)
+ {
+ if (HandleLogon(Session))
+ {
+ SwitchDesktop(Session->ApplicationDesktop);
+ Session->LogonState = STATE_LOGGED_ON;
+ }
+ else
+ {
+
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+ }
+ }
break;
case WLX_SAS_ACTION_NONE: /* 0x02 */
- if (Session->LogonState == STATE_LOGGED_ON_SAS)
+ if (Session->LogonState == STATE_LOGGED_OFF_SAS)
+ {
+ Session->LogonState = STATE_LOGGED_OFF;
+
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+ }
+ else if (Session->LogonState == STATE_LOGGED_ON_SAS)
{
Session->LogonState = STATE_LOGGED_ON;
- }
- else if (Session->LogonState == STATE_LOGGED_OFF)
- {
-
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
}
else if (Session->LogonState == STATE_LOCKED_SAS)
{
@@ -928,82 +934,95 @@
{
DWORD wlxAction = WLX_SAS_ACTION_NONE;
HWND hwnd;
-
- /* Ignore SAS if we are already in an SAS state */
- if (Session->LogonState == STATE_LOGGED_OFF_SAS ||
- Session->LogonState == STATE_LOGGED_ON_SAS ||
- Session->LogonState == STATE_LOCKED_SAS)
- return;
-
- if (Session->LogonState == STATE_LOGGED_ON)
- {
- Session->LogonState = STATE_LOGGED_ON_SAS;
- wlxAction =
(DWORD)Session->Gina.Functions.WlxLoggedOnSAS(Session->Gina.Context, dwSasType,
NULL);
- }
- else if (Session->LogonState == STATE_LOCKED)
- {
- hwnd = GetTopDialogWindow();
- if (hwnd != NULL)
- {
- SendMessage(hwnd, WM_USER, 0, 0);
- }
-
- Session->LogonState = STATE_LOCKED_SAS;
- wlxAction =
(DWORD)Session->Gina.Functions.WlxWkstaLockedSAS(Session->Gina.Context, dwSasType);
- }
- else
- {
- /* Display a new dialog (if necessary) */
- switch (dwSasType)
- {
- case WLX_SAS_TYPE_TIMEOUT: /* 0x00 */
- {
-
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
- return;
- }
- default:
- {
- PSID LogonSid = NULL; /* FIXME */
-
- hwnd = GetTopDialogWindow();
- if (hwnd != NULL)
+ PSID LogonSid = NULL; /* FIXME */
+ BOOL bSecure = TRUE;
+
+ switch (dwSasType)
+ {
+ case WLX_SAS_TYPE_CTRL_ALT_DEL:
+ switch (Session->LogonState)
+ {
+ case STATE_INIT:
+ Session->LogonState = STATE_LOGGED_OFF;
+
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
+ return;
+
+ case STATE_LOGGED_OFF:
+ Session->LogonState = STATE_LOGGED_OFF_SAS;
+
+ hwnd = GetTopDialogWindow();
+ if (hwnd != NULL)
+ SendMessage(hwnd, WLX_WM_SAS, 0, 0);
+
+ Session->Options = 0;
+
+ wlxAction = (DWORD)Session->Gina.Functions.WlxLoggedOutSAS(
+ Session->Gina.Context,
+ Session->SASAction,
+ &Session->LogonId,
+ LogonSid,
+ &Session->Options,
+ &Session->UserToken,
+ &Session->MprNotifyInfo,
+ (PVOID*)&Session->Profile);
+ break;
+
+ case STATE_LOGGED_OFF_SAS:
+ /* Ignore SAS if we are already in an SAS state */
+ return;
+
+ case STATE_LOGGED_ON:
+ Session->LogonState = STATE_LOGGED_ON_SAS;
+ wlxAction =
(DWORD)Session->Gina.Functions.WlxLoggedOnSAS(Session->Gina.Context, dwSasType,
NULL);
+ break;
+
+ case STATE_LOGGED_ON_SAS:
+ /* Ignore SAS if we are already in an SAS state */
+ return;
+
+ case STATE_LOCKED:
+ Session->LogonState = STATE_LOCKED_SAS;
+
+ hwnd = GetTopDialogWindow();
+ if (hwnd != NULL)
+ SendMessage(hwnd, WLX_WM_SAS, 0, 0);
+
+ wlxAction =
(DWORD)Session->Gina.Functions.WlxWkstaLockedSAS(Session->Gina.Context, dwSasType);
+ break;
+
+ case STATE_LOCKED_SAS:
+ /* Ignore SAS if we are already in an SAS state */
+ return;
+
+ default:
+ return;
+ }
+ break;
+
+ case WLX_SAS_TYPE_TIMEOUT:
+ return;
+
+ case WLX_SAS_TYPE_SCRNSVR_TIMEOUT:
+ if
(!Session->Gina.Functions.WlxScreenSaverNotify(Session->Gina.Context,
&bSecure))
+ {
+ /* Skip start of screen saver */
+ SetEvent(Session->hEndOfScreenSaver);
+ }
+ else
+ {
+ StartScreenSaver(Session);
+ if (bSecure)
{
- SendMessage(hwnd, WM_USER, 0, 0);
+ wlxAction = WLX_SAS_ACTION_LOCK_WKSTA;
+// DoGenericAction(Session, WLX_SAS_ACTION_LOCK_WKSTA);
}
-
- Session->Options = 0;
-
- wlxAction = (DWORD)Session->Gina.Functions.WlxLoggedOutSAS(
- Session->Gina.Context,
- Session->SASAction,
- &Session->LogonId,
- LogonSid,
- &Session->Options,
- &Session->UserToken,
- &Session->MprNotifyInfo,
- (PVOID*)&Session->Profile);
- break;
- }
- }
- }
-
- if (dwSasType == WLX_SAS_TYPE_SCRNSVR_TIMEOUT)
- {
- BOOL bSecure = TRUE;
- if (!Session->Gina.Functions.WlxScreenSaverNotify(Session->Gina.Context,
&bSecure))
- {
- /* Skip start of screen saver */
- SetEvent(Session->hEndOfScreenSaver);
- }
- else
- {
- StartScreenSaver(Session);
- if (bSecure)
- DoGenericAction(Session, WLX_SAS_ACTION_LOCK_WKSTA);
- }
- }
- else if (dwSasType == WLX_SAS_TYPE_SCRNSVR_ACTIVITY)
- SetEvent(Session->hUserActivity);
+ }
+ break;
+
+ case WLX_SAS_TYPE_SCRNSVR_ACTIVITY:
+ SetEvent(Session->hUserActivity);
+ break;
+ }
DoGenericAction(Session, wlxAction);
}
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] Tue Jan 14 22:27:34 2014
@@ -429,7 +429,7 @@
//DisplayStatusMessage(Session, Session->WinlogonDesktop,
IDS_APPLYINGCOMPUTERSETTINGS);
/* Display logged out screen */
- WLSession->LogonState = STATE_LOGGED_OFF;
+ WLSession->LogonState = STATE_INIT;
RemoveStatusMessage(WLSession);
/* Check for pending setup */
@@ -442,7 +442,7 @@
RunSetup();
}
else
- PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0);
+ PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_CTRL_ALT_DEL, 0);
/* Tell kernel that CurrentControlSet is good (needed
* to support Last good known configuration boot) */
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] Tue Jan 14 22:27:34 2014
@@ -155,16 +155,6 @@
* STATE_LOCKED. Pressing "Shutdown" changes the state to
* STATE_SHUTTING_DOWN.
*
- * STATE_SCREENSAVER
- * Winlogon runs the screen saver. Upon user activity, the screensaver
- * terminates and the state changes back to STATE_LOGGED_ON if the secure
- * screen saver option is off. Otherwise, the state changes to STATE_LOCKED.
- *
- * STATE_LOGGING_OFF
- * Winlogon shows the logoff dialog. Pressing "Cancel" or a timeout changes
- * the state back to STATE_LOGGED_ON_SAS. Pressing "OK" logs off the user
- * and changes the state to STATE_LOGGED_OFF.
- *
* STATE_LOCKED
* Winlogon shows the locked message dialog. When the user presses "Ctrl-
* Alt-Del" the state changes to STATE_LOCKED_SAS. If DisableCAD is true,
@@ -177,6 +167,11 @@
* pressing "OK" unlocks the computer and changes the state to
* STATE_LOGGED_ON.
*
+ * STATE_LOGGING_OFF
+ * Winlogon shows the logoff dialog. Pressing "Cancel" or a timeout changes
+ * the state back to STATE_LOGGED_ON_SAS. Pressing "OK" logs off the user
+ * and changes the state to STATE_LOGGED_OFF.
+ *
* STATE_SHUTTING_DOWN
* Winlogon shows the shutdown dialog. Presing "Cancel" or a timeout will
* change the state back to STATE_LOGGED_ON_SAS. Pressing "OK" will change
@@ -184,20 +179,25 @@
*
* STATE_SHUT_DOWN
* Terminates Winlogon and initiates shut-down.
+ *
+ * STATE_SCREENSAVER
+ * Winlogon runs the screen saver. Upon user activity, the screensaver
+ * terminates and the state changes back to STATE_LOGGED_ON if the secure
+ * screen saver option is off. Otherwise, the state changes to STATE_LOCKED.
*/
typedef enum _LOGON_STATE
{
- STATE_INIT, // not used yet
+ STATE_INIT,
STATE_LOGGED_OFF,
- STATE_LOGGED_OFF_SAS, // not used yet
+ STATE_LOGGED_OFF_SAS,
STATE_LOGGED_ON,
STATE_LOGGED_ON_SAS,
- STATE_SCREENSAVER, // not used yet
STATE_LOCKED,
STATE_LOCKED_SAS,
STATE_LOGGING_OFF, // not used yet
STATE_SHUTTING_DOWN, // not used yet
- STATE_SHUT_DOWN // not used yet
+ STATE_SHUT_DOWN, // not used yet
+ STATE_SCREENSAVER // not used yet
} LOGON_STATE, *PLOGON_STATE;
#define LockWorkstation(Session)
Modified: trunk/reactos/base/system/winlogon/wlx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/wlx.c…
==============================================================================
--- trunk/reactos/base/system/winlogon/wlx.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/winlogon/wlx.c [iso-8859-1] Tue Jan 14 22:27:34 2014
@@ -155,9 +155,9 @@
return FALSE;
}
- if (uMsg == WM_USER)
- {
- EndDialog(hwndDlg, 0);
+ if (uMsg == WLX_WM_SAS)
+ {
+ EndDialog(hwndDlg, WLX_DLG_SAS);
return 0;
}