2003-12-01 18:21:04 +00:00
|
|
|
/*
|
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 2003 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2003-12-01 18:21:04 +00:00
|
|
|
*/
|
2006-09-26 19:18:02 +00:00
|
|
|
/* COPYRIGHT: See COPYING in the top level directory
|
2003-12-01 18:21:04 +00:00
|
|
|
* PROJECT: ReactOS winlogon
|
|
|
|
* FILE: subsys/system/winlogon/winlogon.h
|
|
|
|
* PURPOSE: Winlogon
|
2005-05-08 04:07:56 +00:00
|
|
|
* PROGRAMMER:
|
2003-12-01 18:21:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINLOGON_MAIN_H__
|
|
|
|
#define __WINLOGON_MAIN_H__
|
|
|
|
|
2006-09-10 02:22:12 +00:00
|
|
|
#define USE_GETLASTINPUTINFO
|
2006-09-09 17:10:42 +00:00
|
|
|
|
2005-10-19 17:03:38 +00:00
|
|
|
#define WIN32_NO_STATUS
|
2005-06-20 22:19:18 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <userenv.h>
|
2005-04-01 05:04:40 +00:00
|
|
|
#include <winwlx.h>
|
2008-07-25 20:16:16 +00:00
|
|
|
#include <cmfuncs.h>
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <rtlfuncs.h>
|
|
|
|
#include <exfuncs.h>
|
2006-07-22 16:03:12 +00:00
|
|
|
#include <setypes.h>
|
2006-08-02 21:01:37 +00:00
|
|
|
#include <ntsecapi.h>
|
2007-11-10 15:56:36 +00:00
|
|
|
#include <accctrl.h>
|
|
|
|
#include <aclapi.h>
|
2005-06-20 22:19:18 +00:00
|
|
|
|
|
|
|
#include <reactos/winlogon.h>
|
|
|
|
|
|
|
|
#include "setup.h"
|
|
|
|
#include "resource.h"
|
2003-12-01 18:21:04 +00:00
|
|
|
|
|
|
|
typedef BOOL (WINAPI * PFWLXNEGOTIATE) (DWORD, DWORD *);
|
|
|
|
typedef BOOL (WINAPI * PFWLXINITIALIZE) (LPWSTR, HANDLE, PVOID, PVOID, PVOID *);
|
|
|
|
typedef VOID (WINAPI * PFWLXDISPLAYSASNOTICE) (PVOID);
|
|
|
|
typedef int (WINAPI * PFWLXLOGGEDOUTSAS) (PVOID, DWORD, PLUID, PSID, PDWORD,
|
2005-05-08 04:07:56 +00:00
|
|
|
PHANDLE, PWLX_MPR_NOTIFY_INFO,
|
2003-12-01 18:21:04 +00:00
|
|
|
PVOID *);
|
|
|
|
typedef BOOL (WINAPI * PFWLXACTIVATEUSERSHELL) (PVOID, PWSTR, PWSTR, PVOID);
|
|
|
|
typedef int (WINAPI * PFWLXLOGGEDONSAS) (PVOID, DWORD, PVOID);
|
|
|
|
typedef VOID (WINAPI * PFWLXDISPLAYLOCKEDNOTICE) (PVOID);
|
|
|
|
typedef int (WINAPI * PFWLXWKSTALOCKEDSAS) (PVOID, DWORD);
|
|
|
|
typedef BOOL (WINAPI * PFWLXISLOCKOK) (PVOID);
|
|
|
|
typedef BOOL (WINAPI * PFWLXISLOGOFFOK) (PVOID);
|
|
|
|
typedef VOID (WINAPI * PFWLXLOGOFF) (PVOID);
|
|
|
|
typedef VOID (WINAPI * PFWLXSHUTDOWN) (PVOID, DWORD);
|
|
|
|
|
|
|
|
/* version 1.1 */
|
|
|
|
|
|
|
|
typedef BOOL (WINAPI * PFWLXSCREENSAVERNOTIFY) (PVOID, BOOL *);
|
|
|
|
typedef BOOL (WINAPI * PFWLXSTARTAPPLICATION) (PVOID, PWSTR, PVOID, PWSTR);
|
|
|
|
|
|
|
|
/* version 1.3 */
|
|
|
|
|
|
|
|
typedef BOOL (WINAPI * PFWLXNETWORKPROVIDERLOAD) (PVOID, PWLX_MPR_NOTIFY_INFO);
|
|
|
|
typedef BOOL (WINAPI * PFWLXDISPLAYSTATUSMESSAGE) (PVOID, HDESK, DWORD, PWSTR, PWSTR);
|
|
|
|
typedef BOOL (WINAPI * PFWLXGETSTATUSMESSAGE) (PVOID, DWORD *, PWSTR, DWORD);
|
|
|
|
typedef BOOL (WINAPI * PFWLXREMOVESTATUSMESSAGE) (PVOID);
|
|
|
|
|
2006-08-04 11:37:18 +00:00
|
|
|
typedef struct _GINAFUNCTIONS
|
2003-12-01 18:21:04 +00:00
|
|
|
{
|
2006-08-02 21:01:37 +00:00
|
|
|
/* Functions always available for a valid GINA */
|
2006-08-09 06:31:02 +00:00
|
|
|
PFWLXNEGOTIATE WlxNegotiate; /* optional */
|
2006-08-02 21:01:37 +00:00
|
|
|
PFWLXINITIALIZE WlxInitialize;
|
|
|
|
|
|
|
|
/* Functions available if WlxVersion >= WLX_VERSION_1_0 (MS Windows 3.5.0) */
|
|
|
|
PFWLXDISPLAYSASNOTICE WlxDisplaySASNotice;
|
|
|
|
PFWLXLOGGEDOUTSAS WlxLoggedOutSAS;
|
|
|
|
PFWLXACTIVATEUSERSHELL WlxActivateUserShell;
|
|
|
|
PFWLXLOGGEDONSAS WlxLoggedOnSAS;
|
|
|
|
PFWLXDISPLAYLOCKEDNOTICE WlxDisplayLockedNotice;
|
|
|
|
PFWLXWKSTALOCKEDSAS WlxWkstaLockedSAS;
|
|
|
|
PFWLXISLOCKOK WlxIsLockOk;
|
|
|
|
PFWLXISLOGOFFOK WlxIsLogoffOk;
|
|
|
|
PFWLXLOGOFF WlxLogoff;
|
|
|
|
PFWLXSHUTDOWN WlxShutdown;
|
|
|
|
|
|
|
|
/* Functions available if WlxVersion >= WLX_VERSION_1_1 (MS Windows 3.5.1) */
|
2006-08-10 18:37:03 +00:00
|
|
|
PFWLXSCREENSAVERNOTIFY WlxScreenSaverNotify; /* optional */
|
2006-10-09 19:19:28 +00:00
|
|
|
PFWLXSTARTAPPLICATION WlxStartApplication; /* optional */
|
2006-08-02 21:01:37 +00:00
|
|
|
|
|
|
|
/* Functions available if WlxVersion >= WLX_VERSION_1_2 (MS Windows NT 4.0) */
|
|
|
|
|
|
|
|
/* Functions available if WlxVersion >= WLX_VERSION_1_3 (MS Windows 2000) */
|
2006-08-09 06:31:02 +00:00
|
|
|
PFWLXNETWORKPROVIDERLOAD WlxNetworkProviderLoad; /* not called ATM */
|
2006-08-02 21:01:37 +00:00
|
|
|
PFWLXDISPLAYSTATUSMESSAGE WlxDisplayStatusMessage;
|
2006-08-09 06:31:02 +00:00
|
|
|
PFWLXGETSTATUSMESSAGE WlxGetStatusMessage; /* doesn't need to be called */
|
2006-08-02 21:01:37 +00:00
|
|
|
PFWLXREMOVESTATUSMESSAGE WlxRemoveStatusMessage;
|
|
|
|
|
|
|
|
/* Functions available if WlxVersion >= WLX_VERSION_1_4 (MS Windows XP) */
|
2006-08-04 11:37:18 +00:00
|
|
|
} GINAFUNCTIONS, *PGINAFUNCTIONS;
|
2003-12-01 18:21:04 +00:00
|
|
|
|
2006-08-04 11:37:18 +00:00
|
|
|
typedef struct _GINAINSTANCE
|
2003-12-01 18:21:04 +00:00
|
|
|
{
|
2006-08-02 21:01:37 +00:00
|
|
|
HMODULE hDllInstance;
|
2006-08-04 11:37:18 +00:00
|
|
|
GINAFUNCTIONS Functions;
|
2006-08-02 21:01:37 +00:00
|
|
|
PVOID Context;
|
|
|
|
DWORD Version;
|
2006-08-04 11:37:18 +00:00
|
|
|
BOOL UseCtrlAltDelete;
|
|
|
|
} GINAINSTANCE, *PGINAINSTANCE;
|
2003-12-01 18:21:04 +00:00
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
/* FIXME: put in an enum */
|
2006-08-09 06:31:02 +00:00
|
|
|
/* See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/winlogon_states.asp */
|
2006-08-02 21:01:37 +00:00
|
|
|
#define WKSTA_IS_LOGGED_OFF 0
|
|
|
|
#define WKSTA_IS_LOGGED_ON 1
|
|
|
|
#define WKSTA_IS_LOCKED 2
|
|
|
|
|
2006-08-03 13:50:40 +00:00
|
|
|
#define LockWorkstation(Session)
|
|
|
|
#define UnlockWorkstation(Session)
|
|
|
|
|
2004-03-28 12:21:41 +00:00
|
|
|
typedef struct _WLSESSION
|
|
|
|
{
|
2006-08-04 11:37:18 +00:00
|
|
|
GINAINSTANCE Gina;
|
2004-03-28 12:21:41 +00:00
|
|
|
DWORD SASAction;
|
|
|
|
BOOL SuppressStatus;
|
|
|
|
BOOL TaskManHotkey;
|
|
|
|
HWND SASWindow;
|
|
|
|
HWINSTA InteractiveWindowStation;
|
2004-07-12 20:09:35 +00:00
|
|
|
LPWSTR InteractiveWindowStationName;
|
2004-03-28 12:21:41 +00:00
|
|
|
HDESK ApplicationDesktop;
|
|
|
|
HDESK WinlogonDesktop;
|
|
|
|
HDESK ScreenSaverDesktop;
|
|
|
|
LUID LogonId;
|
2005-12-01 22:29:57 +00:00
|
|
|
HANDLE UserToken;
|
2007-08-13 14:23:03 +00:00
|
|
|
HANDLE hProfileInfo;
|
2006-08-10 18:37:03 +00:00
|
|
|
DWORD LogonStatus;
|
2006-08-03 13:50:40 +00:00
|
|
|
DWORD DialogTimeout; /* Timeout for dialog boxes, in seconds */
|
|
|
|
|
2006-08-10 18:37:03 +00:00
|
|
|
/* Screen-saver informations */
|
2006-09-09 17:10:42 +00:00
|
|
|
#ifndef USE_GETLASTINPUTINFO
|
2006-08-10 18:37:03 +00:00
|
|
|
HHOOK KeyboardHook;
|
|
|
|
HHOOK MouseHook;
|
2006-09-09 17:10:42 +00:00
|
|
|
#endif
|
2006-08-10 18:37:03 +00:00
|
|
|
HANDLE hEndOfScreenSaverThread;
|
|
|
|
HANDLE hScreenSaverParametersChanged;
|
|
|
|
HANDLE hUserActivity;
|
2006-09-10 02:22:12 +00:00
|
|
|
HANDLE hEndOfScreenSaver;
|
2006-09-09 17:10:42 +00:00
|
|
|
#ifndef USE_GETLASTINPUTINFO
|
2006-08-10 18:37:03 +00:00
|
|
|
DWORD LastActivity;
|
2006-09-09 17:10:42 +00:00
|
|
|
#endif
|
2006-08-10 18:37:03 +00:00
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
/* Logon informations */
|
|
|
|
DWORD Options;
|
|
|
|
WLX_MPR_NOTIFY_INFO MprNotifyInfo;
|
2007-08-13 14:23:03 +00:00
|
|
|
WLX_PROFILE_V2_0 *Profile;
|
2004-03-28 12:21:41 +00:00
|
|
|
} WLSESSION, *PWLSESSION;
|
|
|
|
|
2003-12-01 18:21:04 +00:00
|
|
|
extern HINSTANCE hAppInstance;
|
2004-03-28 12:21:41 +00:00
|
|
|
extern PWLSESSION WLSession;
|
|
|
|
|
|
|
|
#define WLX_SHUTTINGDOWN(Status) \
|
|
|
|
(((Status) == WLX_SAS_ACTION_SHUTDOWN) || \
|
|
|
|
((Status) == WLX_SAS_ACTION_SHUTDOWN_POWER_OFF) || \
|
|
|
|
((Status) == WLX_SAS_ACTION_SHUTDOWN_REBOOT) \
|
|
|
|
)
|
2003-12-01 18:21:04 +00:00
|
|
|
|
2004-03-28 12:21:41 +00:00
|
|
|
#define WLX_SUSPENDING(Status) \
|
|
|
|
(((Status) == WLX_SAS_ACTION_SHUTDOWN_SLEEP) || \
|
|
|
|
((Status) == WLX_SAS_ACTION_SHUTDOWN_SLEEP2) || \
|
|
|
|
((Status) == WLX_SAS_ACTION_SHUTDOWN_HIBERNATE) \
|
|
|
|
)
|
2003-12-01 18:21:04 +00:00
|
|
|
|
2004-12-06 02:23:05 +00:00
|
|
|
/* user32 */
|
|
|
|
BOOL WINAPI
|
|
|
|
UpdatePerUserSystemParameters(DWORD dwUnknown,
|
|
|
|
DWORD dwReserved);
|
|
|
|
|
2010-05-08 16:30:56 +00:00
|
|
|
/* environment.c */
|
|
|
|
BOOL
|
2010-05-14 17:08:20 +00:00
|
|
|
CreateUserEnvironment(IN PWLSESSION Session);
|
2010-05-08 16:30:56 +00:00
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
/* sas.c */
|
2006-09-09 17:10:42 +00:00
|
|
|
BOOL
|
|
|
|
SetDefaultLanguage(
|
2006-10-09 19:19:28 +00:00
|
|
|
IN BOOL UserProfile);
|
2006-09-09 17:10:42 +00:00
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
BOOL
|
|
|
|
InitializeSAS(
|
|
|
|
IN OUT PWLSESSION Session);
|
|
|
|
|
2006-08-10 18:37:03 +00:00
|
|
|
/* screensaver.c */
|
|
|
|
BOOL
|
|
|
|
InitializeScreenSaver(
|
|
|
|
IN OUT PWLSESSION Session);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
StartScreenSaver(
|
|
|
|
IN PWLSESSION Session);
|
|
|
|
|
2006-08-09 06:31:02 +00:00
|
|
|
/* winlogon.c */
|
|
|
|
BOOL
|
|
|
|
DisplayStatusMessage(
|
|
|
|
IN PWLSESSION Session,
|
|
|
|
IN HDESK hDesktop,
|
|
|
|
IN UINT ResourceId);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
RemoveStatusMessage(
|
|
|
|
IN PWLSESSION Session);
|
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
/* wlx.c */
|
|
|
|
BOOL
|
|
|
|
GinaInit(
|
|
|
|
IN OUT PWLSESSION Session);
|
|
|
|
BOOL
|
|
|
|
CreateWindowStationAndDesktops(
|
|
|
|
IN OUT PWLSESSION Session);
|
|
|
|
|
2006-10-09 19:19:28 +00:00
|
|
|
NTSTATUS
|
2006-08-09 06:31:02 +00:00
|
|
|
HandleShutdown(
|
|
|
|
IN OUT PWLSESSION Session,
|
|
|
|
IN DWORD wlxAction);
|
|
|
|
|
2006-08-02 21:01:37 +00:00
|
|
|
VOID WINAPI WlxUseCtrlAltDel(HANDLE hWlx);
|
|
|
|
VOID WINAPI WlxSetContextPointer(HANDLE hWlx, PVOID pWlxContext);
|
|
|
|
VOID WINAPI WlxSasNotify(HANDLE hWlx, DWORD dwSasType);
|
|
|
|
BOOL WINAPI WlxSetTimeout(HANDLE hWlx, DWORD Timeout);
|
|
|
|
int WINAPI WlxAssignShellProtection(HANDLE hWlx, HANDLE hToken, HANDLE hProcess, HANDLE hThread);
|
|
|
|
int WINAPI WlxMessageBox(HANDLE hWlx, HWND hwndOwner, LPWSTR lpszText, LPWSTR lpszTitle, UINT fuStyle);
|
|
|
|
int WINAPI WlxDialogBox(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc);
|
|
|
|
int WINAPI WlxDialogBoxParam(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam);
|
|
|
|
int WINAPI WlxDialogBoxIndirect(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc);
|
|
|
|
int WINAPI WlxDialogBoxIndirectParam(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam);
|
|
|
|
int WINAPI WlxSwitchDesktopToUser(HANDLE hWlx);
|
|
|
|
int WINAPI WlxSwitchDesktopToWinlogon(HANDLE hWlx);
|
|
|
|
int WINAPI WlxChangePasswordNotify(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo);
|
|
|
|
BOOL WINAPI WlxGetSourceDesktop(HANDLE hWlx, PWLX_DESKTOP* ppDesktop);
|
|
|
|
BOOL WINAPI WlxSetReturnDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop);
|
|
|
|
BOOL WINAPI WlxCreateUserDesktop(HANDLE hWlx, HANDLE hToken, DWORD Flags, PWSTR pszDesktopName, PWLX_DESKTOP* ppDesktop);
|
|
|
|
int WINAPI WlxChangePasswordNotifyEx(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo, PWSTR ProviderName, PVOID Reserved);
|
|
|
|
BOOL WINAPI WlxCloseUserDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop, HANDLE hToken);
|
|
|
|
BOOL WINAPI WlxSetOption(HANDLE hWlx, DWORD Option, ULONG_PTR Value, ULONG_PTR* OldValue);
|
|
|
|
BOOL WINAPI WlxGetOption(HANDLE hWlx, DWORD Option, ULONG_PTR* Value);
|
|
|
|
VOID WINAPI WlxWin31Migrate(HANDLE hWlx);
|
|
|
|
BOOL WINAPI WlxQueryClientCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred);
|
|
|
|
BOOL WINAPI WlxQueryInetConnectorCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred);
|
|
|
|
DWORD WINAPI WlxQueryConsoleSwitchCredentials(PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred);
|
|
|
|
BOOL WINAPI WlxQueryTsLogonCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred);
|
|
|
|
BOOL WINAPI WlxDisconnect(VOID);
|
|
|
|
DWORD WINAPI WlxQueryTerminalServicesData(HANDLE hWlx, PWLX_TERMINAL_SERVICES_DATA pTSData, WCHAR* UserName, WCHAR* Domain);
|
|
|
|
|
2003-12-01 18:21:04 +00:00
|
|
|
#endif /* __WINLOGON_MAIN_H__ */
|
|
|
|
|
|
|
|
/* EOF */
|