3 * Copyright (C) 2003-2004, 2006 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * PROJECT: ReactOS msgina.dll
21 * FILE: dll/win32/msgina/msgina.c
22 * PURPOSE: ReactOS Logon GINA DLL
23 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
24 * Hervé Poussineau (hpoussin@reactos.org)
31 #include <ndk/sefuncs.h>
33 HINSTANCE hDllInstance
;
35 extern GINA_UI GinaGraphicalUI
;
36 extern GINA_UI GinaTextUI
;
37 static PGINA_UI pGinaUI
;
38 static SID_IDENTIFIER_AUTHORITY SystemAuthority
= {SECURITY_NT_AUTHORITY
};
46 IN DWORD dwWinlogonVersion
,
47 OUT PDWORD pdwDllVersion
)
49 TRACE("WlxNegotiate(%lx, %p)\n", dwWinlogonVersion
, pdwDllVersion
);
51 if(!pdwDllVersion
|| (dwWinlogonVersion
< WLX_VERSION_1_3
))
54 *pdwDllVersion
= WLX_VERSION_1_3
;
71 return ERROR_INVALID_PARAMETER
;
74 rc
= RegQueryValueExW(hKey
, pszValue
, NULL
, &dwType
, NULL
, &cbData
);
75 if (rc
!= ERROR_SUCCESS
)
78 return ERROR_FILE_NOT_FOUND
;
79 Value
= HeapAlloc(GetProcessHeap(), 0, cbData
+ sizeof(WCHAR
));
81 return ERROR_NOT_ENOUGH_MEMORY
;
82 rc
= RegQueryValueExW(hKey
, pszValue
, NULL
, NULL
, (LPBYTE
)Value
, &cbData
);
83 if (rc
!= ERROR_SUCCESS
)
85 HeapFree(GetProcessHeap(), 0, Value
);
88 /* NULL-terminate the string */
89 Value
[cbData
/ sizeof(WCHAR
)] = '\0';
107 return ERROR_INVALID_PARAMETER
;
109 cbData
= sizeof(DWORD
);
110 rc
= RegQueryValueExW(hKey
, pszValue
, NULL
, &dwType
, (LPBYTE
)&dwValue
, &cbData
);
111 if (rc
== ERROR_SUCCESS
&& dwType
== REG_DWORD
)
114 return ERROR_SUCCESS
;
120 HKEY ControlKey
= NULL
;
121 LPWSTR SystemStartOptions
= NULL
;
122 LPWSTR CurrentOption
, NextOption
; /* Pointers into SystemStartOptions */
123 BOOL ConsoleBoot
= FALSE
;
128 L
"SYSTEM\\CurrentControlSet\\Control",
133 rc
= ReadRegSzValue(ControlKey
, L
"SystemStartOptions", &SystemStartOptions
);
134 if (rc
!= ERROR_SUCCESS
)
137 /* Check for CONSOLE switch in SystemStartOptions */
138 CurrentOption
= SystemStartOptions
;
139 while (CurrentOption
)
141 NextOption
= wcschr(CurrentOption
, L
' ');
144 if (wcsicmp(CurrentOption
, L
"CONSOLE") == 0)
146 TRACE("Found %S. Switching to console boot\n", CurrentOption
);
150 CurrentOption
= NextOption
? NextOption
+ 1 : NULL
;
155 pGinaUI
= &GinaTextUI
;
157 pGinaUI
= &GinaGraphicalUI
;
159 if (ControlKey
!= NULL
)
160 RegCloseKey(ControlKey
);
161 HeapFree(GetProcessHeap(), 0, SystemStartOptions
);
167 GetRegistrySettings(PGINA_CONTEXT pgContext
)
170 LPWSTR lpAutoAdminLogon
= NULL
;
171 LPWSTR lpDontDisplayLastUserName
= NULL
;
172 LPWSTR lpShutdownWithoutLogon
= NULL
;
173 LPWSTR lpIgnoreShiftOverride
= NULL
;
174 DWORD dwDisableCAD
= 0;
178 rc
= RegOpenKeyExW(HKEY_LOCAL_MACHINE
,
179 L
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
183 if (rc
!= ERROR_SUCCESS
)
185 WARN("RegOpenKeyExW() failed with error %lu\n", rc
);
189 rc
= ReadRegSzValue(hKey
,
192 if (rc
== ERROR_SUCCESS
)
194 if (wcscmp(lpAutoAdminLogon
, L
"1") == 0)
195 pgContext
->bAutoAdminLogon
= TRUE
;
198 TRACE("bAutoAdminLogon: %s\n", pgContext
->bAutoAdminLogon
? "TRUE" : "FALSE");
200 rc
= ReadRegDwordValue(hKey
,
203 if (rc
== ERROR_SUCCESS
)
205 if (dwDisableCAD
!= 0)
206 pgContext
->bDisableCAD
= TRUE
;
209 TRACE("bDisableCAD: %s\n", pgContext
->bDisableCAD
? "TRUE" : "FALSE");
211 pgContext
->bShutdownWithoutLogon
= TRUE
;
212 rc
= ReadRegSzValue(hKey
,
213 L
"ShutdownWithoutLogon",
214 &lpShutdownWithoutLogon
);
215 if (rc
== ERROR_SUCCESS
)
217 if (wcscmp(lpShutdownWithoutLogon
, L
"0") == 0)
218 pgContext
->bShutdownWithoutLogon
= FALSE
;
221 rc
= ReadRegSzValue(hKey
,
222 L
"DontDisplayLastUserName",
223 &lpDontDisplayLastUserName
);
224 if (rc
== ERROR_SUCCESS
)
226 if (wcscmp(lpDontDisplayLastUserName
, L
"1") == 0)
227 pgContext
->bDontDisplayLastUserName
= TRUE
;
230 rc
= ReadRegSzValue(hKey
,
231 L
"IgnoreShiftOverride",
232 &lpIgnoreShiftOverride
);
233 if (rc
== ERROR_SUCCESS
)
235 if (wcscmp(lpIgnoreShiftOverride
, L
"1") == 0)
236 pgContext
->bIgnoreShiftOverride
= TRUE
;
239 dwSize
= sizeof(pgContext
->UserName
);
240 rc
= RegQueryValueExW(hKey
,
244 (LPBYTE
)&pgContext
->UserName
,
247 dwSize
= sizeof(pgContext
->Domain
);
248 rc
= RegQueryValueExW(hKey
,
252 (LPBYTE
)&pgContext
->Domain
,
255 dwSize
= sizeof(pgContext
->Password
);
256 rc
= RegQueryValueExW(hKey
,
260 (LPBYTE
)&pgContext
->Password
,
263 if (lpIgnoreShiftOverride
!= NULL
)
264 HeapFree(GetProcessHeap(), 0, lpIgnoreShiftOverride
);
266 if (lpShutdownWithoutLogon
!= NULL
)
267 HeapFree(GetProcessHeap(), 0, lpShutdownWithoutLogon
);
269 if (lpDontDisplayLastUserName
!= NULL
)
270 HeapFree(GetProcessHeap(), 0, lpDontDisplayLastUserName
);
272 if (lpAutoAdminLogon
!= NULL
)
273 HeapFree(GetProcessHeap(), 0, lpAutoAdminLogon
);
281 typedef DWORD (WINAPI
*pThemeWait
)(DWORD dwTimeout
);
282 typedef BOOL (WINAPI
*pThemeWatch
)(void);
285 InitThemeSupport(VOID
)
287 HMODULE hDll
= LoadLibraryW(L
"shsvcs.dll");
288 pThemeWait themeWait
;
289 pThemeWatch themeWatch
;
294 themeWait
= (pThemeWait
) GetProcAddress(hDll
, (LPCSTR
)2);
295 themeWatch
= (pThemeWatch
) GetProcAddress(hDll
, (LPCSTR
)1);
297 if(themeWait
&& themeWatch
)
312 PVOID pWinlogonFunctions
,
315 PGINA_CONTEXT pgContext
;
317 UNREFERENCED_PARAMETER(pvReserved
);
321 pgContext
= (PGINA_CONTEXT
)LocalAlloc(LMEM_FIXED
| LMEM_ZEROINIT
, sizeof(GINA_CONTEXT
));
324 WARN("LocalAlloc() failed\n");
328 if (!GetRegistrySettings(pgContext
))
330 WARN("GetRegistrySettings() failed\n");
331 LocalFree(pgContext
);
335 /* Return the context to winlogon */
336 *pWlxContext
= (PVOID
)pgContext
;
337 pgContext
->hDllInstance
= hDllInstance
;
339 /* Save pointer to dispatch table */
340 pgContext
->pWlxFuncs
= (PWLX_DISPATCH_VERSION_1_3
)pWinlogonFunctions
;
342 /* Save the winlogon handle used to call the dispatch functions */
343 pgContext
->hWlx
= hWlx
;
345 /* Save window station */
346 pgContext
->station
= lpWinsta
;
348 /* Clear status window handle */
349 pgContext
->hStatusWindow
= NULL
;
351 /* Notify winlogon that we will use the default SAS */
352 pgContext
->pWlxFuncs
->WlxUseCtrlAltDel(hWlx
);
354 /* Locates the authentication package */
355 //LsaRegisterLogonProcess(...);
357 pgContext
->nShutdownAction
= WLX_SAS_ACTION_SHUTDOWN_POWER_OFF
;
360 return pGinaUI
->Initialize(pgContext
);
368 WlxScreenSaverNotify(
373 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
375 HKEY hKeyCurrentUser
, hKey
;
376 DWORD bufferSize
= sizeof(szBuffer
);
377 DWORD varType
= REG_SZ
;
380 TRACE("(%p %p)\n", pWlxContext
, pSecure
);
386 * HKLM\Software\Policies\Microsoft\Windows\Control Panel\Desktop : ScreenSaverIsSecure
388 * HKCU\Control Panel\Desktop : ScreenSaverIsSecure
391 if (!ImpersonateLoggedOnUser(pgContext
->UserToken
))
393 ERR("WL: ImpersonateLoggedOnUser() failed with error %lu\n", GetLastError());
398 /* Open the current user HKCU key */
399 rc
= RegOpenCurrentUser(MAXIMUM_ALLOWED
, &hKeyCurrentUser
);
400 TRACE("RegOpenCurrentUser: %ld\n", rc
);
401 if (rc
== ERROR_SUCCESS
)
403 /* Open the subkey */
404 rc
= RegOpenKeyExW(hKeyCurrentUser
,
405 L
"Control Panel\\Desktop",
409 TRACE("RegOpenKeyExW: %ld\n", rc
);
410 RegCloseKey(hKeyCurrentUser
);
414 if (rc
== ERROR_SUCCESS
)
416 rc
= RegQueryValueExW(hKey
,
417 L
"ScreenSaverIsSecure",
423 TRACE("RegQueryValueExW: %ld\n", rc
);
425 if (rc
== ERROR_SUCCESS
)
427 TRACE("szBuffer: \"%S\"\n", szBuffer
);
428 *pSecure
= _wtoi(szBuffer
);
434 /* Revert the impersonation */
437 TRACE("*pSecure: %ld\n", *pSecure
);
451 PWSTR pszDesktopName
,
455 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
456 STARTUPINFOW StartupInfo
;
457 PROCESS_INFORMATION ProcessInformation
;
458 WCHAR CurrentDirectory
[MAX_PATH
];
463 len
= GetWindowsDirectoryW(CurrentDirectory
, MAX_PATH
);
464 if (len
== 0 || len
> MAX_PATH
)
466 ERR("GetWindowsDirectoryW() failed\n");
470 ret
= DuplicateTokenEx(pgContext
->UserToken
, MAXIMUM_ALLOWED
, NULL
, SecurityImpersonation
, TokenPrimary
, &hAppToken
);
473 ERR("DuplicateTokenEx() failed with error %lu\n", GetLastError());
477 ZeroMemory(&StartupInfo
, sizeof(StartupInfo
));
478 ZeroMemory(&ProcessInformation
, sizeof(ProcessInformation
));
479 StartupInfo
.cb
= sizeof(StartupInfo
);
480 StartupInfo
.lpTitle
= pszCmdLine
;
481 StartupInfo
.dwFlags
= STARTF_USESHOWWINDOW
;
482 StartupInfo
.wShowWindow
= SW_SHOW
;
483 StartupInfo
.lpDesktop
= pszDesktopName
;
485 len
= GetWindowsDirectoryW(CurrentDirectory
, MAX_PATH
);
486 if (len
== 0 || len
> MAX_PATH
)
488 ERR("GetWindowsDirectoryW() failed\n");
491 ret
= CreateProcessAsUserW(
498 CREATE_UNICODE_ENVIRONMENT
,
502 &ProcessInformation
);
503 CloseHandle(ProcessInformation
.hProcess
);
504 CloseHandle(ProcessInformation
.hThread
);
505 CloseHandle(hAppToken
);
507 ERR("CreateProcessAsUserW() failed with error %lu\n", GetLastError());
515 WlxActivateUserShell(
517 PWSTR pszDesktopName
,
518 PWSTR pszMprLogonScript
,
522 DWORD BufSize
, ValueType
;
523 WCHAR pszUserInitApp
[MAX_PATH
+ 1];
524 WCHAR pszExpUserInitApp
[MAX_PATH
];
528 TRACE("WlxActivateUserShell()\n");
530 UNREFERENCED_PARAMETER(pszMprLogonScript
);
532 /* Get the path of userinit */
535 L
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
539 if (rc
!= ERROR_SUCCESS
)
541 WARN("RegOpenKeyExW() failed with error %lu\n", rc
);
545 /* Query userinit application */
546 BufSize
= sizeof(pszUserInitApp
) - sizeof(UNICODE_NULL
);
547 rc
= RegQueryValueExW(
552 (LPBYTE
)pszUserInitApp
,
555 if (rc
!= ERROR_SUCCESS
|| (ValueType
!= REG_SZ
&& ValueType
!= REG_EXPAND_SZ
))
557 WARN("RegQueryValueExW() failed with error %lu\n", rc
);
560 pszUserInitApp
[MAX_PATH
] = UNICODE_NULL
;
562 len
= ExpandEnvironmentStringsW(pszUserInitApp
, pszExpUserInitApp
, MAX_PATH
);
565 WARN("ExpandEnvironmentStringsW() failed. Required size %lu\n", len
);
569 /* Start userinit app */
570 return WlxStartApplication(pWlxContext
, pszDesktopName
, pEnvironment
, pszExpUserInitApp
);
582 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
583 INT SasAction
= WLX_SAS_ACTION_NONE
;
585 TRACE("WlxLoggedOnSAS(0x%lx)\n", dwSasType
);
587 UNREFERENCED_PARAMETER(pReserved
);
591 case WLX_SAS_TYPE_CTRL_ALT_DEL
:
592 case WLX_SAS_TYPE_TIMEOUT
:
594 SasAction
= pGinaUI
->LoggedOnSAS(pgContext
, dwSasType
);
597 case WLX_SAS_TYPE_SC_INSERT
:
599 FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_INSERT not supported!\n");
602 case WLX_SAS_TYPE_SC_REMOVE
:
604 FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_REMOVE not supported!\n");
609 WARN("WlxLoggedOnSAS: Unknown SasType: 0x%x\n", dwSasType
);
621 WlxDisplayStatusMessage(
622 IN PVOID pWlxContext
,
628 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
630 TRACE("WlxDisplayStatusMessage(\"%S\")\n", pMessage
);
632 return pGinaUI
->DisplayStatusMessage(pgContext
, hDesktop
, dwOptions
, pTitle
, pMessage
);
639 WlxRemoveStatusMessage(
640 IN PVOID pWlxContext
)
642 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
644 TRACE("WlxRemoveStatusMessage()\n");
646 return pGinaUI
->RemoveStatusMessage(pgContext
);
650 DuplicationString(PWSTR Str
)
655 if (Str
== NULL
) return NULL
;
657 cb
= (wcslen(Str
) + 1) * sizeof(WCHAR
);
658 if ((NewStr
= LocalAlloc(LMEM_FIXED
, cb
)))
659 memcpy(NewStr
, Str
, cb
);
666 IN PGINA_CONTEXT pgContext
,
671 HANDLE hToken
= NULL
;
672 PTOKEN_GROUPS Groups
= NULL
;
673 BOOL bIsAdmin
= FALSE
;
677 NTSTATUS SubStatus
= STATUS_SUCCESS
;
679 TRACE("(%S %S %S)\n", UserName
, Domain
, Password
);
681 Status
= ConnectToLsa(pgContext
);
682 if (!NT_SUCCESS(Status
))
684 WARN("ConnectToLsa() failed\n");
688 Status
= MyLogonUser(pgContext
->LsaHandle
,
689 pgContext
->AuthenticationPackage
,
693 &pgContext
->UserToken
,
695 if (!NT_SUCCESS(Status
))
697 WARN("MyLogonUser() failed\n");
701 Status
= NtQueryInformationToken(hToken
,
706 if ((Status
!= STATUS_SUCCESS
) && (Status
!= STATUS_BUFFER_TOO_SMALL
))
708 TRACE("NtQueryInformationToken() failed (Status 0x%08lx)\n", Status
);
712 Groups
= HeapAlloc(GetProcessHeap(), 0, Size
);
715 TRACE("HeapAlloc() failed\n");
719 Status
= NtQueryInformationToken(hToken
,
724 if (!NT_SUCCESS(Status
))
726 TRACE("NtQueryInformationToken() failed (Status 0x%08lx)\n", Status
);
730 for (i
= 0; i
< Groups
->GroupCount
; i
++)
732 if (RtlEqualSid(Groups
->Groups
[i
].Sid
, AdminSid
))
734 TRACE("Member of Admins group\n");
742 HeapFree(GetProcessHeap(), 0, Groups
);
753 IN OUT PGINA_CONTEXT pgContext
,
757 OUT PNTSTATUS SubStatus
)
761 Status
= ConnectToLsa(pgContext
);
762 if (!NT_SUCCESS(Status
))
764 WARN("ConnectToLsa() failed (Status 0x%08lx)\n", Status
);
768 Status
= MyLogonUser(pgContext
->LsaHandle
,
769 pgContext
->AuthenticationPackage
,
773 &pgContext
->UserToken
,
775 if (!NT_SUCCESS(Status
))
777 WARN("MyLogonUser() failed (Status 0x%08lx)\n", Status
);
786 IN OUT PGINA_CONTEXT pgContext
,
791 LPWSTR ProfilePath
= NULL
;
792 LPWSTR lpEnvironment
= NULL
;
793 TOKEN_STATISTICS Stats
;
794 PWLX_PROFILE_V2_0 pProfile
= NULL
;
795 DWORD cbStats
, cbSize
;
799 /* Store the logon time in the context */
800 GetLocalTime(&pgContext
->LogonTime
);
802 /* Store user and domain in the context */
803 wcscpy(pgContext
->UserName
, UserName
);
804 if (Domain
== NULL
|| wcslen(Domain
) == 0)
806 dwLength
= _countof(pgContext
->Domain
);
807 GetComputerNameW(pgContext
->Domain
, &dwLength
);
811 wcscpy(pgContext
->Domain
, Domain
);
814 /* Get profile path */
816 bResult
= GetProfilesDirectoryW(NULL
, &cbSize
);
817 if (!bResult
&& GetLastError() == ERROR_INSUFFICIENT_BUFFER
)
819 ProfilePath
= HeapAlloc(GetProcessHeap(), 0, cbSize
* sizeof(WCHAR
));
822 WARN("HeapAlloc() failed\n");
825 bResult
= GetProfilesDirectoryW(ProfilePath
, &cbSize
);
829 WARN("GetUserProfileDirectoryW() failed\n");
833 /* Allocate memory for profile */
834 pProfile
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(WLX_PROFILE_V2_0
));
837 WARN("HeapAlloc() failed\n");
840 pProfile
->dwType
= WLX_PROFILE_TYPE_V2_0
;
841 pProfile
->pszProfile
= ProfilePath
;
843 cbSize
= sizeof(L
"LOGONSERVER=\\\\") +
844 wcslen(pgContext
->Domain
) * sizeof(WCHAR
) +
845 sizeof(UNICODE_NULL
);
846 lpEnvironment
= HeapAlloc(GetProcessHeap(), 0, cbSize
);
849 WARN("HeapAlloc() failed\n");
853 StringCbPrintfW(lpEnvironment
, cbSize
, L
"LOGONSERVER=\\\\%ls", pgContext
->Domain
);
854 ASSERT(wcslen(lpEnvironment
) == cbSize
/ sizeof(WCHAR
) - 2);
855 lpEnvironment
[cbSize
/ sizeof(WCHAR
) - 1] = UNICODE_NULL
;
857 pProfile
->pszEnvironment
= lpEnvironment
;
859 if (!GetTokenInformation(pgContext
->UserToken
,
865 WARN("Couldn't get Authentication id from user token!\n");
869 *pgContext
->pAuthenticationId
= Stats
.AuthenticationId
;
870 pgContext
->pMprNotifyInfo
->pszUserName
= DuplicationString(UserName
);
871 pgContext
->pMprNotifyInfo
->pszDomain
= DuplicationString(Domain
);
872 pgContext
->pMprNotifyInfo
->pszPassword
= DuplicationString(Password
);
873 pgContext
->pMprNotifyInfo
->pszOldPassword
= NULL
;
874 *pgContext
->pdwOptions
= 0;
875 *pgContext
->pProfile
= pProfile
;
881 HeapFree(GetProcessHeap(), 0, pProfile
->pszEnvironment
);
883 HeapFree(GetProcessHeap(), 0, pProfile
);
884 HeapFree(GetProcessHeap(), 0, ProfilePath
);
894 IN PVOID pWlxContext
)
896 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
898 TRACE("WlxDisplaySASNotice(%p)\n", pWlxContext
);
900 if (GetSystemMetrics(SM_REMOTESESSION
))
902 /* User is remotely logged on. Don't display a notice */
903 pgContext
->pWlxFuncs
->WlxSasNotify(pgContext
->hWlx
, WLX_SAS_TYPE_CTRL_ALT_DEL
);
907 if (pgContext
->bAutoAdminLogon
)
909 if (pgContext
->bIgnoreShiftOverride
||
910 (GetKeyState(VK_SHIFT
) >= 0))
912 /* Don't display the window, we want to do an automatic logon */
913 pgContext
->pWlxFuncs
->WlxSasNotify(pgContext
->hWlx
, WLX_SAS_TYPE_CTRL_ALT_DEL
);
917 pgContext
->bAutoAdminLogon
= FALSE
;
920 if (pgContext
->bDisableCAD
)
922 pgContext
->pWlxFuncs
->WlxSasNotify(pgContext
->hWlx
, WLX_SAS_TYPE_CTRL_ALT_DEL
);
926 pGinaUI
->DisplaySASNotice(pgContext
);
928 TRACE("WlxDisplaySASNotice() done\n");
936 IN PVOID pWlxContext
,
938 OUT PLUID pAuthenticationId
,
939 IN OUT PSID pLogonSid
,
940 OUT PDWORD pdwOptions
,
942 OUT PWLX_MPR_NOTIFY_INFO pMprNotifyInfo
,
945 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
948 TRACE("WlxLoggedOutSAS()\n");
950 UNREFERENCED_PARAMETER(dwSasType
);
951 UNREFERENCED_PARAMETER(pLogonSid
);
953 pgContext
->pAuthenticationId
= pAuthenticationId
;
954 pgContext
->pdwOptions
= pdwOptions
;
955 pgContext
->pMprNotifyInfo
= pMprNotifyInfo
;
956 pgContext
->pProfile
= pProfile
;
959 res
= pGinaUI
->LoggedOutSAS(pgContext
);
960 *phToken
= pgContext
->UserToken
;
972 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
974 TRACE("WlxWkstaLockedSAS()\n");
976 UNREFERENCED_PARAMETER(dwSasType
);
978 return pGinaUI
->LockedSAS(pgContext
);
987 WlxDisplayLockedNotice(PVOID pWlxContext
)
989 PGINA_CONTEXT pgContext
= (PGINA_CONTEXT
)pWlxContext
;
991 TRACE("WlxDisplayLockedNotice()\n");
993 if (pgContext
->bDisableCAD
)
995 pgContext
->pWlxFuncs
->WlxSasNotify(pgContext
->hWlx
, WLX_SAS_TYPE_CTRL_ALT_DEL
);
999 pGinaUI
->DisplayLockedNotice(pgContext
);
1010 TRACE("WlxIsLogoffOk()\n");
1011 UNREFERENCED_PARAMETER(pWlxContext
);
1017 IN HINSTANCE hinstDLL
,
1019 IN LPVOID lpvReserved
)
1021 UNREFERENCED_PARAMETER(lpvReserved
);
1023 if (dwReason
== DLL_PROCESS_ATTACH
)
1025 hDllInstance
= hinstDLL
;
1027 RtlAllocateAndInitializeSid(&SystemAuthority
,
1029 SECURITY_BUILTIN_DOMAIN_RID
,
1030 DOMAIN_ALIAS_RID_ADMINS
,
1040 else if (dwReason
== DLL_PROCESS_DETACH
)
1042 if (AdminSid
!= NULL
)
1043 RtlFreeSid(AdminSid
);