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.

121 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 2000-2002 Microsoft Corporation
  3. Module Name:
  4. notify.h
  5. Abstract:
  6. This module contains the notification list utilities.
  7. A notification list is optionally synchronized with
  8. a user specified UL_ERESOURCE, and provides an iterator
  9. called UlNotifyAllEntries.
  10. Author:
  11. Michael Courage (mcourage) 25-Jan-2000
  12. Revision History:
  13. --*/
  14. #ifndef _NOTIFY_H_
  15. #define _NOTIFY_H_
  16. //
  17. // forwards
  18. //
  19. typedef struct _UL_NOTIFY_ENTRY *PUL_NOTIFY_ENTRY;
  20. //
  21. // Notification function prototype.
  22. // Invoked on a list notification.
  23. //
  24. // Arguments:
  25. // pEntry - the entry that is being notified
  26. // pv - "anything" parameter from UlNotifyEntries caller
  27. //
  28. // Return Value:
  29. // Function returns TRUE to continue iterating through the list
  30. // or FALSE to stop iterating.
  31. //
  32. typedef
  33. BOOLEAN
  34. (*PUL_NOTIFY_FUNC)(
  35. IN PUL_NOTIFY_ENTRY pEntry,
  36. IN PVOID pHost,
  37. IN PVOID pv
  38. );
  39. //
  40. // The head of a notification list
  41. //
  42. typedef struct _UL_NOTIFY_HEAD
  43. {
  44. //
  45. // A list of UL_NOTIFY_ENTRYs
  46. //
  47. LIST_ENTRY ListHead;
  48. PUL_ERESOURCE pResource;
  49. } UL_NOTIFY_HEAD, *PUL_NOTIFY_HEAD;
  50. //
  51. // An entry in the notification list.
  52. //
  53. typedef struct _UL_NOTIFY_ENTRY
  54. {
  55. //
  56. // List information.
  57. //
  58. LIST_ENTRY ListEntry;
  59. PUL_NOTIFY_HEAD pHead;
  60. //
  61. // A pointer to the object containting this entry
  62. //
  63. PVOID pHost;
  64. } UL_NOTIFY_ENTRY, *PUL_NOTIFY_ENTRY;
  65. //
  66. // Notification List functions
  67. //
  68. VOID
  69. UlInitializeNotifyHead(
  70. IN PUL_NOTIFY_HEAD pHead,
  71. IN PUL_ERESOURCE pResource OPTIONAL
  72. );
  73. VOID
  74. UlInitializeNotifyEntry(
  75. IN PUL_NOTIFY_ENTRY pEntry,
  76. IN PVOID pHost
  77. );
  78. VOID
  79. UlAddNotifyEntry(
  80. IN PUL_NOTIFY_HEAD pHead,
  81. IN PUL_NOTIFY_ENTRY pEntry
  82. );
  83. VOID
  84. UlRemoveNotifyEntry(
  85. IN PUL_NOTIFY_ENTRY pEntry
  86. );
  87. VOID
  88. UlNotifyAllEntries(
  89. IN PUL_NOTIFY_FUNC pFunction,
  90. IN PUL_NOTIFY_HEAD pHead,
  91. IN PVOID pv OPTIONAL
  92. );
  93. #endif // _NOTIFY_H_