ReactOS  0.4.15-dev-5112-g22d8c0f
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
 

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 CreateWindowStationAndDesktops (_Inout_ PWLSESSION Session)
 

Variables

static LIST_ENTRY DialogListHead
 
static WLX_DISPATCH_VERSION_1_4 FunctionTable
 

Typedef Documentation

◆ DIALOG_LIST_ENTRY

◆ PDIALOG_LIST_ENTRY

Function Documentation

◆ AddDialogListEntry()

static PDIALOG_LIST_ENTRY AddDialogListEntry ( VOID  )
static

Definition at line 39 of file wlx.c.

40 {
41  PDIALOG_LIST_ENTRY ListEntry;
42 
43  ListEntry = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DIALOG_LIST_ENTRY));
44  if (ListEntry == NULL)
45  return NULL;
46 
47  TRACE("Add entry %p\n", ListEntry);
48 
50  &ListEntry->Entry);
51 
52  return ListEntry;
53 }
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
LIST_ENTRY Entry
Definition: wlx.c:17
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
static LIST_ENTRY DialogListHead
Definition: wlx.c:26
#define TRACE(s)
Definition: solgame.cpp:4
Definition: wlx.c:15
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by WlxDialogBoxIndirectParam(), and WlxDialogBoxParam().

◆ CloseAllDialogWindows()

VOID CloseAllDialogWindows ( VOID  )

Definition at line 95 of file wlx.c.

96 {
97  PDIALOG_LIST_ENTRY Current;
98  PLIST_ENTRY ListEntry;
99 
100  ListEntry = DialogListHead.Flink;
101  while (ListEntry != &DialogListHead)
102  {
103  Current = CONTAINING_RECORD(ListEntry,
105  Entry);
106 
107  PostMessage(Current->hWnd, WLX_WM_SAS, 0, 0);
108 
109  ListEntry = ListEntry->Flink;
110  }
111 }
#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:5822
static LIST_ENTRY DialogListHead
Definition: wlx.c:26
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
HWND hWnd
Definition: wlx.c:18
Definition: typedefs.h:119
Definition: wlx.c:15
base of all file and directory entries
Definition: entries.h:82

Referenced by DispatchSAS().

◆ CreateWindowStationAndDesktops()

BOOL CreateWindowStationAndDesktops ( _Inout_ PWLSESSION  Session)

Definition at line 928 of file wlx.c.

930 {
931  SECURITY_ATTRIBUTES WinstaSecurity;
932  SECURITY_ATTRIBUTES ApplicationDesktopSecurity;
933  SECURITY_ATTRIBUTES WinlogonDesktopSecurity;
934  SECURITY_ATTRIBUTES ScreenSaverDesktopSecurity;
935  PSECURITY_DESCRIPTOR WlWinstaSecurityDescriptor;
936  PSECURITY_DESCRIPTOR WlApplicationDesktopSecurityDescriptor;
937  PSECURITY_DESCRIPTOR WlWinlogonDesktopSecurityDescriptor;
938  PSECURITY_DESCRIPTOR WlScreenSaverDesktopSecurityDescriptor;
939  BOOL ret = FALSE;
940 
941  if (!CreateWinstaSecurity(&WlWinstaSecurityDescriptor))
942  {
943  ERR("WL: Failed to create winsta security!\n");
944  return ret;
945  }
946 
947  WinstaSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
948  WinstaSecurity.lpSecurityDescriptor = WlWinstaSecurityDescriptor;
949  WinstaSecurity.bInheritHandle = TRUE;
950 
951  if (!CreateApplicationDesktopSecurity(&WlApplicationDesktopSecurityDescriptor))
952  {
953  ERR("WL: Failed to create application desktop security!\n");
954  goto cleanup;
955  }
956 
957  ApplicationDesktopSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
958  ApplicationDesktopSecurity.lpSecurityDescriptor = WlApplicationDesktopSecurityDescriptor;
959  ApplicationDesktopSecurity.bInheritHandle = TRUE;
960 
961  if (!CreateWinlogonDesktopSecurity(&WlWinlogonDesktopSecurityDescriptor))
962  {
963  ERR("WL: Failed to create winlogon desktop security!\n");
964  goto cleanup;
965  }
966 
967  WinlogonDesktopSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
968  WinlogonDesktopSecurity.lpSecurityDescriptor = WlWinlogonDesktopSecurityDescriptor;
969  WinlogonDesktopSecurity.bInheritHandle = FALSE;
970 
971  if (!CreateScreenSaverSecurity(&WlScreenSaverDesktopSecurityDescriptor))
972  {
973  ERR("WL: Failed to create winlogon desktop security!\n");
974  goto cleanup;
975  }
976 
977  ScreenSaverDesktopSecurity.nLength = sizeof(SECURITY_ATTRIBUTES);
978  ScreenSaverDesktopSecurity.lpSecurityDescriptor = WlScreenSaverDesktopSecurityDescriptor;
979  ScreenSaverDesktopSecurity.bInheritHandle = TRUE;
980 
981  /*
982  * Create the interactive window station
983  */
984  Session->InteractiveWindowStationName = L"WinSta0";
985  Session->InteractiveWindowStation = CreateWindowStationW(
986  Session->InteractiveWindowStationName,
987  0,
989  &WinstaSecurity);
990  if (!Session->InteractiveWindowStation)
991  {
992  ERR("WL: Failed to create window station (%lu)\n", GetLastError());
993  goto cleanup;
994  }
995 
996  if (!SetProcessWindowStation(Session->InteractiveWindowStation))
997  {
998  ERR("WL: SetProcessWindowStation() failed (error %lu)\n", GetLastError());
999  goto cleanup;
1000  }
1001 
1002  /*
1003  * Create the application desktop
1004  */
1005  Session->ApplicationDesktop = CreateDesktopW(
1006  L"Default",
1007  NULL,
1008  NULL,
1009  0, /* FIXME: Add DF_ALLOWOTHERACCOUNTHOOK flag? */
1011  &ApplicationDesktopSecurity);
1012  if (!Session->ApplicationDesktop)
1013  {
1014  ERR("WL: Failed to create Default desktop (%lu)\n", GetLastError());
1015  goto cleanup;
1016  }
1017 
1018  /*
1019  * Create the winlogon desktop
1020  */
1021  Session->WinlogonDesktop = CreateDesktopW(
1022  L"Winlogon",
1023  NULL,
1024  NULL,
1025  0,
1027  &WinlogonDesktopSecurity);
1028  if (!Session->WinlogonDesktop)
1029  {
1030  ERR("WL: Failed to create Winlogon desktop (%lu)\n", GetLastError());
1031  goto cleanup;
1032  }
1033 
1034  /*
1035  * Create the screen saver desktop
1036  */
1037  Session->ScreenSaverDesktop = CreateDesktopW(
1038  L"Screen-Saver",
1039  NULL,
1040  NULL,
1041  0,
1043  &ScreenSaverDesktopSecurity);
1044  if(!Session->ScreenSaverDesktop)
1045  {
1046  ERR("WL: Failed to create Screen-Saver desktop (%lu)\n", GetLastError());
1047  goto cleanup;
1048  }
1049 
1050  /*
1051  * Switch to winlogon desktop
1052  */
1053  if (!SetThreadDesktop(Session->WinlogonDesktop) ||
1054  !SwitchDesktop(Session->WinlogonDesktop))
1055  {
1056  ERR("WL: Cannot switch to Winlogon desktop (%lu)\n", GetLastError());
1057  goto cleanup;
1058  }
1059 
1060  SetWindowStationUser(Session->InteractiveWindowStation,
1061  &LuidNone, NULL, 0);
1062 
1063  ret = TRUE;
1064 
1065 cleanup:
1066  if (!ret)
1067  {
1068  if (Session->ApplicationDesktop)
1069  {
1070  CloseDesktop(Session->ApplicationDesktop);
1071  Session->ApplicationDesktop = NULL;
1072  }
1073  if (Session->WinlogonDesktop)
1074  {
1075  CloseDesktop(Session->WinlogonDesktop);
1076  Session->WinlogonDesktop = NULL;
1077  }
1078  if (Session->ScreenSaverDesktop)
1079  {
1080  CloseDesktop(Session->ScreenSaverDesktop);
1081  Session->ScreenSaverDesktop = NULL;
1082  }
1083  if (Session->InteractiveWindowStation)
1084  {
1085  CloseWindowStation(Session->InteractiveWindowStation);
1086  Session->InteractiveWindowStation = NULL;
1087  }
1088  if (WlWinstaSecurityDescriptor)
1089  {
1090  RtlFreeHeap(RtlGetProcessHeap(), 0, WlWinstaSecurityDescriptor);
1091  }
1092  if (WlApplicationDesktopSecurityDescriptor)
1093  {
1094  RtlFreeHeap(RtlGetProcessHeap(), 0, WlApplicationDesktopSecurityDescriptor);
1095  }
1096  if (WlWinlogonDesktopSecurityDescriptor)
1097  {
1098  RtlFreeHeap(RtlGetProcessHeap(), 0, WlWinlogonDesktopSecurityDescriptor);
1099  }
1100  if (WlScreenSaverDesktopSecurityDescriptor)
1101  {
1102  RtlFreeHeap(RtlGetProcessHeap(), 0, WlScreenSaverDesktopSecurityDescriptor);
1103  }
1104  }
1105 
1106  return ret;
1107 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
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
BOOL CreateScreenSaverSecurity(_Out_ PSECURITY_DESCRIPTOR *ScreenSaverDesktopSd)
Creates a security descriptor for the screen saver desktop.
Definition: security.c:690
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI SetProcessWindowStation(_In_ HWINSTA)
LUID LuidNone
Definition: sas.c:47
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
BOOL CreateWinlogonDesktopSecurity(_Out_ PSECURITY_DESCRIPTOR *WinlogonDesktopSd)
Creates a security descriptor for the default Winlogon desktop. This descriptor serves as a security ...
Definition: security.c:541
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SwitchDesktop(_In_ HDESK)
int ret
BOOL CreateApplicationDesktopSecurity(_Out_ PSECURITY_DESCRIPTOR *ApplicationDesktopSd)
Creates a security descriptor for the default application desktop upon its creation.
Definition: security.c:359
#define ERR(fmt,...)
Definition: debug.h:110
LPVOID lpSecurityDescriptor
Definition: compat.h:193
#define NULL
Definition: types.h:112
BOOL CreateWinstaSecurity(_Out_ PSECURITY_DESCRIPTOR *WinstaSd)
Creates a security descriptor for the default window station upon its creation.
Definition: security.c:112
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 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 794 of file wlx.c.

797 {
798  if (*pSecure)
799  *pSecure = WLSession->Gina.Functions.WlxIsLogoffOk(pWlxContext);
800  return TRUE;
801 }
PWLSESSION WLSession
Definition: winlogon.c:20
PFWLXISLOGOFFOK WlxIsLogoffOk
Definition: winlogon.h:101
#define TRUE
Definition: types.h:120
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 117 of file wlx.c.

122 {
123  PDIALOG_LIST_ENTRY ListEntry;
124  INT_PTR ret;
125 
126  if (uMsg == WM_INITDIALOG)
127  {
128  ListEntry = (PDIALOG_LIST_ENTRY)lParam;
129 
130  TRACE("Set dialog handle: %p\n", hwndDlg);
131  ListEntry->hWnd = hwndDlg;
132  lParam = ListEntry->lParam;
133 // SetTopTimeout(hWnd);
134  }
135  else
136  {
137  ListEntry = GetDialogListEntry(hwndDlg);
138  if (ListEntry == NULL)
139  return FALSE;
140  }
141 
142  if (uMsg == WLX_WM_SAS)
143  {
144  EndDialog(hwndDlg, WLX_DLG_SAS);
145  return 0;
146  }
147 
148  ret = ListEntry->DlgProc(hwndDlg, uMsg, wParam, lParam);
149 
150  return ret;
151 
152 /*
153  if (uMsg == WM_TIMER && (UINT_PTR)wParam == IdTimer)
154  {
155  EndDialog(hwndDlg, -1);
156  KillTimer(hwndDlg, IdTimer);
157  return TRUE;
158  }
159  else if (uMsg == WM_INITDIALOG)
160  {
161  IdTimer = SetTimer(hwndDlg, 0, WLSession->DialogTimeout * 1000, NULL);
162  return PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
163  }
164  else if (uMsg == WM_NCDESTROY)
165  {
166  BOOL ret;
167  ret = PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
168  PreviousWindowProc = NULL;
169  return ret;
170  }
171  else
172  {
173  return PreviousWindowProc(hwndDlg, uMsg, wParam, lParam);
174  }
175 */
176 }
DLGPROC DlgProc
Definition: wlx.c:19
LPARAM lParam
Definition: wlx.c:20
#define WLX_WM_SAS
Definition: winwlx.h:71
int32_t INT_PTR
Definition: typedefs.h:64
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
HWND hWnd
Definition: wlx.c:18
int ret
#define WLX_DLG_SAS
Definition: winwlx.h:73
static PDIALOG_LIST_ENTRY GetDialogListEntry(HWND hwndDlg)
Definition: wlx.c:69
Definition: wlx.c:15
#define NULL
Definition: types.h:112
struct _DIALOG_LIST_ENTRY * PDIALOG_LIST_ENTRY
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139

Referenced by WlxDialogBoxIndirectParam(), and WlxDialogBoxParam().

◆ GetDialogListEntry()

static PDIALOG_LIST_ENTRY GetDialogListEntry ( HWND  hwndDlg)
static

Definition at line 69 of file wlx.c.

70 {
71  PDIALOG_LIST_ENTRY Current;
72  PLIST_ENTRY ListEntry;
73 
74  ListEntry = DialogListHead.Flink;
75  while (ListEntry != &DialogListHead)
76  {
77  Current = CONTAINING_RECORD(ListEntry,
79  Entry);
80  if (Current->hWnd == hwndDlg)
81  {
82  TRACE("Found entry: %p\n", Current);
83  return Current;
84  }
85 
86  ListEntry = ListEntry->Flink;
87  }
88 
89  TRACE("Found no entry!\n");
90  return NULL;
91 }
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:26
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define TRACE(s)
Definition: solgame.cpp:4
HWND hWnd
Definition: wlx.c:18
Definition: typedefs.h:119
Definition: wlx.c:15
#define NULL
Definition: types.h:112
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 756 of file wlx.c.

759 {
760  LONG Status;
761  DWORD Type, Size;
762  HKEY hKey;
763 
766  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
767  0,
769  &hKey);
770  if (Status != ERROR_SUCCESS)
771  {
772  /* Default value */
773  wcsncpy(Path, L"msgina.dll", Len);
774  return TRUE;
775  }
776 
777  Size = Len * sizeof(WCHAR);
779  hKey,
780  L"GinaDLL",
781  NULL,
782  &Type,
783  (LPBYTE)Path,
784  &Size);
785  if (Status != ERROR_SUCCESS || Type != REG_SZ || Size == 0)
786  wcsncpy(Path, L"msgina.dll", Len);
787  RegCloseKey(hKey);
788  return TRUE;
789 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
long LONG
Definition: pedump.c:60
Status
Definition: gdiplustypes.h:24
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
Type
Definition: Type.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
#define Len
Definition: deflate.h:82
PRTL_UNICODE_STRING_BUFFER Path
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
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:3356
#define RegCloseKey(hKey)
Definition: registry.h:47
#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 905 of file wlx.c.

