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.

292 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. authzi.h
  5. Abstract:
  6. This module contains the authorization framework APIs for internal callers.
  7. Author:
  8. Kedar Dubhashi - October 2000
  9. Revision History:
  10. Created - October 2000
  11. --*/
  12. #ifndef __AUTHZI_H__
  13. #define __AUTHZI_H__
  14. #include <authz.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. DECLARE_HANDLE(AUTHZ_AUDIT_QUEUE_HANDLE);
  19. typedef AUTHZ_AUDIT_QUEUE_HANDLE *PAUTHZ_AUDIT_QUEUE_HANDLE;
  20. //
  21. // For AuthziInitializeAuditEventType
  22. //
  23. #define AUTHZP_INIT_GENERIC_AUDIT_EVENT 0x1
  24. AUTHZAPI
  25. BOOL
  26. WINAPI
  27. AuthziInitializeAuditEventType(
  28. IN DWORD Flags,
  29. IN USHORT CategoryID,
  30. IN USHORT AuditID,
  31. IN USHORT ParameterCount,
  32. OUT PAUTHZ_AUDIT_EVENT_TYPE_HANDLE phAuditEventType
  33. );
  34. //
  35. // Flags for AuthziModifyAuditEventType
  36. //
  37. #define AUTHZ_AUDIT_EVENT_TYPE_AUDITID 0x1
  38. #define AUTHZ_AUDIT_EVENT_TYPE_CATEGID 0x2 // not implemented
  39. #define AUTHZ_AUDIT_EVENT_TYPE_PARAM 0x4 // not implemented
  40. AUTHZAPI
  41. BOOL
  42. WINAPI
  43. AuthziModifyAuditEventType(
  44. IN DWORD Flags,
  45. IN USHORT CategoryID,
  46. IN USHORT AuditID,
  47. IN USHORT ParameterCount,
  48. IN OUT AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType
  49. );
  50. AUTHZAPI
  51. BOOL
  52. WINAPI
  53. AuthziFreeAuditEventType(
  54. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType
  55. );
  56. #define AUTHZ_MONITOR_AUDIT_QUEUE_SIZE 0x00000001
  57. AUTHZAPI
  58. BOOL
  59. WINAPI
  60. AuthziInitializeAuditQueue(
  61. IN DWORD Flags,
  62. IN DWORD dwAuditQueueHigh,
  63. IN DWORD dwAuditQueueLow,
  64. IN PVOID Reserved,
  65. OUT PAUTHZ_AUDIT_QUEUE_HANDLE phAuditQueue
  66. );
  67. #define AUTHZ_AUDIT_QUEUE_HIGH 0x00000001
  68. #define AUTHZ_AUDIT_QUEUE_LOW 0x00000002
  69. #define AUTHZ_AUDIT_QUEUE_THREAD_PRIORITY 0x00000004
  70. #define AUTHZ_AUDIT_QUEUE_FLAGS 0x00000008
  71. #define AUTHZP_MONITOR_AUDIT_QUEUE_SIZE 0x00000010
  72. AUTHZAPI
  73. BOOL
  74. WINAPI
  75. AuthziModifyAuditQueue(
  76. IN OUT AUTHZ_AUDIT_QUEUE_HANDLE pQueue OPTIONAL,
  77. IN DWORD Flags,
  78. IN DWORD dwQueueFlags OPTIONAL,
  79. IN DWORD dwAuditQueueSizeHigh OPTIONAL,
  80. IN DWORD dwAuditQueueSizeLow OPTIONAL,
  81. IN DWORD dwThreadPriority OPTIONAL
  82. );
  83. AUTHZAPI
  84. BOOL
  85. WINAPI
  86. AuthziFreeAuditQueue(
  87. IN AUTHZ_AUDIT_QUEUE_HANDLE hQueue OPTIONAL
  88. );
  89. AUTHZAPI
  90. BOOL
  91. WINAPI
  92. AuthziLogAuditEvent(
  93. IN DWORD Flags,
  94. IN AUTHZ_AUDIT_EVENT_HANDLE hEvent,
  95. IN PVOID pReserved
  96. );
  97. AUTHZAPI
  98. BOOL
  99. WINAPI
  100. AuthziAllocateAuditParams(
  101. OUT PAUDIT_PARAMS * ppParams,
  102. IN USHORT NumParams
  103. );
  104. AUTHZAPI
  105. BOOL
  106. WINAPI
  107. AuthziInitializeAuditParamsWithRM(
  108. IN DWORD Flags,
  109. IN AUTHZ_RESOURCE_MANAGER_HANDLE hResourceManager,
  110. IN USHORT NumParams,
  111. OUT PAUDIT_PARAMS pParams,
  112. ...
  113. );
  114. AUTHZAPI
  115. BOOL
  116. WINAPI
  117. AuthziInitializeAuditParamsFromArray(
  118. IN DWORD Flags,
  119. IN AUTHZ_RESOURCE_MANAGER_HANDLE hResourceManager,
  120. IN USHORT NumParams,
  121. IN PAUDIT_PARAM pParamArray,
  122. OUT PAUDIT_PARAMS pParams
  123. );
  124. AUTHZAPI
  125. BOOL
  126. WINAPI
  127. AuthziInitializeAuditParams(
  128. IN DWORD dwFlags,
  129. OUT PAUDIT_PARAMS pParams,
  130. OUT PSID* ppUserSid,
  131. IN PCWSTR SubsystemName,
  132. IN USHORT NumParams,
  133. ...
  134. );
  135. AUTHZAPI
  136. BOOL
  137. WINAPI
  138. AuthziFreeAuditParams(
  139. PAUDIT_PARAMS pParams
  140. );
  141. #define AUTHZ_DS_CATEGORY_FLAG 0x00000008
  142. AUTHZAPI
  143. BOOL
  144. WINAPI
  145. AuthziInitializeAuditEvent(
  146. IN DWORD Flags,
  147. IN AUTHZ_RESOURCE_MANAGER_HANDLE hRM,
  148. IN AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAuditEventType OPTIONAL,
  149. IN PAUDIT_PARAMS pAuditParams OPTIONAL,
  150. IN AUTHZ_AUDIT_QUEUE_HANDLE hAuditQueue OPTIONAL,
  151. IN DWORD dwTimeOut,
  152. IN PWSTR szOperationType,
  153. IN PWSTR szObjectType,
  154. IN PWSTR szObjectName,
  155. IN PWSTR szAdditionalInfo OPTIONAL,
  156. OUT PAUTHZ_AUDIT_EVENT_HANDLE phAuditEvent
  157. );
  158. //
  159. // Valid flags for AuthzModifyAuditEvent
  160. //
  161. #define AUTHZ_AUDIT_EVENT_FLAGS 0x00000001
  162. #define AUTHZ_AUDIT_EVENT_OPERATION_TYPE 0x00000002
  163. #define AUTHZ_AUDIT_EVENT_OBJECT_TYPE 0x00000004
  164. #define AUTHZ_AUDIT_EVENT_OBJECT_NAME 0x00000008
  165. #define AUTHZ_AUDIT_EVENT_ADDITIONAL_INFO 0x00000010
  166. #define AUTHZ_AUDIT_EVENT_ADDITIONAL_INFO2 0x00000020
  167. #define AUTHZ_VALID_MODIFY_AUDIT_EVENT_FLAGS (AUTHZ_AUDIT_EVENT_FLAGS | \
  168. AUTHZ_AUDIT_EVENT_OPERATION_TYPE | \
  169. AUTHZ_AUDIT_EVENT_OBJECT_TYPE | \
  170. AUTHZ_AUDIT_EVENT_OBJECT_NAME | \
  171. AUTHZ_AUDIT_EVENT_ADDITIONAL_INFO | \
  172. AUTHZ_AUDIT_EVENT_ADDITIONAL_INFO2)
  173. AUTHZAPI
  174. BOOL
  175. WINAPI
  176. AuthziModifyAuditEvent(
  177. IN DWORD Flags,
  178. IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent,
  179. IN DWORD NewFlags,
  180. IN PWSTR szOperationType,
  181. IN PWSTR szObjectType,
  182. IN PWSTR szObjectName,
  183. IN PWSTR szAdditionalInfo
  184. );
  185. AUTHZAPI
  186. BOOL
  187. WINAPI
  188. AuthziModifyAuditEvent2(
  189. IN DWORD Flags,
  190. IN AUTHZ_AUDIT_EVENT_HANDLE hAuditEvent,
  191. IN DWORD NewFlags,
  192. IN PWSTR szOperationType,
  193. IN PWSTR szObjectType,
  194. IN PWSTR szObjectName,
  195. IN PWSTR szAdditionalInfo,
  196. IN PWSTR szAdditionalInfo2
  197. );
  198. AUTHZAPI
  199. BOOL
  200. WINAPI
  201. AuthziQueryAuditPolicy(
  202. IN DWORD dwFlags,
  203. IN AUTHZ_CLIENT_CONTEXT_HANDLE hContext,
  204. IN PCWSTR szResourceManager OPTIONAL,
  205. IN DWORD dwEventID,
  206. OUT PTOKEN_AUDIT_POLICY pPolicy,
  207. IN OUT PDWORD pPolicySize
  208. );
  209. AUTHZAPI
  210. BOOL
  211. WINAPI
  212. AuthziSetAuditPolicy(
  213. IN DWORD dwFlags,
  214. IN AUTHZ_CLIENT_CONTEXT_HANDLE hContext,
  215. IN PCWSTR szResourceManager OPTIONAL,
  216. IN PTOKEN_AUDIT_POLICY pPolicy
  217. );
  218. AUTHZAPI
  219. BOOL
  220. WINAPI
  221. AuthziSourceAudit(
  222. IN DWORD dwFlags,
  223. IN USHORT CategoryId,
  224. IN USHORT AuditId,
  225. IN PWSTR szSource,
  226. IN PSID pUserSid OPTIONAL,
  227. IN USHORT Count,
  228. ...
  229. );
  230. AUTHZAPI
  231. BOOL
  232. WINAPI
  233. AuthziInitializeContextFromSid(
  234. IN DWORD Flags,
  235. IN PSID UserSid,
  236. IN AUTHZ_RESOURCE_MANAGER_HANDLE hAuthzResourceManager,
  237. IN PLARGE_INTEGER pExpirationTime OPTIONAL,
  238. IN LUID Identifier,
  239. IN PVOID DynamicGroupArgs OPTIONAL,
  240. OUT PAUTHZ_CLIENT_CONTEXT_HANDLE phAuthzClientContext
  241. );
  242. #ifdef __cplusplus
  243. }
  244. #endif
  245. #endif