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.

298 lines
6.0 KiB

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