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.

136 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. net\routing\ipx\sap\sapmain.h
  5. Abstract:
  6. Header file for SAP DLL main module and thread container.
  7. Author:
  8. Vadim Eydelman 05-15-1995
  9. Revision History:
  10. --*/
  11. #ifndef _SAP_SAPMAIN_
  12. #define _SAP_SAPMAIN_
  13. // DLL module instance handle
  14. extern HANDLE hDLLInstance;
  15. // Handle of main thread
  16. extern HANDLE MainThreadHdl;
  17. // Operational state of sap agent
  18. extern ULONG OperationalState;
  19. // Operational state lock to protect from external
  20. // calls in bad states
  21. extern CRITICAL_SECTION OperationalStateLock;
  22. // Are we part of a router
  23. extern volatile BOOLEAN Routing;
  24. // Which external API sets are active
  25. extern volatile BOOLEAN ServiceIfActive;
  26. extern volatile BOOLEAN RouterIfActive;
  27. // Time limit for shutdown broadcast
  28. extern ULONG ShutdownTimeout;
  29. DWORD
  30. GetRouteMetric (
  31. IN UCHAR Network[4],
  32. OUT PUSHORT Metric
  33. );
  34. #define GetServerMetric(Server,Metric) \
  35. ((RouterIfActive) \
  36. ? GetRouteMetric((Server)->Network, (Metric)) \
  37. : ((*Metric=(Server)->HopCount), NO_ERROR))
  38. /*++
  39. *******************************************************************
  40. C r e a t e A l l C o m p o n e n t s
  41. Routine Description:
  42. Calls all sap componenets with initialization call and compiles an
  43. array of synchronization objects from objects returned from each
  44. individual component
  45. Arguments:
  46. None
  47. Return Value:
  48. NO_ERROR - component initialization was performed OK
  49. other - operation failed (windows error code)
  50. *******************************************************************
  51. --*/
  52. DWORD
  53. CreateAllComponents (
  54. HANDLE RMNotificationEvent
  55. );
  56. /*++
  57. *******************************************************************
  58. D e l e t e A l l C o m p o n e n t s
  59. Routine Description:
  60. Releases all resources allocated by SAP agent
  61. Arguments:
  62. None
  63. Return Value:
  64. NO_ERROR - SAP agent was unloaded OK
  65. other - operation failed (windows error code)
  66. *******************************************************************
  67. --*/
  68. DWORD
  69. DeleteAllComponents (
  70. void
  71. );
  72. /*++
  73. *******************************************************************
  74. S t a r t S A P
  75. Routine Description:
  76. Starts SAP threads
  77. Arguments:
  78. None
  79. Return Value:
  80. NO_ERROR - threads started OK
  81. other (windows error code) - start failed
  82. *******************************************************************
  83. --*/
  84. DWORD
  85. StartSAP (
  86. VOID
  87. );
  88. /*++
  89. *******************************************************************
  90. S t o p S A P
  91. Routine Description:
  92. Signals SAP threads to stop
  93. Arguments:
  94. No used
  95. Return Value:
  96. None
  97. *******************************************************************
  98. --*/
  99. VOID
  100. StopSAP (
  101. void
  102. );
  103. VOID
  104. ScheduleSvcsWorkItem (
  105. WORKERFUNCTION *worker
  106. );
  107. VOID
  108. ScheduleRouterWorkItem (
  109. WORKERFUNCTION *worker
  110. );
  111. #endif