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.

127 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 2000-2001 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. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. //
  20. // forwards
  21. //
  22. typedef struct _UL_NOTIFY_ENTRY *PUL_NOTIFY_ENTRY;
  23. //
  24. // Notification function prototype.
  25. // Invoked on a list notification.
  26. //
  27. // Arguments:
  28. // pEntry - the entry that is being notified
  29. // pv - "anything" parameter from UlNotifyEntries caller
  30. //
  31. // Return Value:
  32. // Function returns TRUE to continue iterating through the list
  33. // or FALSE to stop iterating.
  34. //
  35. typedef
  36. BOOLEAN
  37. (*PUL_NOTIFY_FUNC)(
  38. IN PUL_NOTIFY_ENTRY pEntry,
  39. IN PVOID pHost,
  40. IN PVOID pv
  41. );
  42. //
  43. // The head of a notification list
  44. //
  45. typedef struct _UL_NOTIFY_HEAD
  46. {
  47. //
  48. // A list of UL_NOTIFY_ENTRYs
  49. //
  50. LIST_ENTRY ListHead;
  51. PUL_ERESOURCE pResource;
  52. } UL_NOTIFY_HEAD, *PUL_NOTIFY_HEAD;
  53. //
  54. // An entry in the notification list.
  55. //
  56. typedef struct _UL_NOTIFY_ENTRY
  57. {
  58. //
  59. // List information.
  60. //
  61. LIST_ENTRY ListEntry;
  62. PUL_NOTIFY_HEAD pHead;
  63. //
  64. // A pointer to the object containting this entry
  65. //
  66. PVOID pHost;
  67. } UL_NOTIFY_ENTRY, *PUL_NOTIFY_ENTRY;
  68. //
  69. // Notification List functions
  70. //
  71. VOID
  72. UlInitializeNotifyHead(
  73. IN PUL_NOTIFY_HEAD pHead,
  74. IN PUL_ERESOURCE pResource OPTIONAL
  75. );
  76. VOID
  77. UlInitializeNotifyEntry(
  78. IN PUL_NOTIFY_ENTRY pEntry,
  79. IN PVOID pHost
  80. );
  81. VOID
  82. UlAddNotifyEntry(
  83. IN PUL_NOTIFY_HEAD pHead,
  84. IN PUL_NOTIFY_ENTRY pEntry
  85. );
  86. VOID
  87. UlRemoveNotifyEntry(
  88. IN PUL_NOTIFY_ENTRY pEntry
  89. );
  90. VOID
  91. UlNotifyAllEntries(
  92. IN PUL_NOTIFY_FUNC pFunction,
  93. IN PUL_NOTIFY_HEAD pHead,
  94. IN PVOID pv OPTIONAL
  95. );
  96. #ifdef __cplusplus
  97. }; // extern "C"
  98. #endif
  99. #endif // _NOTIFY_H_