907 {
908  DWORD GinaDllVersion;
909 
910  if (!LoadGina(&Session->Gina.Functions, &GinaDllVersion, &Session->Gina.hDllInstance))
911  return FALSE;
912 
913  Session->Gina.Context = NULL;
914  Session->Gina.Version = GinaDllVersion;
915  Session->Gina.UseCtrlAltDelete = FALSE;
916  Session->SuppressStatus = FALSE;
917 
918  TRACE("Calling WlxInitialize(\"%S\")\n", Session->InteractiveWindowStationName);
919  return Session->Gina.Functions.WlxInitialize(
920  Session->InteractiveWindowStationName,
921  (HANDLE)Session,
922  NULL,
924  &Session->Gina.Context);
925 }
#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:805
#define NULL
Definition: types.h:112
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:722

Referenced by WinMain().

◆ InitDialogListHead()

VOID InitDialogListHead ( VOID  )

Definition at line 31 of file wlx.c.

32 {
34 }
static LIST_ENTRY DialogListHead
Definition: wlx.c:26
#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 805 of file wlx.c.

809 {
810  HMODULE hGina = NULL;
811  WCHAR GinaDll[MAX_PATH + 1];
812  BOOL ret = FALSE;
813 
814  GinaDll[0] = '\0';
815  if (!GetGinaPath(GinaDll, MAX_PATH))
816  goto cleanup;
817  /* Terminate string */
818  GinaDll[MAX_PATH] = '\0';
819 
820  hGina = LoadLibraryW(GinaDll);
821  if (!hGina)
822  goto cleanup;
823 
824  Functions->WlxNegotiate = (PFWLXNEGOTIATE)GetProcAddress(hGina, "WlxNegotiate");
825  Functions->WlxInitialize = (PFWLXINITIALIZE)GetProcAddress(hGina, "WlxInitialize");
826 
827  if (!Functions->WlxInitialize)
828  goto cleanup;
829 
830  if (!Functions->WlxNegotiate)
831  {
832  /* Assume current version */
833  *DllVersion = WLX_CURRENT_VERSION;
834  }
835  else
836  {
837  TRACE("About to negotiate with Gina %S. Winlogon uses version %x\n",
838  GinaDll, WLX_CURRENT_VERSION);
839  if (!Functions->WlxNegotiate(WLX_CURRENT_VERSION, DllVersion))
840  goto cleanup;
841  }
842 
843  TRACE("Gina uses WLX_VERSION %lx\n", *DllVersion);
844 
845  if (*DllVersion >= WLX_VERSION_1_0)
846  {
847  Functions->WlxActivateUserShell = (PFWLXACTIVATEUSERSHELL)GetProcAddress(hGina, "WlxActivateUserShell");
848  if (!Functions->WlxActivateUserShell) goto cleanup;
849  Functions->WlxDisplayLockedNotice = (PFWLXDISPLAYLOCKEDNOTICE)GetProcAddress(hGina, "WlxDisplayLockedNotice");
850  if (!Functions->WlxDisplayLockedNotice) goto cleanup;
851  Functions->WlxDisplaySASNotice = (PFWLXDISPLAYSASNOTICE)GetProcAddress(hGina, "WlxDisplaySASNotice");
852  if (!Functions->WlxDisplaySASNotice) goto cleanup;
853  Functions->WlxIsLockOk = (PFWLXISLOCKOK)GetProcAddress(hGina, "WlxIsLockOk");
854  if (!Functions->WlxIsLockOk) goto cleanup;
855  Functions->WlxIsLogoffOk = (PFWLXISLOGOFFOK)GetProcAddress(hGina, "WlxIsLogoffOk");
856  if (!Functions->WlxIsLogoffOk) goto cleanup;
857  Functions->WlxLoggedOnSAS = (PFWLXLOGGEDONSAS)GetProcAddress(hGina, "WlxLoggedOnSAS");
858  if (!Functions->WlxLoggedOnSAS) goto cleanup;
859  Functions->WlxLoggedOutSAS = (PFWLXLOGGEDOUTSAS)GetProcAddress(hGina, "WlxLoggedOutSAS");
860  if (!Functions->WlxLoggedOutSAS) goto cleanup;
861  Functions->WlxLogoff = (PFWLXLOGOFF)GetProcAddress(hGina, "WlxLogoff");
862  if (!Functions->WlxLogoff) goto cleanup;
863  Functions->WlxShutdown = (PFWLXSHUTDOWN)GetProcAddress(hGina, "WlxShutdown");
864  if (!Functions->WlxShutdown) goto cleanup;
865  Functions->WlxWkstaLockedSAS = (PFWLXWKSTALOCKEDSAS)GetProcAddress(hGina, "WlxWkstaLockedSAS");
866  if (!Functions->WlxWkstaLockedSAS) goto cleanup;
867  }
868 
869  if (*DllVersion >= WLX_VERSION_1_1)
870  {
871  Functions->WlxScreenSaverNotify = (PFWLXSCREENSAVERNOTIFY)GetProcAddress(hGina, "WlxScreenSaverNotify");
872  Functions->WlxStartApplication = (PFWLXSTARTAPPLICATION)GetProcAddress(hGina, "WlxStartApplication");
873  }
874 
875  if (*DllVersion >= WLX_VERSION_1_3)
876  {
877  Functions->WlxDisplayStatusMessage = (PFWLXDISPLAYSTATUSMESSAGE)GetProcAddress(hGina, "WlxDisplayStatusMessage");
878  if (!Functions->WlxDisplayStatusMessage) goto cleanup;
879  Functions->WlxGetStatusMessage = (PFWLXGETSTATUSMESSAGE)GetProcAddress(hGina, "WlxGetStatusMessage");
880  if (!Functions->WlxGetStatusMessage) goto cleanup;
881  Functions->WlxNetworkProviderLoad = (PFWLXNETWORKPROVIDERLOAD)GetProcAddress(hGina, "WlxNetworkProviderLoad");
882  if (!Functions->WlxNetworkProviderLoad) goto cleanup;
883  Functions->WlxRemoveStatusMessage = (PFWLXREMOVESTATUSMESSAGE)GetProcAddress(hGina, "WlxRemoveStatusMessage");
884  if (!Functions->WlxRemoveStatusMessage) goto cleanup;
885  }
886 
887  /* Provide some default functions */
888  if (!Functions->WlxScreenSaverNotify)
889  Functions->WlxScreenSaverNotify = DefaultWlxScreenSaverNotify;
890 
891  ret = TRUE;
892 
893 cleanup:
894  if (!ret)
895  {
896  if (hGina)
897  FreeLibrary(hGina);
898  }
899  else
900  *GinaInstance = hGina;
901  return ret;
902 }
static BOOL WINAPI DefaultWlxScreenSaverNotify(IN PVOID pWlxContext, IN OUT BOOL *pSecure)
Definition: wlx.c:794
#define TRUE
Definition: types.h:120
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
#define FALSE
Definition: types.h:117
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:606
#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:607
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
static BOOL GetGinaPath(OUT LPWSTR Path, IN DWORD Len)
Definition: wlx.c:756
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
#define NULL
Definition: types.h:112
BOOL(WINAPI * PFWLXISLOGOFFOK)(PVOID)
Definition: winlogon.h:71
char * cleanup(char *str)
Definition: wpickclick.c:99
#define GetProcAddress(x, y)
Definition: compat.h:612
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 58 of file wlx.c.

59 {
60  TRACE("Remove entry %p\n", ListEntry);
61 
62  RemoveEntryList(&ListEntry->Entry);
63  RtlFreeHeap(RtlGetProcessHeap(), 0, ListEntry);
64 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
LIST_ENTRY Entry
Definition: wlx.c:17
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 248 of file wlx.c.

253 {
255  UNREFERENCED_PARAMETER(hToken);
258 
260  return 0;
261 }
#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 423 of file wlx.c.

427 {
429  UNREFERENCED_PARAMETER(pMprInfo);
430  UNREFERENCED_PARAMETER(dwChangeInfo);
431 
433  return 0;
434 }
#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 495 of file wlx.c.

501 {
503  UNREFERENCED_PARAMETER(pMprInfo);
504  UNREFERENCED_PARAMETER(dwChangeInfo);
505  UNREFERENCED_PARAMETER(ProviderName);
507 
509  return 0;
510 }
#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 517 of file wlx.c.

521 {
523  UNREFERENCED_PARAMETER(pDesktop);
524  UNREFERENCED_PARAMETER(hToken);
525 
527  return FALSE;
528 }
#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 473 of file wlx.c.

479 {
481  UNREFERENCED_PARAMETER(hToken);
483  UNREFERENCED_PARAMETER(pszDesktopName);
484  UNREFERENCED_PARAMETER(ppDesktop);
485 
487  return FALSE;
488 }
#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 287 of file wlx.c.

293 {
295 
296  TRACE("WlxDialogBox()\n");
297 
298  return (int)WlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner, dlgprc, 0);
299 }
#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:306

◆ WlxDialogBoxIndirect()

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

Definition at line 340 of file wlx.c.

346 {
348 
349  TRACE("WlxDialogBoxIndirect()\n");
350 
351  return (int)WlxDialogBoxIndirectParam(hWlx, hInst, hDialogTemplate, hwndOwner, dlgprc, 0);
352 }
int WINAPI WlxDialogBoxIndirectParam(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:359
#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 359 of file wlx.c.

366 {
367  PDIALOG_LIST_ENTRY ListEntry;
368  int ret;
369 
371 
372  TRACE("WlxDialogBoxIndirectParam()\n");
373 
374  ListEntry = AddDialogListEntry();
375  if (ListEntry == NULL)
376  return -1;
377 
378  ListEntry->DlgProc = dlgprc;
379  ListEntry->lParam = dwInitParam;
380 
381  ret = (int)DialogBoxIndirectParamW(hInst, hDialogTemplate, hwndOwner, DefaultWlxWindowProc, (LPARAM)ListEntry);
382 
383  RemoveDialogListEntry(ListEntry);
384 
385  return ret;
386 }
DLGPROC DlgProc
Definition: wlx.c:19
LPARAM lParam
Definition: wlx.c:20
static VOID RemoveDialogListEntry(PDIALOG_LIST_ENTRY ListEntry)
Definition: wlx.c:58
#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:117
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:15
#define NULL
Definition: types.h:112
static PDIALOG_LIST_ENTRY AddDialogListEntry(VOID)
Definition: wlx.c:39
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 306 of file wlx.c.

313 {
314  PDIALOG_LIST_ENTRY ListEntry;
315  int ret;
316 
318 
319  TRACE("WlxDialogBoxParam()\n");
320 
321  ListEntry = AddDialogListEntry();
322  if (ListEntry == NULL)
323  return -1;
324 
325  ListEntry->DlgProc = dlgprc;
326  ListEntry->lParam = dwInitParam;
327 
328  ret = (int)DialogBoxParamW(hInst, lpszTemplate, hwndOwner, DefaultWlxWindowProc, (LPARAM)ListEntry);
329 
330  RemoveDialogListEntry(ListEntry);
331 
332  return ret;
333 }
DLGPROC DlgProc
Definition: wlx.c:19
LPARAM lParam
Definition: wlx.c:20
static VOID RemoveDialogListEntry(PDIALOG_LIST_ENTRY ListEntry)
Definition: wlx.c:58
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:117
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:15
#define NULL
Definition: types.h:112
static PDIALOG_LIST_ENTRY AddDialogListEntry(VOID)
Definition: wlx.c:39
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 667 of file wlx.c.

668 {
670  return FALSE;
671 }
#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 568 of file wlx.c.

572 {
573  PWLSESSION Session = (PWLSESSION)hWlx;
574 
575  TRACE("WlxGetOption(%lu)\n", Option);
576 
577  switch (Option)
578  {
580  *Value = (ULONG_PTR)Session->Gina.UseCtrlAltDelete;
581  return TRUE;
583  {
584  *Value = (ULONG_PTR)Session->Gina.Context;
585  return TRUE;
586  }
591  return FALSE;
593  {
594  switch (Session->Gina.Version)
595  {
596  case WLX_VERSION_1_0:
597  *Value = sizeof(WLX_DISPATCH_VERSION_1_0);
598  break;
599  case WLX_VERSION_1_1:
600  *Value = sizeof(WLX_DISPATCH_VERSION_1_1);
601  break;
602  case WLX_VERSION_1_2:
603  *Value = sizeof(WLX_DISPATCH_VERSION_1_2);
604  break;
605  case WLX_VERSION_1_3:
606  *Value = sizeof(WLX_DISPATCH_VERSION_1_3);
607  break;
608  case WLX_VERSION_1_4:
609  *Value = sizeof(WLX_DISPATCH_VERSION_1_4);
610  break;
611  default:
612  return FALSE;
613  }
614  return TRUE;
615  }
616  }
617 
618  return FALSE;
619 }
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 441 of file wlx.c.

444 {
446  UNREFERENCED_PARAMETER(ppDesktop);
447 
449  return FALSE;
450 }
#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 268 of file wlx.c.

274 {
276 
277  TRACE("WlxMessageBox()\n");
278  /* FIXME: Provide a custom window proc to be able to handle timeout */
279  return MessageBoxW(hwndOwner, lpszText, lpszTitle, fuStyle);
280 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define TRACE(s)
Definition: solgame.cpp:4

◆ WlxQueryClientCredentials()

BOOL WINAPI WlxQueryClientCredentials ( PWLX_CLIENT_CREDENTIALS_INFO_V1_0  pCred)

Definition at line 639 of file wlx.c.

641 {
642  UNREFERENCED_PARAMETER(pCred);
643 
645  return FALSE;
646 }
#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 698 of file wlx.c.

700 {
701  UNREFERENCED_PARAMETER(pCred);
702 
704  return 0;
705 }
#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 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

◆ WlxQueryTerminalServicesData()

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

Definition at line 678 of file wlx.c.

683 {
685  UNREFERENCED_PARAMETER(pTSData);
686  UNREFERENCED_PARAMETER(UserName);
687  UNREFERENCED_PARAMETER(Domain);
688 
690  return 0;
691 }
#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 712 of file wlx.c.

714 {
715  UNREFERENCED_PARAMETER(pCred);
716 
718  return FALSE;
719 }
#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 214 of file wlx.c.

217 {
218  PWLSESSION Session = (PWLSESSION)hWlx;
219 
220  TRACE("WlxSasNotify(0x%lx)\n", dwSasType);
221 
222  if (dwSasType == WLX_SAS_TYPE_CTRL_ALT_DEL || dwSasType > WLX_SAS_TYPE_MAX_MSFT_VALUE)
223  PostMessageW(Session->SASWindow, WLX_WM_SAS, dwSasType, 0);
224 }
#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 198 of file wlx.c.

201 {
202  ULONG_PTR OldValue;
203 
204  TRACE("WlxSetContextPointer(%p)\n", pWlxContext);
205 
206  WlxSetOption(hWlx, WLX_OPTION_CONTEXT_POINTER, (ULONG_PTR)pWlxContext, &OldValue);
207 }
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:535

◆ WlxSetOption()

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

Definition at line 535 of file wlx.c.

540 {
541  PWLSESSION Session = (PWLSESSION)hWlx;
542 
543  TRACE("WlxSetOption(%lu)\n", Option);
544 
545  switch (Option)
546  {
548  *OldValue = (ULONG_PTR)Session->Gina.UseCtrlAltDelete;
549  Session->Gina.UseCtrlAltDelete = (BOOL)Value;
550  return TRUE;
552  *OldValue = (ULONG_PTR)Session->Gina.Context;
553  Session->Gina.Context = (PVOID)Value;
554  return TRUE;
557  return FALSE;
558  }
559 
560  return FALSE;
561 }
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 457 of file wlx.c.

460 {
462  UNREFERENCED_PARAMETER(pDesktop);
463 
465  return FALSE;
466 }
#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 231 of file wlx.c.

234 {
235  PWLSESSION Session = (PWLSESSION)hWlx;
236 
237  TRACE("WlxSetTimeout(%lu)\n", Timeout);
238 
239  Session->DialogTimeout = Timeout;
240  return TRUE;
241 }
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 393 of file wlx.c.

395 {
396  PWLSESSION Session = (PWLSESSION)hWlx;
397 
398  TRACE("WlxSwitchDesktopToUser()\n");
399 
400  return (int)SwitchDesktop(Session->ApplicationDesktop);
401 }
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 408 of file wlx.c.

410 {
411  PWLSESSION Session = (PWLSESSION)hWlx;
412 
413  TRACE("WlxSwitchDesktopToWinlogon()\n");
414 
415  return (int)SwitchDesktop(Session->WinlogonDesktop);
416 }
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 183 of file wlx.c.

185 {
186  ULONG_PTR OldValue;
187 
188  TRACE("WlxUseCtrlAltDel()\n");
189 
190  WlxSetOption(hWlx, WLX_OPTION_USE_CTRL_ALT_DEL, TRUE, &OldValue);
191 }
#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:535

◆ WlxWin31Migrate()

VOID WINAPI WlxWin31Migrate ( HANDLE  hWlx)

Definition at line 626 of file wlx.c.

628 {
630 
632 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define UNIMPLEMENTED
Definition: debug.h:115

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:359
int WINAPI WlxDialogBoxIndirect(HANDLE hWlx, HANDLE hInst, LPCDLGTEMPLATE hDialogTemplate, HWND hwndOwner, DLGPROC dlgprc)
Definition: wlx.c:340
VOID WINAPI WlxWin31Migrate(HANDLE hWlx)
Definition: wlx.c:626
BOOL WINAPI WlxSetTimeout(HANDLE hWlx, DWORD Timeout)
Definition: wlx.c:231
int WINAPI WlxAssignShellProtection(HANDLE hWlx, HANDLE hToken, HANDLE hProcess, HANDLE hThread)
Definition: wlx.c:248
VOID WINAPI WlxSetContextPointer(HANDLE hWlx, PVOID pWlxContext)
Definition: wlx.c:198
int WINAPI WlxDialogBox(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc)
Definition: wlx.c:287
VOID WINAPI WlxSasNotify(HANDLE hWlx, DWORD dwSasType)
Definition: wlx.c:214
BOOL WINAPI WlxCloseUserDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop, HANDLE hToken)
Definition: wlx.c:517
BOOL WINAPI WlxGetSourceDesktop(HANDLE hWlx, PWLX_DESKTOP *ppDesktop)
Definition: wlx.c:441
BOOL WINAPI WlxCreateUserDesktop(HANDLE hWlx, HANDLE hToken, DWORD Flags, PWSTR pszDesktopName, PWLX_DESKTOP *ppDesktop)
Definition: wlx.c:473
int WINAPI WlxChangePasswordNotifyEx(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo, PWSTR ProviderName, PVOID Reserved)
Definition: wlx.c:495
DWORD WINAPI WlxQueryTerminalServicesData(HANDLE hWlx, PWLX_TERMINAL_SERVICES_DATA pTSData, WCHAR *UserName, WCHAR *Domain)
Definition: wlx.c:678
int WINAPI WlxMessageBox(HANDLE hWlx, HWND hwndOwner, LPWSTR lpszText, LPWSTR lpszTitle, UINT fuStyle)
Definition: wlx.c:268
BOOL WINAPI WlxQueryClientCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:639
DWORD WINAPI WlxQueryConsoleSwitchCredentials(PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:698
BOOL WINAPI WlxQueryTsLogonCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred)
Definition: wlx.c:712
int WINAPI WlxSwitchDesktopToWinlogon(HANDLE hWlx)
Definition: wlx.c:408
BOOL WINAPI WlxDisconnect(VOID)
Definition: wlx.c:667
BOOL WINAPI WlxSetOption(HANDLE hWlx, DWORD Option, ULONG_PTR Value, ULONG_PTR *OldValue)
Definition: wlx.c:535
VOID WINAPI WlxUseCtrlAltDel(HANDLE hWlx)
Definition: wlx.c:183
int WINAPI WlxChangePasswordNotify(HANDLE hWlx, PWLX_MPR_NOTIFY_INFO pMprInfo, DWORD dwChangeInfo)
Definition: wlx.c:423
BOOL WINAPI WlxQueryInetConnectorCredentials(PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred)
Definition: wlx.c:653
BOOL WINAPI WlxSetReturnDesktop(HANDLE hWlx, PWLX_DESKTOP pDesktop)
Definition: wlx.c:457
BOOL WINAPI WlxGetOption(HANDLE hWlx, DWORD Option, ULONG_PTR *Value)
Definition: wlx.c:568
int WINAPI WlxDialogBoxParam(HANDLE hWlx, HANDLE hInst, LPWSTR lpszTemplate, HWND hwndOwner, DLGPROC dlgprc, LPARAM dwInitParam)
Definition: wlx.c:306
int WINAPI WlxSwitchDesktopToUser(HANDLE hWlx)
Definition: wlx.c:393

Definition at line 722 of file wlx.c.

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