ReactOS  0.4.15-dev-3207-ga415bd4
winlogon.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <winreg.h>
#include <winwlx.h>
#include <ndk/rtlfuncs.h>
#include <ndk/exfuncs.h>
#include <strsafe.h>
#include <reactos/undocuser.h>
#include <reactos/undocmpr.h>
#include <wine/debug.h>
#include "resource.h"
Include dependency graph for winlogon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _GINAFUNCTIONS
 
struct  _GINAINSTANCE
 
struct  _WLSESSION
 

Macros

#define USE_GETLASTINPUTINFO
 
#define WIN32_NO_STATUS
 
#define LockWorkstation(Session)
 
#define UnlockWorkstation(Session)
 
#define WLX_SHUTTINGDOWN(Status)
 
#define WLX_SUSPENDING(Status)
 

Typedefs

typedef BOOL(WINAPIPFWLXNEGOTIATE) (DWORD, DWORD *)
 
typedef BOOL(WINAPIPFWLXINITIALIZE) (LPWSTR, HANDLE, PVOID, PVOID, PVOID *)
 
typedef VOID(WINAPIPFWLXDISPLAYSASNOTICE) (PVOID)
 
typedef int(WINAPIPFWLXLOGGEDOUTSAS) (PVOID, DWORD, PLUID, PSID, PDWORD, PHANDLE, PWLX_MPR_NOTIFY_INFO, PVOID *)
 
typedef BOOL(WINAPIPFWLXACTIVATEUSERSHELL) (PVOID, PWSTR, PWSTR, PVOID)
 
typedef int(WINAPIPFWLXLOGGEDONSAS) (PVOID, DWORD, PVOID)
 
typedef VOID(WINAPIPFWLXDISPLAYLOCKEDNOTICE) (PVOID)
 
typedef int(WINAPIPFWLXWKSTALOCKEDSAS) (PVOID, DWORD)
 
typedef BOOL(WINAPIPFWLXISLOCKOK) (PVOID)
 
typedef BOOL(WINAPIPFWLXISLOGOFFOK) (PVOID)
 
typedef VOID(WINAPIPFWLXLOGOFF) (PVOID)
 
typedef VOID(WINAPIPFWLXSHUTDOWN) (PVOID, DWORD)
 
typedef BOOL(WINAPIPFWLXSCREENSAVERNOTIFY) (PVOID, BOOL *)
 
typedef BOOL(WINAPIPFWLXSTARTAPPLICATION) (PVOID, PWSTR, PVOID, PWSTR)
 
typedef BOOL(WINAPIPFWLXNETWORKPROVIDERLOAD) (PVOID, PWLX_MPR_NOTIFY_INFO)
 
typedef BOOL(WINAPIPFWLXDISPLAYSTATUSMESSAGE) (PVOID, HDESK, DWORD, PWSTR, PWSTR)
 
typedef BOOL(WINAPIPFWLXGETSTATUSMESSAGE) (PVOID, DWORD *, PWSTR, DWORD)
 
typedef BOOL(WINAPIPFWLXREMOVESTATUSMESSAGE) (PVOID)
 
typedef struct _GINAFUNCTIONS GINAFUNCTIONS
 
typedef struct _GINAFUNCTIONSPGINAFUNCTIONS
 
typedef struct _GINAINSTANCE GINAINSTANCE
 
typedef struct _GINAINSTANCEPGINAINSTANCE
 
typedef enum _LOGON_STATE LOGON_STATE
 
typedef enum _LOGON_STATEPLOGON_STATE
 
typedef struct _WLSESSION WLSESSION
 
typedef struct _WLSESSIONPWLSESSION
 
typedef enum _NOTIFICATION_TYPE NOTIFICATION_TYPE
 
typedef enum _NOTIFICATION_TYPEPNOTIFICATION_TYPE
 

Enumerations

enum  _LOGON_STATE {
  STATE_INIT, STATE_LOGGED_OFF, STATE_LOGGED_OFF_SAS, STATE_LOGGED_ON,
  STATE_LOGGED_ON_SAS, STATE_LOCKED, STATE_LOCKED_SAS, STATE_LOGGING_OFF,
  STATE_SHUTTING_DOWN, STATE_SHUT_DOWN, STATE_SCREENSAVER
}
 
enum  _NOTIFICATION_TYPE {
  LogonHandler, LogoffHandler, LockHandler, UnlockHandler,
  StartupHandler, ShutdownHandler, StartScreenSaverHandler, StopScreenSaverHandler,
  DisconnectHandler, ReconnectHandler, StartShellHandler, PostShellHandler,
  LastHandler
}
 

Functions

BOOL WINAPI SetWindowStationUser (IN HWINSTA hWindowStation, IN PLUID pluid, IN PSID psid OPTIONAL, IN DWORD size)
 
 WINE_DEFAULT_DEBUG_CHANNEL (winlogon)
 
BOOL CreateUserEnvironment (IN PWLSESSION Session)
 
BOOL InitNotifications (VOID)
 
VOID CleanupNotifications (VOID)
 
VOID CallNotificationDlls (PWLSESSION pSession, NOTIFICATION_TYPE Type)
 
BOOL StartRpcServer (VOID)
 
BOOL SetDefaultLanguage (IN PWLSESSION Session)
 
NTSTATUS HandleShutdown (IN OUT PWLSESSION Session, IN DWORD wlxAction)
 
BOOL InitializeSAS (IN OUT PWLSESSION Session)
 
BOOL InitializeScreenSaver (IN OUT PWLSESSION Session)
 
VOID StartScreenSaver (IN PWLSESSION Session)
 
DWORD GetSetupType (VOID)
 
BOOL RunSetup (VOID)
 
DWORD TerminateSystemShutdown (VOID)
 
DWORD StartSystemShutdown (IN PUNICODE_STRING pMessage, IN ULONG dwTimeout, IN BOOLEAN bForceAppsClosed, IN BOOLEAN bRebootAfterShutdown, IN ULONG dwReason)
 
BOOL PlaySoundRoutine (IN LPCWSTR FileName, IN UINT Logon, IN UINT Flags)
 
BOOL DisplayStatusMessage (IN PWLSESSION Session, IN HDESK hDesktop, IN UINT ResourceId)
 
BOOL RemoveStatusMessage (IN PWLSESSION Session)
 
VOID InitDialogListHead (VOID)
 
VOID CloseAllDialogWindows (VOID)
 
BOOL GinaInit (IN OUT PWLSESSION Session)
 
BOOL AddAceToWindowStation (IN HWINSTA WinSta, IN PSID Sid)
 
BOOL CreateWindowStationAndDesktops (IN OUT PWLSESSION Session)
 
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)
 

Variables

HINSTANCE hAppInstance
 
PWLSESSION WLSession
 
LUID LuidNone
 

Macro Definition Documentation

◆ LockWorkstation

#define LockWorkstation (   Session)

Definition at line 211 of file winlogon.h.

◆ UnlockWorkstation

#define UnlockWorkstation (   Session)

Definition at line 212 of file winlogon.h.

◆ USE_GETLASTINPUTINFO

#define USE_GETLASTINPUTINFO

Definition at line 31 of file winlogon.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 33 of file winlogon.h.

◆ WLX_SHUTTINGDOWN

#define WLX_SHUTTINGDOWN (   Status)
Value:
)
#define WLX_SAS_ACTION_SHUTDOWN
Definition: winwlx.h:57
Status
Definition: gdiplustypes.h:24
#define WLX_SAS_ACTION_SHUTDOWN_POWER_OFF
Definition: winwlx.h:62
#define WLX_SAS_ACTION_SHUTDOWN_REBOOT
Definition: winwlx.h:63

Definition at line 271 of file winlogon.h.

◆ WLX_SUSPENDING

#define WLX_SUSPENDING (   Status)
Value:
)
#define WLX_SAS_ACTION_SHUTDOWN_HIBERNATE
Definition: winwlx.h:66
#define WLX_SAS_ACTION_SHUTDOWN_SLEEP2
Definition: winwlx.h:65
Status
Definition: gdiplustypes.h:24
#define WLX_SAS_ACTION_SHUTDOWN_SLEEP
Definition: winwlx.h:64

Definition at line 277 of file winlogon.h.

Typedef Documentation

◆ GINAFUNCTIONS

◆ GINAINSTANCE

◆ LOGON_STATE

◆ NOTIFICATION_TYPE

◆ PFWLXACTIVATEUSERSHELL

typedef BOOL(WINAPI * PFWLXACTIVATEUSERSHELL) (PVOID, PWSTR, PWSTR, PVOID)

Definition at line 66 of file winlogon.h.

◆ PFWLXDISPLAYLOCKEDNOTICE

typedef VOID(WINAPI * PFWLXDISPLAYLOCKEDNOTICE) (PVOID)

Definition at line 68 of file winlogon.h.

◆ PFWLXDISPLAYSASNOTICE

typedef VOID(WINAPI * PFWLXDISPLAYSASNOTICE) (PVOID)

Definition at line 62 of file winlogon.h.

◆ PFWLXDISPLAYSTATUSMESSAGE

typedef BOOL(WINAPI * PFWLXDISPLAYSTATUSMESSAGE) (PVOID, HDESK, DWORD, PWSTR, PWSTR)

Definition at line 83 of file winlogon.h.

◆ PFWLXGETSTATUSMESSAGE

typedef BOOL(WINAPI * PFWLXGETSTATUSMESSAGE) (PVOID, DWORD *, PWSTR, DWORD)

Definition at line 84 of file winlogon.h.

◆ PFWLXINITIALIZE

typedef BOOL(WINAPI * PFWLXINITIALIZE) (LPWSTR, HANDLE, PVOID, PVOID, PVOID *)

Definition at line 61 of file winlogon.h.

◆ PFWLXISLOCKOK

typedef BOOL(WINAPI * PFWLXISLOCKOK) (PVOID)

Definition at line 70 of file winlogon.h.

◆ PFWLXISLOGOFFOK

typedef BOOL(WINAPI * PFWLXISLOGOFFOK) (PVOID)

Definition at line 71 of file winlogon.h.

◆ PFWLXLOGGEDONSAS

typedef int(WINAPI * PFWLXLOGGEDONSAS) (PVOID, DWORD, PVOID)

Definition at line 67 of file winlogon.h.

◆ PFWLXLOGGEDOUTSAS

typedef int(WINAPI * PFWLXLOGGEDOUTSAS) (PVOID, DWORD, PLUID, PSID, PDWORD, PHANDLE, PWLX_MPR_NOTIFY_INFO, PVOID *)

Definition at line 63 of file winlogon.h.

◆ PFWLXLOGOFF

typedef VOID(WINAPI * PFWLXLOGOFF) (PVOID)

Definition at line 72 of file winlogon.h.

◆ PFWLXNEGOTIATE

typedef BOOL(WINAPI * PFWLXNEGOTIATE) (DWORD, DWORD *)

Definition at line 60 of file winlogon.h.

◆ PFWLXNETWORKPROVIDERLOAD

typedef BOOL(WINAPI * PFWLXNETWORKPROVIDERLOAD) (PVOID, PWLX_MPR_NOTIFY_INFO)

Definition at line 82 of file winlogon.h.

◆ PFWLXREMOVESTATUSMESSAGE

typedef BOOL(WINAPI * PFWLXREMOVESTATUSMESSAGE) (PVOID)

Definition at line 85 of file winlogon.h.

◆ PFWLXSCREENSAVERNOTIFY

typedef BOOL(WINAPI * PFWLXSCREENSAVERNOTIFY) (PVOID, BOOL *)

