1 #ifndef _MSGINA_H 2 #define _MSGINA_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <stdarg.h> 9 #include <stdlib.h> 10 #include <tchar.h> 11 12 #define WIN32_NO_STATUS 13 #define _INC_WINDOWS 14 #define COM_NO_WINDOWS_H 15 16 #include <windef.h> 17 #include <winbase.h> 18 #include <winreg.h> 19 #include <winuser.h> 20 #include <winwlx.h> 21 #include <ndk/rtlfuncs.h> 22 #include <ntsecapi.h> 23 24 #include <strsafe.h> 25 26 #include <wine/debug.h> 27 WINE_DEFAULT_DEBUG_CHANNEL(msgina); 28 29 #include "resource.h" 30 31 32 typedef struct 33 { 34 HANDLE hWlx; 35 LPWSTR station; 36 PWLX_DISPATCH_VERSION_1_3 pWlxFuncs; 37 HANDLE hDllInstance; 38 HWND hStatusWindow; 39 HANDLE LsaHandle; 40 ULONG AuthenticationPackage; 41 BOOL bDisableCAD; 42 BOOL bAutoAdminLogon; 43 BOOL bDontDisplayLastUserName; 44 BOOL bShutdownWithoutLogon; 45 BOOL bIgnoreShiftOverride; 46 47 ULONG nShutdownAction; 48 49 /* Information to be filled during logon */ 50 WCHAR UserName[256]; 51 WCHAR DomainName[256]; 52 WCHAR Password[256]; 53 SYSTEMTIME LogonTime; 54 HANDLE UserToken; 55 PLUID pAuthenticationId; 56 PDWORD pdwOptions; 57 PWLX_MPR_NOTIFY_INFO pMprNotifyInfo; 58 PVOID *pProfile; 59 } GINA_CONTEXT, *PGINA_CONTEXT; 60 61 extern HINSTANCE hDllInstance; 62 63 typedef BOOL (*PFGINA_INITIALIZE)(PGINA_CONTEXT); 64 typedef BOOL (*PFGINA_DISPLAYSTATUSMESSAGE)(PGINA_CONTEXT, HDESK, DWORD, PWSTR, PWSTR); 65 typedef BOOL (*PFGINA_REMOVESTATUSMESSAGE)(PGINA_CONTEXT); 66 typedef VOID (*PFGINA_DISPLAYSASNOTICE)(PGINA_CONTEXT); 67 typedef INT (*PFGINA_LOGGEDONSAS)(PGINA_CONTEXT, DWORD); 68 typedef INT (*PFGINA_LOGGEDOUTSAS)(PGINA_CONTEXT); 69 typedef INT (*PFGINA_LOCKEDSAS)(PGINA_CONTEXT); 70 typedef VOID (*PFGINA_DISPLAYLOCKEDNOTICE)(PGINA_CONTEXT); 71 72 typedef struct _GINA_UI 73 { 74 PFGINA_INITIALIZE Initialize; 75 PFGINA_DISPLAYSTATUSMESSAGE DisplayStatusMessage; 76 PFGINA_REMOVESTATUSMESSAGE RemoveStatusMessage; 77 PFGINA_DISPLAYSASNOTICE DisplaySASNotice; 78 PFGINA_LOGGEDONSAS LoggedOnSAS; 79 PFGINA_LOGGEDOUTSAS LoggedOutSAS; 80 PFGINA_LOCKEDSAS LockedSAS; 81 PFGINA_DISPLAYLOCKEDNOTICE DisplayLockedNotice; 82 } GINA_UI, *PGINA_UI; 83 84 /* lsa.c */ 85 86 NTSTATUS 87 ConnectToLsa( 88 PGINA_CONTEXT pgContext); 89 90 NTSTATUS 91 MyLogonUser( 92 HANDLE LsaHandle, 93 ULONG AuthenticationPackage, 94 LPWSTR lpszUsername, 95 LPWSTR lpszDomain, 96 LPWSTR lpszPassword, 97 PHANDLE phToken, 98 PNTSTATUS SubStatus); 99 100 /* msgina.c */ 101 102 LONG 103 ReadRegSzValue( 104 IN HKEY hKey, 105 IN LPCWSTR pszValue, 106 OUT LPWSTR *pValue); 107 108 BOOL 109 DoAdminUnlock( 110 IN PGINA_CONTEXT pgContext, 111 IN PWSTR UserName, 112 IN PWSTR Domain, 113 IN PWSTR Password); 114 115 NTSTATUS 116 DoLoginTasks( 117 IN OUT PGINA_CONTEXT pgContext, 118 IN PWSTR UserName, 119 IN PWSTR Domain, 120 IN PWSTR Password, 121 OUT PNTSTATUS SubStatus); 122 123 BOOL 124 CreateProfile( 125 IN OUT PGINA_CONTEXT pgContext, 126 IN PWSTR UserName, 127 IN PWSTR Domain, 128 IN PWSTR Password); 129 130 /* shutdown.c */ 131 132 DWORD 133 GetDefaultShutdownSelState(VOID); 134 135 DWORD 136 LoadShutdownSelState(VOID); 137 138 VOID 139 SaveShutdownSelState(DWORD ShutdownCode); 140 141 DWORD 142 GetDefaultShutdownOptions(VOID); 143 144 DWORD 145 GetAllowedShutdownOptions(VOID); 146 147 INT_PTR 148 ShutdownDialog( 149 IN HWND hwndDlg, 150 IN DWORD ShutdownOptions, 151 IN PGINA_CONTEXT pgContext); 152 153 154 #ifdef __cplusplus 155 } // extern "C" 156 #endif 157 158 #endif /* _MSGINA_H */ 159