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

322 lines
6.3 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // iaslsa.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file describes the private wrapper around LSA/SAM.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 08/19/1998 Original version.
  16. // 10/19/1998 Added IASGetUserParameters.
  17. // 10/21/1998 Added IASQueryDialinPrivilege & IASValidateUserName.
  18. // 01/25/1999 MS-CHAP v2
  19. // 02/03/1999 Drop ARAP guest logon support.
  20. // 02/19/1999 Add IASGetDcName.
  21. // 03/08/1999 Add IASPurgeTicketCache.
  22. // 05/21/1999 Add ChallengeLength to IASLogonMSCHAPv2.
  23. // 07/29/1999 Add IASGetAliasMembership.
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. #ifndef _IASLSA_H_
  27. #define _IASLSA_H_
  28. #if _MSC_VER >= 1000
  29. #pragma once
  30. #endif
  31. #include <dsgetdc.h>
  32. #include <lmcons.h>
  33. #include <mprapi.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. //////////
  38. // These are defined here to avoid dependencies on the NT headers.
  39. //////////
  40. #define _MSV1_0_CHALLENGE_LENGTH 8
  41. #define _NT_RESPONSE_LENGTH 24
  42. #define _LM_RESPONSE_LENGTH 24
  43. #define _MSV1_0_USER_SESSION_KEY_LENGTH 16
  44. #define _MSV1_0_LANMAN_SESSION_KEY_LENGTH 8
  45. #define _ENCRYPTED_LM_OWF_PASSWORD_LENGTH 16
  46. #define _ENCRYPTED_NT_OWF_PASSWORD_LENGTH 16
  47. #define _SAMPR_ENCRYPTED_USER_PASSWORD_LENGTH 516
  48. #define _MAX_ARAP_USER_NAMELEN 32
  49. #define _AUTHENTICATOR_RESPONSE_LENGTH 20
  50. DWORD
  51. WINAPI
  52. IASLsaInitialize( VOID );
  53. VOID
  54. WINAPI
  55. IASLsaUninitialize( VOID );
  56. DWORD
  57. WINAPI
  58. IASLogonPAP(
  59. IN PCWSTR UserName,
  60. IN PCWSTR Domain,
  61. IN PCSTR Password,
  62. OUT PHANDLE Token
  63. );
  64. DWORD
  65. WINAPI
  66. IASLogonCHAP(
  67. IN PCWSTR UserName,
  68. IN PCWSTR Domain,
  69. IN BYTE ChallengeID,
  70. IN PBYTE Challenge,
  71. IN DWORD ChallengeLength,
  72. IN PBYTE Response,
  73. OUT PHANDLE Token
  74. );
  75. typedef struct _IAS_ARAP_PROFILE {
  76. DWORD NTResponse1;
  77. DWORD NTResponse2;
  78. DWORD PwdCreationDate;
  79. DWORD PwdExpiryDelta;
  80. DWORD CurrentTime;
  81. } IAS_ARAP_PROFILE, *PIAS_ARAP_PROFILE;
  82. DWORD
  83. WINAPI
  84. IASLogonARAP(
  85. IN PCWSTR UserName,
  86. IN PCWSTR Domain,
  87. IN DWORD NTChallenge1,
  88. IN DWORD NTChallenge2,
  89. IN DWORD MacResponse1,
  90. IN DWORD MacResponse2,
  91. IN DWORD MacChallenge1,
  92. IN DWORD MacChallenge2,
  93. OUT PIAS_ARAP_PROFILE Profile,
  94. OUT PHANDLE Token
  95. );
  96. DWORD
  97. WINAPI
  98. IASChangePasswordARAP(
  99. IN PCWSTR UserName,
  100. IN PCWSTR Domain,
  101. IN PBYTE OldPassword,
  102. IN PBYTE NewPassword
  103. );
  104. typedef struct _IAS_MSCHAP_PROFILE {
  105. WCHAR LogonDomainName[DNLEN + 1];
  106. UCHAR UserSessionKey[_MSV1_0_USER_SESSION_KEY_LENGTH];
  107. UCHAR LanmanSessionKey[_MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  108. } IAS_MSCHAP_PROFILE, *PIAS_MSCHAP_PROFILE;
  109. DWORD
  110. WINAPI
  111. IASLogonMSCHAP(
  112. IN PCWSTR UserName,
  113. IN PCWSTR Domain,
  114. IN PBYTE Challenge,
  115. IN PBYTE NtResponse,
  116. IN PBYTE LmResponse,
  117. OUT PIAS_MSCHAP_PROFILE Profile,
  118. OUT PHANDLE Token
  119. );
  120. DWORD
  121. WINAPI
  122. IASChangePassword1(
  123. IN PCWSTR UserName,
  124. IN PCWSTR Domain,
  125. IN PBYTE Challenge,
  126. IN PBYTE LmOldPassword,
  127. IN PBYTE LmNewPassword,
  128. IN PBYTE NtOldPassword,
  129. IN PBYTE NtNewPassword,
  130. IN DWORD NewLmPasswordLength,
  131. IN BOOL NtPresent,
  132. OUT PBYTE NewNtResponse,
  133. OUT PBYTE NewLmResponse
  134. );
  135. DWORD
  136. WINAPI
  137. IASChangePassword2(
  138. IN PCWSTR UserName,
  139. IN PCWSTR Domain,
  140. IN PBYTE OldNtHash,
  141. IN PBYTE OldLmHash,
  142. IN PBYTE NtEncPassword,
  143. IN PBYTE LmEncPassword,
  144. IN BOOL LmPresent
  145. );
  146. typedef struct _IAS_MSCHAP_V2_PROFILE {
  147. WCHAR LogonDomainName[DNLEN + 1];
  148. UCHAR AuthResponse[_AUTHENTICATOR_RESPONSE_LENGTH];
  149. UCHAR RecvSessionKey[_MSV1_0_USER_SESSION_KEY_LENGTH];
  150. UCHAR SendSessionKey[_MSV1_0_USER_SESSION_KEY_LENGTH];
  151. } IAS_MSCHAP_V2_PROFILE, *PIAS_MSCHAP_V2_PROFILE;
  152. DWORD
  153. WINAPI
  154. IASLogonMSCHAPv2(
  155. IN PCWSTR UserName,
  156. IN PCWSTR Domain,
  157. IN PCSTR HashUserName,
  158. IN PBYTE Challenge,
  159. IN DWORD ChallengeLength,
  160. IN PBYTE Response,
  161. IN PBYTE PeerChallenge,
  162. OUT PIAS_MSCHAP_V2_PROFILE Profile,
  163. OUT PHANDLE Token
  164. );
  165. DWORD
  166. WINAPI
  167. IASChangePassword3(
  168. IN PCWSTR UserName,
  169. IN PCWSTR Domain,
  170. IN PBYTE EncHash,
  171. IN PBYTE EncPassword
  172. );
  173. typedef struct _IAS_LOGON_HOURS {
  174. USHORT UnitsPerWeek;
  175. PUCHAR LogonHours;
  176. } IAS_LOGON_HOURS, *PIAS_LOGON_HOURS;
  177. DWORD
  178. WINAPI
  179. IASCheckAccountRestrictions(
  180. IN PLARGE_INTEGER AccountExpires,
  181. IN PIAS_LOGON_HOURS LogonHours
  182. );
  183. typedef PVOID (WINAPI *PIAS_LSA_ALLOC)(
  184. IN SIZE_T uBytes
  185. );
  186. DWORD
  187. WINAPI
  188. IASGetAliasMembership(
  189. IN PSID UserSid,
  190. IN PTOKEN_GROUPS GlobalGroups,
  191. IN PIAS_LSA_ALLOC Allocator,
  192. OUT PTOKEN_GROUPS *Groups,
  193. OUT PDWORD ReturnLength
  194. );
  195. DWORD
  196. WINAPI
  197. IASGetGroupsForUser(
  198. IN PCWSTR UserName,
  199. IN PCWSTR Domain,
  200. IN PIAS_LSA_ALLOC Allocator,
  201. OUT PTOKEN_GROUPS *Groups,
  202. OUT PDWORD ReturnLength
  203. );
  204. DWORD
  205. WINAPI
  206. IASGetRASUserInfo(
  207. IN PCWSTR UserName,
  208. IN PCWSTR Domain,
  209. OUT PRAS_USER_0 RasUser0
  210. );
  211. DWORD
  212. WINAPI
  213. IASGetUserParameters(
  214. IN PCWSTR UserName,
  215. IN PCWSTR Domain,
  216. OUT PWSTR *UserParameters
  217. );
  218. typedef enum _IAS_DIALIN_PRIVILEGE {
  219. IAS_DIALIN_DENY,
  220. IAS_DIALIN_POLICY,
  221. IAS_DIALIN_ALLOW
  222. } IAS_DIALIN_PRIVILEGE, *PIAS_DIALIN_PRIVILEGE;
  223. DWORD
  224. WINAPI
  225. IASQueryDialinPrivilege(
  226. IN PCWSTR UserName,
  227. IN PCWSTR Domain,
  228. OUT PIAS_DIALIN_PRIVILEGE pfPrivilege
  229. );
  230. DWORD
  231. WINAPI
  232. IASValidateUserName(
  233. IN PCWSTR UserName,
  234. IN PCWSTR Domain
  235. );
  236. PCWSTR
  237. WINAPI
  238. IASGetDefaultDomain( VOID );
  239. BOOL
  240. WINAPI
  241. IASIsDomainLocal(
  242. IN PCWSTR Domain
  243. );
  244. typedef enum _IAS_ROLE {
  245. IAS_ROLE_STANDALONE,
  246. IAS_ROLE_MEMBER,
  247. IAS_ROLE_DC
  248. } IAS_ROLE;
  249. IAS_ROLE
  250. WINAPI
  251. IASGetRole( VOID );
  252. typedef enum _IAS_PRODUCT_TYPE {
  253. IAS_PRODUCT_WORKSTATION,
  254. IAS_PRODUCT_SERVER
  255. } IAS_PRODUCT_TYPE;
  256. IAS_PRODUCT_TYPE
  257. WINAPI
  258. IASGetProductType( VOID );
  259. DWORD
  260. WINAPI
  261. IASGetGuestAccountName(
  262. OUT PWSTR GuestAccount
  263. );
  264. HRESULT
  265. WINAPI
  266. IASMapWin32Error(
  267. DWORD dwError,
  268. HRESULT hrDefault
  269. );
  270. DWORD
  271. WINAPI
  272. IASGetDcName(
  273. IN LPCWSTR DomainName,
  274. IN ULONG Flags,
  275. OUT PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  276. );
  277. DWORD
  278. WINAPI
  279. IASPurgeTicketCache( VOID );
  280. #ifdef __cplusplus
  281. }
  282. #endif
  283. #endif // _IASLSA_H_