Definition at line 77 of file winlogon.h.

◆ PFWLXSHUTDOWN

typedef VOID(WINAPI * PFWLXSHUTDOWN) (PVOID, DWORD)

Definition at line 73 of file winlogon.h.

◆ PFWLXSTARTAPPLICATION

typedef BOOL(WINAPI * PFWLXSTARTAPPLICATION) (PVOID, PWSTR, PVOID, PWSTR)

Definition at line 78 of file winlogon.h.

◆ PFWLXWKSTALOCKEDSAS

typedef int(WINAPI * PFWLXWKSTALOCKEDSAS) (PVOID, DWORD)

Definition at line 69 of file winlogon.h.

◆ PGINAFUNCTIONS

◆ PGINAINSTANCE

◆ PLOGON_STATE

◆ PNOTIFICATION_TYPE

◆ PWLSESSION

◆ WLSESSION

Enumeration Type Documentation

◆ _LOGON_STATE

Enumerator
STATE_INIT 
STATE_LOGGED_OFF 
STATE_LOGGED_OFF_SAS 
STATE_LOGGED_ON 
STATE_LOGGED_ON_SAS 
STATE_LOCKED 
STATE_LOCKED_SAS 
STATE_LOGGING_OFF 
STATE_SHUTTING_DOWN 
STATE_SHUT_DOWN 
STATE_SCREENSAVER 

Definition at line 196 of file winlogon.h.

197 {
198  STATE_INIT,
203  STATE_LOCKED,
205  STATE_LOGGING_OFF, // not used yet
206  STATE_SHUTTING_DOWN, // not used yet
207  STATE_SHUT_DOWN, // not used yet
208  STATE_SCREENSAVER // not used yet
enum _LOGON_STATE LOGON_STATE
enum _LOGON_STATE * PLOGON_STATE

◆ _NOTIFICATION_TYPE

Enumerator
LogonHandler 
LogoffHandler 
LockHandler 
UnlockHandler 
StartupHandler 
ShutdownHandler 
StartScreenSaverHandler 
StopScreenSaverHandler 
DisconnectHandler 
ReconnectHandler 
StartShellHandler 
PostShellHandler 
LastHandler 

Definition at line 251 of file winlogon.h.

Function Documentation

◆ AddAceToWindowStation()

BOOL AddAceToWindowStation ( IN HWINSTA  WinSta,
IN PSID  Sid 
)

Definition at line 942 of file wlx.c.

945 {
946  DWORD AclSize;
948  PACL pDefaultAcl = NULL;
949  PSECURITY_DESCRIPTOR WinstaSd = NULL;
951  BOOL Ret = FALSE;
952 
953  /* Allocate space for an ACL */
954  AclSize = sizeof(ACL)
955  + 2 * (FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + GetLengthSid(Sid));
956  pDefaultAcl = HeapAlloc(GetProcessHeap(), 0, AclSize);
957  if (!pDefaultAcl)
958  {
959  ERR("WL: HeapAlloc() failed\n");
960  goto cleanup;
961  }
962 
963  /* Initialize it */
964  if (!InitializeAcl(pDefaultAcl, AclSize, ACL_REVISION))
965  {
966  ERR("WL: InitializeAcl() failed (error %lu)\n", GetLastError());
967  goto cleanup;
968  }
969 
970  /* Initialize new security descriptor */
973  {
974  ERR("WL: InitializeSecurityDescriptor() failed (error %lu)\n", GetLastError());
975  goto cleanup;
976  }
977 
978  /* Allocate memory for access allowed ACE */
980  GetLengthSid(Sid) - sizeof(DWORD));
981 
982  /* Create the first ACE for the window station */
983  Ace->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;
985  Ace->Header.AceSize = sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(Sid) - sizeof(DWORD);
986  Ace->Mask = GENERIC_ACCESS;
987 
988  /* Copy the sid */
989  if (!CopySid(GetLengthSid(Sid), &Ace->SidStart, Sid))
990  {
991  ERR("WL: CopySid() failed (error %lu)\n", GetLastError());
992  goto cleanup;
993  }
994 
995  /* Add the first ACE */
996  if (!AddAce(pDefaultAcl, ACL_REVISION, MAXDWORD, (LPVOID)Ace, Ace->Header.AceSize))
997  {
998  ERR("WL: AddAce() failed (error %lu)\n", GetLastError());
999  goto cleanup;
1000  }
1001 
1002  /* Add the second ACE to the end of ACL */
1003  Ace->Header.AceFlags = NO_PROPAGATE_INHERIT_ACE;
1004  Ace->Mask = WINSTA_ALL;
1005  if (!AddAce(pDefaultAcl, ACL_REVISION, MAXDWORD, (LPVOID)Ace, Ace->Header.AceSize))
1006  {
1007  ERR("WL: AddAce() failed (error %lu)\n", GetLastError());
1008  goto cleanup;
1009  }
1010 
1011  /* Add ACL to winsta's security descriptor */
1012  if (!SetSecurityDescriptorDacl(WinstaSd, TRUE, pDefaultAcl, FALSE))
1013  {
1014  ERR("WL: SetSecurityDescriptorDacl() failed (error %lu)\n", GetLastError());
1015  goto cleanup;
1016  }
1017 
1018  /* Apply security to the window station */
1020  if (!SetUserObjectSecurity(WinSta, &SecurityInformation, WinstaSd))
1021  {
1022  ERR("WL: SetUserObjectSecurity() failed (error %lu)\n", GetLastError());
1023  goto cleanup;
1024  }
1025 
1026  /* Indicate success */
1027  Ret = TRUE;
1028 
1029 cleanup:
1030  /* Free allocated stuff */
1031  if (pDefaultAcl) HeapFree(GetProcessHeap(), 0, pDefaultAcl);
1032  if (WinstaSd) HeapFree(GetProcessHeap(), 0, WinstaSd);
1033  if (Ace) HeapFree(GetProcessHeap(), 0, Ace);
1034 
1035  return Ret;
1036 }
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
Definition: security.c:885
#define SECURITY_DESCRIPTOR_MIN_LENGTH
Definition: setypes.h:780
#define TRUE
Definition: types.h:120
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
Definition: security.c:808
#define GENERIC_ACCESS
Definition: wlx.c:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
#define NO_PROPAGATE_INHERIT_ACE
Definition: setypes.h:735
#define DWORD
Definition: nt_native.h:44
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
Definition: card.h:12
struct _ACL ACL
#define MAXDWORD
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1103
BOOL WINAPI SetUserObjectSecurity(_In_ HANDLE, _In_ PSECURITY_INFORMATION, _In_ PSECURITY_DESCRIPTOR)
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define CONTAINER_INHERIT_ACE
Definition: setypes.h:734
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD WINAPI GetLengthSid(PSID pSid)
Definition: security.c:798
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ACCESS_ALLOWED_ACE_TYPE
Definition: setypes.h:704
#define ERR(fmt,...)
Definition: debug.h:110
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
BOOL WINAPI AddAce(PACL pAcl, DWORD dwAceRevision, DWORD dwStartingAceIndex, LPVOID pAceList, DWORD nAceListLength)
Definition: security.c:1020
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define ACL_REVISION
Definition: setypes.h:39
char * cleanup(char *str)
Definition: wpickclick.c:99
#define INHERIT_ONLY_ACE
Definition: setypes.h:736
#define WINSTA_ALL
Definition: wlx.c:20
BOOL WINAPI CopySid(DWORD nDestinationSidLength, PSID pDestinationSid, PSID pSourceSid)
Definition: security.c:591
#define HeapFree(x, y, z)
Definition: compat.h:594
#define OBJECT_INHERIT_ACE
Definition: setypes.h:733
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125

Referenced by AllowWinstaAccess().

◆ CallNotificationDlls()

VOID CallNotificationDlls ( PWLSESSION  pSession,
NOTIFICATION_TYPE  Type 
)

Definition at line 380 of file notify.c.

383 {
384  PLIST_ENTRY ListEntry;
385  PNOTIFICATION_ITEM NotificationDll;
387  HKEY hNotifyKey = NULL;
388  DWORD dwError;
389 
390  TRACE("CallNotificationDlls()\n");
391 
393  L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify",
394  0,
396  &hNotifyKey);
397  if (dwError != ERROR_SUCCESS)
398  {
399  TRACE("RegOpenKeyExW()\n");
400  return;
401  }
402 
403  Info.Size = sizeof(WLX_NOTIFICATION_INFO);
404 
405  switch (Type)
406  {
407  case LogoffHandler:
408  case ShutdownHandler:
409  Info.Flags = 3;
410  break;
411 
412  default:
413  Info.Flags = 0;
414  break;
415  }
416 
417  Info.UserName = NULL; //UserName;
418  Info.Domain = NULL; //Domain;
419  Info.WindowStation = pSession->InteractiveWindowStationName;
420  Info.hToken = pSession->UserToken;
421 
422  switch (Type)
423  {
424  case LogonHandler:
425  case StartShellHandler:
426  Info.hDesktop = pSession->ApplicationDesktop;
427  break;
428 
430  Info.hDesktop = pSession->ApplicationDesktop;
431  break;
432 
433  default:
434  Info.hDesktop = pSession->WinlogonDesktop;
435  break;
436  }
437 
438  Info.pStatusCallback = NULL;
439 
440  ListEntry = NotificationDllListHead.Flink;
441  while (ListEntry != &NotificationDllListHead)
442  {
443 TRACE("ListEntry %p\n", ListEntry);
444 
445  NotificationDll = CONTAINING_RECORD(ListEntry,
447  ListEntry);
448 TRACE("NotificationDll: %p\n", NotificationDll);
449  if (NotificationDll != NULL && NotificationDll->bEnabled)
450  CallNotificationDll(hNotifyKey, NotificationDll, Type, &Info);
451 
452  ListEntry = ListEntry->Flink;
453  }
454 
455  RegCloseKey(hNotifyKey);
456 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HDESK WinlogonDesktop
Definition: winlogon.h:224
#define KEY_READ
Definition: nt_native.h:1023
HANDLE UserToken
Definition: winlogon.h:227
static LIST_ENTRY NotificationDllListHead
Definition: notify.c:50
HDESK ApplicationDesktop
Definition: winlogon.h:223
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define TRACE(s)
Definition: solgame.cpp:4
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
LPWSTR InteractiveWindowStationName
Definition: winlogon.h:222
Definition: typedefs.h:119
#define NULL
Definition: types.h:112
static VOID CallNotificationDll(HKEY hNotifyKey, PNOTIFICATION_ITEM NotificationDll, NOTIFICATION_TYPE Type, PWLX_NOTIFICATION_INFO pInfo)
Definition: notify.c:309
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
struct _WLX_NOTIFICATION_INFO WLX_NOTIFICATION_INFO
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by DoGenericAction(), HandleLogoff(), HandleLogon(), HandleShutdown(), StartScreenSaver(), and WinMain().

◆ CleanupNotifications()

VOID CleanupNotifications ( VOID  )

Definition at line 460 of file notify.c.

