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.

115 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1991-1993 Microsoft Corporation
  3. Module Name:
  4. svcslib.h
  5. Abstract:
  6. Contains information for connecting services to the controller process.
  7. Author:
  8. Dan Lafferty (danl) 26-Oct-1993
  9. Environment:
  10. User Mode -Win32
  11. Revision History:
  12. 26-Oct-1993 danl
  13. created
  14. 04-Dec-1996 anirudhs
  15. Added CWorkItemContext
  16. --*/
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // Function Prototypes
  22. //
  23. DWORD
  24. SvcStartLocalDispatcher(
  25. VOID
  26. );
  27. BOOL
  28. SetupInProgress(
  29. HKEY SystemKey,
  30. LPDWORD pdwOOBEMode OPTIONAL
  31. );
  32. #ifdef __cplusplus
  33. //===================
  34. // CWorkItemContext
  35. //===================
  36. // Higher-level wrapper for Rtl thread pool functions
  37. //
  38. // An instance of this class is a callback context for the Rtl thread pool functions
  39. //
  40. class CWorkItemContext
  41. {
  42. public:
  43. NTSTATUS AddWorkItem(
  44. IN DWORD dwFlags
  45. )
  46. {
  47. return RtlQueueWorkItem(CallBack,
  48. this, // pContext
  49. dwFlags);
  50. }
  51. NTSTATUS AddDelayedWorkItem(
  52. IN DWORD dwTimeout,
  53. IN DWORD dwFlags
  54. );
  55. VOID RemoveDelayedWorkItem(
  56. VOID
  57. )
  58. {
  59. ASSERT(m_hWorkItem != NULL);
  60. RtlDeregisterWait(m_hWorkItem);
  61. m_hWorkItem = NULL;
  62. }
  63. static BOOL Init();
  64. static void UnInit();
  65. protected:
  66. virtual VOID Perform(
  67. IN BOOLEAN fWaitStatus
  68. ) = 0;
  69. HANDLE m_hWorkItem;
  70. private:
  71. static VOID CallBack(
  72. IN PVOID pContext
  73. );
  74. static VOID DelayCallBack(
  75. IN PVOID pContext,
  76. IN BOOLEAN fWaitStatus
  77. );
  78. static HANDLE s_hNeverSignaled;
  79. };
  80. #define DECLARE_CWorkItemContext \
  81. protected: \
  82. VOID Perform( \
  83. IN BOOLEAN fWaitStatus \
  84. );
  85. } // extern "C"
  86. #endif // __cplusplus