mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 10:28:45 +00:00
Simplify management of loggedout window
Implement locking/unlocking of the workstation (only by code, not the associated dialogs) svn path=/trunk/; revision=23434
This commit is contained in:
parent
e202c810ac
commit
603ac11c9a
8 changed files with 157 additions and 162 deletions
|
@ -28,17 +28,21 @@ BEGIN
|
||||||
LTEXT "Password:",IDC_STATIC,36,93,42,8
|
LTEXT "Password:",IDC_STATIC,36,93,42,8
|
||||||
EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL
|
EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD
|
EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD
|
||||||
|
CONTROL "",IDC_ROSLOGO,"Static",SS_BLACKFRAME,7,7,261,51
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LOGGEDON_DLG DIALOGEX 0,0,186,52
|
IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116
|
||||||
STYLE NOT WS_VISIBLE | DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SETFONT | DS_FIXEDSYS | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
|
STYLE NOT WS_VISIBLE | DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SETFONT | DS_FIXEDSYS | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
|
||||||
CAPTION "Security"
|
CAPTION "Security"
|
||||||
FONT 8,"MS Shell Dlg 2",400,0,1
|
FONT 8,"MS Shell Dlg 2",400,0,1
|
||||||
BEGIN
|
BEGIN
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,125,31,50,14
|
PUSHBUTTON "Cancel",IDCANCEL,170,95,70,14
|
||||||
PUSHBUTTON "Log off",IDC_LOGOFF,11,31,50,14
|
PUSHBUTTON "Log off",IDC_LOGOFF,90,76,70,14
|
||||||
PUSHBUTTON "Shutdown",IDC_SHUTDOWN,69,31,50,14
|
PUSHBUTTON "Shutdown",IDC_SHUTDOWN,170,76,70,14
|
||||||
LTEXT "What do you want to do?",IDC_STATIC,50,18,87,8
|
LTEXT "What do you want to do?",IDC_STATIC,86,53,87,8
|
||||||
|
PUSHBUTTON "Lock computer",IDC_LOCK,10,76,70,14
|
||||||
|
PUSHBUTTON "Task manager",IDC_TASKMGR,90,95,70,14
|
||||||
|
CONTROL "",IDC_ROSLOGO,"Static",SS_BLACKFRAME,7,7,230,38
|
||||||
END
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
|
@ -47,4 +51,3 @@ BEGIN
|
||||||
IDS_ASKFORUSER "User name: "
|
IDS_ASKFORUSER "User name: "
|
||||||
IDS_ASKFORPASSWORD "Password: "
|
IDS_ASKFORPASSWORD "Password: "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,8 @@
|
||||||
|
|
||||||
#include "msgina.h"
|
#include "msgina.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#define YDEBUG
|
||||||
#define TRACE DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
#include <wine/debug.h>
|
||||||
#define FIXME DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
|
||||||
#define WARN DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
|
||||||
#undef DPRINT
|
|
||||||
#undef DPRINT1
|
|
||||||
|
|
||||||
static HBITMAP hBitmap = NULL;
|
|
||||||
static int cxSource, cySource;
|
|
||||||
|
|
||||||
typedef struct _DISPLAYSTATUSMSG
|
typedef struct _DISPLAYSTATUSMSG
|
||||||
{
|
{
|
||||||
|
@ -155,21 +148,30 @@ GUIDisplayStatusMessage(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static INT_PTR CALLBACK
|
||||||
|
DisplaySASNoticeWindowProc(
|
||||||
|
IN HWND hwndDlg,
|
||||||
|
IN UINT uMsg,
|
||||||
|
IN WPARAM wParam,
|
||||||
|
IN LPARAM lParam)
|
||||||
|
{
|
||||||
|
return DefWindowProc(hwndDlg, uMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
GUIDisplaySASNotice(
|
GUIDisplaySASNotice(
|
||||||
IN OUT PGINA_CONTEXT pgContext)
|
IN OUT PGINA_CONTEXT pgContext)
|
||||||
{
|
{
|
||||||
int result;
|
INT result;
|
||||||
|
|
||||||
TRACE("GUIDisplaySASNotice()\n");
|
TRACE("GUIDisplaySASNotice()\n");
|
||||||
|
|
||||||
/* Display the notice window */
|
/* Display the notice window */
|
||||||
result = pgContext->pWlxFuncs->WlxDialogBoxParam(
|
result = DialogBoxParam(
|
||||||
pgContext->hWlx,
|
|
||||||
pgContext->hDllInstance,
|
pgContext->hDllInstance,
|
||||||
MAKEINTRESOURCE(IDD_NOTICE_DLG),
|
MAKEINTRESOURCE(IDD_NOTICE_DLG),
|
||||||
NULL,
|
NULL,
|
||||||
(DLGPROC)DefWindowProc,
|
DisplaySASNoticeWindowProc,
|
||||||
(LPARAM)NULL);
|
(LPARAM)NULL);
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
{
|
{
|
||||||
|
@ -210,40 +212,37 @@ LoggedOutWindowProc(
|
||||||
IN WPARAM wParam,
|
IN WPARAM wParam,
|
||||||
IN LPARAM lParam)
|
IN LPARAM lParam)
|
||||||
{
|
{
|
||||||
BITMAP bitmap;
|
PGINA_CONTEXT pgContext;
|
||||||
|
|
||||||
|
pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
/* FIXME: take care of DontDisplayLastUserName, NoDomainUI, ShutdownWithoutLogon */
|
/* FIXME: take care of DontDisplayLastUserName, NoDomainUI, ShutdownWithoutLogon */
|
||||||
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)lParam);
|
pgContext = (PGINA_CONTEXT)lParam;
|
||||||
|
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext);
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
|
SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME));
|
||||||
|
|
||||||
hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDC_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||||
if (hBitmap != NULL)
|
|
||||||
{
|
|
||||||
GetObject(hBitmap, sizeof(BITMAP), &bitmap);
|
|
||||||
cxSource = bitmap.bmWidth;
|
|
||||||
cySource = bitmap.bmHeight;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
HDC hdc, hdcMem;
|
HDC hdc;
|
||||||
hdc = BeginPaint(hwndDlg, &ps);
|
if (pgContext->hBitmap)
|
||||||
hdcMem = CreateCompatibleDC(hdc);
|
{
|
||||||
SelectObject(hdcMem, hBitmap);
|
hdc = BeginPaint(hwndDlg, &ps);
|
||||||
BitBlt(hdc, 0, 0, cxSource, cySource, hdcMem, 0, 0, SRCCOPY);
|
DrawState(hdc, NULL, NULL, (LPARAM)pgContext->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP);
|
||||||
DeleteDC(hdcMem);
|
EndPaint(hwndDlg, &ps);
|
||||||
EndPaint(hwndDlg, &ps);
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
DeleteObject(hBitmap);
|
DeleteObject(pgContext->hBitmap);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
@ -252,10 +251,8 @@ LoggedOutWindowProc(
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext;
|
|
||||||
LPWSTR UserName = NULL, Password = NULL;
|
LPWSTR UserName = NULL, Password = NULL;
|
||||||
INT result = WLX_SAS_ACTION_NONE;
|
INT result = WLX_SAS_ACTION_NONE;
|
||||||
pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
|
|
||||||
|
|
||||||
if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0')
|
if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0')
|
||||||
break;
|
break;
|
||||||
|
@ -300,14 +297,23 @@ LoggedOnWindowProc(
|
||||||
{
|
{
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDYES:
|
case IDC_LOCK:
|
||||||
case IDNO:
|
EndDialog(hwndDlg, WLX_SAS_ACTION_LOCK_WKSTA);
|
||||||
{
|
return TRUE;
|
||||||
EndDialog(hwndDlg, LOWORD(wParam));
|
case IDC_LOGOFF:
|
||||||
break;
|
EndDialog(hwndDlg, WLX_SAS_ACTION_LOGOFF);
|
||||||
}
|
return TRUE;
|
||||||
|
case IDC_SHUTDOWN:
|
||||||
|
EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN_POWER_OFF);
|
||||||
|
return TRUE;
|
||||||
|
case IDC_TASKMGR:
|
||||||
|
EndDialog(hwndDlg, WLX_SAS_ACTION_TASKLIST);
|
||||||
|
return TRUE;
|
||||||
|
case IDCANCEL:
|
||||||
|
EndDialog(hwndDlg, WLX_SAS_ACTION_NONE);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
|
@ -329,50 +335,30 @@ GUILoggedOnSAS(
|
||||||
IN OUT PGINA_CONTEXT pgContext,
|
IN OUT PGINA_CONTEXT pgContext,
|
||||||
IN DWORD dwSasType)
|
IN DWORD dwSasType)
|
||||||
{
|
{
|
||||||
INT SasAction = WLX_SAS_ACTION_NONE;
|
INT result;
|
||||||
|
|
||||||
TRACE("GUILoggedOnSAS()\n");
|
TRACE("GUILoggedOnSAS()\n");
|
||||||
|
|
||||||
switch (dwSasType)
|
if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
|
||||||
{
|
{
|
||||||
case WLX_SAS_TYPE_CTRL_ALT_DEL:
|
/* Nothing to do for WLX_SAS_TYPE_TIMEOUT ; the dialog will
|
||||||
{
|
* close itself thanks to the use of WlxDialogBoxParam */
|
||||||
INT result;
|
return WLX_SAS_ACTION_NONE;
|
||||||
/* Display "Are you sure you want to log off?" dialog */
|
|
||||||
result = pgContext->pWlxFuncs->WlxDialogBoxParam(
|
|
||||||
pgContext->hWlx,
|
|
||||||
pgContext->hDllInstance,
|
|
||||||
MAKEINTRESOURCE(IDD_LOGGEDON_DLG),
|
|
||||||
NULL,
|
|
||||||
LoggedOnWindowProc,
|
|
||||||
(LPARAM)pgContext);
|
|
||||||
if (result == IDOK)
|
|
||||||
SasAction = WLX_SAS_ACTION_LOCK_WKSTA;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case WLX_SAS_TYPE_SC_INSERT:
|
|
||||||
{
|
|
||||||
FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_INSERT not supported!\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case WLX_SAS_TYPE_SC_REMOVE:
|
|
||||||
{
|
|
||||||
FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_REMOVE not supported!\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case WLX_SAS_TYPE_TIMEOUT:
|
|
||||||
{
|
|
||||||
FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_TIMEOUT not supported!\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
WARN("WlxLoggedOnSAS: Unknown SasType: 0x%x\n", dwSasType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return SasAction;
|
result = pgContext->pWlxFuncs->WlxDialogBoxParam(
|
||||||
|
pgContext->hWlx,
|
||||||
|
pgContext->hDllInstance,
|
||||||
|
MAKEINTRESOURCE(IDD_LOGGEDON_DLG),
|
||||||
|
NULL,
|
||||||
|
LoggedOnWindowProc,
|
||||||
|
(LPARAM)pgContext);
|
||||||
|
if (result >= WLX_SAS_ACTION_LOGON &&
|
||||||
|
result <= WLX_SAS_ACTION_SWITCH_CONSOLE)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return WLX_SAS_ACTION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT
|
static INT
|
||||||
|
|
|
@ -42,7 +42,7 @@ WlxNegotiate(
|
||||||
IN DWORD dwWinlogonVersion,
|
IN DWORD dwWinlogonVersion,
|
||||||
OUT PDWORD pdwDllVersion)
|
OUT PDWORD pdwDllVersion)
|
||||||
{
|
{
|
||||||
DPRINT1("WlxNegotiate(%lx, %p)\n", dwWinlogonVersion, pdwDllVersion);
|
TRACE("WlxNegotiate(%lx, %p)\n", dwWinlogonVersion, pdwDllVersion);
|
||||||
|
|
||||||
if(!pdwDllVersion || (dwWinlogonVersion < WLX_VERSION_1_3))
|
if(!pdwDllVersion || (dwWinlogonVersion < WLX_VERSION_1_3))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -147,20 +147,22 @@ WlxStartApplication(
|
||||||
PWSTR pszCmdLine)
|
PWSTR pszCmdLine)
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
||||||
STARTUPINFO si;
|
STARTUPINFO StartupInfo;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION ProcessInformation;
|
||||||
|
WCHAR CurrentDirectory[MAX_PATH];
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
|
|
||||||
si.cb = sizeof(STARTUPINFO);
|
StartupInfo.cb = sizeof(STARTUPINFO);
|
||||||
si.lpReserved = NULL;
|
StartupInfo.lpReserved = NULL;
|
||||||
si.lpTitle = pszCmdLine;
|
StartupInfo.lpTitle = pszCmdLine;
|
||||||
si.dwX = si.dwY = si.dwXSize = si.dwYSize = 0L;
|
StartupInfo.dwX = StartupInfo.dwY = StartupInfo.dwXSize = StartupInfo.dwYSize = 0L;
|
||||||
si.dwFlags = 0;
|
StartupInfo.dwFlags = 0;
|
||||||
si.wShowWindow = SW_SHOW;
|
StartupInfo.wShowWindow = SW_SHOW;
|
||||||
si.lpReserved2 = NULL;
|
StartupInfo.lpReserved2 = NULL;
|
||||||
si.cbReserved2 = 0;
|
StartupInfo.cbReserved2 = 0;
|
||||||
si.lpDesktop = pszDesktopName;
|
StartupInfo.lpDesktop = pszDesktopName;
|
||||||
|
|
||||||
|
GetWindowsDirectoryW (CurrentDirectory, MAX_PATH);
|
||||||
Ret = CreateProcessAsUser(pgContext->UserToken,
|
Ret = CreateProcessAsUser(pgContext->UserToken,
|
||||||
NULL,
|
NULL,
|
||||||
pszCmdLine,
|
pszCmdLine,
|
||||||
|
@ -169,11 +171,11 @@ WlxStartApplication(
|
||||||
FALSE,
|
FALSE,
|
||||||
CREATE_UNICODE_ENVIRONMENT,
|
CREATE_UNICODE_ENVIRONMENT,
|
||||||
pEnvironment,
|
pEnvironment,
|
||||||
NULL,
|
CurrentDirectory,
|
||||||
&si,
|
&StartupInfo,
|
||||||
&pi);
|
&ProcessInformation);
|
||||||
|
|
||||||
VirtualFree(pEnvironment, 0, MEM_RELEASE);
|
//VirtualFree(pEnvironment, 0, MEM_RELEASE);
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,15 +190,10 @@ WlxActivateUserShell(
|
||||||
PWSTR pszMprLogonScript,
|
PWSTR pszMprLogonScript,
|
||||||
PVOID pEnvironment)
|
PVOID pEnvironment)
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
|
||||||
STARTUPINFO StartupInfo;
|
|
||||||
PROCESS_INFORMATION ProcessInformation;
|
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD BufSize, ValueType;
|
DWORD BufSize, ValueType;
|
||||||
WCHAR pszUserInitApp[MAX_PATH];
|
WCHAR pszUserInitApp[MAX_PATH];
|
||||||
WCHAR pszExpUserInitApp[MAX_PATH];
|
WCHAR pszExpUserInitApp[MAX_PATH];
|
||||||
BOOL Ret;
|
|
||||||
WCHAR CurrentDirectory[MAX_PATH];
|
|
||||||
|
|
||||||
/* get the path of userinit */
|
/* get the path of userinit */
|
||||||
if(RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
if(RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
|
@ -216,38 +213,12 @@ WlxActivateUserShell(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
/* start userinit */
|
|
||||||
/* FIXME - allow to start more applications that are comma-separated */
|
|
||||||
StartupInfo.cb = sizeof(STARTUPINFO);
|
|
||||||
StartupInfo.lpReserved = NULL;
|
|
||||||
StartupInfo.lpDesktop = pszDesktopName;
|
|
||||||
StartupInfo.lpTitle = NULL;
|
|
||||||
StartupInfo.dwFlags = 0;
|
|
||||||
StartupInfo.lpReserved2 = NULL;
|
|
||||||
StartupInfo.cbReserved2 = 0;
|
|
||||||
StartupInfo.dwX = StartupInfo.dwY = StartupInfo.dwXSize = StartupInfo.dwYSize = 0;
|
|
||||||
StartupInfo.wShowWindow = SW_SHOW;
|
|
||||||
|
|
||||||
ExpandEnvironmentStrings(pszUserInitApp, pszExpUserInitApp, MAX_PATH);
|
ExpandEnvironmentStrings(pszUserInitApp, pszExpUserInitApp, MAX_PATH);
|
||||||
|
|
||||||
GetWindowsDirectoryW (CurrentDirectory, MAX_PATH);
|
/* Start userinit */
|
||||||
Ret = CreateProcessAsUser(pgContext->UserToken,
|
/* FIXME - allow to start more applications that are comma-separated */
|
||||||
NULL,
|
/* FIXME: Call VirtualFree(pEnvironment, 0, MEM_RELEASE); ? */
|
||||||
pszExpUserInitApp,
|
return WlxStartApplication(pWlxContext, pszDesktopName, pEnvironment, pszExpUserInitApp);
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
FALSE,
|
|
||||||
CREATE_UNICODE_ENVIRONMENT,
|
|
||||||
pEnvironment,
|
|
||||||
CurrentDirectory,
|
|
||||||
&StartupInfo,
|
|
||||||
&ProcessInformation);
|
|
||||||
if(!Ret) ERR("GINA: Failed: 3, error %lu\n", GetLastError());
|
|
||||||
VirtualFree(pEnvironment, 0, MEM_RELEASE);
|
|
||||||
Ret = pgContext->pWlxFuncs->WlxSwitchDesktopToUser(pgContext->hWlx);
|
|
||||||
if(!Ret) ERR("GINA: Failed: 4, error %lu\n", GetLastError());
|
|
||||||
return Ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -261,10 +232,36 @@ WlxLoggedOnSAS(
|
||||||
PVOID pReserved)
|
PVOID pReserved)
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
||||||
|
INT SasAction = WLX_SAS_ACTION_NONE;
|
||||||
|
|
||||||
DPRINT1("WlxLoggedOnSAS(0x%lx)\n", dwSasType);
|
TRACE("WlxLoggedOnSAS(0x%lx)\n", dwSasType);
|
||||||
|
|
||||||
return pGinaUI->LoggedOnSAS(pgContext, dwSasType);
|
switch (dwSasType)
|
||||||
|
{
|
||||||
|
case WLX_SAS_TYPE_CTRL_ALT_DEL:
|
||||||
|
case WLX_SAS_TYPE_TIMEOUT:
|
||||||
|
{
|
||||||
|
SasAction = pGinaUI->LoggedOnSAS(pgContext, dwSasType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case WLX_SAS_TYPE_SC_INSERT:
|
||||||
|
{
|
||||||
|
FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_INSERT not supported!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case WLX_SAS_TYPE_SC_REMOVE:
|
||||||
|
{
|
||||||
|
FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_REMOVE not supported!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
WARN("WlxLoggedOnSAS: Unknown SasType: 0x%x\n", dwSasType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return SasAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -280,7 +277,7 @@ WlxDisplayStatusMessage(
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
||||||
|
|
||||||
DPRINT1("WlxDisplayStatusMessage(\"%S\")\n", pMessage);
|
TRACE("WlxDisplayStatusMessage(\"%S\")\n", pMessage);
|
||||||
|
|
||||||
return pGinaUI->DisplayStatusMessage(pgContext, hDesktop, dwOptions, pTitle, pMessage);
|
return pGinaUI->DisplayStatusMessage(pgContext, hDesktop, dwOptions, pTitle, pMessage);
|
||||||
}
|
}
|
||||||
|
@ -363,13 +360,13 @@ DoLoginTasks(
|
||||||
LOGON32_PROVIDER_DEFAULT,
|
LOGON32_PROVIDER_DEFAULT,
|
||||||
pgContext->phToken))
|
pgContext->phToken))
|
||||||
{
|
{
|
||||||
WARN("GINA: Logonuser() failed\n");
|
WARN("LogonUserW() failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(*pgContext->phToken))
|
if(!*pgContext->phToken)
|
||||||
{
|
{
|
||||||
WARN("GINA: *phToken == NULL!\n");
|
WARN("*phToken == NULL!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +381,7 @@ DoLoginTasks(
|
||||||
sizeof(TOKEN_STATISTICS),
|
sizeof(TOKEN_STATISTICS),
|
||||||
&cbStats))
|
&cbStats))
|
||||||
{
|
{
|
||||||
WARN("GINA: Couldn't get Authentication id from user token!\n");
|
WARN("Couldn't get Authentication id from user token!\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
*pgContext->pAuthenticationId = Stats.AuthenticationId;
|
*pgContext->pAuthenticationId = Stats.AuthenticationId;
|
||||||
|
@ -482,7 +479,7 @@ WlxDisplaySASNotice(
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
||||||
|
|
||||||
DPRINT1("WlxDisplaySASNotice(%p)\n", pWlxContext);
|
TRACE("WlxDisplaySASNotice(%p)\n", pWlxContext);
|
||||||
|
|
||||||
if (GetSystemMetrics(SM_REMOTESESSION))
|
if (GetSystemMetrics(SM_REMOTESESSION))
|
||||||
{
|
{
|
||||||
|
@ -501,7 +498,7 @@ WlxDisplaySASNotice(
|
||||||
|
|
||||||
pGinaUI->DisplaySASNotice(pgContext);
|
pGinaUI->DisplaySASNotice(pgContext);
|
||||||
|
|
||||||
DPRINT1("WlxDisplaySASNotice() done\n");
|
TRACE("WlxDisplaySASNotice() done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -520,7 +517,7 @@ WlxLoggedOutSAS(
|
||||||
{
|
{
|
||||||
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext;
|
||||||
|
|
||||||
DPRINT1("WlxLoggedOutSAS()\n");
|
TRACE("WlxLoggedOutSAS()\n");
|
||||||
|
|
||||||
pgContext->pAuthenticationId = pAuthenticationId;
|
pgContext->pAuthenticationId = pAuthenticationId;
|
||||||
pgContext->pdwOptions = pdwOptions;
|
pgContext->pdwOptions = pdwOptions;
|
||||||
|
|
|
@ -21,6 +21,9 @@ typedef struct {
|
||||||
PHANDLE phToken;
|
PHANDLE phToken;
|
||||||
PWLX_MPR_NOTIFY_INFO pNprNotifyInfo;
|
PWLX_MPR_NOTIFY_INFO pNprNotifyInfo;
|
||||||
PVOID *pProfile;
|
PVOID *pProfile;
|
||||||
|
|
||||||
|
/* Current logo to display */
|
||||||
|
HBITMAP hBitmap;
|
||||||
} GINA_CONTEXT, *PGINA_CONTEXT;
|
} GINA_CONTEXT, *PGINA_CONTEXT;
|
||||||
|
|
||||||
HINSTANCE hDllInstance;
|
HINSTANCE hDllInstance;
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "msgina.dll\0"
|
#define REACTOS_STR_ORIGINAL_FILENAME "msgina.dll\0"
|
||||||
#include <reactos/version.rc>
|
#include <reactos/version.rc>
|
||||||
|
|
||||||
|
IDI_ROSLOGO BITMAP "resources/reactos.bmp"
|
||||||
IDC_ROSLOGO BITMAP "resources/reactos.bmp"
|
|
||||||
|
|
||||||
#include "En.rc"
|
#include "En.rc"
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,15 @@
|
||||||
#define IDC_PASSWORD 1003
|
#define IDC_PASSWORD 1003
|
||||||
#define IDC_SHUTDOWN 1004
|
#define IDC_SHUTDOWN 1004
|
||||||
#define IDC_STATUSLABEL 1005
|
#define IDC_STATUSLABEL 1005
|
||||||
#define IDC_ROSLOGO 1006
|
#define IDC_LOCK 1006
|
||||||
|
#define IDC_ROSLOGO 1007
|
||||||
|
#define IDI_ROSLOGO 1008
|
||||||
#define IDS_ASKFORUSER 40000
|
#define IDS_ASKFORUSER 40000
|
||||||
#define IDS_PRESSCTRLALTDELETE 40001
|
#define IDS_PRESSCTRLALTDELETE 40001
|
||||||
|
#define IDC_TASKMGR 40002
|
||||||
#define IDS_ASKFORPASSWORD 40002
|
#define IDS_ASKFORPASSWORD 40002
|
||||||
|
|
||||||
|
|
||||||
#endif /* __MSGINA_RESOURCE_H */
|
#endif /* __MSGINA_RESOURCE_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -56,7 +56,7 @@ WlxIsLockOk(
|
||||||
PVOID pWlxContext)
|
PVOID pWlxContext)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ WlxIsLogoffOk(
|
||||||
PVOID pWlxContext)
|
PVOID pWlxContext)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ WlxWkstaLockedSAS(
|
||||||
DWORD dwSasType)
|
DWORD dwSasType)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return 0;
|
return WLX_SAS_ACTION_UNLOCK_WKSTA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,8 @@
|
||||||
|
|
||||||
#include "msgina.h"
|
#include "msgina.h"
|
||||||
|
|
||||||
#include <debug.h>
|
#define YDEBUG
|
||||||
#define TRACE DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
#include <wine/debug.h>
|
||||||
#define FIXME DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
|
||||||
#define WARN DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
|
|
||||||
#undef DPRINT
|
|
||||||
#undef DPRINT1
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
TUIInitialize(
|
TUIInitialize(
|
||||||
|
@ -77,8 +73,15 @@ TUILoggedOnSAS(
|
||||||
IN DWORD dwSasType)
|
IN DWORD dwSasType)
|
||||||
{
|
{
|
||||||
TRACE("TUILoggedOnSAS()\n");
|
TRACE("TUILoggedOnSAS()\n");
|
||||||
for (;;) FIXME("FIXME!\n");
|
|
||||||
return 0;
|
if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL)
|
||||||
|
{
|
||||||
|
/* Nothing to do for WLX_SAS_TYPE_TIMEOUT */
|
||||||
|
return WLX_SAS_ACTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
FIXME("FIXME: TUILoggedOnSAS(): Let's suppose the user wants to log off...\n");
|
||||||
|
return WLX_SAS_ACTION_LOGOFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
|
@ -122,18 +125,18 @@ static INT
|
||||||
TUILoggedOutSAS(
|
TUILoggedOutSAS(
|
||||||
IN OUT PGINA_CONTEXT pgContext)
|
IN OUT PGINA_CONTEXT pgContext)
|
||||||
{
|
{
|
||||||
WCHAR User[256];
|
WCHAR UserName[256];
|
||||||
WCHAR Password[256];
|
WCHAR Password[256];
|
||||||
|
|
||||||
TRACE("TUILoggedOutSAS()\n");
|
TRACE("TUILoggedOutSAS()\n");
|
||||||
|
|
||||||
/* Ask the user for credentials */
|
/* Ask the user for credentials */
|
||||||
if (!ReadString(pgContext, IDS_ASKFORUSER, User, 256, TRUE))
|
if (!ReadString(pgContext, IDS_ASKFORUSER, UserName, 256, TRUE))
|
||||||
return WLX_SAS_ACTION_NONE;
|
return WLX_SAS_ACTION_NONE;
|
||||||
if (!ReadString(pgContext, IDS_ASKFORPASSWORD, Password, 256, FALSE))
|
if (!ReadString(pgContext, IDS_ASKFORPASSWORD, Password, 256, FALSE))
|
||||||
return WLX_SAS_ACTION_NONE;
|
return WLX_SAS_ACTION_NONE;
|
||||||
|
|
||||||
if (DoLoginTasks(pgContext, User, NULL, Password))
|
if (DoLoginTasks(pgContext, UserName, NULL, Password))
|
||||||
return WLX_SAS_ACTION_LOGON;
|
return WLX_SAS_ACTION_LOGON;
|
||||||
else
|
else
|
||||||
return WLX_SAS_ACTION_NONE;
|
return WLX_SAS_ACTION_NONE;
|
||||||
|
|
Loading…
Reference in a new issue