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.

176 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. queue.h
  5. Abstract:
  6. prototypes for queue algorithms and data structures to handle policy notifications
  7. Author:
  8. Vishnu Patankar (vishnup) 15-Aug-2000 created
  9. --*/
  10. #ifndef _queuep_
  11. #define _queuep_
  12. #include "splay.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define SCE_QUEUE_INFO_SAM 1L
  17. #define SCE_QUEUE_INFO_AUDIT 2L
  18. #define SCE_QUEUE_INFO_RIGHTS 4L
  19. typedef enum _NOTIFICATIONQ_OPERATION_TYPE {
  20. ScepNotificationEnqueue = 1,
  21. ScepNotificationDequeue,
  22. ScepNotificationRetry,
  23. ScepNotificationProcess
  24. } NOTIFICATIONQ_OPERATION_TYPE, *PNOTIFICATIONQ_OPERATION_TYPE;
  25. #define SCEP_NUM_NOTIFICATION_SECONDS 300
  26. #define SCEP_NUM_SHUTDOWN_SECONDS 60
  27. #define SCEP_NUM_CHECK_EMPTY_SECONDS 60
  28. #define SCEP_NUM_REST_SECONDS 20
  29. #define SCEP_IS_SAM_OBJECT(ObjectType) ((ObjectType == SecurityDbObjectSamUser ||\
  30. ObjectType == SecurityDbObjectSamGroup ||\
  31. ObjectType == SecurityDbObjectSamAlias) ?\
  32. TRUE : FALSE)
  33. #define MAX_SID_LENGTH SID_MAX_SUB_AUTHORITIES*sizeof(DWORD)+10
  34. #define SCE_NOTIFICATION_PATH \
  35. SCE_ROOT_PATH TEXT("\\Notifications")
  36. typedef struct _SCESRV_POLQUEUE_ {
  37. DWORD dwPending;
  38. SECURITY_DB_TYPE DbType;
  39. SECURITY_DB_OBJECT_TYPE ObjectType;
  40. SECURITY_DB_DELTA_TYPE DeltaType;
  41. DWORD ExplicitLowRight;
  42. DWORD ExplicitHighRight;
  43. CHAR Sid[MAX_SID_LENGTH];
  44. struct _SCESRV_POLQUEUE_ *Next;
  45. } SCESRV_POLQUEUE, *PSCESRV_POLQUEUE;
  46. NTSTATUS
  47. ScepQueueStartSystemThread(
  48. );
  49. DWORD
  50. ScepNotificationQInitialize(
  51. );
  52. DWORD
  53. ScepNotificationQSystemThreadFunc(
  54. );
  55. VOID
  56. ScepNotificationQDequeue(
  57. IN BOOL bAllNodes
  58. );
  59. DWORD
  60. ScepNotificationQEnqueue(
  61. IN SECURITY_DB_TYPE DbType,
  62. IN SECURITY_DB_DELTA_TYPE DeltaType,
  63. IN SECURITY_DB_OBJECT_TYPE ObjectType,
  64. IN PSID ObjectSid OPTIONAL,
  65. IN DWORD ExplicitLowRight,
  66. IN DWORD ExplicitHighRight,
  67. IN PSCESRV_POLQUEUE pRetryQNode OPTIONAL
  68. );
  69. VOID
  70. ScepNotificationQFree(
  71. );
  72. DWORD
  73. ScepNotificationQFlush(
  74. );
  75. DWORD
  76. ScepNotificationQUnFlush(
  77. );
  78. VOID
  79. ScepNotificationQNodeLog(
  80. IN PSCESRV_POLQUEUE pQNode,
  81. IN NOTIFICATIONQ_OPERATION_TYPE NotificationOp
  82. );
  83. DWORD
  84. ScepGetQueueInfo(
  85. OUT DWORD *pdwInfo,
  86. IN OUT PSCEP_SPLAY_TREE pRootNode OPTIONAL
  87. );
  88. DWORD
  89. ScepNotifyLogPolicy(
  90. IN DWORD ErrCode,
  91. IN BOOL bLogTime,
  92. IN PWSTR Msg,
  93. IN DWORD DbType,
  94. IN DWORD ObjectType,
  95. IN PWSTR ObjectName OPTIONAL
  96. );
  97. DWORD
  98. ScepQueuePrepareShutdown(
  99. );
  100. DWORD
  101. ScepNotificationLogOpen(
  102. );
  103. VOID
  104. ScepNotificationLogClose(
  105. );
  106. VOID
  107. ScepBackupNotificationLogFile(
  108. );
  109. VOID
  110. ScepNotificationQCleanup(
  111. );
  112. VOID
  113. ScepNotificationQControl(
  114. IN DWORD Flag
  115. );
  116. DWORD
  117. ScepCheckAndWaitPolicyPropFinish();
  118. //
  119. // for debugging only
  120. //
  121. VOID
  122. ScepDbgNotificationQDump(
  123. );
  124. VOID
  125. ScepDbgNotificationQDumpNode(
  126. IN PSCESRV_POLQUEUE pQNode
  127. );
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif