ReactOS  0.4.14-dev-317-g96040ec
wlx.c File Reference
#include "winlogon.h"
Include dependency graph for wlx.c:

Go to the source code of this file.

Classes

struct  _DIALOG_LIST_ENTRY
 

Macros

#define DESKTOP_ALL
 
#define WINSTA_ALL
 
#define GENERIC_ACCESS
 

Typedefs

typedef struct _DIALOG_LIST_ENTRY DIALOG_LIST_ENTRY
 
typedef struct _DIALOG_LIST_ENTRYPDIALOG_LIST_ENTRY
 

Functions

VOID InitDialogListHead (VOID)
 
static PDIALOG_LIST_ENTRY AddDialogListEntry (VOID)
 
static VOID RemoveDialogListEntry (PDIALOG_LIST_ENTRY ListEntry)
 
static PDIALOG_LIST_ENTRY GetDialogListEntry (HWND hwndDlg)
 
VOID CloseAllDialogWindows (VOID)
 
static INT_PTR CALLBACK DefaultWlxWindowProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
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)
 
BOOL WINAPI WlxDisconnect (VOID)
 
DWORD WINAPI WlxQueryTerminalServicesData (HANDLE hWlx, PWLX_TERMINAL_SERVICES_DATA pTSData, WCHAR *UserName, WCHAR *Domain)
 
DWORD WINAPI WlxQueryConsoleSwitchCredentials (PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred)
 
BOOL WINAPI WlxQueryTsLogonCredentials (PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred)
 
static BOOL GetGinaPath (OUT LPWSTR Path, IN DWORD Len)
 
static BOOL WINAPI DefaultWlxScreenSaverNotify (IN PVOID pWlxContext, IN OUT BOOL *pSecure)
 
static BOOL LoadGina (IN OUT PGINAFUNCTIONS Functions, OUT DWORD *DllVersion, OUT HMODULE *GinaInstance)
 
BOOL GinaInit (IN OUT PWLSESSION Session)
 
BOOL AddAceToWindowStation (IN HWINSTA WinSta, IN PSID Sid)
 
BOOL AddAceToDesktop (IN HDESK Desktop, IN PSID WinlogonSid, IN PSID UserSid)
 
BOOL CreateWindowStationAndDesktops (IN OUT PWLSESSION Session)
 

Variables

static LIST_ENTRY DialogListHead
 
static WLX_DISPATCH_VERSION_1_4 FunctionTable
 

Macro Definition Documentation

◆ DESKTOP_ALL

#define DESKTOP_ALL
Value:
DESKTOP_CREATEMENU | DESKTOP_HOOKCONTROL | DESKTOP_JOURNALRECORD | \
DESKTOP_JOURNALPLAYBACK | DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | \
DESKTOP_SWITCHDESKTOP | STANDARD_RIGHTS_REQUIRED)
#define DESKTOP_ENUMERATE
Definition: winuser.h:218
#define DESKTOP_READOBJECTS
Definition: winuser.h:222
#define DESKTOP_CREATEWINDOW
Definition: winuser.h:217
#define DESKTOP_JOURNALRECORD
Definition: winuser.h:221
#define STANDARD_RIGHTS_REQUIRED
Definition: nt_native.h:63
#define DESKTOP_HOOKCONTROL
Definition: winuser.h:219
#define DESKTOP_WRITEOBJECTS
Definition: winuser.h:224

Definition at line 15 of file wlx.c.

◆ GENERIC_ACCESS

#define GENERIC_ACCESS
Value:
GENERIC_EXECUTE | GENERIC_ALL)
#define GENERIC_ALL
Definition: nt_native.h:92
#define GENERIC_WRITE
Definition: nt_native.h:90
#define GENERIC_READ
Definition: compat.h:124

Definition at line 26 of file wlx.c.

◆ WINSTA_ALL