461 {
462  PLIST_ENTRY ListEntry;
463  PNOTIFICATION_ITEM NotificationDll;
464 
465  ListEntry = NotificationDllListHead.Flink;
466  while (ListEntry != &NotificationDllListHead)
467  {
468  NotificationDll = CONTAINING_RECORD(ListEntry,
470  ListEntry);
471  if (NotificationDll != NULL)
472  {
473  if (NotificationDll->pszKeyName != NULL)
474  RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll->pszKeyName);
475 
476  if (NotificationDll->pszDllName != NULL)
477  RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll->pszDllName);
478  }
479 
480  ListEntry = ListEntry->Flink;
481 
482  RemoveEntryList(&NotificationDll->ListEntry);
483 
484  RtlFreeHeap(RtlGetProcessHeap(), 0, NotificationDll);
485  }
486 }
PWSTR pszKeyName
Definition: notify.c:38
PWSTR pszDllName
Definition: notify.c:39
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
static LIST_ENTRY NotificationDllListHead
Definition: notify.c:50
LIST_ENTRY ListEntry
Definition: notify.c:37
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: typedefs.h:119
#define NULL
Definition: types.h:112

Referenced by WinMain().

◆ CloseAllDialogWindows()

VOID CloseAllDialogWindows ( VOID  )

Definition at line 109 of file wlx.c.

110 {
111  PDIALOG_LIST_ENTRY Current;
112  PLIST_ENTRY ListEntry;
113 
114  ListEntry = DialogListHead.Flink;
115  while (ListEntry != &DialogListHead)
116  {
117  Current = CONTAINING_RECORD(ListEntry,
119  Entry);
120 
121  PostMessage(Current->hWnd, WLX_WM_SAS, 0, 0);
122 
123  ListEntry = ListEntry->Flink;
124  }
125 }
#define WLX_WM_SAS
Definition: winwlx.h:71
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define PostMessage
Definition: winuser.h:5808
static LIST_ENTRY DialogListHead
Definition: wlx.c:40
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
HWND hWnd
Definition: wlx.c:32
Definition: typedefs.h:119
Definition: wlx.c:29
base of all file and directory entries
Definition: entries.h:82

Referenced by DispatchSAS().

◆ CreateUserEnvironment()

BOOL CreateUserEnvironment ( IN PWLSESSION  Session)

Definition at line 128 of file environment.c.

130 {
131  HKEY hKeyCurrentUser;
132  LONG lError;
133 
134  TRACE("WL: CreateUserEnvironment called\n");
135 
136  /* Impersonate the new user */
137  if (!ImpersonateLoggedOnUser(Session->UserToken))
138  {
139  ERR("ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
140  return FALSE;
141  }
142 
143  /* Open the new user HKCU key */
145  &hKeyCurrentUser);
146  if (lError == ERROR_SUCCESS)
147  {
148  BuildVolatileEnvironment(Session,
149  hKeyCurrentUser);
150  RegCloseKey(hKeyCurrentUser);
151  }
152 
153  /* Revert the impersonation */
154  RevertToSelf();
155 
156  TRACE("WL: CreateUserEnvironment done\n");
157 
158  return TRUE;
159 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
BOOL WINAPI RevertToSelf(VOID)
Definition: security.c:1487
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
static VOID BuildVolatileEnvironment(IN PWLSESSION Session, IN HKEY hKeyCurrentUser)
Definition: environment.c:19
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
Definition: misc.c:152
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018

Referenced by HandleLogon().

◆ CreateWindowStationAndDesktops()

BOOL CreateWindowStationAndDesktops ( IN OUT PWLSESSION  Session)

Definition at line 1121 of file wlx.c.

1123 {
1124  BYTE LocalSystemBuffer[SECURITY_MAX_SID_SIZE];
1125  BYTE InteractiveBuffer[SECURITY_MAX_SID_SIZE];
1126  PSID pLocalSystemSid = (PSID)&LocalSystemBuffer;
1127  PSID pInteractiveSid = (PSID)InteractiveBuffer;
1128  DWORD SidSize, AclSize;
1129  PACL pDefaultAcl = NULL;
1130  PACL pUserDesktopAcl = NULL;
1131  SECURITY_DESCRIPTOR DefaultSecurityDescriptor;
1132  SECURITY_ATTRIBUTES DefaultSecurity;
1133  SECURITY_DESCRIPTOR UserDesktopSecurityDescriptor;
1134  SECURITY_ATTRIBUTES UserDesktopSecurity;
1135  BOOL ret = FALSE;
1136 
1137  /*
1138  * Prepare information for ACLs we will apply
1139  */
1140  SidSize = SECURITY_MAX_SID_SIZE;
1141  if (!CreateWellKnownSid(WinLocalSystemSid, NULL, pLocalSystemSid, &SidSize))
1142  {
1143  ERR("WL: CreateWellKnownSid() failed (error %lu)\n", GetLastError());
1144  goto cleanup;
1145  }
1146  SidSize = SECURITY_MAX_SID_SIZE;
1147  if (!CreateWellKnownSid(WinInteractiveSid, NULL, pInteractiveSid, &SidSize))
1148  {
1149  ERR("WL: CreateWellKnownSid() failed (error %lu)\n", GetLastError());
1150  goto cleanup;
1151  }
1152 
1153  AclSize = sizeof(ACL)
1155  + FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + GetLengthSid(pInteractiveSid);
1156  pDefaultAcl = HeapAlloc(GetProcessHeap(), 0, AclSize);
1157  pUserDesktopAcl = HeapAlloc(GetProcessHeap(), 0, AclSize);
1158  if (!pDefaultAcl || !pUserDesktopAcl)
1159  {
1160  ERR("WL: HeapAlloc() failed\n");
1161  goto cleanup;
1162  }
1163 
1164  if (!InitializeAcl(pDefaultAcl, AclSize, ACL_REVISION)
1165  || !InitializeAcl(pUserDesktopAcl, AclSize, ACL_REVISION))
1166  {
1167  ERR("WL: InitializeAcl() failed (error %lu)\n", GetLastError());
1168  goto cleanup;
1169  }
1170 
1171  /*
1172  * Create default ACL (window station, winlogon desktop, screen saver desktop)
1173  */
1175  || !AddAccessAllowedAce(pDefaultAcl, ACL_REVISION, GENERIC_READ, pInteractiveSid))
1176  {
1177  ERR("WL: AddAccessAllowedAce() failed (error %lu)\n", GetLastError());
1178  goto cleanup;
1179  }
1180 
1181  /*
1182  * Create the default security descriptor
1183  */
1184  if (!InitializeSecurityDescriptor(&DefaultSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION))
1185  {
1186  ERR("WL: InitializeSecurityDescriptor() failed (error %lu)\n", GetLastError());
1187  goto cleanup;
1188  }
1189 
1190  if (!SetSecurityDescriptorDacl(&DefaultSecurityDescriptor, TRUE, pDefaultAcl, FALSE))
1191  {
1192  ERR("WL: SetSecurityDescriptorDacl() failed (error %lu)\n", GetLastError());
1193  goto cleanup;
1194  }
1195 
1196  DefaultSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
1197  DefaultSecurity.lpSecurityDescriptor = &DefaultSecurityDescriptor;
1198  DefaultSecurity.bInheritHandle = TRUE;
1199 
1200  /*
1201  * Create user desktop ACL
1202  */
1204  || !AddAccessAllowedAce(pUserDesktopAcl, ACL_REVISION, GENERIC_ALL, pInteractiveSid))
1205  {
1206  ERR("WL: AddAccessAllowedAce() failed (error %lu)\n", GetLastError());
1207  goto cleanup;
1208  }
1209 
1210  /*
1211  * Create the user desktop security descriptor
1212  */
1213  if (!InitializeSecurityDescriptor(&UserDesktopSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION))
1214  {
1215  ERR("WL: InitializeSecurityDescriptor() failed (error %lu)\n", GetLastError());
1216  goto cleanup;
1217  }
1218 
1219  if (!SetSecurityDescriptorDacl(&UserDesktopSecurityDescriptor, TRUE, pUserDesktopAcl, FALSE))
1220  {
1221  ERR("WL: SetSecurityDescriptorDacl() failed (error %lu)\n", GetLastError());
1222  goto cleanup;
1223  }
1224 
1225  UserDesktopSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
1226  UserDesktopSecurity.lpSecurityDescriptor = &UserDesktopSecurityDescriptor;
1227  UserDesktopSecurity.bInheritHandle = TRUE;
1228 
1229  /*
1230  * Create the interactive window station
1231  */
1232  Session->InteractiveWindowStationName = L"WinSta0";
1233  Session->InteractiveWindowStation = CreateWindowStationW(
1234  Session->InteractiveWindowStationName,
1235  0,
1237  &DefaultSecurity);
1238  if (!Session->InteractiveWindowStation)
1239  {
1240  ERR("WL: Failed to create window station (%lu)\n", GetLastError());
1241  goto cleanup;
1242  }
1243  if (!SetProcessWindowStation(Session->InteractiveWindowStation))
1244  {
1245  ERR("WL: SetProcessWindowStation() failed (error %lu)\n", GetLastError());
1246  goto cleanup;
1247  }
1248 
1249  /*
1250  * Create the application desktop
1251  */
1252  Session->ApplicationDesktop = CreateDesktopW(
1253  L"Default",
1254  NULL,
1255  NULL,
1256  0, /* FIXME: Add DF_ALLOWOTHERACCOUNTHOOK flag? */
1258  &UserDesktopSecurity);
1259  if (!Session->ApplicationDesktop)
1260  {
1261  ERR("WL: Failed to create Default desktop (%lu)\n", GetLastError());
1262  goto cleanup;
1263  }
1264 
1265  /*
1266  * Create the winlogon desktop
1267  */
1268  Session->WinlogonDesktop = CreateDesktopW(
1269  L"Winlogon",
1270  NULL,
1271  NULL,
1272  0,
1274  &DefaultSecurity); // FIXME: Must use restricted Winlogon-only security!!
1275  if (!Session->WinlogonDesktop)
1276  {
1277  ERR("WL: Failed to create Winlogon desktop (%lu)\n", GetLastError());
1278  goto cleanup;
1279  }
1280 
1281  /*
1282  * Create the screen saver desktop
1283  */
1284  Session->ScreenSaverDesktop = CreateDesktopW(
1285  L"Screen-Saver",
1286  NULL,
1287  NULL,
1288  0,
1290  &DefaultSecurity);
1291  if(!Session->ScreenSaverDesktop)
1292  {
1293  ERR("WL: Failed to create Screen-Saver desktop (%lu)\n", GetLastError());
1294  goto cleanup;
1295  }
1296 
1297  /*
1298  * Switch to winlogon desktop
1299  */
1300  if (!SetThreadDesktop(Session->WinlogonDesktop) ||
1301  !SwitchDesktop(Session->WinlogonDesktop))
1302  {
1303  ERR("WL: Cannot switch to Winlogon desktop (%lu)\n", GetLastError());
1304  goto cleanup;
1305  }
1306 
1307  SetWindowStationUser(Session->InteractiveWindowStation,
1308  &LuidNone, NULL, 0);
1309 
1310  ret = TRUE;
1311 
1312 cleanup:
1313  if (!ret)
1314  {
1315  if (Session->ApplicationDesktop)
1316  {
1317  CloseDesktop(Session->ApplicationDesktop);
1318  Session->ApplicationDesktop = NULL;
1319  }
1320  if (Session->WinlogonDesktop)
1321  {
1322  CloseDesktop(Session->WinlogonDesktop);
1323  Session->WinlogonDesktop = NULL;
1324  }
1325  if (Session->ScreenSaverDesktop)
1326  {
1327  CloseDesktop(Session->ScreenSaverDesktop);
1328  Session->ScreenSaverDesktop = NULL;
1329  }
1330  if (Session->InteractiveWindowStation)
1331  {
1332  CloseWindowStation(Session->InteractiveWindowStation);
1333  Session->InteractiveWindowStation = NULL;
1334  }
1335  }
1336  HeapFree(GetProcessHeap(), 0, pDefaultAcl);
1337  HeapFree(GetProcessHeap(), 0, pUserDesktopAcl);
1338  return ret;
1339 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define GENERIC_ALL
Definition: nt_native.h:92
BOOL WINAPI SetWindowStationUser(IN HWINSTA hWindowStation, IN PLUID pluid, IN PSID psid OPTIONAL, IN DWORD size)
Definition: winsta.c:419
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
#define SECURITY_MAX_SID_SIZE
Definition: setypes.h:473
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
Definition: security.c:885
#define TRUE
Definition: types.h:120
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
Definition: security.c:808
BOOL WINAPI AddAccessAllowedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
Definition: security.c:918
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI SetProcessWindowStation(_In_ HWINSTA)
LUID LuidNone
Definition: sas.c:47
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _ACL ACL
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD WINAPI GetLengthSid(PSID pSid)
Definition: security.c:798
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SwitchDesktop(_In_ HDESK)
struct _SID * PSID
Definition: eventlog.c:35
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:135
unsigned char BYTE
Definition: xxhash.c:193
#define ERR(fmt,...)
Definition: debug.h:110
static PSID pLocalSystemSid
Definition: security.c:18
LPVOID lpSecurityDescriptor
Definition: compat.h:193
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
#define ACL_REVISION
Definition: setypes.h:39
HWINSTA WINAPI CreateWindowStationW(_In_opt_ LPCWSTR lpwinsta, _In_ DWORD dwFlags, _In_ ACCESS_MASK dwDesiredAccess, _In_opt_ LPSECURITY_ATTRIBUTES lpsa)
BOOL WINAPI CloseDesktop(_In_ HDESK)
char * cleanup(char *str)
Definition: wpickclick.c:99
HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop, LPCWSTR lpszDevice, LPDEVMODEW pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
Definition: desktop.c:473
BOOL WINAPI CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType, IN PSID DomainSid OPTIONAL, OUT PSID pSid, IN OUT DWORD *cbSid)
Definition: security.c:601
#define HeapFree(x, y, z)
Definition: compat.h:594
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES

