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.

224 lines
5.1 KiB

  1. /*****************************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright (C) 1992-1993 Microsoft Corp. **/
  4. /*****************************************************************************/
  5. //***
  6. // File Name:
  7. // CLAUTH.H
  8. //
  9. // Function:
  10. // Contains header information for Win32 Client and Client
  11. // Authentication Transport module
  12. //
  13. // History:
  14. // 05/18/92 - Michael Salamone (MikeSa) - Original Version 1.0
  15. //***
  16. #ifndef _CLAUTH_
  17. #define _CLAUTH_
  18. /* This flag enables the NT31/WFW311 RAS compression support re-added for the
  19. ** NT-PPC release.
  20. */
  21. #define RASCOMPRESSION 1
  22. #include <lmcons.h>
  23. #ifndef MAX_PHONE_NUMBER_LEN
  24. #define MAX_PHONE_NUMBER_LEN 48
  25. #endif
  26. #ifndef MAX_INIT_NAMES
  27. #define MAX_INIT_NAMES 16
  28. #endif
  29. //
  30. // Used for establishing session with RAS netbios server
  31. //
  32. #define AUTH_NETBIOS_NAME "DIALIN_GATEWAY "
  33. //
  34. // Used for passing NetBIOS projection info to Supervisor
  35. //
  36. typedef struct _NAME_STRUCT
  37. {
  38. BYTE NBName[NETBIOS_NAME_LEN]; // NetBIOS name
  39. WORD wType; // GROUP, UNIQUE, COMPUTER
  40. } NAME_STRUCT, *PNAME_STRUCT;
  41. //
  42. // Configuration info supplied by UI to auth transport
  43. //
  44. #define INVALID_NET_HANDLE 0xFFFFFFFFL
  45. typedef struct _AUTH_CONFIGURATION_INFO
  46. {
  47. RAS_PROTOCOLTYPE Protocol;
  48. DWORD NetHandle;
  49. WORD CallbackDelay;
  50. BOOL fUseCallbackDelay;
  51. BOOL fUseSoftwareCompression;
  52. BOOL fForceDataEncryption;
  53. BOOL fProjectIp;
  54. BOOL fProjectIpx;
  55. BOOL fProjectNbf;
  56. } AUTH_CONFIGURATION_INFO, *PAUTH_CONFIGURATION_INFO;
  57. typedef struct _AUTH_SUCCESS_INFO
  58. {
  59. BOOL fPppCapable;
  60. } AUTH_SUCCESS_INFO, *PAUTH_SUCCESS_INFO;
  61. //
  62. // Error codes for AUTH_FAILURE_INFO are found in raserror.h
  63. //
  64. typedef struct _AUTH_FAILURE_INFO
  65. {
  66. DWORD Result;
  67. DWORD ExtraInfo; // Only valid if non-zero
  68. } AUTH_FAILURE_INFO, *PAUTH_FAILURE_INFO;
  69. //
  70. // Projection result info must be copied into this structure.
  71. //
  72. typedef struct _NETBIOS_PROJECTION_RESULT
  73. {
  74. DWORD Result;
  75. char achName[NETBIOS_NAME_LEN + 1]; // this will be NULL-terminated
  76. } NETBIOS_PROJECTION_RESULT, *PNETBIOS_PROJECTION_RESULT;
  77. typedef struct _AUTH_PROJECTION_RESULT
  78. {
  79. BOOL IpProjected;
  80. BOOL IpxProjected;
  81. BOOL NbProjected;
  82. NETBIOS_PROJECTION_RESULT NbInfo;
  83. } AUTH_PROJECTION_RESULT, *PAUTH_PROJECTION_RESULT;
  84. //
  85. // These are possible values for wInfoType field in AUTH_RESULT struct below.
  86. //
  87. #define AUTH_DONE 1
  88. #define AUTH_RETRY_NOTIFY 2
  89. #define AUTH_FAILURE 3
  90. #define AUTH_PROJ_RESULT 4
  91. #define AUTH_REQUEST_CALLBACK_DATA 5
  92. #define AUTH_CALLBACK_NOTIFY 6
  93. #define AUTH_CHANGE_PASSWORD_NOTIFY 7
  94. #define AUTH_PROJECTING_NOTIFY 8
  95. #define AUTH_LINK_SPEED_NOTIFY 9
  96. #define AUTH_STOP_COMPLETED 10
  97. //
  98. // This is structure returned by AuthGetInfo API
  99. //
  100. typedef struct _AUTH_CLIENT_INFO
  101. {
  102. WORD wInfoType;
  103. union
  104. {
  105. AUTH_SUCCESS_INFO DoneInfo;
  106. AUTH_PROJECTION_RESULT ProjResult;
  107. AUTH_FAILURE_INFO FailureInfo;
  108. };
  109. } AUTH_CLIENT_INFO, *PAUTH_CLIENT_INFO;
  110. //
  111. // Interface exported to Client UI follows
  112. //
  113. //
  114. // Used by Client UI to supply Auth Xport w/callback number
  115. //
  116. DWORD AuthCallback(
  117. IN HPORT,
  118. IN PCHAR // pszCallbackNumber
  119. );
  120. DWORD AuthChangePassword(
  121. IN HPORT,
  122. IN PCHAR, // pszUserName
  123. IN PCHAR, // pszPassword
  124. IN PCHAR // pszNewPassword
  125. );
  126. //
  127. // Called by UI to tell authentication it has completed processing the
  128. // last authentication event. Called after AUTH_PROJECTION_RESULT and
  129. // AUTH_CALLBACK_NOTIFY authentication events.
  130. //
  131. DWORD AuthContinue(
  132. IN HPORT
  133. );
  134. //
  135. // Used by Client UI to get completion info from Auth Xport module
  136. //
  137. DWORD AuthGetInfo(
  138. IN HPORT,
  139. OUT PAUTH_CLIENT_INFO
  140. );
  141. //
  142. // To allow UI to provide a new username and/or password for authenticating
  143. // on. Called in response to AUTH_RETRY_NOTIFY event (indicating previous
  144. // username/password combination failed authentication).
  145. //
  146. DWORD AuthRetry(
  147. IN HPORT,
  148. IN PCHAR, // Username
  149. IN PCHAR, // Password
  150. IN PCHAR // Domain
  151. );
  152. //
  153. // To kick off an Authentication thread for the given port. Used to
  154. // 1) initiate authentication; 2) retry authentication when invalid
  155. // account info supplied; 3) resume authentication after callback..
  156. //
  157. DWORD AuthStart(
  158. IN HPORT,
  159. IN PCHAR OPTIONAL, // Username
  160. IN PCHAR OPTIONAL, // Password
  161. IN PCHAR, // Domain
  162. IN PAUTH_CONFIGURATION_INFO,
  163. IN HANDLE // Event Handle
  164. );
  165. //
  166. // Used by Client UI to tell Auth Xport module to halt authentication
  167. // processing on the given port.
  168. //
  169. DWORD AuthStop(
  170. IN HPORT hPort
  171. );
  172. //
  173. // Returned by AuthStop
  174. //
  175. #define AUTH_STOP_PENDING 1
  176. #endif