#define WINSTA_ALL
Value:
WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | \
WINSTA_WRITEATTRIBUTES | WINSTA_ACCESSGLOBALATOMS | \
WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | WINSTA_READSCREEN | \
STANDARD_RIGHTS_REQUIRED)
#define WINSTA_ACCESSGLOBALATOMS
Definition: winuser.h:409
#define WINSTA_ENUMERATE
Definition: winuser.h:412
#define WINSTA_READATTRIBUTES
Definition: winuser.h:414
#define WINSTA_CREATEDESKTOP
Definition: winuser.h:410
#define WINSTA_ENUMDESKTOPS
Definition: winuser.h:411
#define WINSTA_READSCREEN
Definition: winuser.h:415

Definition at line 20 of file wlx.c.

Typedef Documentation

◆ DIALOG_LIST_ENTRY

◆ PDIALOG_LIST_ENTRY

Function Documentation

◆ AddAceToDesktop()

BOOL AddAceToDesktop ( IN HDESK  Desktop,
IN PSID  WinlogonSid,
IN PSID  UserSid 
)

Definition at line 1039 of file wlx.c.

1043 {
1044  DWORD AclSize;
1046  PACL Acl = NULL;
1047  PSECURITY_DESCRIPTOR DesktopSd = NULL;
1048  BOOL Ret = FALSE;
1049 
1050  /* Allocate ACL */
1051  AclSize = sizeof(ACL)
1052  + FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + GetLengthSid(WinlogonSid);
1053 
1054  /* Take user's sid into account */
1055  if (UserSid)
1056  AclSize += FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + GetLengthSid(UserSid);
1057 
1058  Acl = HeapAlloc(GetProcessHeap(), 0, AclSize);
1059  if (!Acl)
1060  {
1061  ERR("WL: HeapAlloc() failed\n");
1062  goto cleanup;
1063  }
1064 
1065  /* Initialize ACL */
1066  if (!InitializeAcl(Acl, AclSize, ACL_REVISION))
1067  {
1068  ERR("WL: InitializeAcl() failed (error %lu)\n", GetLastError());
1069  goto cleanup;
1070  }
1071 
1072  /* Add full desktop access ACE for winlogon */
1073  if (!AddAccessAllowedAce(Acl, ACL_REVISION, DESKTOP_ALL, WinlogonSid))
1074  {
1075  ERR("WL: AddAccessAllowedAce() failed (error %lu)\n", GetLastError());
1076  goto cleanup;
1077  }
1078 
1079  /* Add full desktop access ACE for a user (if provided) */
1080  if (UserSid && !AddAccessAllowedAce(Acl, ACL_REVISION, DESKTOP_ALL, UserSid))
1081  {
1082  ERR("WL: AddAccessAllowedAce() failed (error %lu)\n", GetLastError());
1083  goto cleanup;
1084  }
1085 
1086  /* Initialize new security descriptor */
1089  {
1090  ERR("WL: InitializeSecurityDescriptor() failed (error %lu)\n", GetLastError());
1091  goto cleanup;
1092  }
1093 
1094  /* Add ACL to the security descriptor */
1095  if (!SetSecurityDescriptorDacl(DesktopSd, TRUE, Acl, FALSE))
1096  {
1097  ERR("WL: SetSecurityDescriptorDacl() failed (error %lu)\n", GetLastError());
1098  goto cleanup;
1099  }
1100 
1101  /* Apply security to the window station */
1104  {
1105  ERR("WL: SetUserObjectSecurity() failed (error %lu)\n", GetLastError());
1106  goto cleanup;
1107  }
1108 
1109  /* Indicate success */
1110  Ret = TRUE;
1111 
1112 cleanup:
1113  /* Free allocated stuff */
1114  if (Acl) HeapFree(GetProcessHeap(), 0, Acl);
1115  if (DesktopSd) HeapFree(GetProcessHeap(), 0, DesktopSd);
1116 
1117  return Ret;
1118 }
#define TRUE
Definition: types.h:120
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
Definition: security.c:885
#define SECURITY_DESCRIPTOR_MIN_LENGTH
Definition: setypes.h:761
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:1059
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
struct _ACL ACL
smooth NULL
Definition: ftsmooth.c:416
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 DESKTOP_ALL
Definition: wlx.c:15
#define GetProcessHeap()
Definition: compat.h:395
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 ERR(fmt,...)
Definition: debug.h:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
#define ACL_REVISION
Definition: setypes.h:39
char * cleanup(char *str)
Definition: wpickclick.c:99
#define HeapFree(x, y, z)
Definition: compat.h:394
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125

