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.

102 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. ntos\tdi\isn\fwd\driver.h
  5. Abstract:
  6. IPX Forwarder driver dispatch routines
  7. Author:
  8. Vadim Eydelman
  9. Revision History:
  10. --*/
  11. #ifndef _IPXFWD_DRIVER_
  12. #define _IPXFWD_DRIVER_
  13. // Pseudo constant 0xFFFFFFFFFFFFF
  14. extern const UCHAR BROADCAST_NODE[6];
  15. // Performance measurement:
  16. // Enabling flag
  17. extern BOOLEAN MeasuringPerformance;
  18. // Access control
  19. extern KSPIN_LOCK PerfCounterLock;
  20. // Statistic accumulators (counters)
  21. extern FWD_PERFORMANCE PerfBlock;
  22. // Access control for external callers (ipx stack, filter driver)
  23. // Flag set upon completion of initialization of all components
  24. extern volatile BOOLEAN IpxFwdInitialized;
  25. // Number of clients executing forwarder code (if -1, the forwarder
  26. // is being stopped)
  27. extern LONG ClientCount;
  28. // Event to be signalled by the last client inside forwarder
  29. extern KEVENT ClientsGoneEvent;
  30. /*++
  31. E n t e r F o r w a r d e r
  32. Routine Description:
  33. Checks if forwarder is initialized and grants access
  34. to it (records the entrance as well
  35. Arguments:
  36. None
  37. Return Value:
  38. TRUE - access granted
  39. FALSE - forwarder is not yet initialized or is being stopped
  40. --*/
  41. //BOOLEAN
  42. //EnterForwarder (
  43. // void
  44. // );
  45. #define EnterForwarder() ( \
  46. (InterlockedIncrement(&ClientCount), IpxFwdInitialized) \
  47. ? TRUE \
  48. : (DoLeaveForwarder(), FALSE) \
  49. )
  50. /*++
  51. L e a v e F o r w a r d e r
  52. Routine Description:
  53. Records the fact that external client stopped using forwarder
  54. Arguments:
  55. None
  56. Return Value:
  57. None
  58. --*/
  59. //BOOLEAN
  60. //EnterForwarder (
  61. // void
  62. // );
  63. #define LeaveForwarder() \
  64. ((InterlockedDecrement(&ClientCount)<0) \
  65. ? KeSetEvent (&ClientsGoneEvent,0,FALSE) \
  66. : 0 \
  67. )
  68. // Same as above but implemented as a routine to be used in
  69. // the EnterForwarder macro above (this reduces code size
  70. // and aids in debugging by improving readability of disassembly
  71. BOOLEAN
  72. DoLeaveForwarder (
  73. VOID
  74. );
  75. #endif