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.

309 lines
7.5 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1997
  6. //
  7. // File: lsaitf.h
  8. //
  9. // Contents: Prototypes for auth packages to call into LSA & SAM
  10. //
  11. //
  12. // History: 21-February-1997 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __LSAITF_H__
  16. #define __LSAITF_H__
  17. #include <samrpc.h>
  18. #include <lsarpc.h>
  19. #include <samisrv.h>
  20. #include <lsaisrv.h>
  21. NTSTATUS
  22. I_SamrSetInformationUser(
  23. IN SAMPR_HANDLE UserHandle,
  24. IN USER_INFORMATION_CLASS UserInformationClass,
  25. IN PSAMPR_USER_INFO_BUFFER Buffer
  26. );
  27. NTSTATUS
  28. I_SamrCloseHandle(
  29. IN OUT SAMPR_HANDLE * SamHandle
  30. );
  31. NTSTATUS
  32. I_SamrOpenDomain(
  33. IN SAMPR_HANDLE ServerHandle,
  34. IN ACCESS_MASK DesiredAccess,
  35. IN PRPC_SID DomainId,
  36. OUT SAMPR_HANDLE * DomainHandle
  37. );
  38. NTSTATUS
  39. I_SamrQueryInformationDomain(
  40. IN SAMPR_HANDLE DomainHandle,
  41. IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
  42. OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer
  43. );
  44. NTSTATUS
  45. I_SamIConnect(
  46. IN PSAMPR_SERVER_NAME ServerName,
  47. OUT SAMPR_HANDLE *ServerHandle,
  48. IN ACCESS_MASK DesiredAccess,
  49. IN BOOLEAN TrustedClient
  50. );
  51. NTSTATUS
  52. I_SamIAccountRestrictions(
  53. IN SAM_HANDLE UserHandle,
  54. IN PUNICODE_STRING LogonWorkstation,
  55. IN PUNICODE_STRING Workstations,
  56. IN PLOGON_HOURS LogonHours,
  57. OUT PLARGE_INTEGER LogoffTime,
  58. OUT PLARGE_INTEGER KickoffTime
  59. );
  60. NTSTATUS
  61. I_SamIGetUserLogonInformation(
  62. IN SAMPR_HANDLE DomainHandle,
  63. IN ULONG Flags,
  64. IN PUNICODE_STRING AccountName,
  65. OUT PSAMPR_USER_INFO_BUFFER * Buffer,
  66. OUT PSID_AND_ATTRIBUTES_LIST ReverseMembership,
  67. OUT OPTIONAL SAMPR_HANDLE * UserHandle
  68. );
  69. NTSTATUS
  70. I_SamIGetUserLogonInformationEx(
  71. IN SAMPR_HANDLE DomainHandle,
  72. IN ULONG Flags,
  73. IN PUNICODE_STRING AccountName,
  74. IN ULONG WhichFields,
  75. OUT PSAMPR_USER_INFO_BUFFER * Buffer,
  76. OUT PSID_AND_ATTRIBUTES_LIST ReverseMembership,
  77. OUT OPTIONAL SAMPR_HANDLE * UserHandle
  78. );
  79. VOID
  80. I_SamIFree_SAMPR_USER_INFO_BUFFER (
  81. PSAMPR_USER_INFO_BUFFER Source,
  82. USER_INFORMATION_CLASS Branch
  83. );
  84. VOID
  85. I_SamIFree_SAMPR_ULONG_ARRAY (
  86. PSAMPR_ULONG_ARRAY Source
  87. );
  88. VOID
  89. I_SamIFree_SAMPR_RETURNED_USTRING_ARRAY (
  90. PSAMPR_RETURNED_USTRING_ARRAY Source
  91. );
  92. VOID
  93. I_SamIFreeSidAndAttributesList(
  94. IN PSID_AND_ATTRIBUTES_LIST List
  95. );
  96. VOID
  97. I_SamIIncrementPerformanceCounter(
  98. IN SAM_PERF_COUNTER_TYPE CounterType
  99. );
  100. VOID
  101. I_SamIFreeVoid(
  102. IN PVOID ptr
  103. );
  104. NTSTATUS
  105. I_SamIUpdateLogonStatistics(
  106. IN SAMPR_HANDLE DomainHandle,
  107. IN PSAM_LOGON_STATISTICS LogonStats
  108. );
  109. NTSTATUS
  110. I_SamIUPNFromUserHandle(
  111. IN SAMPR_HANDLE UserHandle,
  112. OUT BOOLEAN *UPNDefaulted,
  113. OUT PUNICODE_STRING UPN
  114. );
  115. NTSTATUS
  116. I_LsaIOpenPolicyTrusted(
  117. OUT PLSAPR_HANDLE PolicyHandle
  118. );
  119. NTSTATUS
  120. I_LsarClose(
  121. IN OUT LSAPR_HANDLE *ObjectHandle
  122. );
  123. NTSTATUS
  124. I_LsaIQueryInformationPolicyTrusted(
  125. IN POLICY_INFORMATION_CLASS InformationClass,
  126. OUT PLSAPR_POLICY_INFORMATION *Buffer
  127. );
  128. VOID
  129. I_LsaIFree_LSAPR_POLICY_INFORMATION (
  130. IN POLICY_INFORMATION_CLASS InformationClass,
  131. IN PLSAPR_POLICY_INFORMATION PolicyInformation
  132. );
  133. NTSTATUS
  134. I_LsarQueryInformationPolicy(
  135. IN LSAPR_HANDLE PolicyHandle,
  136. IN POLICY_INFORMATION_CLASS InformationClass,
  137. OUT PLSAPR_POLICY_INFORMATION *PolicyInformation
  138. );
  139. NTSTATUS
  140. I_LsarCreateSecret(
  141. IN LSAPR_HANDLE PolicyHandle,
  142. IN PLSAPR_UNICODE_STRING SecretName,
  143. IN ACCESS_MASK DesiredAccess,
  144. OUT LSAPR_HANDLE *SecretHandle
  145. );
  146. NTSTATUS
  147. I_LsarOpenSecret(
  148. IN LSAPR_HANDLE PolicyHandle,
  149. IN PLSAPR_UNICODE_STRING SecretName,
  150. IN ACCESS_MASK DesiredAccess,
  151. OUT LSAPR_HANDLE *SecretHandle
  152. );
  153. NTSTATUS
  154. I_LsarSetSecret(
  155. IN LSAPR_HANDLE SecretHandle,
  156. IN PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue,
  157. IN PLSAPR_CR_CIPHER_VALUE EncryptedOldValue
  158. );
  159. NTSTATUS
  160. I_LsarQuerySecret(
  161. IN LSAPR_HANDLE SecretHandle,
  162. IN OUT OPTIONAL PLSAPR_CR_CIPHER_VALUE *EncryptedCurrentValue,
  163. IN OUT OPTIONAL PLARGE_INTEGER CurrentValueSetTime,
  164. IN OUT OPTIONAL PLSAPR_CR_CIPHER_VALUE *EncryptedOldValue,
  165. IN OUT OPTIONAL PLARGE_INTEGER OldValueSetTime
  166. );
  167. NTSTATUS
  168. I_LsarDelete(
  169. IN OUT LSAPR_HANDLE ObjectHandle
  170. );
  171. VOID
  172. I_LsaIFree_LSAPR_CR_CIPHER_VALUE (
  173. IN PLSAPR_CR_CIPHER_VALUE CipherValue
  174. );
  175. NTSTATUS NTAPI
  176. I_LsaIRegisterPolicyChangeNotificationCallback(
  177. IN pfLsaPolicyChangeNotificationCallback Callback,
  178. IN POLICY_NOTIFICATION_INFORMATION_CLASS MonitorInfoClass
  179. );
  180. NTSTATUS NTAPI
  181. I_LsaIUnregisterPolicyChangeNotificationCallback(
  182. IN pfLsaPolicyChangeNotificationCallback Callback,
  183. IN POLICY_NOTIFICATION_INFORMATION_CLASS MonitorInfoClass
  184. );
  185. NTSTATUS
  186. I_LsaIAuditAccountLogonEx(
  187. IN ULONG AuditId,
  188. IN BOOLEAN Successful,
  189. IN PUNICODE_STRING Source,
  190. IN PUNICODE_STRING ClientName,
  191. IN PUNICODE_STRING MappedName,
  192. IN NTSTATUS LogonStatus, OPTIONAL
  193. IN PSID ClientSid
  194. );
  195. NTSTATUS
  196. I_LsaIGetLogonGuid(
  197. IN PUNICODE_STRING pUserName,
  198. IN PUNICODE_STRING pUserDomain,
  199. IN PBYTE pBuffer,
  200. IN UINT BufferSize,
  201. OUT LPGUID pLogonGuid
  202. );
  203. NTSTATUS
  204. I_LsaISetLogonGuidInLogonSession(
  205. IN PLUID pLogonId,
  206. IN LPGUID pLogonGuid
  207. );
  208. VOID
  209. I_LsaIAuditKerberosLogon(
  210. IN NTSTATUS LogonStatus,
  211. IN NTSTATUS LogonSubStatus,
  212. IN PUNICODE_STRING AccountName,
  213. IN PUNICODE_STRING AuthenticatingAuthority,
  214. IN PUNICODE_STRING WorkstationName,
  215. IN PSID UserSid, OPTIONAL
  216. IN SECURITY_LOGON_TYPE LogonType,
  217. IN PTOKEN_SOURCE TokenSource,
  218. IN PLUID LogonId,
  219. IN LPGUID LogonGuid,
  220. IN PLSA_ADT_STRING_LIST TransittedServices
  221. );
  222. NTSTATUS
  223. I_LsaIAuditLogonUsingExplicitCreds(
  224. IN USHORT AuditEventType,
  225. IN PLUID pUser1LogonId,
  226. IN LPGUID pUser1LogonGuid,
  227. IN HANDLE User1ProcessId,
  228. IN PUNICODE_STRING pUser2Name,
  229. IN PUNICODE_STRING pUser2Domain,
  230. IN LPGUID pUser2LogonGuid,
  231. IN PUNICODE_STRING pTargetName,
  232. IN PUNICODE_STRING pTargetInfo
  233. );
  234. NTSTATUS
  235. I_LsaICallPackage(
  236. IN PUNICODE_STRING AuthenticationPackage,
  237. IN PVOID ProtocolSubmitBuffer,
  238. IN ULONG SubmitBufferLength,
  239. OUT PVOID *ProtocolReturnBuffer,
  240. OUT PULONG ReturnBufferLength,
  241. OUT PNTSTATUS ProtocolStatus
  242. );
  243. NTSTATUS NTAPI
  244. I_LsaIAddNameToLogonSession(
  245. IN PLUID LogonId,
  246. IN ULONG NameFormat,
  247. IN PUNICODE_STRING Name
  248. );
  249. NTSTATUS
  250. I_LsaIGetNameFromLuid(
  251. IN PLUID LogonId,
  252. IN ULONG NameFormat,
  253. IN BOOLEAN LocalOnly,
  254. OUT PUNICODE_STRING Name
  255. );
  256. //
  257. // Internal package-specific flags for the logon session
  258. //
  259. #define LOGONSES_FLAG_NTLM_DOWNLEVEL 0x00000001
  260. NTSTATUS NTAPI
  261. I_LsaISetPackageAttrInLogonSession(
  262. IN PLUID LogonId,
  263. IN ULONG PackageAttr
  264. );
  265. #endif // __LSAITF_H__