◆ 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 }
#define TRUE
Definition: types.h:120
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
Definition: security.c:885
#define SECURITY_DESCRIPTOR_MIN_LENGTH
Definition: setypes.h:761
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:1059
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
#define NO_PROPAGATE_INHERIT_ACE
Definition: setypes.h:716
#define DWORD
Definition: nt_native.h:44
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
Definition: card.h:12
struct _ACL ACL
smooth NULL
Definition: ftsmooth.c:416
#define MAXDWORD
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
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:715
#define GetProcessHeap()
Definition: compat.h:395
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:685
#define ERR(fmt,...)
Definition: debug.h:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
BOOL WINAPI AddAce(PACL pAcl, DWORD dwAceRevision, DWORD dwStartingAceIndex, LPVOID pAceList, DWORD nAceListLength)
Definition: security.c:1020
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define ACL_REVISION
Definition: setypes.h:39
char * cleanup(char *str)
Definition: wpickclick.c:99
#define INHERIT_ONLY_ACE
Definition: setypes.h:717
#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:394
#define OBJECT_INHERIT_ACE
Definition: setypes.h:714
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125

Referenced by AllowWinstaAccess().

◆ AddDialogListEntry()

static PDIALOG_LIST_ENTRY AddDialogListEntry ( VOID  )
static

Definition at line 53 of file wlx.c.

54 {
55  PDIALOG_LIST_ENTRY ListEntry;
56 
57  ListEntry = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DIALOG_LIST_ENTRY));
58  if (ListEntry == NULL)
59  return NULL;
60 
61  TRACE("Add entry %p\n", ListEntry);
62 
64  &ListEntry->Entry);
65 
66  return ListEntry;
67 }
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
LIST_ENTRY Entry
Definition: wlx.c:31
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
static LIST_ENTRY DialogListHead
Definition: wlx.c:40
#define TRACE(s)
Definition: solgame.cpp:4
Definition: wlx.c:29
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by WlxDialogBoxIndirectParam(), and WlxDialogBoxParam().

◆ 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:5733
static LIST_ENTRY DialogListHead
Definition: wlx.c:40
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
HWND hWnd
Definition: wlx.c:32
Definition: typedefs.h:117
Definition: wlx.c:29
base of all file and directory entries
Definition: entries.h:82

Referenced by DispatchSAS().

◆ 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
#define TRUE
Definition: types.h:120
#define SECURITY_MAX_SID_SIZE
Definition: setypes.h:458
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
Definition: security.c:885
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:1059
BOOL WINAPI SetProcessWindowStation(_In_ HWINSTA)
LUID LuidNone
Definition: sas.c:46
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _ACL ACL
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
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
unsigned char BYTE
Definition: mem.h:68
#define GENERIC_READ
Definition: compat.h:124
#define ERR(fmt,...)
Definition: debug.h:109
static PSID pLocalSystemSid
Definition: security.c:18
LPVOID lpSecurityDescriptor
Definition: compat.h:181
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262
#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:394
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES

Referenced by WinMain().

◆ DefaultWlxScreenSaverNotify()

static BOOL WINAPI DefaultWlxScreenSaverNotify ( IN PVOID  pWlxContext,
IN OUT BOOL pSecure 
)
static

Definition at line 808 of file wlx.c.

811 {
812  if (*pSecure)
813  *pSecure = WLSession->Gina.Functions.WlxIsLogoffOk(pWlxContext);
814  return TRUE;
815 }
PWLSESSION WLSession
Definition: winlogon.c:20
#define TRUE
Definition: types.h:120
PFWLXISLOGOFFOK WlxIsLogoffOk
Definition: winlogon.h:101
GINAINSTANCE Gina
Definition: winlogon.h:216
GINAFUNCTIONS Functions
Definition: winlogon.h:123

Referenced by LoadGina().

◆ DefaultWlxWindowProc()

static INT_PTR CALLBACK DefaultWlxWindowProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 131 of file wlx.c.

136 {
137  PDIALOG_LIST_ENTRY ListEntry;
138  INT_PTR ret;
139 
140  if (uMsg == WM_INITDIALOG)
141  {
142  ListEntry = (PDIALOG_LIST_ENTRY)lParam;
143 
144  TRACE("Set dialog handle: %p\n", hwndDlg);
145  ListEntry->hWnd = hwndDlg;
146  lParam = ListEntry->lParam;
147 // SetTopTimeout(hWnd);
148  }
149  else
150  {
151  ListEntry = GetDialogListEntry(hwndDlg);
152  if (ListEntry == NULL)
153  return FALSE;
154  }
155 
156  if (uMsg == WLX_WM_SAS)
157  {
158  EndDialog(hwndDlg, WLX_DLG_SAS);
159  return 0;
160  }
161 
162  ret = ListEntry->DlgProc(hwndDlg, uMsg, wParam, lParam);
163 
164  return ret;
165 
166 /*
167  if (uMsg == WM_TIMER && (UINT_PTR)wParam == IdTimer)
168  {
169  EndDialog(hwndDlg, -1);
170  KillTimer(hwndDlg, IdTimer);
171  return TRUE;
172  }
173  else if (uMsg == WM_INITDIALOG)
174  {
175  IdTimer = SetTimer(hwndDlg, 0, WLSession->DialogTimeout * 1000, NULL);
176  return PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
177  }
178  else if (uMsg == WM_NCDESTROY)
179  {
180  BOOL ret;
181  ret = PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
182  PreviousWindowProc = NULL;
183  return ret;
184  }
185  else
186  {
187  return PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
188  }
189 */
190 }
DLGPROC DlgProc
Definition: wlx.c:33
LPARAM lParam
Definition: wlx.c:34
#define WLX_WM_SAS
Definition: winwlx.h:71
int32_t INT_PTR
Definition: typedefs.h:62
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HWND hWnd
Definition: wlx.c:32
int ret
#define WLX_DLG_SAS
Definition: winwlx.h:73
static PDIALOG_LIST_ENTRY GetDialogListEntry(HWND hwndDlg)
Definition: wlx.c:83
Definition: wlx.c:29
struct _DIALOG_LIST_ENTRY * PDIALOG_LIST_ENTRY
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139

Referenced by WlxDialogBoxIndirectParam(), and WlxDialogBoxParam().

◆ GetDialogListEntry()

static PDIALOG_LIST_ENTRY GetDialogListEntry ( HWND  hwndDlg)
static

Definition at line 83 of file wlx.c.

84 {
85  PDIALOG_LIST_ENTRY Current;
86  PLIST_ENTRY ListEntry;
87 
88  ListEntry = DialogListHead.Flink;
89  while (ListEntry != &DialogListHead)
90  {
91  Current = CONTAINING_RECORD(ListEntry,
93  Entry);
94  if (Current->hWnd == hwndDlg)
95  {
96  TRACE("Found entry: %p\n", Current);
97  return Current;
98  }
99 
100  ListEntry = ListEntry->Flink;
101  }
102 
103  TRACE("Found no entry!\n");
104  return NULL;
105 }
smooth NULL
Definition: ftsmooth.c:416
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
static LIST_ENTRY DialogListHead
Definition: wlx.c:40
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
HWND hWnd
Definition: wlx.c:32
Definition: typedefs.h:117
Definition: wlx.c:29
base of all file and directory entries
Definition: entries.h:82

Referenced by DefaultWlxWindowProc().

◆ GetGinaPath()

static BOOL GetGinaPath ( OUT LPWSTR  Path,
IN DWORD  Len 
)
static

Definition at line 770 of file wlx.c.