Referenced by WinMain().

◆ DisplayStatusMessage()

BOOL DisplayStatusMessage ( IN PWLSESSION  Session,
IN HDESK  hDesktop,
IN UINT  ResourceId 
)

Definition at line 349 of file winlogon.c.

353 {
354  WCHAR StatusMsg[MAX_PATH];
355 
356  if (Session->Gina.Version < WLX_VERSION_1_3)
357  return TRUE;
358 
359  if (Session->SuppressStatus)
360  return TRUE;
361 
362  if (LoadStringW(hAppInstance, ResourceId, StatusMsg, MAX_PATH) == 0)
363  return FALSE;
364 
365  return Session->Gina.Functions.WlxDisplayStatusMessage(Session->Gina.Context, hDesktop, 0, NULL, StatusMsg);
366 }
#define TRUE
Definition: types.h:120
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define FALSE
Definition: types.h:117
HINSTANCE hAppInstance
Definition: winlogon.c:19
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112
#define WLX_VERSION_1_3
Definition: winwlx.h:31

Referenced by HandleLogoff(), HandleLogon(), HandleShutdown(), and WinMain().

◆ GetSetupType()

DWORD GetSetupType ( VOID  )

Definition at line 16 of file setup.c.

17 {
18  DWORD dwError;
19  HKEY hKey;
20  DWORD dwType;
21  DWORD dwSize;
22  DWORD dwSetupType;
23 
24  TRACE("GetSetupType()\n");
25 
26  /* Open key */
28  L"SYSTEM\\Setup",
29  0,
31  &hKey);
32  if (dwError != ERROR_SUCCESS)
33  return 0;
34 
35  /* Read key */
36  dwSize = sizeof(DWORD);
37  dwError = RegQueryValueExW(hKey,
38  L"SetupType",
39  NULL,
40  &dwType,
41  (LPBYTE)&dwSetupType,
42  &dwSize);
43 
44  /* Close key, and check if returned values are correct */
46  if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD))
47  return 0;
48 
49  TRACE("GetSetupType() returns %lu\n", dwSetupType);
50  return dwSetupType;
51 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SASWindowProc(), and WinMain().

◆ GinaInit()

BOOL GinaInit ( IN OUT PWLSESSION  Session)

Definition at line 919 of file wlx.c.

921 {
922  DWORD GinaDllVersion;
923 
924  if (!LoadGina(&Session->Gina.Functions, &GinaDllVersion, &Session->Gina.hDllInstance))
925  return FALSE;
926 
927  Session->Gina.Context = NULL;
928  Session->Gina.Version = GinaDllVersion;
929  Session->Gina.UseCtrlAltDelete = FALSE;
930  Session->SuppressStatus = FALSE;
931 
932  TRACE("Calling WlxInitialize(\"%S\")\n", Session->InteractiveWindowStationName);
933  return Session->Gina.Functions.WlxInitialize(
934  Session->InteractiveWindowStationName,
935  (HANDLE)Session,
936  NULL,
938  &Session->Gina.Context);
939 }
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL LoadGina(IN OUT PGINAFUNCTIONS Functions, OUT DWORD *DllVersion, OUT HMODULE *GinaInstance)
Definition: wlx.c:819
#define NULL
Definition: types.h:112
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:736

Referenced by WinMain().

◆ HandleShutdown()

NTSTATUS HandleShutdown ( IN OUT PWLSESSION  Session,
IN DWORD  wlxAction 
)

Definition at line 1040 of file sas.c.

1043 {
1044  PLOGOFF_SHUTDOWN_DATA LSData;
1045  HANDLE hThread;
1046  DWORD exitCode;
1047  BOOLEAN Old;
1048 
1049  // SwitchDesktop(Session->WinlogonDesktop);
1050 
1051  /* If the system is rebooting, show the appropriate string */
1052  if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_REBOOT)
1053  DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_REACTOSISRESTARTING);
1054  else
1055  DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_REACTOSISSHUTTINGDOWN);
1056 
1057  /* Prepare data for shutdown thread */
1058  LSData = HeapAlloc(GetProcessHeap(), 0, sizeof(LOGOFF_SHUTDOWN_DATA));
1059  if (!LSData)
1060  {
1061  ERR("Failed to allocate mem for thread data\n");
1062  return STATUS_NO_MEMORY;
1063  }
1064  if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_POWER_OFF)
1065  LSData->Flags = EWX_POWEROFF;
1066  else if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_REBOOT)
1067  LSData->Flags = EWX_REBOOT;
1068  else
1069  LSData->Flags = EWX_SHUTDOWN;
1070  LSData->Session = Session;
1071 
1072  // FIXME: We may need to specify this flag to really force application kill
1073  // (we are shutting down ReactOS, not just logging off so no hangs, etc...
1074  // should be allowed).
1075  // LSData->Flags |= EWX_FORCE;
1076 
1077  /* Run shutdown thread */
1079  if (!hThread)
1080  {
1081  ERR("Unable to create shutdown thread, error %lu\n", GetLastError());
1082  HeapFree(GetProcessHeap(), 0, LSData);
1083  return STATUS_UNSUCCESSFUL;
1084  }
1086  HeapFree(GetProcessHeap(), 0, LSData);
1087  if (!GetExitCodeThread(hThread, &exitCode))
1088  {
1089  ERR("Unable to get exit code of shutdown thread (error %lu)\n", GetLastError());
1091  return STATUS_UNSUCCESSFUL;
1092  }
1094  if (exitCode == 0)
1095  {
1096  ERR("Shutdown thread returned failure\n");
1097  return STATUS_UNSUCCESSFUL;
1098  }
1099 
1101 
1102  /* Destroy SAS window */
1103  UninitializeSAS(Session);
1104 
1105  /* Now we can shut down NT */
1106  ERR("Shutting down NT...\n");
1108  if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_REBOOT)
1109  {
1111  }
1112  else
1113  {
1114  if (FALSE)
1115  {
1116  /* FIXME - only show this dialog if it's a shutdown and the computer doesn't support APM */
1119  }
1121  }
1123  return STATUS_SUCCESS;
1124 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL DisplayStatusMessage(IN PWLSESSION Session, IN HDESK hDesktop, IN UINT ResourceId)
Definition: winlogon.c:349
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
PWLSESSION Session
Definition: sas.c:42
static VOID UninitializeSAS(IN OUT PWLSESSION Session)
Definition: sas.c:1026
#define EWX_REBOOT
Definition: winuser.h:633
static DWORD WINAPI LogoffShutdownThread(LPVOID Parameter)
Definition: sas.c:695
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:540
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define DialogBox
Definition: winuser.h:5737
static INT_PTR CALLBACK ShutdownComputerWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: sas.c:994
#define FALSE
Definition: types.h:117
#define EWX_SHUTDOWN
Definition: winuser.h:634
#define IDS_REACTOSISSHUTTINGDOWN
Definition: resource.h:31
unsigned char BOOLEAN
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SE_SHUTDOWN_PRIVILEGE
Definition: security.c:673
#define EWX_POWEROFF
Definition: winuser.h:632
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define WLX_SAS_ACTION_SHUTDOWN_POWER_OFF
Definition: winwlx.h:62
NTSTATUS NTAPI NtShutdownSystem(IN SHUTDOWN_ACTION Action)
Definition: shutdown.c:43
#define IDD_SHUTDOWNCOMPUTER
Definition: resource.h:7
#define ERR(fmt,...)
Definition: debug.h:110
VOID CallNotificationDlls(PWLSESSION pSession, NOTIFICATION_TYPE Type)
Definition: notify.c:380
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define NULL
Definition: types.h:112
HANDLE hThread
Definition: wizard.c:28
#define WLX_SAS_ACTION_SHUTDOWN_REBOOT
Definition: winwlx.h:63
#define IDS_REACTOSISRESTARTING
Definition: resource.h:38
#define STATUS_SUCCESS
Definition: shellext.h:65
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:594
HINSTANCE hAppInstance
Definition: mmc.c:23

Referenced by DoGenericAction(), and WinMain().

◆ InitDialogListHead()

VOID InitDialogListHead ( VOID  )

Definition at line 45 of file wlx.c.

46 {
48 }
static LIST_ENTRY DialogListHead
Definition: wlx.c:40
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

Referenced by WinMain().

◆ InitializeSAS()

BOOL InitializeSAS ( IN OUT PWLSESSION  Session)

Definition at line 1584 of file sas.c.

