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.

91 lines
1.6 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 2001
  6. //
  7. // File: kerbscav.h
  8. //
  9. // Contents: Scavenger (task automation) code
  10. //
  11. //
  12. // History: 29-April-2001 Created MarkPu
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __KERBSCAV_HXX_
  16. #define __KERBSCAV_HXX_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // Scavenger API
  22. //
  23. NTSTATUS
  24. KerbInitializeScavenger();
  25. NTSTATUS
  26. KerbShutdownScavenger();
  27. //
  28. // A trigger function fires when it's time to execute a task
  29. //
  30. // TaskHandle -- a context for KerbTask* functions
  31. // TaskItem -- context that was passed to KerbAddScavengerTask
  32. //
  33. // The scavenger code serializes the calls to trigger functions (NT timers don't)
  34. //
  35. typedef void ( *KERB_TASK_TRIGGER )( void * TaskHandle, void * TaskItem );
  36. //
  37. // A destroy function fires when the scavenger is done with a task and it will
  38. // not be rescheduled.
  39. //
  40. typedef void ( *KERB_TASK_DESTROY )( void * TaskItem );
  41. NTSTATUS
  42. KerbAddScavengerTask(
  43. IN BOOLEAN Periodic,
  44. IN LONG Interval,
  45. IN ULONG Flags,
  46. IN KERB_TASK_TRIGGER pfnTrigger,
  47. IN KERB_TASK_DESTROY pfnDestroy,
  48. IN void * TaskItem
  49. );
  50. //
  51. // Task manipulation code to be used inside trigger functions
  52. //
  53. BOOLEAN
  54. KerbTaskIsPeriodic(
  55. IN void * TaskHandle
  56. );
  57. LONG
  58. KerbTaskGetInterval(
  59. IN void * TaskHandle
  60. );
  61. void
  62. KerbTaskReschedule(
  63. IN void * TaskHandle,
  64. IN BOOLEAN Periodic,
  65. IN LONG Interval
  66. );
  67. void
  68. KerbTaskCancel(
  69. IN void * TaskHandle
  70. );
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif // __KERBSCAV_HXX_