Leaked source code of windows server 2003
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.

1132 lines
36 KiB

  1. /*++ BUILD Version: 0001 Increment this if a change has global effects
  2. Copyright (c) 1985-1999, Microsoft Corporation
  3. Module Name:
  4. winwlx.h
  5. Abstract:
  6. WLX == WinLogon eXtension
  7. This file contains definitions, data types, and routine prototypes
  8. necessary to produce a replacement Graphical Identification aNd
  9. Authentication (GINA) DLL for Winlogon.
  10. Author:
  11. Richard Ward (RichardW) and Jim Kelly (JimK) May-1994
  12. Revision History:
  13. --*/
  14. #ifndef _WINWLX_
  15. #define _WINWLX_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. ////////////////////////////////////////////////////////////////////////
  20. // //
  21. // #defines //
  22. // //
  23. ////////////////////////////////////////////////////////////////////////
  24. /////////////////////////////////////////////////////////////////////////
  25. /////////////////////////////////////////////////////////////////////////
  26. //
  27. // Revisions of Winlogon API available for use by GINAs
  28. // Version is two parts: Major revision and minor revision.
  29. // Major revision is the upper 16-bits, minor is the lower
  30. // 16-bits.
  31. //
  32. #define WLX_VERSION_1_0 (0X00010000)
  33. #define WLX_VERSION_1_1 (0X00010001)
  34. #define WLX_VERSION_1_2 (0X00010002)
  35. #define WLX_VERSION_1_3 (0X00010003)
  36. #define WLX_VERSION_1_4 (0X00010004)
  37. #define WLX_CURRENT_VERSION (WLX_VERSION_1_4)
  38. /////////////////////////////////////////////////////////////////////////
  39. /////////////////////////////////////////////////////////////////////////
  40. //
  41. // Secure attention sequence types
  42. // These values are passed to routines that have a dwSasType
  43. // parameter.
  44. //
  45. // ALL VALUES FROM 0 TO 127 ARE RESERVED FOR MICROSOFT DEFINITION.
  46. // VALUES ABOVE 127 ARE RESERVED FOR CUSTOMER DEFINITION.
  47. //
  48. // CTRL_ALT_DEL - used to indicate that the standard ctrl-alt-del
  49. // secure attention sequence has been entered.
  50. //
  51. // SCRNSVR_TIMEOUT - used to indicate that keyboard/mouse inactivity
  52. // has lead to a screensaver activation. It is up to the GINA
  53. // DLL whether this constitutes a workstation locking event.
  54. //
  55. // SCRNSVR_ACTIVITY - used to indicate that keyboard or mouse
  56. // activity occured while a secure screensaver was active.
  57. //
  58. // SC_INSERT - used to indicate that a smart card has been inserted
  59. // to a compatible device
  60. //
  61. // SC_REMOVE - used to indicate that a smart card has been removed
  62. // from a compatible device
  63. //
  64. #define WLX_SAS_TYPE_TIMEOUT (0)
  65. #define WLX_SAS_TYPE_CTRL_ALT_DEL (1)
  66. #define WLX_SAS_TYPE_SCRNSVR_TIMEOUT (2)
  67. #define WLX_SAS_TYPE_SCRNSVR_ACTIVITY (3)
  68. #define WLX_SAS_TYPE_USER_LOGOFF (4)
  69. #define WLX_SAS_TYPE_SC_INSERT (5)
  70. #define WLX_SAS_TYPE_SC_REMOVE (6)
  71. #define WLX_SAS_TYPE_AUTHENTICATED (7)
  72. #define WLX_SAS_TYPE_SC_FIRST_READER_ARRIVED (8)
  73. #define WLX_SAS_TYPE_SC_LAST_READER_REMOVED (9)
  74. #define WLX_SAS_TYPE_SWITCHUSER (10)
  75. #define WLX_SAS_TYPE_MAX_MSFT_VALUE (127)
  76. //
  77. // This structure is available through WlxGetOption, and is
  78. // passed as the lParam for any S/C SAS notices sent to windows
  79. //
  80. typedef struct _WLX_SC_NOTIFICATION_INFO {
  81. PWSTR pszCard ;
  82. PWSTR pszReader ;
  83. PWSTR pszContainer ;
  84. PWSTR pszCryptoProvider ;
  85. } WLX_SC_NOTIFICATION_INFO, * PWLX_SC_NOTIFICATION_INFO ;
  86. /////////////////////////////////////////////////////////////////////////
  87. /////////////////////////////////////////////////////////////////////////
  88. //
  89. // Upon successful logon, the GINA DLL may specify any of the following
  90. // options to Winlogon (via the dwOptions parameter of the WlxLoggedOutSas()
  91. // api). When set, these options specify:
  92. //
  93. // NO_PROFILE - Winlogon must NOT load a profile for the logged
  94. // on user. Either the GINA DLL will take care of
  95. // this activity, or the user does not need a profile.
  96. //
  97. #define WLX_LOGON_OPT_NO_PROFILE (0x00000001)
  98. /////////////////////////////////////////////////////////////////////////
  99. /////////////////////////////////////////////////////////////////////////
  100. //
  101. // GINA DLLs are expected to return account information to Winlogon
  102. // following a successful logon. This information allows Winlogon
  103. // to support profile loading and supplemental network providers.
  104. //
  105. // To allow different sets of profile information to be returned
  106. // by GINAs over time, the first DWORD of each profile structure
  107. // is expected to contain a type-identifier. The following constants
  108. // are the defined profile type identifiers.
  109. //
  110. //
  111. // Standard profile is V2_0
  112. //
  113. #define WLX_PROFILE_TYPE_V1_0 (1)
  114. #define WLX_PROFILE_TYPE_V2_0 (2)
  115. /////////////////////////////////////////////////////////////////////////
  116. /////////////////////////////////////////////////////////////////////////
  117. //
  118. // WlxLoggedOnSas() and WlxWkstaLockedSas() return an action
  119. // value to Winlogon directing Winlogon to either remain unchanged
  120. // or to perform some action (such as force-log the user off).
  121. // These are the values that may be returned. Note, however, that
  122. // not all of the values may be returned by both of these api. See
  123. // the description of each api to see which values are expected from
  124. // each.
  125. //
  126. // LOGON - User has logged on
  127. // NONE - Don't change the state of the window station.
  128. // LOCK_WKSTA - Lock the workstation, wait for next SAS.
  129. // LOGOFF - Log the user off of the workstation.
  130. // SHUTDOWN - Log the user off and shutdown the machine.
  131. // PWD_CHANGED - Indicates that the user changed their password. Notify network providers.
  132. // TASKLIST - Invoke the task list.
  133. // UNLOCK_WKSTA - Unlock the workstation.
  134. // FORCE_LOGOFF - Forcibly log the user off.
  135. // SHUTDOWN_POWER_OFF - Turn off machine after shutting down.
  136. // SHUTDOWN_REBOOT - Reboot machine after shutting down.
  137. // SHUTDOWN_SLEEP - Put the machine to sleep
  138. // SHUTDOWN_SLEEP2 - Put the machine to sleep and disable wakeup events
  139. // SHUTDOWN_HIBERNATE - Hibernate the machine
  140. // RECONNECTED - Session was reconnected to an earlier session
  141. //
  142. #define WLX_SAS_ACTION_LOGON (1)
  143. #define WLX_SAS_ACTION_NONE (2)
  144. #define WLX_SAS_ACTION_LOCK_WKSTA (3)
  145. #define WLX_SAS_ACTION_LOGOFF (4)
  146. #define WLX_SAS_ACTION_SHUTDOWN (5)
  147. #define WLX_SAS_ACTION_PWD_CHANGED (6)
  148. #define WLX_SAS_ACTION_TASKLIST (7)
  149. #define WLX_SAS_ACTION_UNLOCK_WKSTA (8)
  150. #define WLX_SAS_ACTION_FORCE_LOGOFF (9)
  151. #define WLX_SAS_ACTION_SHUTDOWN_POWER_OFF (10)
  152. #define WLX_SAS_ACTION_SHUTDOWN_REBOOT (11)
  153. #define WLX_SAS_ACTION_SHUTDOWN_SLEEP (12)
  154. #define WLX_SAS_ACTION_SHUTDOWN_SLEEP2 (13)
  155. #define WLX_SAS_ACTION_SHUTDOWN_HIBERNATE (14)
  156. #define WLX_SAS_ACTION_RECONNECTED (15)
  157. #define WLX_SAS_ACTION_DELAYED_FORCE_LOGOFF (16)
  158. #define WLX_SAS_ACTION_SWITCH_CONSOLE (17)
  159. ////////////////////////////////////////////////////////////////////////
  160. // //
  161. // Window Messages //
  162. // //
  163. ////////////////////////////////////////////////////////////////////////
  164. //
  165. // The WM_SAS is defined as follows
  166. //
  167. // The wParam parameter has the SAS Type (above)
  168. #define WLX_WM_SAS (WM_USER + 601)
  169. //
  170. // Dialog return values
  171. //
  172. // These may be returned by dialogs started by a GINA dll.
  173. //
  174. #define WLX_DLG_SAS 101
  175. #define WLX_DLG_INPUT_TIMEOUT 102 // Input (keys, etc) timed out
  176. #define WLX_DLG_SCREEN_SAVER_TIMEOUT 103 // Screen Saver activated
  177. #define WLX_DLG_USER_LOGOFF 104 // User logged off
  178. ////////////////////////////////////////////////////////////////////////
  179. // //
  180. // #data types //
  181. // //
  182. ////////////////////////////////////////////////////////////////////////
  183. /////////////////////////////////////////////////////////////////////////
  184. /////////////////////////////////////////////////////////////////////////
  185. //
  186. // The WLX_PROFILE_* structure is returned from a GINA DLL
  187. // following authentication. This information is used by Winlogon
  188. // to support supplemental Network Providers and to load the
  189. // newly logged-on user's profile.
  190. //
  191. // Winlogon is responsible for freeing both the profile structure
  192. // and the fields within the structure that are marked as separately
  193. // deallocatable.
  194. //
  195. typedef struct _WLX_PROFILE_V1_0 {
  196. //
  197. // This field identifies the type of profile being returned by a
  198. // GINA DLL. Profile types are defined with the prefix
  199. // WLX_PROFILE_TYPE_xxx. It allows Winlogon to typecast the
  200. // structure so the remainder of the structure may be referenced.
  201. //
  202. DWORD dwType;
  203. //
  204. // pathname of profile to load for user.
  205. //
  206. // The buffer pointed to by this field must be separately allocated.
  207. // Winlogon will free the buffer when it is no longer needed.
  208. //
  209. //
  210. PWSTR pszProfile;
  211. } WLX_PROFILE_V1_0, * PWLX_PROFILE_V1_0;
  212. typedef struct _WLX_PROFILE_V2_0 {
  213. //
  214. // This field identifies the type of profile being returned by a
  215. // GINA DLL. Profile types are defined with the prefix
  216. // WLX_PROFILE_TYPE_xxx. It allows Winlogon to typecast the
  217. // structure so the remainder of the structure may be referenced.
  218. //
  219. DWORD dwType;
  220. //
  221. // pathname of profile to load for user.
  222. //
  223. // This parameter can be NULL. If so, the user has a local
  224. // profile only.
  225. //
  226. // The buffer pointed to by this field must be separately allocated.
  227. // Winlogon will free the buffer when it is no longer needed.
  228. //
  229. //
  230. PWSTR pszProfile;
  231. //
  232. // pathname of policy to load for user.
  233. //
  234. // This parameter can be NULL which prevents network wide policy
  235. // from being applied.
  236. //
  237. // The buffer pointed to by this field must be separately allocated.
  238. // Winlogon will free the buffer when it is no longer needed.
  239. //
  240. //
  241. PWSTR pszPolicy;
  242. //
  243. // pathname of network default user profile
  244. //
  245. // This parameter can be NULL, which causes the Default User
  246. // profile on the local machine to be used.
  247. //
  248. // The buffer pointed to by this field must be separately allocated.
  249. // Winlogon will free the buffer when it is no longer needed.
  250. //
  251. //
  252. PWSTR pszNetworkDefaultUserProfile;
  253. //
  254. // name of the server which validated the user account
  255. //
  256. // This is used to enumerate globals groups the user belongs
  257. // to for policy support. This parameter can be NULL.
  258. //
  259. // The buffer pointed to by this field must be separately allocated.
  260. // Winlogon will free the buffer when it is no longer needed.
  261. //
  262. //
  263. PWSTR pszServerName;
  264. //
  265. // pointer to a series of null terminated environment variables
  266. //
  267. // envname=environment variable value
  268. // - or -
  269. // envname=%OtherVar%\more text
  270. //
  271. // Each environment variable is NULL terminated with the last
  272. // environment variable double NULL terminated. These variables
  273. // are set into the user's initial environment. The environment
  274. // variable value can contain other environment variables wrapped
  275. // in "%" signs. This parameter can be NULL.
  276. //
  277. // The buffer pointed to by this field must be separately allocated.
  278. // Winlogon will free the buffer when it is no longer needed.
  279. //
  280. //
  281. PWSTR pszEnvironment;
  282. } WLX_PROFILE_V2_0, * PWLX_PROFILE_V2_0;
  283. /////////////////////////////////////////////////////////////////////////
  284. /////////////////////////////////////////////////////////////////////////
  285. //
  286. // The WLX_NPR_NOTIFICATION_INFO structure is returned
  287. // from a GINA DLL following successful authentication.
  288. // This information is used by Winlogon to provide
  289. // identification and authentication information already
  290. // collected to network providers. Winlogon is
  291. // responsible for freeing both the main structure and all
  292. // string and other buffers pointed to from within the
  293. // structure.
  294. //
  295. typedef struct _WLX_MPR_NOTIFY_INFO {
  296. //
  297. // The name of the account logged onto (e.g. REDMOND\Joe).
  298. // The string pointed to by this field must be separately
  299. // allocated and will be separately deallocated by Winlogon.
  300. //
  301. PWSTR pszUserName;
  302. //
  303. // The string pointed to by this field must be separately
  304. // allocated and will be separately deallocated by Winlogon.
  305. //
  306. PWSTR pszDomain;
  307. //
  308. // Cleartext password of the user account. If the OldPassword
  309. // field is non-null, then this field contains the new password
  310. // in a password change operation. The string pointed to by
  311. // this field must be separately allocated and will be seperately
  312. // deallocated by Winlogon.
  313. //
  314. PWSTR pszPassword;
  315. //
  316. // Cleartext old password of the user account whose password
  317. // has just been changed. The Password field contains the new
  318. // password. The string pointed to by this field must be
  319. // separately allocated and will be separately deallocated by
  320. // Winlogon.
  321. //
  322. PWSTR pszOldPassword;
  323. } WLX_MPR_NOTIFY_INFO, * PWLX_MPR_NOTIFY_INFO;
  324. /////////////////////////////////////////////////////////////////////////
  325. /////////////////////////////////////////////////////////////////////////
  326. //
  327. // WLX_TERMINAL_SERVICES_DATA is used by the GINA during a
  328. // WlxQueryTerminalServicesData() callback into WinLogon from the
  329. // WlxLoggedOutSAS() context, after the user name and domain are known.
  330. // This structure relates to TS user configuration information which is
  331. // retrieved from the Domain Controller and SAM database. Having WinLogon
  332. // pass this information means the GINA does not need to do the same
  333. // off-machines lookups again.
  334. //
  335. #define WLX_DIRECTORY_LENGTH 256
  336. typedef struct _WLX_TERMINAL_SERVICES_DATA {
  337. //
  338. // TS profile path, overrides the standard profile path.
  339. //
  340. WCHAR ProfilePath[WLX_DIRECTORY_LENGTH + 1];
  341. //
  342. // TS home directory, overrides standard home directory.
  343. //
  344. WCHAR HomeDir[WLX_DIRECTORY_LENGTH + 1];
  345. //
  346. // TS home directory drive, overrides standard drive.
  347. //
  348. WCHAR HomeDirDrive[4];
  349. } WLX_TERMINAL_SERVICES_DATA, *PWLX_TERMINAL_SERVICES_DATA;
  350. /////////////////////////////////////////////////////////////////////////
  351. /////////////////////////////////////////////////////////////////////////
  352. //
  353. // The WLX_CLIENT_CREDENTIALS_INFO structure is returned
  354. // from winlogon from the WlxQueryClientCredentials() call.
  355. //
  356. // This allows a network client WinStation to pass client
  357. // credentials for automatic logon.
  358. //
  359. // The MSGINA DLL is responsible for freeing the memory
  360. // and substrings with LocalFree().
  361. //
  362. #define WLX_CREDENTIAL_TYPE_V1_0 (1)
  363. #define WLX_CREDENTIAL_TYPE_V2_0 (2)
  364. typedef struct _WLX_CLIENT_CREDENTIALS_INFO {
  365. //
  366. // This field identifies the type of credentials structure being allocated
  367. // by GINA DLL. Credential types are defined with the prefix
  368. // WLX_CREDENTIAL_TYPE_xxx. It allows Winlogon to typecast the
  369. // structure so the remainder of the structure may be referenced.
  370. //
  371. DWORD dwType;
  372. PWSTR pszUserName;
  373. PWSTR pszDomain;
  374. PWSTR pszPassword;
  375. //
  376. // This field forces a prompt for the password. This
  377. // is due to an administrator override.
  378. //
  379. // This allows the distinguishing of autologon
  380. // with no password.
  381. //
  382. BOOL fPromptForPassword;
  383. } WLX_CLIENT_CREDENTIALS_INFO_V1_0, * PWLX_CLIENT_CREDENTIALS_INFO_V1_0;
  384. typedef struct _WLX_CLIENT_CREDENTIALS_INFO_2_0 {
  385. DWORD dwType;
  386. PWSTR pszUserName;
  387. PWSTR pszDomain;
  388. PWSTR pszPassword;
  389. BOOL fPromptForPassword;
  390. //
  391. // This field tells winlogon to disconnect/abort the logon attempt if the
  392. // provided password is incorrect, or if it should reprompt (current
  393. // behavior)
  394. //
  395. BOOL fDisconnectOnLogonFailure;
  396. } WLX_CLIENT_CREDENTIALS_INFO_V2_0, * PWLX_CLIENT_CREDENTIALS_INFO_V2_0;
  397. /////////////////////////////////////////////////////////////////////////
  398. /////////////////////////////////////////////////////////////////////////
  399. //
  400. // The WLX_CONSOLESWITCH_CREDENTIALS_INFO structure is returned
  401. // from gina in response to WlxGetConsoleSwitchCredentials calls.
  402. // This structure is also returned from winlogon in response to
  403. // to WlxQueryConsoleSwitchCredentials call
  404. //
  405. // This is used to implement single session Terminal Server. A remote
  406. // session winlogon calls WlxGetConsoleSwitchCredentials to get the token
  407. // and other info of the logged on user from msgina. This info is then passed to
  408. // the console session winlogon to autologon the user on the console session.
  409. // The gina on console session calls WlxQueryConsoleSwitchCredentials to get
  410. // this info from winlogon and logs on the user.
  411. //
  412. // The caller is responsible for freeing the memory
  413. // and substrings with LocalFree().
  414. //
  415. #define WLX_CONSOLESWITCHCREDENTIAL_TYPE_V1_0 (1)
  416. typedef struct _WLX_CONSOLESWITCH_CREDENTIALS_INFO {
  417. //
  418. // This field identifies the type of credentials structure being allocated
  419. // Credential types are defined with the prefix
  420. // WLX_CONSOLESWITCHCREDENTIAL_TYPE_xxx. It allows Winlogon to typecast the
  421. // structure so the remainder of the structure may be referenced.
  422. //
  423. DWORD dwType;
  424. HANDLE UserToken;
  425. LUID LogonId;
  426. QUOTA_LIMITS Quotas;
  427. PWSTR UserName;
  428. PWSTR Domain;
  429. LARGE_INTEGER LogonTime;
  430. BOOL SmartCardLogon;
  431. ULONG ProfileLength;
  432. //
  433. // From MSV1_0_INTERACTIVE_PROFILE
  434. //
  435. DWORD MessageType;
  436. USHORT LogonCount;
  437. USHORT BadPasswordCount;
  438. LARGE_INTEGER ProfileLogonTime;
  439. LARGE_INTEGER LogoffTime;
  440. LARGE_INTEGER KickOffTime;
  441. LARGE_INTEGER PasswordLastSet;
  442. LARGE_INTEGER PasswordCanChange;
  443. LARGE_INTEGER PasswordMustChange;
  444. PWSTR LogonScript;
  445. PWSTR HomeDirectory;
  446. PWSTR FullName;
  447. PWSTR ProfilePath;
  448. PWSTR HomeDirectoryDrive;
  449. PWSTR LogonServer;
  450. ULONG UserFlags;
  451. ULONG PrivateDataLen;
  452. PBYTE PrivateData;
  453. } WLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0, * PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0;
  454. ////////////////////////////////////////////////////////////////////////
  455. // //
  456. // Services that replacement GINAs ** MUST ** provide //
  457. // //
  458. ////////////////////////////////////////////////////////////////////////
  459. BOOL
  460. WINAPI
  461. WlxNegotiate(
  462. DWORD dwWinlogonVersion,
  463. PDWORD pdwDllVersion
  464. );
  465. BOOL
  466. WINAPI
  467. WlxInitialize(
  468. LPWSTR lpWinsta,
  469. HANDLE hWlx,
  470. PVOID pvReserved,
  471. PVOID pWinlogonFunctions,
  472. PVOID * pWlxContext
  473. );
  474. VOID
  475. WINAPI
  476. WlxDisplaySASNotice(
  477. PVOID pWlxContext
  478. );
  479. int
  480. WINAPI
  481. WlxLoggedOutSAS(
  482. PVOID pWlxContext,
  483. DWORD dwSasType,
  484. PLUID pAuthenticationId,
  485. PSID pLogonSid,
  486. PDWORD pdwOptions,
  487. PHANDLE phToken,
  488. PWLX_MPR_NOTIFY_INFO pNprNotifyInfo,
  489. PVOID * pProfile
  490. );
  491. BOOL
  492. WINAPI
  493. WlxActivateUserShell(
  494. PVOID pWlxContext,
  495. PWSTR pszDesktopName,
  496. PWSTR pszMprLogonScript,
  497. PVOID pEnvironment
  498. );
  499. int
  500. WINAPI
  501. WlxLoggedOnSAS(
  502. PVOID pWlxContext,
  503. DWORD dwSasType,
  504. PVOID pReserved
  505. );
  506. VOID
  507. WINAPI
  508. WlxDisplayLockedNotice(
  509. PVOID pWlxContext
  510. );
  511. int
  512. WINAPI
  513. WlxWkstaLockedSAS(
  514. PVOID pWlxContext,
  515. DWORD dwSasType
  516. );
  517. BOOL
  518. WINAPI
  519. WlxIsLockOk(
  520. PVOID pWlxContext
  521. );
  522. BOOL
  523. WINAPI
  524. WlxIsLogoffOk(
  525. PVOID pWlxContext
  526. );
  527. VOID
  528. WINAPI
  529. WlxLogoff(
  530. PVOID pWlxContext
  531. );
  532. VOID
  533. WINAPI
  534. WlxShutdown(
  535. PVOID pWlxContext,
  536. DWORD ShutdownType
  537. );
  538. //
  539. // NEW for version 1.1
  540. //
  541. BOOL
  542. WINAPI
  543. WlxScreenSaverNotify(
  544. PVOID pWlxContext,
  545. BOOL * pSecure);
  546. BOOL
  547. WINAPI
  548. WlxStartApplication(
  549. PVOID pWlxContext,
  550. PWSTR pszDesktopName,
  551. PVOID pEnvironment,
  552. PWSTR pszCmdLine
  553. );
  554. //
  555. // New for 1.3
  556. //
  557. BOOL
  558. WINAPI
  559. WlxNetworkProviderLoad(
  560. PVOID pWlxContext,
  561. PWLX_MPR_NOTIFY_INFO pNprNotifyInfo
  562. );
  563. #define STATUSMSG_OPTION_NOANIMATION 0x00000001
  564. #define STATUSMSG_OPTION_SETFOREGROUND 0x00000002
  565. BOOL
  566. WINAPI
  567. WlxDisplayStatusMessage(
  568. PVOID pWlxContext,
  569. HDESK hDesktop,
  570. DWORD dwOptions,
  571. PWSTR pTitle,
  572. PWSTR pMessage
  573. );
  574. BOOL
  575. WINAPI
  576. WlxGetStatusMessage(
  577. PVOID pWlxContext,
  578. DWORD * pdwOptions,
  579. PWSTR pMessage,
  580. DWORD dwBufferSize
  581. );
  582. BOOL
  583. WINAPI
  584. WlxRemoveStatusMessage(
  585. PVOID pWlxContext
  586. );
  587. //
  588. // New for 1.4
  589. //
  590. BOOL
  591. WINAPI
  592. WlxGetConsoleSwitchCredentials (
  593. PVOID pWlxContext,
  594. PVOID pCredInfo
  595. );
  596. VOID
  597. WINAPI
  598. WlxReconnectNotify (
  599. PVOID pWlxContext
  600. );
  601. VOID
  602. WINAPI
  603. WlxDisconnectNotify (
  604. PVOID pWlxContext
  605. );
  606. ////////////////////////////////////////////////////////////////////////
  607. // //
  608. // Services that Winlogon provides //
  609. // //
  610. ////////////////////////////////////////////////////////////////////////
  611. typedef struct _WLX_DESKTOP {
  612. DWORD Size;
  613. DWORD Flags;
  614. HDESK hDesktop;
  615. PWSTR pszDesktopName;
  616. } WLX_DESKTOP, * PWLX_DESKTOP;
  617. #define WLX_DESKTOP_NAME 0x00000001 // Name present
  618. #define WLX_DESKTOP_HANDLE 0x00000002 // Handle present
  619. typedef VOID
  620. (WINAPI * PWLX_USE_CTRL_ALT_DEL)(
  621. HANDLE hWlx
  622. );
  623. typedef VOID
  624. (WINAPI * PWLX_SET_CONTEXT_POINTER)(
  625. HANDLE hWlx,
  626. PVOID pWlxContext
  627. );
  628. typedef VOID
  629. (WINAPI * PWLX_SAS_NOTIFY)(
  630. HANDLE hWlx,
  631. DWORD dwSasType
  632. );
  633. typedef BOOL
  634. (WINAPI * PWLX_SET_TIMEOUT)(
  635. HANDLE hWlx,
  636. DWORD Timeout);
  637. typedef int
  638. (WINAPI * PWLX_ASSIGN_SHELL_PROTECTION)(
  639. HANDLE hWlx,
  640. HANDLE hToken,
  641. HANDLE hProcess,
  642. HANDLE hThread
  643. );
  644. typedef int
  645. (WINAPI * PWLX_MESSAGE_BOX)(
  646. HANDLE hWlx,
  647. HWND hwndOwner,
  648. LPWSTR lpszText,
  649. LPWSTR lpszTitle,
  650. UINT fuStyle
  651. );
  652. typedef int
  653. (WINAPI * PWLX_DIALOG_BOX)(
  654. HANDLE hWlx,
  655. HANDLE hInst,
  656. LPWSTR lpszTemplate,
  657. HWND hwndOwner,
  658. DLGPROC dlgprc
  659. );
  660. typedef int
  661. (WINAPI * PWLX_DIALOG_BOX_INDIRECT)(
  662. HANDLE hWlx,
  663. HANDLE hInst,
  664. LPCDLGTEMPLATE hDialogTemplate,
  665. HWND hwndOwner,
  666. DLGPROC dlgprc
  667. );
  668. typedef int
  669. (WINAPI * PWLX_DIALOG_BOX_PARAM)(
  670. HANDLE hWlx,
  671. HANDLE hInst,
  672. LPWSTR lpszTemplate,
  673. HWND hwndOwner,
  674. DLGPROC dlgprc,
  675. LPARAM dwInitParam
  676. );
  677. typedef int
  678. (WINAPI * PWLX_DIALOG_BOX_INDIRECT_PARAM)(
  679. HANDLE hWlx,
  680. HANDLE hInst,
  681. LPCDLGTEMPLATE hDialogTemplate,
  682. HWND hwndOwner,
  683. DLGPROC dlgprc,
  684. LPARAM dwInitParam
  685. );
  686. typedef int
  687. (WINAPI * PWLX_SWITCH_DESKTOP_TO_USER)(
  688. HANDLE hWlx);
  689. typedef int
  690. (WINAPI * PWLX_SWITCH_DESKTOP_TO_WINLOGON)(
  691. HANDLE hWlx);
  692. typedef int
  693. (WINAPI * PWLX_CHANGE_PASSWORD_NOTIFY)(
  694. HANDLE hWlx,
  695. PWLX_MPR_NOTIFY_INFO pMprInfo,
  696. DWORD dwChangeInfo
  697. );
  698. typedef BOOL
  699. (WINAPI * PWLX_GET_SOURCE_DESKTOP)(
  700. HANDLE hWlx,
  701. PWLX_DESKTOP * ppDesktop);
  702. typedef BOOL
  703. (WINAPI * PWLX_SET_RETURN_DESKTOP)(
  704. HANDLE hWlx,
  705. PWLX_DESKTOP pDesktop);
  706. typedef BOOL
  707. (WINAPI * PWLX_CREATE_USER_DESKTOP)(
  708. HANDLE hWlx,
  709. HANDLE hToken,
  710. DWORD Flags,
  711. PWSTR pszDesktopName,
  712. PWLX_DESKTOP * ppDesktop);
  713. #define WLX_CREATE_INSTANCE_ONLY 0x00000001
  714. #define WLX_CREATE_USER 0x00000002
  715. typedef int
  716. (WINAPI * PWLX_CHANGE_PASSWORD_NOTIFY_EX)(
  717. HANDLE hWlx,
  718. PWLX_MPR_NOTIFY_INFO pMprInfo,
  719. DWORD dwChangeInfo,
  720. PWSTR ProviderName,
  721. PVOID Reserved);
  722. typedef BOOL
  723. (WINAPI * PWLX_CLOSE_USER_DESKTOP)(
  724. HANDLE hWlx,
  725. PWLX_DESKTOP pDesktop,
  726. HANDLE hToken );
  727. typedef BOOL
  728. (WINAPI * PWLX_SET_OPTION)(
  729. HANDLE hWlx,
  730. DWORD Option,
  731. ULONG_PTR Value,
  732. ULONG_PTR * OldValue
  733. );
  734. typedef BOOL
  735. (WINAPI * PWLX_GET_OPTION)(
  736. HANDLE hWlx,
  737. DWORD Option,
  738. ULONG_PTR * Value
  739. );
  740. typedef VOID
  741. (WINAPI * PWLX_WIN31_MIGRATE)(
  742. HANDLE hWlx
  743. );
  744. typedef BOOL
  745. (WINAPI * PWLX_QUERY_CLIENT_CREDENTIALS)(
  746. PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred
  747. );
  748. typedef BOOL
  749. (WINAPI * PWLX_QUERY_IC_CREDENTIALS)(
  750. PWLX_CLIENT_CREDENTIALS_INFO_V1_0 pCred
  751. );
  752. typedef BOOL
  753. (WINAPI * PWLX_QUERY_TS_LOGON_CREDENTIALS)(
  754. PWLX_CLIENT_CREDENTIALS_INFO_V2_0 pCred
  755. );
  756. typedef BOOL
  757. (WINAPI * PWLX_DISCONNECT)(
  758. );
  759. typedef DWORD
  760. (WINAPI * PWLX_QUERY_TERMINAL_SERVICES_DATA)(
  761. HANDLE hWlx,
  762. PWLX_TERMINAL_SERVICES_DATA pTSData,
  763. WCHAR * UserName,
  764. WCHAR * Domain
  765. );
  766. typedef DWORD
  767. (WINAPI * PWLX_QUERY_CONSOLESWITCH_CREDENTIALS)(
  768. PWLX_CONSOLESWITCH_CREDENTIALS_INFO_V1_0 pCred
  769. );
  770. //
  771. // Options that can be get or set:
  772. //
  773. #define WLX_OPTION_USE_CTRL_ALT_DEL 0x00000001
  774. #define WLX_OPTION_CONTEXT_POINTER 0x00000002
  775. #define WLX_OPTION_USE_SMART_CARD 0x00000003
  776. #define WLX_OPTION_FORCE_LOGOFF_TIME 0x00000004
  777. #define WLX_OPTION_IGNORE_AUTO_LOGON 0x00000008
  778. #define WLX_OPTION_NO_SWITCH_ON_SAS 0x00000009
  779. //
  780. // Options that can be queried only:
  781. //
  782. #define WLX_OPTION_SMART_CARD_PRESENT 0x00010001
  783. #define WLX_OPTION_SMART_CARD_INFO 0x00010002
  784. #define WLX_OPTION_DISPATCH_TABLE_SIZE 0x00010003
  785. ////////////////////////////////////////////////////////////////////////
  786. // //
  787. // Function dispatch tables. //
  788. // One of the following tables will be passed to the GINA DLL //
  789. // in the WlxInitialize() call during initialization. //
  790. // //
  791. ////////////////////////////////////////////////////////////////////////
  792. typedef struct _WLX_DISPATCH_VERSION_1_0 {
  793. PWLX_USE_CTRL_ALT_DEL WlxUseCtrlAltDel;
  794. PWLX_SET_CONTEXT_POINTER WlxSetContextPointer;
  795. PWLX_SAS_NOTIFY WlxSasNotify;
  796. PWLX_SET_TIMEOUT WlxSetTimeout;
  797. PWLX_ASSIGN_SHELL_PROTECTION WlxAssignShellProtection;
  798. PWLX_MESSAGE_BOX WlxMessageBox;
  799. PWLX_DIALOG_BOX WlxDialogBox;
  800. PWLX_DIALOG_BOX_PARAM WlxDialogBoxParam;
  801. PWLX_DIALOG_BOX_INDIRECT WlxDialogBoxIndirect;
  802. PWLX_DIALOG_BOX_INDIRECT_PARAM WlxDialogBoxIndirectParam;
  803. PWLX_SWITCH_DESKTOP_TO_USER WlxSwitchDesktopToUser;
  804. PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  805. PWLX_CHANGE_PASSWORD_NOTIFY WlxChangePasswordNotify;
  806. } WLX_DISPATCH_VERSION_1_0, *PWLX_DISPATCH_VERSION_1_0;
  807. typedef struct _WLX_DISPATCH_VERSION_1_1 {
  808. PWLX_USE_CTRL_ALT_DEL WlxUseCtrlAltDel;
  809. PWLX_SET_CONTEXT_POINTER WlxSetContextPointer;
  810. PWLX_SAS_NOTIFY WlxSasNotify;
  811. PWLX_SET_TIMEOUT WlxSetTimeout;
  812. PWLX_ASSIGN_SHELL_PROTECTION WlxAssignShellProtection;
  813. PWLX_MESSAGE_BOX WlxMessageBox;
  814. PWLX_DIALOG_BOX WlxDialogBox;
  815. PWLX_DIALOG_BOX_PARAM WlxDialogBoxParam;
  816. PWLX_DIALOG_BOX_INDIRECT WlxDialogBoxIndirect;
  817. PWLX_DIALOG_BOX_INDIRECT_PARAM WlxDialogBoxIndirectParam;
  818. PWLX_SWITCH_DESKTOP_TO_USER WlxSwitchDesktopToUser;
  819. PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  820. PWLX_CHANGE_PASSWORD_NOTIFY WlxChangePasswordNotify;
  821. PWLX_GET_SOURCE_DESKTOP WlxGetSourceDesktop;
  822. PWLX_SET_RETURN_DESKTOP WlxSetReturnDesktop;
  823. PWLX_CREATE_USER_DESKTOP WlxCreateUserDesktop;
  824. PWLX_CHANGE_PASSWORD_NOTIFY_EX WlxChangePasswordNotifyEx;
  825. } WLX_DISPATCH_VERSION_1_1, * PWLX_DISPATCH_VERSION_1_1;
  826. typedef struct _WLX_DISPATCH_VERSION_1_2 {
  827. PWLX_USE_CTRL_ALT_DEL WlxUseCtrlAltDel;
  828. PWLX_SET_CONTEXT_POINTER WlxSetContextPointer;
  829. PWLX_SAS_NOTIFY WlxSasNotify;
  830. PWLX_SET_TIMEOUT WlxSetTimeout;
  831. PWLX_ASSIGN_SHELL_PROTECTION WlxAssignShellProtection;
  832. PWLX_MESSAGE_BOX WlxMessageBox;
  833. PWLX_DIALOG_BOX WlxDialogBox;
  834. PWLX_DIALOG_BOX_PARAM WlxDialogBoxParam;
  835. PWLX_DIALOG_BOX_INDIRECT WlxDialogBoxIndirect;
  836. PWLX_DIALOG_BOX_INDIRECT_PARAM WlxDialogBoxIndirectParam;
  837. PWLX_SWITCH_DESKTOP_TO_USER WlxSwitchDesktopToUser;
  838. PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  839. PWLX_CHANGE_PASSWORD_NOTIFY WlxChangePasswordNotify;
  840. PWLX_GET_SOURCE_DESKTOP WlxGetSourceDesktop;
  841. PWLX_SET_RETURN_DESKTOP WlxSetReturnDesktop;
  842. PWLX_CREATE_USER_DESKTOP WlxCreateUserDesktop;
  843. PWLX_CHANGE_PASSWORD_NOTIFY_EX WlxChangePasswordNotifyEx;
  844. PWLX_CLOSE_USER_DESKTOP WlxCloseUserDesktop ;
  845. } WLX_DISPATCH_VERSION_1_2, * PWLX_DISPATCH_VERSION_1_2;
  846. typedef struct _WLX_DISPATCH_VERSION_1_3 {
  847. PWLX_USE_CTRL_ALT_DEL WlxUseCtrlAltDel;
  848. PWLX_SET_CONTEXT_POINTER WlxSetContextPointer;
  849. PWLX_SAS_NOTIFY WlxSasNotify;
  850. PWLX_SET_TIMEOUT WlxSetTimeout;
  851. PWLX_ASSIGN_SHELL_PROTECTION WlxAssignShellProtection;
  852. PWLX_MESSAGE_BOX WlxMessageBox;
  853. PWLX_DIALOG_BOX WlxDialogBox;
  854. PWLX_DIALOG_BOX_PARAM WlxDialogBoxParam;
  855. PWLX_DIALOG_BOX_INDIRECT WlxDialogBoxIndirect;
  856. PWLX_DIALOG_BOX_INDIRECT_PARAM WlxDialogBoxIndirectParam;
  857. PWLX_SWITCH_DESKTOP_TO_USER WlxSwitchDesktopToUser;
  858. PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  859. PWLX_CHANGE_PASSWORD_NOTIFY WlxChangePasswordNotify;
  860. PWLX_GET_SOURCE_DESKTOP WlxGetSourceDesktop;
  861. PWLX_SET_RETURN_DESKTOP WlxSetReturnDesktop;
  862. PWLX_CREATE_USER_DESKTOP WlxCreateUserDesktop;
  863. PWLX_CHANGE_PASSWORD_NOTIFY_EX WlxChangePasswordNotifyEx;
  864. PWLX_CLOSE_USER_DESKTOP WlxCloseUserDesktop ;
  865. PWLX_SET_OPTION WlxSetOption;
  866. PWLX_GET_OPTION WlxGetOption;
  867. PWLX_WIN31_MIGRATE WlxWin31Migrate;
  868. PWLX_QUERY_CLIENT_CREDENTIALS WlxQueryClientCredentials;
  869. PWLX_QUERY_IC_CREDENTIALS WlxQueryInetConnectorCredentials;
  870. PWLX_DISCONNECT WlxDisconnect;
  871. PWLX_QUERY_TERMINAL_SERVICES_DATA WlxQueryTerminalServicesData;
  872. } WLX_DISPATCH_VERSION_1_3, * PWLX_DISPATCH_VERSION_1_3;
  873. typedef struct _WLX_DISPATCH_VERSION_1_4 {
  874. PWLX_USE_CTRL_ALT_DEL WlxUseCtrlAltDel;
  875. PWLX_SET_CONTEXT_POINTER WlxSetContextPointer;
  876. PWLX_SAS_NOTIFY WlxSasNotify;
  877. PWLX_SET_TIMEOUT WlxSetTimeout;
  878. PWLX_ASSIGN_SHELL_PROTECTION WlxAssignShellProtection;
  879. PWLX_MESSAGE_BOX WlxMessageBox;
  880. PWLX_DIALOG_BOX WlxDialogBox;
  881. PWLX_DIALOG_BOX_PARAM WlxDialogBoxParam;
  882. PWLX_DIALOG_BOX_INDIRECT WlxDialogBoxIndirect;
  883. PWLX_DIALOG_BOX_INDIRECT_PARAM WlxDialogBoxIndirectParam;
  884. PWLX_SWITCH_DESKTOP_TO_USER WlxSwitchDesktopToUser;
  885. PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  886. PWLX_CHANGE_PASSWORD_NOTIFY WlxChangePasswordNotify;
  887. PWLX_GET_SOURCE_DESKTOP WlxGetSourceDesktop;
  888. PWLX_SET_RETURN_DESKTOP WlxSetReturnDesktop;
  889. PWLX_CREATE_USER_DESKTOP WlxCreateUserDesktop;
  890. PWLX_CHANGE_PASSWORD_NOTIFY_EX WlxChangePasswordNotifyEx;
  891. PWLX_CLOSE_USER_DESKTOP WlxCloseUserDesktop ;
  892. PWLX_SET_OPTION WlxSetOption;
  893. PWLX_GET_OPTION WlxGetOption;
  894. PWLX_WIN31_MIGRATE WlxWin31Migrate;
  895. PWLX_QUERY_CLIENT_CREDENTIALS WlxQueryClientCredentials;
  896. PWLX_QUERY_IC_CREDENTIALS WlxQueryInetConnectorCredentials;
  897. PWLX_DISCONNECT WlxDisconnect;
  898. PWLX_QUERY_TERMINAL_SERVICES_DATA WlxQueryTerminalServicesData;
  899. PWLX_QUERY_CONSOLESWITCH_CREDENTIALS WlxQueryConsoleSwitchCredentials;
  900. PWLX_QUERY_TS_LOGON_CREDENTIALS WlxQueryTsLogonCredentials;
  901. } WLX_DISPATCH_VERSION_1_4, * PWLX_DISPATCH_VERSION_1_4;
  902. //
  903. // Non-GINA notification DLLs
  904. //
  905. typedef DWORD (*PFNMSGECALLBACK)(BOOL bVerbose, LPWSTR lpMessage);
  906. typedef struct _WLX_NOTIFICATION_INFO {
  907. ULONG Size ;
  908. ULONG Flags ;
  909. PWSTR UserName ;
  910. PWSTR Domain ;
  911. PWSTR WindowStation ;
  912. HANDLE hToken ;
  913. HDESK hDesktop ;
  914. PFNMSGECALLBACK pStatusCallback ;
  915. } WLX_NOTIFICATION_INFO, * PWLX_NOTIFICATION_INFO ;
  916. #endif /* _WINWLX_ */