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.

94 lines
1.8 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. OUT OPTIONAL void * * TaskHandle
  50. );
  51. //
  52. // Task manipulation code to be used at any time
  53. //
  54. BOOL
  55. KerbTaskDoItNow(
  56. IN HANDLE TaskHandle
  57. );
  58. //
  59. // Task manipulation code to be used inside trigger functions
  60. //
  61. BOOLEAN
  62. KerbTaskIsPeriodic(
  63. IN void * TaskHandle
  64. );
  65. LONG
  66. KerbTaskGetInterval(
  67. IN void * TaskHandle
  68. );
  69. void
  70. KerbTaskCancel(
  71. IN void * TaskHandle
  72. );
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif // __KERBSCAV_HXX_