30 LPCWSTR ServiceString =
L"services.exe";
35 StartupInfo.
cb =
sizeof(StartupInfo);
43 TRACE(
"WL: Creating new process - %S\n", ServiceString);
61 TRACE(
"WL: Created new process - %S\n", ServiceString);
66 TRACE(
"WL: StartServicesManager() done.\n");
78 LPCWSTR ServiceString =
L"lsass.exe";
83 StartupInfo.
cb =
sizeof(StartupInfo);
91 TRACE(
"WL: Creating new process - %S\n", ServiceString);
102 &ProcessInformation);
104 TRACE(
"WL: Created new process - %S\n", ServiceString);
123 L"LSA_RPC_SERVER_ACTIVE");
127 TRACE(
"WL: Failed to create the notification event (Error %lu)\n", dwError);
133 L"LSA_RPC_SERVER_ACTIVE");
136 ERR(
"WL: Could not open the notification event (Error %lu)\n",
GetLastError());
142 TRACE(
"WL: Wait for the LSA server!\n");
144 TRACE(
"WL: LSA server running!\n");
158 WCHAR szBuffer[128] =
L"";
161 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
167 ERR(
"WL: RegOpenKeyExW(\"HKLM\\System\\CurrentControlSet\\Services\\Tcpip\\Parameters\") failed (error %lu)\n", lError);
175 pszBuffer = szBuffer;
198 ERR(
"WL: Could not reallocate memory for pszBuffer\n");
203 TRACE(
"NV Hostname is '%S'.\n", pszBuffer);
212 ERR(
"WL: RegSetValueExW(\"Hostname\") failed (error %lu)\n", lError);
230 if (pszBuffer != szBuffer)
236 pszBuffer = pszNewBuffer;
259 ERR(
"WL: Could not reallocate memory for pszBuffer\n");
264 TRACE(
"NV Domain is '%S'.\n", pszBuffer);
273 ERR(
"WL: RegSetValueExW(\"Domain\") failed (error %lu)\n", lError);
276 if (pszBuffer != szBuffer)
287 WCHAR wszKeyName[12], wszKLID[10];
309 ERR(
"Wrong type: %ws!\n", wszKLID);
321 ERR(
"LoadKeyboardLayoutW(%ws) failed!\n", wszKLID);
335 WARN(
"RegOpenKeyExW(Keyboard Layout\\Preload) failed!\n");
359 if (Session->SuppressStatus)
365 return Session->Gina.Functions.WlxDisplayStatusMessage(Session->Gina.Context, hDesktop, 0,
NULL, StatusMsg);
376 return Session->Gina.Functions.WlxRemoveStatusMessage(Session->Gina.Context);
445 ULONG HardErrorResponse;
463 ERR(
"WL: Could not register logon process\n");
471 ERR(
"WL: Could not allocate memory for winlogon instance\n");
484 ERR(
"WL: Could not create window station and desktops\n");
494 ERR(
"WL: Could not preload keyboard layouts\n");
501 ERR(
"WL: Could not start the RPC server\n");
508 ERR(
"WL: Could not start services.exe\n");
515 ERR(
"WL: Failed to start lsass.exe service (error %lu)\n",
GetLastError());
529 ERR(
"WL: Failed to initialize Gina\n");
578 ERR(
"WL: Failed to initialize SAS\n");
593 TRACE(
"WL: Setup mode detected\n");
DWORD StartRpcServer(VOID)
BOOL InitNotifications(VOID)
VOID CallNotificationDlls(PWLSESSION pSession, NOTIFICATION_TYPE Type)
VOID CleanupNotifications(VOID)
#define IDD_GINALOADFAILED
#define IDC_GINALOADFAILED
#define IDS_REACTOSISSTARTINGUP
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
#define NT_SUCCESS(StatCode)
ULONG AuthenticationPackage
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
ULONG WINAPI LsaNtStatusToWinError(IN NTSTATUS Status)
#define HeapFree(x, y, z)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
VOID WINAPI ExitProcess(IN UINT uExitCode)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
#define ERROR_ALREADY_EXISTS
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define CM_BOOT_FLAG_ACCEPTED
NTSYSAPI NTSTATUS __cdecl RtlSetThreadIsCritical(_In_ BOOLEAN NewValue, _Out_opt_ PBOOLEAN OldValue, _In_ BOOLEAN NeedBreaks)
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
NTSYSAPI NTSTATUS __cdecl RtlSetProcessIsCritical(_In_ BOOLEAN NewValue, _Out_opt_ PBOOLEAN OldValue, _In_ BOOLEAN NeedBreaks)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtInitializeRegistry(IN USHORT Flag)
#define UNREFERENCED_PARAMETER(P)
#define MICROSOFT_KERBEROS_NAME_W
NTSTATUS NTAPI LsaLookupAuthenticationPackage(HANDLE, PLSA_STRING, PULONG)
ULONG LSA_OPERATIONAL_MODE
NTSTATUS NTAPI LsaDeregisterLogonProcess(HANDLE)
NTSTATUS NTAPI LsaRegisterLogonProcess(PLSA_STRING, PHANDLE, PLSA_OPERATIONAL_MODE)
#define STATUS_PORT_CONNECTION_REFUSED
#define STATUS_SYSTEM_PROCESS_TERMINATED
NTSTATUS HandleShutdown(IN OUT PWLSESSION Session, IN DWORD wlxAction)
BOOL InitializeSAS(IN OUT PWLSESSION Session)
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentProcessId(void)
BOOL DisplayStatusMessage(IN PWLSESSION Session, IN HDESK hDesktop, IN UINT ResourceId)
static BOOL InitKeyboardLayouts(VOID)
static BOOL StartLsass(VOID)
static INT_PTR CALLBACK GinaLoadFailedWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static BOOL StartServicesManager(VOID)
int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd)
static VOID UpdateTcpIpInformation(VOID)
BOOL RemoveStatusMessage(IN PWLSESSION Session)
static VOID WaitForLsass(VOID)
#define LockWorkstation(Session)
BOOL GinaInit(IN OUT PWLSESSION Session)
struct _WLSESSION * PWLSESSION
VOID InitDialogListHead(VOID)
struct _WLSESSION WLSESSION
BOOL CreateWindowStationAndDesktops(_Inout_ PWLSESSION Session)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define KLF_SETFORPROCESS
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HWND WINAPI GetDesktopWindow(void)
HWND WINAPI SetFocus(_In_opt_ HWND)
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
BOOL WINAPI RegisterLogonProcess(DWORD, BOOL)
#define KLF_SUBSTITUTE_OK
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define WLX_SAS_TYPE_CTRL_ALT_DEL
#define WLX_SAS_ACTION_SHUTDOWN_REBOOT
_Must_inspect_result_ _In_ ULONG Flags