1586 {
1587  WNDCLASSEXW swc;
1588  BOOL ret = FALSE;
1589 
1590  if (!SwitchDesktop(Session->WinlogonDesktop))
1591  {
1592  ERR("WL: Failed to switch to winlogon desktop\n");
1593  goto cleanup;
1594  }
1595 
1596  /* Register SAS window class */
1597  swc.cbSize = sizeof(WNDCLASSEXW);
1598  swc.style = CS_SAVEBITS;
1599  swc.lpfnWndProc = SASWindowProc;
1600  swc.cbClsExtra = 0;
1601  swc.cbWndExtra = 0;
1602  swc.hInstance = hAppInstance;
1603  swc.hIcon = NULL;
1604  swc.hCursor = NULL;
1605  swc.hbrBackground = NULL;
1606  swc.lpszMenuName = NULL;
1608  swc.hIconSm = NULL;
1609  if (RegisterClassExW(&swc) == 0)
1610  {
1611  ERR("WL: Failed to register SAS window class\n");
1612  goto cleanup;
1613  }
1614 
1615  /* Create invisible SAS window */
1616  Session->SASWindow = CreateWindowExW(
1617  0,
1620  WS_POPUP,
1621  0, 0, 0, 0, 0, 0,
1622  hAppInstance, Session);
1623  if (!Session->SASWindow)
1624  {
1625  ERR("WL: Failed to create SAS window\n");
1626  goto cleanup;
1627  }
1628 
1629  /* Register SAS window to receive SAS notifications */
1630  if (!SetLogonNotifyWindow(Session->SASWindow))
1631  {
1632  ERR("WL: Failed to register SAS window\n");
1633  goto cleanup;
1634  }
1635 
1636  if (!SetDefaultLanguage(NULL))
1637  return FALSE;
1638 
1639  ret = TRUE;
1640 
1641 cleanup:
1642  if (!ret)
1643  UninitializeSAS(Session);
1644  return ret;
1645 }
int cbWndExtra
Definition: winuser.h:3196
#define TRUE
Definition: types.h:120
BOOL WINAPI SetLogonNotifyWindow(HWND Wnd)
Definition: logon.c:91
static LRESULT CALLBACK SASWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: sas.c:1384
HICON hIcon
Definition: winuser.h:3198
struct _WNDCLASSEXW WNDCLASSEXW
static VOID UninitializeSAS(IN OUT PWLSESSION Session)
Definition: sas.c:1026
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3201
#define WINLOGON_SAS_CLASS
Definition: sas.c:26
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
int cbClsExtra
Definition: winuser.h:3195
LPCWSTR lpszClassName
Definition: winuser.h:3202
HBRUSH hbrBackground
Definition: winuser.h:3200
UINT cbSize
Definition: winuser.h:3192
BOOL WINAPI SwitchDesktop(_In_ HDESK)
HINSTANCE hInstance
Definition: winuser.h:3197
#define CS_SAVEBITS
Definition: winuser.h:652
BOOL SetDefaultLanguage(IN PWLSESSION Session)
Definition: sas.c:111
int ret
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HCURSOR hCursor
Definition: winuser.h:3199
UINT style
Definition: winuser.h:3193
WNDPROC lpfnWndProc
Definition: winuser.h:3194
#define ERR(fmt,...)
Definition: debug.h:110
#define WS_POPUP
Definition: pedump.c:616
#define WINLOGON_SAS_TITLE
Definition: sas.c:27
#define NULL
Definition: types.h:112
HICON hIconSm
Definition: winuser.h:3203
char * cleanup(char *str)
Definition: wpickclick.c:99
HINSTANCE hAppInstance
Definition: mmc.c:23

Referenced by WinMain().

◆ InitializeScreenSaver()

BOOL InitializeScreenSaver ( IN OUT PWLSESSION  Session)

Definition at line 204 of file screensaver.c.

206 {
207  HANDLE ScreenSaverThread;
208 
209 #ifndef USE_GETLASTINPUTINFO
210  /* Register hooks to detect keyboard and mouse activity */
211  Session->KeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardActivityProc, hAppInstance, 0);
212  if (!Session->KeyboardHook)
213  {
214  ERR("WL: Unable to register keyboard hook\n");
215  return FALSE;
216  }
217 
218  Session->MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseActivityProc, hAppInstance, 0);
219  if (!Session->MouseHook)
220  {
221  ERR("WL: Unable to register mouse hook\n");
222  return FALSE;
223  }
224 #endif
225 
226  Session->hScreenSaverParametersChanged = CreateEventW(NULL, FALSE, FALSE, NULL);
227  if (!Session->hScreenSaverParametersChanged)
228  {
229  WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError());
230  return TRUE;
231  }
232 
233  Session->hEndOfScreenSaverThread = CreateEventW(NULL, FALSE, FALSE, NULL);
234  if (!Session->hEndOfScreenSaverThread)
235  {
236  WARN("WL: Unable to create screen saver event (error %lu)\n", GetLastError());
237  CloseHandle(Session->hScreenSaverParametersChanged);
238  return TRUE;
239  }
240 
241  ScreenSaverThread = CreateThread(NULL,
242  0,
244  Session,
245  0,
246  NULL);
247  if (ScreenSaverThread)
248  CloseHandle(ScreenSaverThread);
249  else
250  ERR("WL: Unable to start screen saver thread\n");
251 
252  return TRUE;
253 }
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define WH_MOUSE_LL
Definition: winuser.h:44
#define FALSE
Definition: types.h:117
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
#define WH_KEYBOARD_LL
Definition: winuser.h:43
#define SetWindowsHookEx
Definition: winuser.h:5832
#define ERR(fmt,...)
Definition: debug.h:110
static DWORD WINAPI ScreenSaverThreadMain(IN LPVOID lpParameter)
Definition: screensaver.c:76
#define NULL
Definition: types.h:112
HINSTANCE hAppInstance
Definition: mmc.c:23

Referenced by HandleLogon().

◆ InitNotifications()

BOOL InitNotifications ( VOID  )

Definition at line 253 of file notify.c.

254 {
255  HKEY hNotifyKey = NULL;
256  LONG lError;
257  DWORD dwIndex;
258  WCHAR szKeyName[80];
259  DWORD dwKeyName;
260 
261  TRACE("InitNotifications()\n");
262 
264 
266 
268  L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify",
269  0,
271  &hNotifyKey);
272  if (lError != ERROR_SUCCESS)
273  {
274  TRACE("RegOpenKeyExW()\n");
275  return TRUE;
276  }
277 
278  dwIndex = 0;
279  for(;;)
280  {
281  dwKeyName = 80 * sizeof(WCHAR);
282  lError = RegEnumKeyExW(hNotifyKey,
283  dwIndex,
284  szKeyName,
285  &dwKeyName,
286  NULL,
287  NULL,
288  NULL,
289  NULL);
290  if (lError != ERROR_SUCCESS)
291  break;
292 
293  TRACE("Notification DLL: %S\n", szKeyName);
294  AddNotificationDll(hNotifyKey, szKeyName);
295 
296  dwIndex++;
297  }
298 
299  RegCloseKey(hNotifyKey);
300 
301  TRACE("InitNotifications() done\n");
302 
303  return TRUE;
304 }
static VOID AddSfcNotification(VOID)
Definition: notify.c:57
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
static LIST_ENTRY NotificationDllListHead
Definition: notify.c:50
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
static VOID AddNotificationDll(HKEY hNotifyKey, PWSTR pszKeyName)
Definition: notify.c:109
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by WinMain().

◆ PlaySoundRoutine()

BOOL PlaySoundRoutine ( IN LPCWSTR  FileName,
IN UINT  Logon,
IN UINT  Flags 
)

Definition at line 240 of file sas.c.

244 {
245  typedef BOOL (WINAPI *PLAYSOUNDW)(LPCWSTR,HMODULE,DWORD);
246  typedef UINT (WINAPI *WAVEOUTGETNUMDEVS)(VOID);
247  PLAYSOUNDW Play;
248  WAVEOUTGETNUMDEVS waveOutGetNumDevs;
249  UINT NumDevs;
251  BOOL Ret = FALSE;
252 
253  hLibrary = LoadLibraryW(L"winmm.dll");
254  if (hLibrary)
255  {
256  waveOutGetNumDevs = (WAVEOUTGETNUMDEVS)GetProcAddress(hLibrary, "waveOutGetNumDevs");
257  if (waveOutGetNumDevs)
258  {
259  NumDevs = waveOutGetNumDevs();
260  if (!NumDevs)
261  {
262  if (!bLogon)
263  {
264  Beep(500, 500);
265  }
267  return FALSE;
268  }
269  }
270 
271  Play = (PLAYSOUNDW)GetProcAddress(hLibrary, "PlaySoundW");
272  if (Play)
273  {
274  Ret = Play(FileName, NULL, Flags);
275  }
277  }
278 
279  return Ret;
280 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LoadLibraryW(x)
Definition: compat.h:606
UINT WINAPI waveOutGetNumDevs(void)
Definition: winmm.c:2140
#define FreeLibrary(x)
Definition: compat.h:607
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define WINAPI
Definition: msvc.h:6
static const WCHAR L[]
Definition: oid.c:1250
#define VOID
Definition: acefi.h:82
HMODULE hLibrary
Definition: odbccp32.c:12
HANDLE HMODULE
Definition: typedefs.h:77
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI Beep(IN DWORD dwFreq, IN DWORD dwDuration)
Definition: deviceio.c:48
#define GetProcAddress(x, y)
Definition: compat.h:612

Referenced by HandleMessageBeep(), and PlayLogonSoundThread().

◆ RemoveStatusMessage()

BOOL RemoveStatusMessage ( IN PWLSESSION  Session)

Definition at line 370 of file winlogon.c.

372 {
373  if (Session->Gina.Version < WLX_VERSION_1_3)
374  return TRUE;
375 
376  return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context);
377 }
#define TRUE
Definition: types.h:120
#define WLX_VERSION_1_3
Definition: winwlx.h:31

Referenced by DoGenericAction(), HandleLogon(), and WinMain().

◆ RunSetup()

BOOL RunSetup ( VOID  )

Definition at line 153 of file setup.c.

154 {
155  HANDLE hThread;
156 
158  0,
160  NULL,
161  0,
162  NULL);
163  if (hThread != NULL)
165 
166  return hThread != NULL;
167 }
#define CloseHandle
Definition: compat.h:598
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
static DWORD WINAPI RunSetupThreadProc(IN LPVOID lpParameter)
Definition: setup.c:57
#define NULL
Definition: types.h:112
HANDLE hThread
Definition: wizard.c:28

Referenced by WinMain().

◆ SetDefaultLanguage()

BOOL SetDefaultLanguage ( IN PWLSESSION  Session)

Definition at line 111 of file sas.c.

