home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / winwlx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  30.5 KB  |  983 lines

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