773 {
774  LONG Status;
775  DWORD Type, Size;
776  HKEY hKey;
777 
780  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
781  0,
783  &hKey);
784  if (Status != ERROR_SUCCESS)
785  {
786  /* Default value */
787  wcsncpy(Path, L"msgina.dll", Len);
788  return TRUE;
789  }
790 
791  Size = Len * sizeof(WCHAR);
793  hKey,
794  L"GinaDLL",
795  NULL,
796  &Type,
797  (LPBYTE)Path,
798  &Size);
799  if (Status != ERROR_SUCCESS || Type != REG_SZ || Size == 0)
800  wcsncpy(Path, L"msgina.dll", Len);
801  RegCloseKey(hKey);
802  return TRUE;
803 }
#define TRUE
Definition: types.h:120
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
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
unsigned long DWORD
Definition: ntddk_ex.h:95
#define Len
Definition: deflate.h:82
static const WCHAR L[]
Definition: oid.c:1250
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
PRTL_UNICODE_STRING_BUFFER Path
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by LoadGina().

◆ 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 }
smooth NULL
Definition: ftsmooth.c:416
#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
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:736

Referenced by 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().

◆ LoadGina()

static BOOL LoadGina ( IN OUT PGINAFUNCTIONS  Functions,
OUT DWORD DllVersion,
OUT HMODULE GinaInstance 
)
static

Definition at line 819 of file wlx.c.

