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.

171 lines
2.8 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 MAX_SID_LENGTH SID_MAX_SUB_AUTHORITIES*sizeof(DWORD)+10
  30. #define SCE_NOTIFICATION_PATH \
  31. SCE_ROOT_PATH TEXT("\\Notifications")
  32. typedef struct _SCESRV_POLQUEUE_ {
  33. DWORD dwPending;
  34. SECURITY_DB_TYPE DbType;
  35. SECURITY_DB_OBJECT_TYPE ObjectType;
  36. SECURITY_DB_DELTA_TYPE DeltaType;
  37. DWORD ExplicitLowRight;
  38. DWORD ExplicitHighRight;
  39. CHAR Sid[MAX_SID_LENGTH];
  40. struct _SCESRV_POLQUEUE_ *Next;
  41. } SCESRV_POLQUEUE, *PSCESRV_POLQUEUE;
  42. NTSTATUS
  43. ScepQueueStartSystemThread(
  44. );
  45. DWORD
  46. ScepNotificationQInitialize(
  47. );
  48. DWORD
  49. ScepNotificationQSystemThreadFunc(
  50. );
  51. VOID
  52. ScepNotificationQDequeue(
  53. );
  54. DWORD
  55. ScepNotificationQEnqueue(
  56. IN SECURITY_DB_TYPE DbType,
  57. IN SECURITY_DB_DELTA_TYPE DeltaType,
  58. IN SECURITY_DB_OBJECT_TYPE ObjectType,
  59. IN PSID ObjectSid OPTIONAL,
  60. IN DWORD ExplicitLowRight,
  61. IN DWORD ExplicitHighRight,
  62. IN PSCESRV_POLQUEUE pRetryQNode OPTIONAL
  63. );
  64. VOID
  65. ScepNotificationQFree(
  66. );
  67. DWORD
  68. ScepNotificationQFlush(
  69. );
  70. DWORD
  71. ScepNotificationQUnFlush(
  72. );
  73. VOID
  74. ScepNotificationQNodeLog(
  75. IN PSCESRV_POLQUEUE pQNode,
  76. IN NOTIFICATIONQ_OPERATION_TYPE NotificationOp
  77. );
  78. DWORD
  79. ScepGetQueueInfo(
  80. OUT DWORD *pdwInfo,
  81. IN OUT PSCEP_SPLAY_TREE pRootNode
  82. );
  83. DWORD
  84. ScepNotifyLogPolicy(
  85. IN DWORD ErrCode,
  86. IN BOOL bLogTime,
  87. IN PWSTR Msg,
  88. IN DWORD DbType,
  89. IN DWORD ObjectType,
  90. IN PWSTR ObjectName OPTIONAL
  91. );
  92. DWORD
  93. ScepQueuePrepareShutdown(
  94. );
  95. DWORD
  96. ScepNotificationLogOpen(
  97. );
  98. VOID
  99. ScepNotificationLogClose(
  100. );
  101. VOID
  102. ScepBackupNotificationLogFile(
  103. );
  104. VOID
  105. ScepNotificationQCleanup(
  106. );
  107. VOID
  108. ScepNotificationQControl(
  109. IN DWORD Flag
  110. );
  111. DWORD
  112. ScepCheckAndWaitPolicyPropFinish();
  113. //
  114. // for debugging only
  115. //
  116. VOID
  117. ScepDbgNotificationQDump(
  118. );
  119. VOID
  120. ScepDbgNotificationQDumpNode(
  121. IN PSCESRV_POLQUEUE pQNode
  122. );
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif