home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / winwlx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  16.5 KB  |  537 lines

  1. /*++ BUILD Version: 0001    Increment this if a change has global effects
  2.  
  3. Copyright (c) 1985-1995, 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. Revision History:
  18.  
  19.  
  20.  
  21. --*/
  22.  
  23. #ifndef _WINWLX_
  24. #define _WINWLX_
  25.  
  26.  
  27.  
  28. ////////////////////////////////////////////////////////////////////////
  29. //                                                                    //
  30. //  #defines                                                          //
  31. //                                                                    //
  32. ////////////////////////////////////////////////////////////////////////
  33.  
  34.  
  35. /////////////////////////////////////////////////////////////////////////
  36. /////////////////////////////////////////////////////////////////////////
  37. //
  38. // Revisions of Winlogon API available for use by GINAs
  39. // Version is two parts: Major revision and minor revision.
  40. // Major revision is the upper 16-bits, minor is the lower
  41. // 16-bits.
  42. //
  43.  
  44. #define WLX_VERSION_1_0             (0X00010000)
  45. #define WLX_CURRENT_VERSION         (WLX_VERSION_1_0)
  46.  
  47.  
  48. /////////////////////////////////////////////////////////////////////////
  49. /////////////////////////////////////////////////////////////////////////
  50. //
  51. // Secure attention sequence types
  52. // These values are passed to routines that have a dwSasType
  53. // parameter.
  54. //
  55. //  ALL VALUES FROM 0 TO 127 ARE RESERVED FOR MICROSOFT DEFINITION.
  56. //  VALUES ABOVE 127 ARE RESERVED FOR CUSTOMER DEFINITION.
  57. //
  58. //      CTRL_ALT_DEL - used to indicate that the standard ctrl-alt-del
  59. //          secure attention sequence has been entered.
  60. //
  61. //      SCRNSVR_TIMEOUT - used to indicate that keyboard/mouse inactivity
  62. //          has lead to a screensaver activation.  It is up to the GINA
  63. //          DLL whether this constitutes a workstation locking event.
  64. //
  65. //      SCRNSVR_ACTIVITY - used to indicate that keyboard or mouse
  66. //          activity occured while a secure screensaver was active.
  67. //
  68.  
  69. #define WLX_SAS_TYPE_TIMEOUT                    (0)
  70. #define WLX_SAS_TYPE_CTRL_ALT_DEL               (1)
  71. #define WLX_SAS_TYPE_SCRNSVR_TIMEOUT            (2)
  72. #define WLX_SAS_TYPE_SCRNSVR_ACTIVITY           (3)
  73. #define WLX_SAS_TYPE_USER_LOGOFF                (4)
  74. #define WLX_SAS_TYPE_MAX_MSFT_VALUE             (127)
  75.  
  76.  
  77.  
  78.  
  79.  
  80. /////////////////////////////////////////////////////////////////////////
  81. /////////////////////////////////////////////////////////////////////////
  82. //
  83. // Upon successful logon, the GINA DLL may specify any of the following
  84. // options to Winlogon (via the dwOptions parameter of the WlxLoggedOutSas()
  85. // api).  When set, these options specify:
  86. //
  87. //      NO_PROFILE - Winlogon must NOT load a profile for the logged
  88. //                   on user.  Either the GINA DLL will take care of
  89. //                   this activity, or the user does not need a profile.
  90. //
  91.  
  92. #define WLX_LOGON_OPT_NO_PROFILE        (0x00000001)
  93.  
  94.  
  95.  
  96. /////////////////////////////////////////////////////////////////////////
  97. /////////////////////////////////////////////////////////////////////////
  98. //
  99. // GINA DLLs are expected to return account information to Winlogon
  100. // following a successful logon.  This information allows Winlogon
  101. // to support profile loading and supplemental network providers.
  102. //
  103. // To allow different sets of profile information to be returned
  104. // by GINAs over time, the first DWORD of each profile structure
  105. // is expected to contain a type-identifier.  The following constants
  106. // are the defined profile type identifiers.
  107. //
  108. // NOTE: currently, there is only one profile structure defined.
  109. //       This will change with future releases.
  110. //
  111.  
  112. //
  113. // Standard profile for V1_0
  114. //
  115.  
  116. #define WLX_PROFILE_TYPE_V1_0           (1)
  117.  
  118.  
  119.  
  120.  
  121. /////////////////////////////////////////////////////////////////////////
  122. /////////////////////////////////////////////////////////////////////////
  123. //
  124. // WlxLoggedOnSas() and WlxWkstaLockedSas() return an action
  125. // value to Winlogon directing Winlogon to either remain unchanged
  126. // or to perform some action (such as force-log the user off).
  127. // These are the values that may be returned.  Note, however, that
  128. // not all of the values may be returned by both of these api.  See
  129. // the description of each api to see which values are expected from
  130. // each.
  131. //
  132. //  LOGON        - User has logged on
  133. //  NONE         - Don't change the state of the window station.
  134. //  LOCK_WKSTA   - Lock the workstation, wait for next SAS.
  135. //  LOGOFF       - Log the user off of the workstation.
  136. //  SHUTDOWN     - Log the user off and shutdown the machine.
  137. //  PWD_CHANGED  - Indicates that the user changed their password.  Notify network providers.
  138. //  TASKLIST     - Invoke the task list.
  139. //  UNLOCK_WKSTA - Unlock the workstation.
  140. //  FORCE_LOGOFF - Forcibly log the user off.
  141. //
  142.  
  143. #define WLX_SAS_ACTION_LOGON                        (1)
  144. #define WLX_SAS_ACTION_NONE                         (2)
  145. #define WLX_SAS_ACTION_LOCK_WKSTA                   (3)
  146. #define WLX_SAS_ACTION_LOGOFF                       (4)
  147. #define WLX_SAS_ACTION_SHUTDOWN                     (5)
  148. #define WLX_SAS_ACTION_PWD_CHANGED                  (6)
  149. #define WLX_SAS_ACTION_TASKLIST                     (7)
  150. #define WLX_SAS_ACTION_UNLOCK_WKSTA                 (8)
  151. #define WLX_SAS_ACTION_FORCE_LOGOFF                 (9)
  152. #define WLX_SAS_ACTION_SHUTDOWN_POWER_OFF           (10)
  153. #define WLX_SAS_ACTION_SHUTDOWN_REBOOT              (11)
  154.  
  155.  
  156. ////////////////////////////////////////////////////////////////////////
  157. //                                                                    //
  158. //  Window Messages                                                   //
  159. //                                                                    //
  160. ////////////////////////////////////////////////////////////////////////
  161.  
  162. //
  163. // The WM_SAS is defined as follows
  164. //
  165. //  The wParam parameter has the SAS Type (above)
  166.  
  167. #define WLX_WM_SAS                  (WM_USER + 601)
  168.  
  169. //
  170. // The WLX_WM_TIMEOUT message is sent to an open dialog before it is
  171. // timed out.  If it is not caught by the Dialog Proc, Winlogon will end
  172. // the dialog with a dialog return code below.
  173. #define WLX_WM_TIMEOUT              (WM_USER + 602)
  174.  
  175. //
  176. // Dialog return values
  177. //
  178. // These may be returned by dialogs started by a GINA dll.
  179. //
  180. #define WLX_DLG_SAS                     101
  181. #define WLX_DLG_INPUT_TIMEOUT           102     // Input (keys, etc) timed out
  182. #define WLX_DLG_SCREEN_SAVER_TIMEOUT    103     // Screen Saver activated
  183. #define WLX_DLG_USER_LOGOFF             104     // User logged off
  184.  
  185.  
  186.  
  187.  
  188. ////////////////////////////////////////////////////////////////////////
  189. //                                                                    //
  190. //  #data types                                                       //
  191. //                                                                    //
  192. ////////////////////////////////////////////////////////////////////////
  193.  
  194. /////////////////////////////////////////////////////////////////////////
  195. /////////////////////////////////////////////////////////////////////////
  196. //
  197. // The WLX_PROFILE_V1_0 structure is returned from a GINA DLL
  198. // following authentication.  This information is used by Winlogon
  199. // to support supplemental Network Providers and to load the
  200. // newly logged-on user's profile.
  201. //
  202. // Winlogon is responsible for freeing both the profile structure
  203. // and the fields within the structure that are marked as separately
  204. // deallocatable.
  205. //
  206.  
  207. typedef struct _WLX_PROFILE_V1_0 {
  208.  
  209.     //
  210.     // This field identifies the type of profile being returned by a
  211.     // GINA DLL.  Profile types are defined with the prefix
  212.     // WLX_PROFILE_TYPE_xxx.  It allows Winlogon to typecast the
  213.     // structure so the remainder of the structure may be referenced.
  214.     //
  215.  
  216.     DWORD               dwType;
  217.  
  218.  
  219.  
  220.     //
  221.     // pathname of profile to load for user.
  222.     //
  223.     // The buffer pointed to by this field must be separately allocated.
  224.     // Winlogon will free the buffer when it is no longer needed.
  225.     //
  226.     //
  227.     PWSTR               pszProfile;
  228.  
  229. } WLX_PROFILE_V1_0, * PWLX_PROFILE_V1_0;
  230.  
  231.  
  232.  
  233.  
  234. /////////////////////////////////////////////////////////////////////////
  235. /////////////////////////////////////////////////////////////////////////
  236. //
  237. // The WLX_NPR_NOTIFICATION_INFO structure is returned
  238. // from a GINA DLL following successful authentication.
  239. // This information is used by Winlogon to provide
  240. // identification and authentication information already
  241. // collected to network providers.  Winlogon is
  242. // responsible for freeing both the main structure and all
  243. // string and other buffers pointed to from within the
  244. // structure.
  245. //
  246.  
  247. typedef struct _WLX_MPR_NOTIFY_INFO {
  248.  
  249.     //
  250.     // The name of the account logged onto (e.g. REDMOND\Joe).
  251.     // The string pointed to by this field must be separately
  252.     // allocated and will be separately deallocated by Winlogon.
  253.     //
  254.  
  255.     PWSTR           pszUserName;
  256.  
  257.     //
  258.     // The string pointed to by this field must be separately
  259.     // allocated and will be separately deallocated by Winlogon.
  260.     //
  261.  
  262.     PWSTR           pszDomain;
  263.  
  264.     //
  265.     // Cleartext password of the user account.  If the OldPassword
  266.     // field is non-null, then this field contains the new password
  267.     // in a password change operation.  The string pointed to by
  268.     // this field must be separately allocated and will be seperately
  269.     // deallocated by Winlogon.
  270.     //
  271.  
  272.     PWSTR           pszPassword;
  273.  
  274.     //
  275.     // Cleartext old password of the user account whose password
  276.     // has just been changed.  The Password field contains the new
  277.     // password.  The string pointed to by this field must be
  278.     // separately allocated and will be separately deallocated by
  279.     // Winlogon.
  280.     //
  281.  
  282.     PWSTR           pszOldPassword;
  283.  
  284. } WLX_MPR_NOTIFY_INFO, * PWLX_MPR_NOTIFY_INFO;
  285.  
  286.  
  287.  
  288.  
  289.  
  290. ////////////////////////////////////////////////////////////////////////
  291. //                                                                    //
  292. //  Services that replacement GINAs   ** MUST ** provide              //
  293. //                                                                    //
  294. ////////////////////////////////////////////////////////////////////////
  295.  
  296.  
  297.  
  298. BOOL
  299. WINAPI
  300. WlxNegotiate(
  301.     DWORD                   dwWinlogonVersion,
  302.     PDWORD                  pdwDllVersion
  303.     );
  304.  
  305. BOOL
  306. WINAPI
  307. WlxInitialize(
  308.     LPWSTR                  lpWinsta,
  309.     HANDLE                  hWlx,
  310.     PVOID                   pvReserved,
  311.     PVOID                   pWinlogonFunctions,
  312.     PVOID *                 pWlxContext
  313.     );
  314.  
  315. VOID
  316. WINAPI
  317. WlxDisplaySASNotice(
  318.     PVOID                   pWlxContext
  319.     );
  320.  
  321.  
  322. int
  323. WINAPI
  324. WlxLoggedOutSAS(
  325.     PVOID                   pWlxContext,
  326.     DWORD                   dwSasType,
  327.     PLUID                   pAuthenticationId,
  328.     PSID                    pLogonSid,
  329.     PDWORD                  pdwOptions,
  330.     PHANDLE                 phToken,
  331.     PWLX_MPR_NOTIFY_INFO    pNprNotifyInfo,
  332.     PVOID *                 pProfile
  333.     );
  334.  
  335. BOOL
  336. WINAPI
  337. WlxActivateUserShell(
  338.     PVOID                   pWlxContext,
  339.     PWSTR                   pszDesktopName,
  340.     PWSTR                   pszMprLogonScript,
  341.     PVOID                   pEnvironment
  342.     );
  343.  
  344. int
  345. WINAPI
  346. WlxLoggedOnSAS(
  347.     PVOID                   pWlxContext,
  348.     DWORD                   dwSasType,
  349.     PVOID                   pReserved
  350.     );
  351.  
  352. VOID
  353. WINAPI
  354. WlxDisplayLockedNotice(
  355.     PVOID                   pWlxContext
  356.     );
  357.  
  358. int
  359. WINAPI
  360. WlxWkstaLockedSAS(
  361.     PVOID                   pWlxContext,
  362.     DWORD                   dwSasType
  363.     );
  364.  
  365. BOOL
  366. WINAPI
  367. WlxIsLockOk(
  368.     PVOID                   pWlxContext
  369.     );
  370.  
  371. BOOL
  372. WINAPI
  373. WlxIsLogoffOk(
  374.     PVOID                   pWlxContext
  375.     );
  376.  
  377. VOID
  378. WINAPI
  379. WlxLogoff(
  380.     PVOID                   pWlxContext
  381.     );
  382.  
  383.  
  384. VOID
  385. WINAPI
  386. WlxShutdown(
  387.     PVOID                   pWlxContext,
  388.     DWORD                   ShutdownType
  389.     );
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. ////////////////////////////////////////////////////////////////////////
  399. //                                                                    //
  400. //  Services that Winlogon provides                                   //
  401. //                                                                    //
  402. ////////////////////////////////////////////////////////////////////////
  403.  
  404.  
  405. typedef VOID
  406. (WINAPI * PWLX_USE_CTRL_ALT_DEL)(
  407.     HANDLE                  hWlx
  408.     );
  409.  
  410. typedef VOID
  411. (WINAPI * PWLX_SET_CONTEXT_POINTER)(
  412.     HANDLE                  hWlx,
  413.     PVOID                   pWlxContext
  414.     );
  415.  
  416. typedef VOID
  417. (WINAPI * PWLX_SAS_NOTIFY)(
  418.     HANDLE                  hWlx,
  419.     DWORD                   dwSasType
  420.     );
  421.  
  422. typedef BOOL
  423. (WINAPI * PWLX_SET_TIMEOUT)(
  424.     HANDLE                  hWlx,
  425.     DWORD                   Timeout);
  426.  
  427. typedef int
  428. (WINAPI * PWLX_ASSIGN_SHELL_PROTECTION)(
  429.     HANDLE                  hWlx,
  430.     HANDLE                  hToken,
  431.     HANDLE                  hProcess,
  432.     HANDLE                  hThread
  433.     );
  434.  
  435. typedef int
  436. (WINAPI * PWLX_MESSAGE_BOX)(
  437.     HANDLE                  hWlx,
  438.     HWND                    hwndOwner,
  439.     LPWSTR                  lpszText,
  440.     LPWSTR                  lpszTitle,
  441.     UINT                    fuStyle
  442.     );
  443.  
  444. typedef int
  445. (WINAPI * PWLX_DIALOG_BOX)(
  446.     HANDLE                  hWlx,
  447.     HANDLE                  hInst,
  448.     LPWSTR                  lpszTemplate,
  449.     HWND                    hwndOwner,
  450.     DLGPROC                 dlgprc
  451.     );
  452.  
  453. typedef int
  454. (WINAPI * PWLX_DIALOG_BOX_INDIRECT)(
  455.     HANDLE                  hWlx,
  456.     HANDLE                  hInst,
  457.     LPCDLGTEMPLATE          hDialogTemplate,
  458.     HWND                    hwndOwner,
  459.     DLGPROC                 dlgprc
  460.     );
  461.  
  462. typedef int
  463. (WINAPI * PWLX_DIALOG_BOX_PARAM)(
  464.     HANDLE                  hWlx,
  465.     HANDLE                  hInst,
  466.     LPWSTR                  lpszTemplate,
  467.     HWND                    hwndOwner,
  468.     DLGPROC                 dlgprc,
  469.     LPARAM                  dwInitParam
  470.     );
  471.  
  472. typedef int
  473. (WINAPI * PWLX_DIALOG_BOX_INDIRECT_PARAM)(
  474.     HANDLE                  hWlx,
  475.     HANDLE                  hInst,
  476.     LPCDLGTEMPLATE          hDialogTemplate,
  477.     HWND                    hwndOwner,
  478.     DLGPROC                 dlgprc,
  479.     LPARAM                  dwInitParam
  480.     );
  481.  
  482. typedef int
  483. (WINAPI * PWLX_SWITCH_DESKTOP_TO_USER)(
  484.     HANDLE                  hWlx);
  485.  
  486. typedef int
  487. (WINAPI * PWLX_SWITCH_DESKTOP_TO_WINLOGON)(
  488.     HANDLE                  hWlx);
  489.  
  490.  
  491. typedef int
  492. (WINAPI * PWLX_CHANGE_PASSWORD_NOTIFY)(
  493.     HANDLE                  hWlx,
  494.     PWLX_MPR_NOTIFY_INFO    pMprInfo,
  495.     DWORD                   dwChangeInfo
  496.     );
  497.  
  498.  
  499.  
  500.  
  501. ////////////////////////////////////////////////////////////////////////
  502. //                                                                    //
  503. //  Function dispatch tables.                                         //
  504. //  One of the following tables will be passed to the GINA DLL        //
  505. //  in the WlxInitialize() call during initialization.                //
  506. //                                                                    //
  507. //  NOTE: FOR THIS REVISION THERE IS ONLY ONE TABLE.  DEVELOPERS      //
  508. //        SHOULD EXPECT MORE IN FUTURE RELEASE.                       //
  509. //                                                                    //
  510. ////////////////////////////////////////////////////////////////////////
  511.  
  512. //
  513. // Dispatch table for version WLX_VERSION_1_0
  514. //
  515.  
  516. typedef struct _WLX_DISPATCH_VERSION_1_0 {
  517.     PWLX_USE_CTRL_ALT_DEL           WlxUseCtrlAltDel;
  518.     PWLX_SET_CONTEXT_POINTER        WlxSetContextPointer;
  519.     PWLX_SAS_NOTIFY                 WlxSasNotify;
  520.     PWLX_SET_TIMEOUT                WlxSetTimeout;
  521.     PWLX_ASSIGN_SHELL_PROTECTION    WlxAssignShellProtection;
  522.     PWLX_MESSAGE_BOX                WlxMessageBox;
  523.     PWLX_DIALOG_BOX                 WlxDialogBox;
  524.     PWLX_DIALOG_BOX_PARAM           WlxDialogBoxParam;
  525.     PWLX_DIALOG_BOX_INDIRECT        WlxDialogBoxIndirect;
  526.     PWLX_DIALOG_BOX_INDIRECT_PARAM  WlxDialogBoxIndirectParam;
  527.     PWLX_SWITCH_DESKTOP_TO_USER     WlxSwitchDesktopToUser;
  528.     PWLX_SWITCH_DESKTOP_TO_WINLOGON WlxSwitchDesktopToWinlogon;
  529.     PWLX_CHANGE_PASSWORD_NOTIFY     WlxChangePasswordNotify;
  530. } WLX_DISPATCH_VERSION_1_0, *PWLX_DISPATCH_VERSION_1_0;
  531.  
  532.  
  533.  
  534.  
  535.  
  536. #endif /* _WINWLX_ */
  537.