113 {
114  BOOL ret = FALSE;
115  BOOL UserProfile;
116  LONG rc;
117  HKEY UserKey, hKey = NULL;
118  LPCWSTR SubKey, ValueName;
119  DWORD dwType, dwSize;
120  LPWSTR Value = NULL;
121  UNICODE_STRING ValueString;
123  LCID Lcid;
124 
125  UserProfile = (Session && Session->UserToken);
126 
127  if (UserProfile && !ImpersonateLoggedOnUser(Session->UserToken))
128  {
129  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
130  return FALSE;
131  // FIXME: ... or use the default language of the system??
132  // UserProfile = FALSE;
133  }
134 
135  if (UserProfile)
136  {
137  rc = RegOpenCurrentUser(MAXIMUM_ALLOWED, &UserKey);
138  if (rc != ERROR_SUCCESS)
139  {
140  TRACE("RegOpenCurrentUser() failed with error %lu\n", rc);
141  goto cleanup;
142  }
143 
144  SubKey = L"Control Panel\\International";
145  ValueName = L"Locale";
146  }
147  else
148  {
149  UserKey = NULL;
150  SubKey = L"System\\CurrentControlSet\\Control\\Nls\\Language";
151  ValueName = L"Default";
152  }
153 
154  rc = RegOpenKeyExW(UserKey ? UserKey : HKEY_LOCAL_MACHINE,
155  SubKey,
156  0,
157  KEY_READ,
158  &hKey);
159 
160  if (UserKey)
161  RegCloseKey(UserKey);
162 
163  if (rc != ERROR_SUCCESS)
164  {
165  TRACE("RegOpenKeyEx() failed with error %lu\n", rc);
166  goto cleanup;
167  }
168 
169  rc = RegQueryValueExW(hKey,
170  ValueName,
171  NULL,
172  &dwType,
173  NULL,
174  &dwSize);
175  if (rc != ERROR_SUCCESS)
176  {
177  TRACE("RegQueryValueEx() failed with error %lu\n", rc);
178  goto cleanup;
179  }
180  else if (dwType != REG_SZ)
181  {
182  TRACE("Wrong type for %S\\%S registry entry (got 0x%lx, expected 0x%x)\n",
183  SubKey, ValueName, dwType, REG_SZ);
184  goto cleanup;
185  }
186 
188  if (!Value)
189  {
190  TRACE("HeapAlloc() failed\n");
191  goto cleanup;
192  }
193  rc = RegQueryValueExW(hKey,
194  ValueName,
195  NULL,
196  NULL,
197  (LPBYTE)Value,
198  &dwSize);
199  if (rc != ERROR_SUCCESS)
200  {
201  TRACE("RegQueryValueEx() failed with error %lu\n", rc);
202  goto cleanup;
203  }
204 
205  /* Convert Value to a Lcid */
206  ValueString.Length = ValueString.MaximumLength = (USHORT)dwSize;
207  ValueString.Buffer = Value;
208  Status = RtlUnicodeStringToInteger(&ValueString, 16, (PULONG)&Lcid);
209  if (!NT_SUCCESS(Status))
210  {
211  TRACE("RtlUnicodeStringToInteger() failed with status 0x%08lx\n", Status);
212  goto cleanup;
213  }
214 
215  TRACE("%s language is 0x%08lx\n",
216  UserProfile ? "User" : "System", Lcid);
217  Status = NtSetDefaultLocale(UserProfile, Lcid);
218  if (!NT_SUCCESS(Status))
219  {
220  TRACE("NtSetDefaultLocale() failed with status 0x%08lx\n", Status);
221  goto cleanup;
222  }
223 
224  ret = TRUE;
225 
226 cleanup:
227  if (Value)
229 
230  if (hKey)
231  RegCloseKey(hKey);
232 
233  if (UserProfile)
234  RevertToSelf();
235 
236  return ret;
237 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define ERROR_SUCCESS
Definition: deptool.c:10
_In_ CONST DEVPROPKEY _In_ LCID Lcid
Definition: iofuncs.h:2414
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
BOOL WINAPI RevertToSelf(VOID)
Definition: security.c:1487
LONG NTSTATUS
Definition: precomp.h:26
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD LCID
Definition: nls.h:13
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
Definition: misc.c:152
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI NtSetDefaultLocale(IN BOOLEAN UserProfile, IN LCID DefaultLocaleId)
Definition: locale.c:203
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:110
unsigned short USHORT
Definition: pedump.c:61
FxAutoRegKey hKey
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by HandleLogon(), and InitializeSAS().

◆ SetWindowStationUser()

BOOL WINAPI SetWindowStationUser ( IN HWINSTA  hWindowStation,
IN PLUID  pluid,
IN PSID psid  OPTIONAL,
IN DWORD  size 
)

Definition at line 419 of file winsta.c.

424 {
425  BOOL Success;
426 
427  Success = NtUserSetWindowStationUser(hWindowStation, pluid, psid, size);
428  if (Success)
429  {
430  /* Signal log-on/off to WINSRV */
431 
432  /* User is logging on if *pluid != LuidNone, otherwise it is a log-off */
433  LUID LuidNone = {0, 0};
434  BOOL IsLogon = (pluid && !RtlEqualLuid(pluid, &LuidNone));
435 
436  Logon(IsLogon);
437  }
438 
439  return Success;
440 }
LUID LuidNone
Definition: sas.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
#define RtlEqualLuid(Luid1, Luid2)
Definition: rtlfuncs.h:301
GLsizeiptr size
Definition: glext.h:5919
VOID FASTCALL Logon(BOOL IsLogon)
Definition: logon.c:74
BOOL NTAPI NtUserSetWindowStationUser(IN HWINSTA hWindowStation, IN PLUID pluid, IN PSID psid OPTIONAL, IN DWORD size)
Definition: winsta.c:1975

Referenced by AllowWinstaAccess(), CreateWindowStationAndDesktops(), HandleLogoff(), and HandleLogon().

◆ StartRpcServer()

BOOL StartRpcServer ( VOID  )

Definition at line 19 of file rpcserver.c.

20 {
22 
23  TRACE("StartRpcServer() called\n");
24 
25  Status = RpcServerUseProtseqEpW(L"ncacn_np",
27  L"\\pipe\\winreg",
28  NULL);
29  if (Status != RPC_S_OK)
30  {
31  ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
32  return FALSE;
33  }
34 
35  Status = RpcServerRegisterIf(winreg_v1_0_s_ifspec,
36  NULL,
37  NULL);
38  if (Status != RPC_S_OK)
39  {
40  ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status);
41  return FALSE;
42  }
43 
44  Status = RpcServerListen(1, 20, TRUE);
45  if (Status != RPC_S_OK)
46  {
47  ERR("RpcServerListen() failed (Status %lx)\n", Status);
48  return FALSE;
49  }
50 
51  TRACE("StartRpcServer() done\n");
52  return TRUE;
53 }
#define TRUE
Definition: types.h:120
long RPC_STATUS
Definition: rpc.h:52
#define FALSE
Definition: types.h:117
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
static const WCHAR L[]
Definition: oid.c:1250
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:927
#define ERR(fmt,...)
Definition: debug.h:110
#define RPC_C_PROTSEQ_MAX_REQS_DEFAULT
Definition: rpcdce.h:123
#define NULL
Definition: types.h:112
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by WinMain().

◆ StartScreenSaver()

VOID StartScreenSaver ( IN PWLSESSION  Session)

Definition at line 257 of file screensaver.c.

259 {
260  HKEY hKey = NULL, hCurrentUser = NULL;
261  WCHAR szApplicationName[MAX_PATH];
262  WCHAR szCommandLine[MAX_PATH + 3];
263  DWORD bufferSize = sizeof(szApplicationName) - sizeof(WCHAR);
264  DWORD dwType;
265  STARTUPINFOW StartupInfo;
266  PROCESS_INFORMATION ProcessInformation;
267  HANDLE HandleArray[2];
268  LONG rc;
269  DWORD Status;
270  BOOL ret = FALSE;
271 
272  if (!ImpersonateLoggedOnUser(Session->UserToken))
273  {
274  ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
275  goto cleanup;
276  }
277 
279  &hCurrentUser);
280  if (rc != ERROR_SUCCESS)
281  {
282  ERR("WL: RegOpenCurrentUser error %lu\n", rc);
283  goto cleanup;
284  }
285 
286  rc = RegOpenKeyExW(hCurrentUser,
287  L"Control Panel\\Desktop",
288  0,
290  &hKey);
291  if (rc != ERROR_SUCCESS)
292  {
293  ERR("WL: RegOpenKeyEx error %lu\n", rc);
294  goto cleanup;
295  }
296 
297  rc = RegQueryValueExW(hKey,
298  L"SCRNSAVE.EXE",
299  0,
300  &dwType,
301  (LPBYTE)szApplicationName,
302  &bufferSize);
303  if (rc != ERROR_SUCCESS || dwType != REG_SZ)
304  {
305  if (rc != ERROR_FILE_NOT_FOUND)
306  ERR("WL: RegQueryValueEx error %lu\n", rc);
307  goto cleanup;
308  }
309 
310  if (bufferSize == 0)
311  {
312  ERR("WL: Buffer size is NULL!\n");
313  goto cleanup;
314  }
315 
316  szApplicationName[bufferSize / sizeof(WCHAR)] = 0; /* Terminate the string */
317 
318  if (wcslen(szApplicationName) == 0)
319  {
320  ERR("WL: Application Name length is zero!\n");
321  goto cleanup;
322  }
323 
324  wsprintfW(szCommandLine, L"%s /s", szApplicationName);
325  TRACE("WL: Executing %S\n", szCommandLine);
326 
327  ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
328  ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
329  StartupInfo.cb = sizeof(STARTUPINFOW);
330  StartupInfo.dwFlags = STARTF_SCREENSAVER;
331 
332  /* FIXME: Run the screen saver on the secure screen saver desktop if required */
333  StartupInfo.lpDesktop = L"WinSta0\\Default";
334 
335  ret = CreateProcessW(szApplicationName,
336  szCommandLine,
337  NULL,
338  NULL,
339  FALSE,
340  0,
341  NULL,
342  NULL,
343  &StartupInfo,
344  &ProcessInformation);
345  if (!ret)
346  {
347  ERR("WL: Unable to start %S, error %lu\n", szApplicationName, GetLastError());
348  goto cleanup;
349  }
350 
351  CloseHandle(ProcessInformation.hThread);
352 
353  SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, TRUE, NULL, 0);
354 
356 
357  /* Wait the end of the process or some other activity */
358  ResetEvent(Session->hUserActivity);
359  HandleArray[0] = ProcessInformation.hProcess;
360  HandleArray[1] = Session->hUserActivity;
361  Status = WaitForMultipleObjects(2, HandleArray, FALSE, INFINITE);
362  if (Status == WAIT_OBJECT_0 + 1)
363  {
364  /* Kill the screen saver */
365  TerminateProcess(ProcessInformation.hProcess, 0);
366  }
367 
368  SetEvent(Session->hEndOfScreenSaver);
369 
370  CloseHandle(ProcessInformation.hProcess);
371 
373 
374 cleanup:
375  if (hKey)
376  RegCloseKey(hKey);
377 
378  if (hCurrentUser)
379  RegCloseKey(hCurrentUser);
380 
381  RevertToSelf();
382 
383  if (!ret)
384  {
385  PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_ACTIVITY, 0);
386 #ifndef USE_GETLASTINPUTINFO
387  InterlockedExchange((LONG*)&Session->LastActivity, GetTickCount());
388 #endif
389  }
390 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WLX_WM_SAS
Definition: winwlx.h:71
#define CloseHandle
Definition: compat.h:598
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WLX_SAS_TYPE_SCRNSVR_ACTIVITY
Definition: winwlx.h:38
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
BOOL WINAPI RevertToSelf(VOID)
Definition: security.c:1487
struct _STARTUPINFOW STARTUPINFOW
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ZeroMemory
Definition: winbase.h:1664
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition: synch.c:151
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LPWSTR lpDesktop
Definition: winbase.h:848
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
Definition: misc.c:152
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4594
Status
Definition: gdiplustypes.h:24
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TRACE(s)
Definition: solgame.cpp:4
#define WAIT_OBJECT_0
Definition: winbase.h:403
DWORD cb
Definition: winbase.h:846
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const WCHAR L[]
Definition: oid.c:1250
size_t bufferSize
#define InterlockedExchange
Definition: armddk.h:54
#define ERR(fmt,...)
Definition: debug.h:110
VOID CallNotificationDlls(PWLSESSION pSession, NOTIFICATION_TYPE Type)
Definition: notify.c:380
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
#define STARTF_SCREENSAVER
Definition: undocuser.h:164
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
Definition: reg.c:3232
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
char * cleanup(char *str)
Definition: wpickclick.c:99
DWORD dwFlags
Definition: winbase.h:857
#define INFINITE
Definition: serial.h:102
#define REG_SZ
Definition: layer.c:22

Referenced by DispatchSAS().

◆ StartSystemShutdown()

DWORD StartSystemShutdown ( IN PUNICODE_STRING  pMessage,
IN ULONG  dwTimeout,
IN BOOLEAN  bForceAppsClosed,
IN BOOLEAN  bRebootAfterShutdown,
IN ULONG  dwReason 
)