823 {
824  HMODULE hGina = NULL;
825  WCHAR GinaDll[MAX_PATH + 1];
826  BOOL ret = FALSE;
827 
828  GinaDll[0] = '\0';
829  if (!GetGinaPath(GinaDll, MAX_PATH))
830  goto cleanup;
831  /* Terminate string */
832  GinaDll[MAX_PATH] = '\0';
833 
834  hGina = LoadLibraryW(GinaDll);
835  if (!hGina)
836  goto cleanup;
837 
838  Functions->WlxNegotiate = (PFWLXNEGOTIATE)GetProcAddress(hGina, "WlxNegotiate");
839  Functions->WlxInitialize = (PFWLXINITIALIZE)GetProcAddress(hGina, "WlxInitialize");
840 
841  if (!Functions->WlxInitialize)
842  goto cleanup;
843 
844  if (!Functions->WlxNegotiate)
845  {
846  /* Assume current version */
847  *DllVersion = WLX_CURRENT_VERSION;
848  }
849  else
850  {
851  TRACE("About to negotiate with Gina %S. Winlogon uses version %x\n",
852  GinaDll, WLX_CURRENT_VERSION);
853  if (!Functions->WlxNegotiate(WLX_CURRENT_VERSION, DllVersion))
854  goto cleanup;
855  }
856 
857  TRACE("Gina uses WLX_VERSION %lx\n", *DllVersion);
858 
859  if (*DllVersion >= WLX_VERSION_1_0)
860  {
861  Functions->WlxActivateUserShell = (PFWLXACTIVATEUSERSHELL)GetProcAddress(hGina, "WlxActivateUserShell");
862  if (!Functions->WlxActivateUserShell) goto cleanup;
863  Functions->WlxDisplayLockedNotice = (PFWLXDISPLAYLOCKEDNOTICE)GetProcAddress(hGina, "WlxDisplayLockedNotice");
864  if (!Functions->WlxDisplayLockedNotice) goto cleanup;
865  Functions->WlxDisplaySASNotice = (PFWLXDISPLAYSASNOTICE)GetProcAddress(hGina, "WlxDisplaySASNotice");
866  if (!Functions->WlxDisplaySASNotice) goto cleanup;
867  Functions->WlxIsLockOk = (PFWLXISLOCKOK)GetProcAddress(hGina, "WlxIsLockOk");
868  if (!Functions->WlxIsLockOk) goto cleanup;
869  Functions->WlxIsLogoffOk = (PFWLXISLOGOFFOK)GetProcAddress(hGina, "WlxIsLogoffOk");
870  if (!Functions->WlxIsLogoffOk) goto cleanup;
871  Functions->WlxLoggedOnSAS = (PFWLXLOGGEDONSAS)GetProcAddress(hGina, "WlxLoggedOnSAS");
872  if (!Functions->WlxLoggedOnSAS) goto cleanup;
873  Functions->WlxLoggedOutSAS = (PFWLXLOGGEDOUTSAS)GetProcAddress(hGina, "WlxLoggedOutSAS");
874  if (!Functions->WlxLoggedOutSAS) goto cleanup;
875  Functions->WlxLogoff = (PFWLXLOGOFF)GetProcAddress(hGina, "WlxLogoff");
876  if (!Functions->WlxLogoff) goto cleanup;
877  Functions->WlxShutdown = (PFWLXSHUTDOWN)GetProcAddress(hGina, "WlxShutdown");
878  if (!Functions->WlxShutdown) goto cleanup;
879  Functions->WlxWkstaLockedSAS = (PFWLXWKSTALOCKEDSAS)GetProcAddress(hGina, "WlxWkstaLockedSAS");
880  if (!Functions->WlxWkstaLockedSAS) goto cleanup;
881  }
882 
883  if (*DllVersion >= WLX_VERSION_1_1)
884  {
885  Functions->WlxScreenSaverNotify = (PFWLXSCREENSAVERNOTIFY)GetProcAddress(hGina, "WlxScreenSaverNotify");
886  Functions->WlxStartApplication = (PFWLXSTARTAPPLICATION)GetProcAddress(hGina, "WlxStartApplication");
887  }
888 
889  if (*DllVersion >= WLX_VERSION_1_3)
890  {
891  Functions->WlxDisplayStatusMessage = (PFWLXDISPLAYSTATUSMESSAGE)GetProcAddress(hGina, "WlxDisplayStatusMessage");
892  if (!Functions->WlxDisplayStatusMessage) goto cleanup;
893  Functions->WlxGetStatusMessage = (PFWLXGETSTATUSMESSAGE)GetProcAddress(hGina, "WlxGetStatusMessage");
894  if (!Functions->WlxGetStatusMessage) goto cleanup;
895  Functions->WlxNetworkProviderLoad = (PFWLXNETWORKPROVIDERLOAD)GetProcAddress(hGina, "WlxNetworkProviderLoad");
896  if (!Functions->WlxNetworkProviderLoad) goto cleanup;
897  Functions->WlxRemoveStatusMessage = (PFWLXREMOVESTATUSMESSAGE)GetProcAddress(hGina, "WlxRemoveStatusMessage");
898  if (!Functions->WlxRemoveStatusMessage) goto cleanup;
899  }
900 
901  /* Provide some default functions */
902  if (!Functions->WlxScreenSaverNotify)
903  Functions->WlxScreenSaverNotify = DefaultWlxScreenSaverNotify;
904 
905  ret = TRUE;
906 
907 cleanup:
908  if (!ret)
909  {
910  if (hGina)
911  FreeLibrary(hGina);
912  }
913  else
914  *GinaInstance = hGina;
915  return ret;
916 }
#define TRUE
Definition: types.h:120
static BOOL WINAPI DefaultWlxScreenSaverNotify(IN PVOID pWlxContext, IN OUT BOOL *pSecure)
Definition: wlx.c:808
BOOL(WINAPI * PFWLXSCREENSAVERNOTIFY)(PVOID, BOOL *)
Definition: winlogon.h:77
BOOL(WINAPI * PFWLXDISPLAYSTATUSMESSAGE)(PVOID, HDESK, DWORD, PWSTR, PWSTR)
Definition: winlogon.h:83
int(WINAPI * PFWLXLOGGEDONSAS)(PVOID, DWORD, PVOID)
Definition: winlogon.h:67
int(WINAPI * PFWLXWKSTALOCKEDSAS)(PVOID, DWORD)
Definition: winlogon.h:69
BOOL(WINAPI * PFWLXINITIALIZE)(LPWSTR, HANDLE, PVOID, PVOID, PVOID *)
Definition: winlogon.h:61
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL(WINAPI * PFWLXREMOVESTATUSMESSAGE)(PVOID)
Definition: winlogon.h:85
VOID(WINAPI * PFWLXSHUTDOWN)(PVOID, DWORD)
Definition: winlogon.h:73
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
#define WLX_VERSION_1_1
Definition: winwlx.h:29
BOOL(WINAPI * PFWLXNETWORKPROVIDERLOAD)(PVOID, PWLX_MPR_NOTIFY_INFO)
Definition: winlogon.h:82
VOID(WINAPI * PFWLXDISPLAYLOCKEDNOTICE)(PVOID)
Definition: winlogon.h:68
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
static BOOL GetGinaPath(OUT LPWSTR Path, IN DWORD Len)
Definition: wlx.c:770
VOID(WINAPI * PFWLXLOGOFF)(PVOID)
Definition: winlogon.h:72
int ret
BOOL(WINAPI * PFWLXACTIVATEUSERSHELL)(PVOID, PWSTR, PWSTR, PVOID)
Definition: winlogon.h:66
VOID(WINAPI * PFWLXDISPLAYSASNOTICE)(PVOID)
Definition: winlogon.h:62
int(WINAPI * PFWLXLOGGEDOUTSAS)(PVOID, DWORD, PLUID, PSID, PDWORD, PHANDLE, PWLX_MPR_NOTIFY_INFO, PVOID *)
Definition: winlogon.h:63
BOOL(WINAPI * PFWLXSTARTAPPLICATION)(PVOID, PWSTR, PVOID, PWSTR)
Definition: winlogon.h:78
BOOL(WINAPI * PFWLXISLOCKOK)(PVOID)
Definition: winlogon.h:70
#define WLX_VERSION_1_0
Definition: winwlx.h:28
#define WLX_CURRENT_VERSION
Definition: winwlx.h:33
BOOL(WINAPI * PFWLXISLOGOFFOK)(PVOID)
Definition: winlogon.h:71
char * cleanup(char *str)
Definition: wpickclick.c:99
#define GetProcAddress(x, y)
Definition: compat.h:410
BOOL(WINAPI * PFWLXNEGOTIATE)(DWORD, DWORD *)
Definition: winlogon.h:60
#define WLX_VERSION_1_3
Definition: winwlx.h:31
BOOL(WINAPI * PFWLXGETSTATUSMESSAGE)(PVOID, DWORD *, PWSTR, DWORD)
Definition: winlogon.h:84

Referenced by GinaInit().

◆ RemoveDialogListEntry()

static VOID RemoveDialogListEntry ( PDIALOG_LIST_ENTRY  ListEntry)
static

Definition at line 72 of file wlx.c.

73 {
74  TRACE("Remove entry %p\n", ListEntry);
75 
76  RemoveEntryList(&ListEntry->Entry);
77  RtlFreeHeap(RtlGetProcessHeap(), 0, ListEntry);
78 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
LIST_ENTRY Entry
Definition: wlx.c:31
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by WlxDialogBoxIndirectParam(), and WlxDialogBoxParam().

◆ 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:323
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
HANDLE hThread
Definition: wizard.c:27
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#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:323
#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:323
static INT_PTR CALLBACK DefaultWlxWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wlx.c:131
smooth NULL
Definition: ftsmooth.c:416
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
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:323
static INT_PTR CALLBACK DefaultWlxWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wlx.c:131
smooth NULL
Definition: ftsmooth.c:416
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
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 UNIMPLEMENTED
Definition: debug.h:114

◆ 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 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
BOOL UseCtrlAltDelete
Definition: winlogon.h:126
PVOID Context
Definition: winlogon.h:124
#define TRUE
Definition: types.h:120
struct _WLSESSION * PWLSESSION
struct _WLX_DISPATCH_VERSION_1_0 WLX_DISPATCH_VERSION_1_0
#define WLX_OPTION_DISPATCH_TABLE_SIZE
Definition: winwlx.h:331
uint32_t ULONG_PTR
Definition: typedefs.h:63
#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
#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:114
#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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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:63
#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 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
BOOL UseCtrlAltDelete
Definition: winlogon.h:126
PVOID Context
Definition: winlogon.h:124
#define TRUE
Definition: types.h:120
struct _WLSESSION * PWLSESSION
unsigned int BOOL
Definition: ntddk_ex.h:94
GINAINSTANCE Gina
Definition: winlogon.h:216
#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:114
#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:323
#define UNIMPLEMENTED
Definition: debug.h:114

◆ 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 }
#define TRUE
Definition: types.h:120
struct _WLSESSION * PWLSESSION
#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:63
#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:323
#define UNIMPLEMENTED
Definition: debug.h:114

Variable Documentation

◆ DialogListHead

LIST_ENTRY DialogListHead
static

◆ FunctionTable

