Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
15 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: MSGinaExports.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Private exported functions (by ordinal) from msgina for personal SKU
  7. // functionality.
  8. //
  9. // History: 2000-02-04 vtan created
  10. // 2000-02-28 vtan added ShellIsFriendlyUIActive
  11. // 2000-02-29 vtan added ShellIsSingleUserNoPassword
  12. // 2000-03-02 vtan added ShellIsMultipleUsersEnabled
  13. // 2000-04-27 vtan added ShellTurnOffDialog
  14. // 2000-04-27 vtan added ShellACPIPowerButtonPressed
  15. // 2000-05-03 vtan added ShellStatusHostBegin
  16. // 2000-05-03 vtan added ShellStatusHostEnd
  17. // 2000-05-04 vtan added ShellSwitchWhenInteractiveReady
  18. // 2000-05-18 vtan added ShellDimScreen
  19. // 2000-06-02 vtan added ShellInstallAccountFilterData
  20. // 2000-07-14 vtan added ShellStatusHostShuttingDown
  21. // 2000-07-27 vtan added ShellIsSuspendAllowed
  22. // 2000-07-31 vtan added ShellEnableMultipleUsers
  23. // 2000-07-31 vtan added ShellEnableRemoteConnections
  24. // 2000-08-01 vtan added ShellEnableFriendlyUI
  25. // 2000-08-01 vtan added ShellIsRemoteConnectionsEnabled
  26. // 2000-08-03 vtan added ShellSwitchUser
  27. // 2000-08-09 vtan added ShellNotifyThemeUserChange
  28. // 2000-08-14 vtan added ShellIsUserInteractiveLogonAllowed
  29. // 2000-08-15 vtan moved to internally published header
  30. // 2000-10-13 vtan added ShellStartThemeServer
  31. // 2000-10-17 vtan added ShellStopThemeServer
  32. // 2000-11-30 vtan removed ShellStartThemeServer
  33. // 2000-11-30 vtan removed ShellStopThemeServer
  34. // 2001-01-11 vtan added stub functions for imp library
  35. // 2001-01-11 vtan added ShellReturnToWelcome
  36. // 2001-01-31 vtan added ShellStatusHostPowerEvent
  37. // 2001-04-03 vtan added ShellStartCredentialServer
  38. // 2001-04-04 vtan added ShellAcquireLogonMutex
  39. // 2001-04-04 vtan added ShellReleaseLogonMutex
  40. // 2001-04-06 vtan added ShellSignalShutdown
  41. // 2001-04-12 vtan added ShellStatusHostHide
  42. // 2001-04-12 vtan added ShellStatusHostShow
  43. // --------------------------------------------------------------------------
  44. #ifndef _MSGinaExports_
  45. #define _MSGinaExports_
  46. #if !defined(_MSGINA_)
  47. #define MSGINAAPI DECLSPEC_IMPORT
  48. #define GINASTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  49. #define GINASTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  50. #else
  51. #define MSGINAAPI
  52. #define GINASTDAPI_(type) STDAPI_(type)
  53. #define GINASTDAPI STDAPI
  54. #endif
  55. #include <unknwn.h>
  56. typedef enum _USERLOGTYPE
  57. {
  58. ULT_LOGON, // User log on
  59. ULT_LOGOFF, // User log off
  60. ULT_TSRECONNECT, // Terminal server reconnect
  61. ULT_STARTSHELL, // About to start the Shell
  62. } USERLOGTYPE;
  63. typedef enum _SWITCHTYPE
  64. {
  65. SWITCHTYPE_CREATE, // Create the switch event and sync event
  66. SWITCHTYPE_REGISTER, // Check the switch event and register wait
  67. SWITCHTYPE_CANCEL, // Cancel the wait and clean up
  68. } SWITCHTYPE;
  69. #define SZ_INTERACTIVE_LOGON_MUTEX_NAME TEXT("Global\\msgina: InteractiveLogonMutex")
  70. #define SZ_INTERACTIVE_LOGON_REQUEST_MUTEX_NAME TEXT("Global\\msgina: InteractiveLogonRequestMutex")
  71. #define SZ_INTERACTIVE_LOGON_REPLY_EVENT_NAME TEXT("Global\\msgina: InteractiveLogonReplyEvent")
  72. #define SZ_SHUT_DOWN_EVENT_NAME TEXT("Global\\msgina: ShutdownEvent")
  73. #ifdef _MSGINA_
  74. // --------------------------------------------------------------------------
  75. // This section contains declarations in the DS component of msgina used by
  76. // the shell component of msgina.
  77. // --------------------------------------------------------------------------
  78. // These are GINA internal dialog return codes.
  79. #define MSGINA_DLG_FAILURE IDCANCEL
  80. #define MSGINA_DLG_SUCCESS IDOK
  81. #define MSGINA_DLG_INTERRUPTED 0x10000000
  82. // Our own return codes. These should *Not* conflict with the
  83. // GINA defined ones.
  84. #define MSGINA_DLG_LOCK_WORKSTATION 110
  85. #define MSGINA_DLG_INPUT_TIMEOUT 111
  86. #define MSGINA_DLG_SCREEN_SAVER_TIMEOUT 112
  87. #define MSGINA_DLG_USER_LOGOFF 113
  88. #define MSGINA_DLG_TASKLIST 114
  89. #define MSGINA_DLG_SHUTDOWN 115
  90. #define MSGINA_DLG_FORCE_LOGOFF 116
  91. #define MSGINA_DLG_DISCONNECT 117
  92. #define MSGINA_DLG_SWITCH_CONSOLE 118
  93. #define MSGINA_DLG_SWITCH_FAILURE 119
  94. #define MSGINA_DLG_SMARTCARD_INSERTED 120
  95. #define MSGINA_DLG_SMARTCARD_REMOVED 121
  96. // Additional flags that can be added to the
  97. // MSGINA_DLG_USER_LOGOFF return code.
  98. #define MSGINA_DLG_SHUTDOWN_FLAG 0x8000
  99. #define MSGINA_DLG_REBOOT_FLAG 0x4000
  100. #define MSGINA_DLG_SYSTEM_FLAG 0x2000 // System process was initiator
  101. #define MSGINA_DLG_POWEROFF_FLAG 0x1000 // Poweroff after shutdown
  102. #define MSGINA_DLG_SLEEP_FLAG 0x0800
  103. #define MSGINA_DLG_SLEEP2_FLAG 0x0400
  104. #define MSGINA_DLG_HIBERNATE_FLAG 0x0200
  105. #define MSGINA_DLG_FLAG_MASK (MSGINA_DLG_SHUTDOWN_FLAG | MSGINA_DLG_REBOOT_FLAG | MSGINA_DLG_SYSTEM_FLAG | MSGINA_DLG_POWEROFF_FLAG | MSGINA_DLG_SLEEP_FLAG | MSGINA_DLG_SLEEP2_FLAG | MSGINA_DLG_HIBERNATE_FLAG)
  106. // Define the input timeout delay for logon dialogs (seconds)
  107. #define LOGON_TIMEOUT 120
  108. // Define an external reference to the HINSTANCE of msgina.dll
  109. EXTERN_C HINSTANCE hDllInstance;
  110. // Functions used (must declare as C and be transparent in functionality).
  111. EXTERN_C void _Gina_SasNotify (void *pWlxContext, DWORD dwSASType);
  112. EXTERN_C BOOL _Gina_SetTimeout (void *pWlxContext, DWORD dwTimeout);
  113. EXTERN_C INT_PTR _Gina_DialogBoxParam (void *pWlxContext, HINSTANCE hInstance, LPCWSTR pszTemplate, HWND hwndParent, DLGPROC pfnDlgProc, LPARAM lParam);
  114. EXTERN_C INT_PTR _Gina_MessageBox (void *pWlxContext, HWND hwnd, LPCWSTR pszText, LPCWSTR pszCaption, UINT uiType);
  115. EXTERN_C int _Gina_SwitchDesktopToUser (void *pWlxContext);
  116. EXTERN_C INT_PTR _Gina_ShutdownDialog (void *pWlxContext, HWND hwndParent, DWORD dwExcludeItems);
  117. EXTERN_C HANDLE _Gina_GetUserToken (void *pWlxContext);
  118. EXTERN_C const WCHAR* _Gina_GetUsername (void *pWlxContext);
  119. EXTERN_C const WCHAR* _Gina_GetDomain (void *pWlxContext);
  120. EXTERN_C void _Gina_SetTextFields (HWND hwndDialog, const WCHAR *pwszUsername, const WCHAR *pwszDomain, const WCHAR *pwszPassword);
  121. EXTERN_C BOOL _Gina_SetPasswordFocus (HWND hwndDialog);
  122. // --------------------------------------------------------------------------
  123. // This section contains declarations in the shell component of msgina used
  124. // by the DS component of msgina.
  125. // --------------------------------------------------------------------------
  126. // These are return results from CW_LogonDialog_Init that inform the caller
  127. // whether auto logon with no password should be performed, whether the regular
  128. // Windows 2000 logon dialog should be displayed or whether the consumer windows
  129. // external UI host will handle the logon information gathering.
  130. #define SHELL_LOGONDIALOG_NONE 0
  131. #define SHELL_LOGONDIALOG_LOGON 1
  132. #define SHELL_LOGONDIALOG_EXTERNALHOST 2
  133. #define SHELL_LOGONDIALOG_LOGGEDOFF 0
  134. #define SHELL_LOGONDIALOG_RETURNTOWELCOME 1
  135. #define SHELL_LOGONDIALOG_RETURNTOWELCOME_UNLOCK 2
  136. #define SHELL_LOGONSTATUS_LOCK_MAGIC_NUMBER 48517
  137. // Functions used (must declare as C and be transparent in functionality).
  138. EXTERN_C NTSTATUS _Shell_DllMain (HINSTANCE hInstance, DWORD dwReason);
  139. EXTERN_C NTSTATUS _Shell_Initialize (void *pWlxContext);
  140. EXTERN_C NTSTATUS _Shell_Terminate (void);
  141. EXTERN_C NTSTATUS _Shell_Reconnect (void);
  142. EXTERN_C NTSTATUS _Shell_Disconnect (void);
  143. EXTERN_C NTSTATUS _Shell_LogonDialog_StaticInitialize (void);
  144. EXTERN_C NTSTATUS _Shell_LogonDialog_StaticTerminate (void);
  145. EXTERN_C int _Shell_LogonDialog_Init (HWND hwndDialog, int iDialogType);
  146. EXTERN_C void _Shell_LogonDialog_Destroy (void);
  147. EXTERN_C BOOL _Shell_LogonDialog_UIHostActive (void);
  148. EXTERN_C BOOL _Shell_LogonDialog_Cancel (void);
  149. EXTERN_C BOOL _Shell_LogonDialog_LogonDisplayError (NTSTATUS status, NTSTATUS subStatus);
  150. EXTERN_C void _Shell_LogonDialog_LogonCompleted (INT_PTR iDialogResult, const WCHAR *pszUsername, const WCHAR *pszDomain);
  151. EXTERN_C void _Shell_LogonDialog_ShuttingDown (void);
  152. EXTERN_C BOOL _Shell_LogonDialog_DlgProc (HWND hwndDialog, UINT uiMessage, WPARAM wParam, LPARAM lParam);
  153. EXTERN_C void _Shell_LogonDialog_ShowUIHost (void);
  154. EXTERN_C void _Shell_LogonDialog_HideUIHost (void);
  155. EXTERN_C NTSTATUS _Shell_LogonStatus_StaticInitialize (void);
  156. EXTERN_C NTSTATUS _Shell_LogonStatus_StaticTerminate (void);
  157. EXTERN_C void _Shell_LogonStatus_Init (UINT uiStartType);
  158. EXTERN_C void _Shell_LogonStatus_Destroy (UINT uiEndType);
  159. EXTERN_C BOOL _Shell_LogonStatus_Exists (void);
  160. EXTERN_C BOOL _Shell_LogonStatus_IsStatusWindow (HWND hwnd);
  161. EXTERN_C BOOL _Shell_LogonStatus_IsSuspendAllowed (void);
  162. EXTERN_C BOOL _Shell_LogonStatus_WaitForUIHost (void);
  163. EXTERN_C void _Shell_LogonStatus_ShowStatusMessage (const WCHAR *pszMessage);
  164. EXTERN_C void _Shell_LogonStatus_SetStateStatus (int iCode);
  165. EXTERN_C void _Shell_LogonStatus_SetStateLogon (int iCode);
  166. EXTERN_C void _Shell_LogonStatus_SetStateLoggedOn (void);
  167. EXTERN_C void _Shell_LogonStatus_SetStateEnd (void);
  168. EXTERN_C void _Shell_LogonStatus_NotifyWait (void);
  169. EXTERN_C void _Shell_LogonStatus_NotifyNoAnimations (void);
  170. EXTERN_C void _Shell_LogonStatus_SelectUser (const WCHAR *pszUsername, const WCHAR *pszDomain);
  171. EXTERN_C void _Shell_LogonStatus_InteractiveLogon (const WCHAR *pszUsername, const WCHAR *pszDomain, WCHAR *pszPassword);
  172. EXTERN_C void* _Shell_LogonStatus_GetUIHost (void);
  173. EXTERN_C HANDLE _Shell_LogonStatus_ResetReadyEvent (void);
  174. EXTERN_C void _Shell_LogonStatus_Show (void);
  175. EXTERN_C void _Shell_LogonStatus_Hide (void);
  176. EXTERN_C BOOL _Shell_LogonStatus_IsHidden (void);
  177. // These are functions that implement exports. Stubs are declared
  178. // in the DS depot to allow the import lib to built without dependency.
  179. EXTERN_C LONG _ShellGetUserList (BOOL fRemoveGuest, DWORD *pdwUserCount, void* *pUserList);
  180. EXTERN_C BOOL _ShellIsSingleUserNoPassword (WCHAR *pwszUsername, WCHAR *pwszDomain);
  181. EXTERN_C BOOL _ShellIsFriendlyUIActive (void);
  182. EXTERN_C BOOL _ShellIsMultipleUsersEnabled (void);
  183. EXTERN_C BOOL _ShellIsRemoteConnectionsEnabled (void);
  184. EXTERN_C BOOL _ShellEnableFriendlyUI (BOOL fEnable);
  185. EXTERN_C BOOL _ShellEnableMultipleUsers (BOOL fEnable);
  186. EXTERN_C BOOL _ShellEnableRemoteConnections (BOOL fEnable);
  187. EXTERN_C DWORD _ShellTurnOffDialog (HWND hwndParent);
  188. EXTERN_C int _ShellACPIPowerButtonPressed (void *pWlxContext, UINT uiEventType, BOOL fLocked);
  189. EXTERN_C BOOL _ShellIsSuspendAllowed (void);
  190. EXTERN_C void _ShellStatusHostBegin (UINT uiStartType);
  191. EXTERN_C void _ShellStatusHostEnd (UINT uiEndType);
  192. EXTERN_C void _ShellStatusHostShuttingDown (void);
  193. EXTERN_C void _ShellStatusHostPowerEvent (void);
  194. EXTERN_C BOOL _ShellSwitchWhenInteractiveReady (SWITCHTYPE eSwitchType, void *pWlxContext);
  195. EXTERN_C HRESULT _ShellDimScreen (IUnknown* *ppIUnknown, HWND* phwndDimmed);
  196. EXTERN_C void _ShellInstallAccountFilterData (void);
  197. EXTERN_C DWORD _ShellSwitchUser (BOOL fWait);
  198. EXTERN_C int _ShellIsUserInteractiveLogonAllowed (const WCHAR *pwszUsername);
  199. EXTERN_C void _ShellNotifyThemeUserChange (USERLOGTYPE eUserLogType, HANDLE hToken);
  200. EXTERN_C DWORD _ShellReturnToWelcome (BOOL fUnlock);
  201. EXTERN_C DWORD _ShellStartCredentialServer (const WCHAR *pwszUsername, const WCHAR *pwszDomain, WCHAR *pwszPassword, DWORD dwTimeout);
  202. EXTERN_C void _ShellAcquireLogonMutex (void);
  203. EXTERN_C void _ShellReleaseLogonMutex (BOOL fSignalEvent);
  204. EXTERN_C void _ShellSignalShutdown (void);
  205. EXTERN_C void _ShellStatusHostHide (void);
  206. EXTERN_C void _ShellStatusHostShow (void);
  207. #endif /* _MSGINA_ */
  208. // --------------------------------------------------------------------------
  209. // This section contains functions exported by ordinal from the shell
  210. // component of msgina.
  211. // --------------------------------------------------------------------------
  212. GINASTDAPI_(LONG) ShellGetUserList (BOOL fRemoveGuest, DWORD *pdwUserCount, void* *pUserList);
  213. GINASTDAPI_(BOOL) ShellIsSingleUserNoPassword (WCHAR *pwszUsername, WCHAR *pwszDomain);
  214. GINASTDAPI_(BOOL) ShellIsFriendlyUIActive (void);
  215. GINASTDAPI_(BOOL) ShellIsMultipleUsersEnabled (void);
  216. GINASTDAPI_(BOOL) ShellIsRemoteConnectionsEnabled (void);
  217. GINASTDAPI_(BOOL) ShellEnableFriendlyUI (BOOL fEnable);
  218. GINASTDAPI_(BOOL) ShellEnableMultipleUsers (BOOL fEnable);
  219. GINASTDAPI_(BOOL) ShellEnableRemoteConnections (BOOL fEnable);
  220. GINASTDAPI_(DWORD) ShellTurnOffDialog (HWND hwndParent);
  221. GINASTDAPI_(int) ShellACPIPowerButtonPressed (void *pWlxContext, UINT uiEventType, BOOL fLocked);
  222. GINASTDAPI_(BOOL) ShellIsSuspendAllowed (void);
  223. GINASTDAPI_(void) ShellStatusHostBegin (UINT uiStartType);
  224. GINASTDAPI_(void) ShellStatusHostEnd (UINT uiEndType);
  225. GINASTDAPI_(void) ShellStatusHostShuttingDown (void);
  226. GINASTDAPI_(void) ShellStatusHostPowerEvent (void);
  227. GINASTDAPI_(BOOL) ShellSwitchWhenInteractiveReady (SWITCHTYPE eSwitchType, void *pWlxContext);
  228. GINASTDAPI ShellDimScreen (IUnknown* *ppIUnknown, HWND* phwndDimmed);
  229. GINASTDAPI_(void) ShellInstallAccountFilterData (void);
  230. GINASTDAPI_(DWORD) ShellSwitchUser (BOOL fWait);
  231. GINASTDAPI_(int) ShellIsUserInteractiveLogonAllowed (const WCHAR *pwszUsername);
  232. GINASTDAPI_(void) ShellNotifyThemeUserChange (USERLOGTYPE eUserLogType, HANDLE hToken);
  233. GINASTDAPI_(DWORD) ShellReturnToWelcome (BOOL fUnlock);
  234. GINASTDAPI_(DWORD) ShellStartCredentialServer (const WCHAR *pwszUsername, const WCHAR *pwszDomain, WCHAR *pwszPassword, DWORD dwTimeout);
  235. GINASTDAPI_(void) ShellAcquireLogonMutex (void);
  236. GINASTDAPI_(void) ShellReleaseLogonMutex (BOOL fSignalEvent);
  237. GINASTDAPI_(void) ShellSignalShutdown (void);
  238. GINASTDAPI_(void) ShellStatusHostHide (void);
  239. GINASTDAPI_(void) ShellStatusHostShow (void);
  240. #endif /* _MSGinaExports_ */