Definition at line 337 of file shutdown.c.

343 {
344  HANDLE hThread;
345 
346  /* Fail if the timeout is 10 years or more */
349 
352 
353  if ((dwTimeout != 0) && pMessage && pMessage->Length && pMessage->Buffer)
354  {
357  pMessage->Length + sizeof(UNICODE_NULL));
359  {
361  return GetLastError();
362  }
363 
365  pMessage->Buffer,
366  pMessage->Length / sizeof(WCHAR));
367  }
368  else
369  {
371  }
372 
374  g_ShutdownParams.bForceAppsClosed = bForceAppsClosed;
375  g_ShutdownParams.bRebootAfterShutdown = bRebootAfterShutdown;
377 
378  /* If dwTimeout is zero perform an immediate system shutdown,
379  * otherwise display the countdown shutdown dialog. */
380  if (g_ShutdownParams.dwTimeout == 0)
381  {
383  return ERROR_SUCCESS;
384  }
385  else
386  {
388  &g_ShutdownParams, 0, NULL);
389  if (hThread)
390  {
392  return ERROR_SUCCESS;
393  }
394  }
395 
397  {
400  }
401 
403  return GetLastError();
404 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CloseHandle
Definition: compat.h:598
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define ERROR_SHUTDOWN_IN_PROGRESS
Definition: winerror.h:651
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
SYS_SHUTDOWN_PARAMS g_ShutdownParams
Definition: shutdown.c:43
char _InterlockedCompareExchange8(_Interlocked_operand_ char volatile *_Destination, char _Exchange, char _Comparand)
DWORD dwReason
Definition: misc.cpp:154
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
static BOOL DoSystemShutdown(IN PSYS_SHUTDOWN_PARAMS pShutdownParams)
Definition: shutdown.c:49
BOOLEAN bForceAppsClosed
Definition: shutdown.c:37
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6077
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
BOOLEAN bRebootAfterShutdown
Definition: shutdown.c:36
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HANDLE hThread
Definition: wizard.c:28
static DWORD WINAPI InitiateSystemShutdownThread(IN LPVOID lpParameter)
Definition: shutdown.c:231
#define SECONDS_PER_DECADE
Definition: shutdown.c:22
BOOLEAN bShuttingDown
Definition: shutdown.c:35
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by BaseInitiateSystemShutdownEx().

◆ TerminateSystemShutdown()

DWORD TerminateSystemShutdown ( VOID  )

Definition at line 328 of file shutdown.c.