WLX_DISPATCH_VERSION_1_4 FunctionTable
static
Initial value:
= {
}
int WINAPI WlxDialogBoxIndirectParam(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:373
int WINAPI WlxDialogBoxIndirect(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc)
Definition: wlx.c:354
VOID WINAPI WlxWin31Migrate(HANDLE hWlx)
Definition: wlx.c:640
BOOL WINAPI WlxSetTimeout(HANDLE hWlx, DWORD Timeout)
Definition: wlx.c:245
int WINAPI WlxAssignShellProtection(HANDLE hWlx, HANDLE hToken, HANDLE hProcess, HANDLE hThread)
Definition: wlx.c:262
VOID WINAPI WlxSetContextPointer(HANDLE hWlx, PVOID pWlxContext)
Definition: wlx.c:212
int WINAPI WlxDialogBox(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc)
Definition: wlx.c:301
VOID WINAPI WlxSasNotify(HANDLE hWlx, DWORD dwSasType)
Definition: wlx.c:228
BOOL WINAPI WlxCloseUserDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop, HANDLE hToken)
Definition: wlx.c:531
BOOL WINAPI WlxGetSourceDesktop(HANDLE hWlx, PWLX_DESKTOP *ppDesktop)
Definition: wlx.c:455
BOOL WINAPI WlxCreateUserDesktop(HANDLE hWlx, HANDLE hToken, DWORD Flags, PWSTR pszDesktopName, PWLX_DESKTOP *ppDesktop)
Definition: wlx.c:487
int WINAPI WlxChangePasswordNotifyEx(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo, PWSTR ProviderName, PVOID Reserved)
Definition: wlx.c:509
DWORD WINAPI WlxQueryTerminalServicesData(HANDLE hWlx, PWLX_TERMINAL_SERVICES_DATA pTSData, WCHAR *UserName, WCHAR *Domain)
Definition: wlx.c:692
int WINAPI WlxMessageBox(HANDLE hWlx, HWND hwndOwner, LPWSTR lpszText, LPWSTR lpszTitle, UINT fuStyle)
Definition: wlx.c:282
BOOL WINAPI WlxQueryClientCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:653
DWORD WINAPI WlxQueryConsoleSwitchCredentials(PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:712
BOOL WINAPI WlxQueryTsLogonCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred)
Definition: wlx.c:726
int WINAPI WlxSwitchDesktopToWinlogon(HANDLE hWlx)
Definition: wlx.c:422
BOOL WINAPI WlxDisconnect(VOID)
Definition: wlx.c:681
BOOL WINAPI WlxSetOption(HANDLE hWlx, DWORD Option, ULONG_PTR Value, ULONG_PTR *OldValue)
Definition: wlx.c:549
VOID WINAPI WlxUseCtrlAltDel(HANDLE hWlx)
Definition: wlx.c:197
int WINAPI WlxChangePasswordNotify(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo)
Definition: wlx.c:437
BOOL WINAPI WlxQueryInetConnectorCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:667
BOOL WINAPI WlxSetReturnDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop)
Definition: wlx.c:471
BOOL WINAPI WlxGetOption(HANDLE hWlx, DWORD Option, ULONG_PTR *Value)
Definition: wlx.c:582
int WINAPI WlxDialogBoxParam(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:320
int WINAPI WlxSwitchDesktopToUser(HANDLE hWlx)
Definition: wlx.c:407

Definition at line 736 of file wlx.c.

Referenced by CreateSoundDeviceInstance(), DestroySoundDeviceInstance(), DoWaveStreaming(), GetSoundDeviceCapabilities(), GetSoundDeviceFunctionTable(), GinaInit(), IKsAllocator_fnDeviceIoControl(), MmeGetDeviceInterfaceString(), MmeGetLineInfo(), MmeGetPosition(), MmeSetState(), PeLdrpBindImportName(), PrepareWaveHeader(), QueryWaveDeviceFormatSupport(), RtlLookupFunctionEntry(), SetSoundDeviceFunctionTable(), SetWaveDeviceFormat(), StopStreamingInSoundThread(), UnprepareWaveHeader(), and WriteWaveHeader().