329 {
332 
333  return ERROR_SUCCESS;
334 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
SYS_SHUTDOWN_PARAMS g_ShutdownParams
Definition: shutdown.c:43
char _InterlockedCompareExchange8(_Interlocked_operand_ char volatile *_Destination, char _Exchange, char _Comparand)
#define FALSE
Definition: types.h:117
#define ERROR_NO_SHUTDOWN_IN_PROGRESS
Definition: winerror.h:652
BOOLEAN bShuttingDown
Definition: shutdown.c:35

Referenced by BaseAbortSystemShutdown().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( winlogon  )

◆ WlxAssignShellProtection()

int WINAPI WlxAssignShellProtection ( HANDLE  hWlx,
HANDLE  hToken,
HANDLE  hProcess,
HANDLE  hThread 
)

Definition at line 262 of file wlx.c.

267 {
269  UNREFERENCED_PARAMETER(hToken);
272 
274  return 0;
275 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
HANDLE hThread
Definition: wizard.c:28
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxChangePasswordNotify()

int WINAPI WlxChangePasswordNotify ( HANDLE  hWlx,
PWLX_MPR_NOTIFY_INFO  pMprInfo,
DWORD  dwChangeInfo 
)

Definition at line 437 of file wlx.c.

441 {
443  UNREFERENCED_PARAMETER(pMprInfo);
444  UNREFERENCED_PARAMETER(dwChangeInfo);
445 
447  return 0;
448 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxChangePasswordNotifyEx()

int WINAPI WlxChangePasswordNotifyEx ( HANDLE  hWlx,
PWLX_MPR_NOTIFY_INFO  pMprInfo,
DWORD  dwChangeInfo,
PWSTR  ProviderName,
PVOID  Reserved 
)

Definition at line 509 of file wlx.c.

515 {
517  UNREFERENCED_PARAMETER(pMprInfo);
518  UNREFERENCED_PARAMETER(dwChangeInfo);
519  UNREFERENCED_PARAMETER(ProviderName);
521 
523  return 0;
524 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxCloseUserDesktop()

BOOL WINAPI WlxCloseUserDesktop ( HANDLE  hWlx,
PWLX_DESKTOP  pDesktop,
HANDLE  hToken 
)

Definition at line 531 of file wlx.c.

535 {
537  UNREFERENCED_PARAMETER(pDesktop);
538  UNREFERENCED_PARAMETER(hToken);
539 
541  return FALSE;
542 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxCreateUserDesktop()

BOOL WINAPI WlxCreateUserDesktop ( HANDLE  hWlx,
HANDLE  hToken,
DWORD  Flags,
PWSTR  pszDesktopName,
PWLX_DESKTOP ppDesktop 
)

Definition at line 487 of file wlx.c.

493 {
495  UNREFERENCED_PARAMETER(hToken);
497  UNREFERENCED_PARAMETER(pszDesktopName);
498  UNREFERENCED_PARAMETER(ppDesktop);
499 
501  return FALSE;
502 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxDialogBox()

int WINAPI WlxDialogBox ( HANDLE  hWlx,
HANDLE  hInst,
LPWSTR  lpszTemplate,
HWND  hwndOwner,
DLGPROC  dlgprc 
)

Definition at line 301 of file wlx.c.

307 {
309 
310  TRACE("WlxDialogBox()\n");
311 
312  return (int)WlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner, dlgprc, 0);
313 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TRACE(s)
Definition: solgame.cpp:4
HINSTANCE hInst
Definition: dxdiag.c:13
int WINAPI WlxDialogBoxParam(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:320

◆ WlxDialogBoxIndirect()

int WINAPI WlxDialogBoxIndirect ( HANDLE  hWlx,
HANDLE  hInst,
LPCDLGTEMPLATE  hDialogTemplate,
HWND  hwndOwner,
DLGPROC  dlgprc 
)

Definition at line 354 of file wlx.c.

360 {
362 
363  TRACE("WlxDialogBoxIndirect()\n");
364 
365  return (int)WlxDialogBoxIndirectParam(hWlx, hInst, hDialogTemplate, hwndOwner, dlgprc, 0);
366 }
int WINAPI WlxDialogBoxIndirectParam(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:373
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TRACE(s)
Definition: solgame.cpp:4
HINSTANCE hInst
Definition: dxdiag.c:13

◆ WlxDialogBoxIndirectParam()

int WINAPI WlxDialogBoxIndirectParam ( HANDLE  hWlx,
HANDLE  hInst,
LPCDLGTEMPLATE  hDialogTemplate,
HWND  hwndOwner,
DLGPROC  dlgprc,
LPARAM  dwInitParam 
)

Definition at line 373 of file wlx.c.

380 {
381  PDIALOG_LIST_ENTRY ListEntry;
382  int ret;
383 
385 
386  TRACE("WlxDialogBoxIndirectParam()\n");
387 
388  ListEntry = AddDialogListEntry();
389  if (ListEntry == NULL)
390  return -1;
391 
392  ListEntry->DlgProc = dlgprc;
393  ListEntry->lParam = dwInitParam;
394 
395  ret = (int)DialogBoxIndirectParamW(hInst, hDialogTemplate, hwndOwner, DefaultWlxWindowProc, (LPARAM)ListEntry);
396 
397  RemoveDialogListEntry(ListEntry);
398 
399  return ret;
400 }
DLGPROC DlgProc
Definition: wlx.c:33
LPARAM lParam
Definition: wlx.c:34
static VOID RemoveDialogListEntry(PDIALOG_LIST_ENTRY ListEntry)
Definition: wlx.c:72
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static INT_PTR CALLBACK DefaultWlxWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wlx.c:131
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
int ret
HINSTANCE hInst
Definition: dxdiag.c:13
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
Definition: wlx.c:29
#define NULL
Definition: types.h:112
static PDIALOG_LIST_ENTRY AddDialogListEntry(VOID)
Definition: wlx.c:53
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by WlxDialogBoxIndirect().

◆ WlxDialogBoxParam()

int WINAPI WlxDialogBoxParam ( HANDLE  hWlx,
HANDLE  hInst,
LPWSTR  lpszTemplate,
HWND  hwndOwner,
DLGPROC  dlgprc,
LPARAM  dwInitParam 
)

Definition at line 320 of file wlx.c.

327 {
328  PDIALOG_LIST_ENTRY ListEntry;
329  int ret;
330 
332 
333  TRACE("WlxDialogBoxParam()\n");
334 
335  ListEntry = AddDialogListEntry();
336  if (ListEntry == NULL)
337  return -1;
338 
339  ListEntry->DlgProc = dlgprc;
340  ListEntry->lParam = dwInitParam;
341 
342  ret = (int)DialogBoxParamW(hInst, lpszTemplate, hwndOwner, DefaultWlxWindowProc, (LPARAM)ListEntry);
343 
344  RemoveDialogListEntry(ListEntry);
345 
346  return ret;
347 }
DLGPROC DlgProc
Definition: wlx.c:33
LPARAM lParam
Definition: wlx.c:34
static VOID RemoveDialogListEntry(PDIALOG_LIST_ENTRY ListEntry)
Definition: wlx.c:72
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static INT_PTR CALLBACK DefaultWlxWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wlx.c:131
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
int ret
HINSTANCE hInst
Definition: dxdiag.c:13
Definition: wlx.c:29
#define NULL
Definition: types.h:112
static PDIALOG_LIST_ENTRY AddDialogListEntry(VOID)
Definition: wlx.c:53
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by WlxDialogBox().

◆ WlxDisconnect()

BOOL WINAPI WlxDisconnect ( VOID  )

Definition at line 681 of file wlx.c.

682 {
684  return FALSE;
685 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxGetOption()

BOOL WINAPI WlxGetOption ( HANDLE  hWlx,
DWORD  Option,
ULONG_PTR Value 
)

Definition at line 582 of file wlx.c.

586 {
587  PWLSESSION Session = (PWLSESSION)hWlx;
588 
589  TRACE("WlxGetOption(%lu)\n", Option);
590 
591  switch (Option)
592  {
594  *Value = (ULONG_PTR)Session->Gina.UseCtrlAltDelete;
595  return TRUE;
597  {
598  *Value = (ULONG_PTR)Session->Gina.Context;
599  return TRUE;
600  }
605  return FALSE;
607  {
608  switch (Session->Gina.Version)
609  {
610  case WLX_VERSION_1_0:
611  *Value = sizeof(WLX_DISPATCH_VERSION_1_0);
612  break;
613  case WLX_VERSION_1_1:
614  *Value = sizeof(WLX_DISPATCH_VERSION_1_1);
615  break;
616  case WLX_VERSION_1_2:
617  *Value = sizeof(WLX_DISPATCH_VERSION_1_2);
618  break;
619  case WLX_VERSION_1_3:
620  *Value = sizeof(WLX_DISPATCH_VERSION_1_3);
621  break;
622  case WLX_VERSION_1_4:
623  *Value = sizeof(WLX_DISPATCH_VERSION_1_4);
624  break;
625  default:
626  return FALSE;
627  }
628  return TRUE;
629  }
630  }
631 
632  return FALSE;
633 }
BOOL UseCtrlAltDelete
Definition: winlogon.h:126
PVOID Context
Definition: winlogon.h:124
struct _WLSESSION * PWLSESSION
struct _WLX_DISPATCH_VERSION_1_0 WLX_DISPATCH_VERSION_1_0
#define TRUE
Definition: types.h:120
#define WLX_OPTION_DISPATCH_TABLE_SIZE
Definition: winwlx.h:331
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define FALSE
Definition: types.h:117
#define WLX_OPTION_SMART_CARD_INFO
Definition: winwlx.h:330
#define WLX_VERSION_1_1
Definition: winwlx.h:29
GINAINSTANCE Gina
Definition: winlogon.h:216
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define WLX_OPTION_SMART_CARD_PRESENT
Definition: winwlx.h:329
#define WLX_OPTION_CONTEXT_POINTER
Definition: winwlx.h:323
#define WLX_VERSION_1_4
Definition: winwlx.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define WLX_OPTION_USE_CTRL_ALT_DEL
Definition: winwlx.h:322
#define WLX_OPTION_USE_SMART_CARD
Definition: winwlx.h:324
#define WLX_VERSION_1_2
Definition: winwlx.h:30
struct _WLX_DISPATCH_VERSION_1_4 WLX_DISPATCH_VERSION_1_4
struct _WLX_DISPATCH_VERSION_1_1 WLX_DISPATCH_VERSION_1_1
#define WLX_VERSION_1_0
Definition: winwlx.h:28
struct _WLX_DISPATCH_VERSION_1_3 WLX_DISPATCH_VERSION_1_3
struct _WLX_DISPATCH_VERSION_1_2 WLX_DISPATCH_VERSION_1_2
#define UNIMPLEMENTED
Definition: debug.h:115
#define ULONG_PTR
Definition: config.h:101
DWORD Version
Definition: winlogon.h:125
#define WLX_VERSION_1_3
Definition: winwlx.h:31

◆ WlxGetSourceDesktop()

BOOL WINAPI WlxGetSourceDesktop ( HANDLE  hWlx,
PWLX_DESKTOP ppDesktop 
)

Definition at line 455 of file wlx.c.

458 {
460  UNREFERENCED_PARAMETER(ppDesktop);
461 
463  return FALSE;
464 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxMessageBox()

int WINAPI WlxMessageBox ( HANDLE  hWlx,
HWND  hwndOwner,
LPWSTR  lpszText,
LPWSTR  lpszTitle,
UINT  fuStyle 
)

Definition at line 282 of file wlx.c.

288 {
290 
291  TRACE("WlxMessageBox()\n");
292  /* FIXME: Provide a custom window proc to be able to handle timeout */
293  return MessageBoxW(hwndOwner, lpszText, lpszTitle, fuStyle);
294 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TRACE(s)
Definition: solgame.cpp:4
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)

◆ WlxQueryClientCredentials()

BOOL WINAPI WlxQueryClientCredentials ( PWLX_CLIENT_CREDENTIALS_INFO_V1_0  pCred)

Definition at line 653 of file wlx.c.

655 {
656  UNREFERENCED_PARAMETER(pCred);
657 
659  return FALSE;
660 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxQueryConsoleSwitchCredentials()

DWORD WINAPI WlxQueryConsoleSwitchCredentials ( PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0  pCred)

Definition at line 712 of file wlx.c.

714 {
715  UNREFERENCED_PARAMETER(pCred);
716 
718  return 0;
719 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxQueryInetConnectorCredentials()

BOOL WINAPI WlxQueryInetConnectorCredentials ( PWLX_CLIENT_CREDENTIALS_INFO_V1_0  pCred)

Definition at line 667 of file wlx.c.

669 {
670  UNREFERENCED_PARAMETER(pCred);
671 
673  return FALSE;
674 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxQueryTerminalServicesData()

DWORD WINAPI WlxQueryTerminalServicesData ( HANDLE  hWlx,
PWLX_TERMINAL_SERVICES_DATA  pTSData,
WCHAR UserName,
WCHAR Domain 
)

Definition at line 692 of file wlx.c.

697 {
699  UNREFERENCED_PARAMETER(pTSData);
700  UNREFERENCED_PARAMETER(UserName);
701  UNREFERENCED_PARAMETER(Domain);
702 
704  return 0;
705 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxQueryTsLogonCredentials()

BOOL WINAPI WlxQueryTsLogonCredentials ( PWLX_CLIENT_CREDENTIALS_INFO_V2_0  pCred)

Definition at line 726 of file wlx.c.

728 {
729  UNREFERENCED_PARAMETER(pCred);
730 
732  return FALSE;
733 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxSasNotify()

VOID WINAPI WlxSasNotify ( HANDLE  hWlx,
DWORD  dwSasType 
)

Definition at line 228 of file wlx.c.

231 {
232  PWLSESSION Session = (PWLSESSION)hWlx;
233 
234  TRACE("WlxSasNotify(0x%lx)\n", dwSasType);
235 
236  if (dwSasType == WLX_SAS_TYPE_CTRL_ALT_DEL || dwSasType > WLX_SAS_TYPE_MAX_MSFT_VALUE)
237  PostMessageW(Session->SASWindow, WLX_WM_SAS, dwSasType, 0);
238 }
#define WLX_WM_SAS
Definition: winwlx.h:71
struct _WLSESSION * PWLSESSION
HWND SASWindow
Definition: winlogon.h:220
#define TRACE(s)
Definition: solgame.cpp:4
#define WLX_SAS_TYPE_CTRL_ALT_DEL
Definition: winwlx.h:36
#define WLX_SAS_TYPE_MAX_MSFT_VALUE
Definition: winwlx.h:46
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ WlxSetContextPointer()

VOID WINAPI WlxSetContextPointer ( HANDLE  hWlx,
PVOID  pWlxContext 
)

Definition at line 212 of file wlx.c.

215 {
216  ULONG_PTR OldValue;
217 
218  TRACE("WlxSetContextPointer(%p)\n", pWlxContext);
219 
220  WlxSetOption(hWlx, WLX_OPTION_CONTEXT_POINTER, (ULONG_PTR)pWlxContext, &OldValue);
221 }
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WLX_OPTION_CONTEXT_POINTER
Definition: winwlx.h:323
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI WlxSetOption(HANDLE hWlx, DWORD Option, ULONG_PTR Value, ULONG_PTR *OldValue)
Definition: wlx.c:549

◆ WlxSetOption()

BOOL WINAPI WlxSetOption ( HANDLE  hWlx,
DWORD  Option,
ULONG_PTR  Value,
ULONG_PTR OldValue 
)

Definition at line 549 of file wlx.c.

554 {
555  PWLSESSION Session = (PWLSESSION)hWlx;
556 
557  TRACE("WlxSetOption(%lu)\n", Option);
558 
559  switch (Option)
560  {
562  *OldValue = (ULONG_PTR)Session->Gina.UseCtrlAltDelete;
563  Session->Gina.UseCtrlAltDelete = (BOOL)Value;
564  return TRUE;
566  *OldValue = (ULONG_PTR)Session->Gina.Context;
567  Session->Gina.Context = (PVOID)Value;
568  return TRUE;
571  return FALSE;
572  }
573 
574  return FALSE;
575 }
BOOL UseCtrlAltDelete
Definition: winlogon.h:126
PVOID Context
Definition: winlogon.h:124
struct _WLSESSION * PWLSESSION
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GINAINSTANCE Gina
Definition: winlogon.h:216
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define WLX_OPTION_CONTEXT_POINTER
Definition: winwlx.h:323
#define TRACE(s)
Definition: solgame.cpp:4
#define WLX_OPTION_USE_CTRL_ALT_DEL
Definition: winwlx.h:322
#define WLX_OPTION_USE_SMART_CARD
Definition: winwlx.h:324
#define UNIMPLEMENTED
Definition: debug.h:115
#define ULONG_PTR
Definition: config.h:101

Referenced by WlxSetContextPointer(), and WlxUseCtrlAltDel().

◆ WlxSetReturnDesktop()

BOOL WINAPI WlxSetReturnDesktop ( HANDLE  hWlx,
PWLX_DESKTOP  pDesktop 
)

Definition at line 471 of file wlx.c.

474 {
476  UNREFERENCED_PARAMETER(pDesktop);
477 
479  return FALSE;
480 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ WlxSetTimeout()

BOOL WINAPI WlxSetTimeout ( HANDLE  hWlx,
DWORD  Timeout 
)

Definition at line 245 of file wlx.c.

248 {
249  PWLSESSION Session = (PWLSESSION)hWlx;
250 
251  TRACE("WlxSetTimeout(%lu)\n", Timeout);
252 
253  Session->DialogTimeout = Timeout;
254  return TRUE;
255 }
struct _WLSESSION * PWLSESSION
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4
DWORD DialogTimeout
Definition: winlogon.h:230
static ULONG Timeout
Definition: ping.c:61

◆ WlxSwitchDesktopToUser()

int WINAPI WlxSwitchDesktopToUser ( HANDLE  hWlx)

Definition at line 407 of file wlx.c.

409 {
410  PWLSESSION Session = (PWLSESSION)hWlx;
411 
412  TRACE("WlxSwitchDesktopToUser()\n");
413 
414  return (int)SwitchDesktop(Session->ApplicationDesktop);
415 }
struct _WLSESSION * PWLSESSION
HDESK ApplicationDesktop
Definition: winlogon.h:223
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SwitchDesktop(_In_ HDESK)

◆ WlxSwitchDesktopToWinlogon()

int WINAPI WlxSwitchDesktopToWinlogon ( HANDLE  hWlx)

Definition at line 422 of file wlx.c.

424 {
425  PWLSESSION Session = (PWLSESSION)hWlx;
426 
427  TRACE("WlxSwitchDesktopToWinlogon()\n");
428 
429  return (int)SwitchDesktop(Session->WinlogonDesktop);
430 }
struct _WLSESSION * PWLSESSION
HDESK WinlogonDesktop
Definition: winlogon.h:224
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SwitchDesktop(_In_ HDESK)

◆ WlxUseCtrlAltDel()

VOID WINAPI WlxUseCtrlAltDel ( HANDLE  hWlx)

Definition at line 197 of file wlx.c.

199 {
200  ULONG_PTR OldValue;
201 
202  TRACE("WlxUseCtrlAltDel()\n");
203 
204  WlxSetOption(hWlx, WLX_OPTION_USE_CTRL_ALT_DEL, TRUE, &OldValue);
205 }
#define TRUE
Definition: types.h:120
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define TRACE(s)
Definition: solgame.cpp:4
#define WLX_OPTION_USE_CTRL_ALT_DEL
Definition: winwlx.h:322
BOOL WINAPI WlxSetOption(HANDLE hWlx, DWORD Option, ULONG_PTR Value, ULONG_PTR *OldValue)
Definition: wlx.c:549

◆ WlxWin31Migrate()

VOID WINAPI WlxWin31Migrate ( HANDLE  hWlx)

Definition at line 640 of file wlx.c.

642 {
644 
646 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define UNIMPLEMENTED
Definition: debug.h:115

Variable Documentation

◆ hAppInstance

◆ LuidNone

LUID LuidNone

◆ WLSession

PWLSESSION WLSession

Definition at line 20 of file winlogon.c.

Referenced by DefaultWlxScreenSaverNotify(), RunSetupThreadProc(), and WinMain().