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.

54 lines
1.6 KiB

  1. //-----------------------------------------------------------------------------
  2. // PEER_ENTRY
  3. //-----------------------------------------------------------------------------
  4. typedef struct _PEER_ENTRY {
  5. LIST_ENTRY Link; // link all peers for that IF
  6. IPADDR IpAddr;
  7. DWORD Status;
  8. DWORD MajorVersion;
  9. DWORD MinorVersion;
  10. DWORD GenerationId;
  11. PDYNAMIC_RW_LOCK DRWL; // DRWL for the peer
  12. } _PEER_ENTRY, *PPEER_ENTRY;
  13. //
  14. // macros for G_PeerLists_CS lock
  15. //
  16. #define ACQUIRE_PEER_LISTS_LOCK(_proc) \
  17. ENTER_CRITICAL_SECTION(&G_pIfTable->PeerLists_CS, \
  18. "G_PeerListsCS", _proc);
  19. #define RELEASE_PEER_LISTS_LOCK(_proc) \
  20. LEAVE_CRITICAL_SECTION(&G_pIfTable->PeerLists_CS, \
  21. "G_PeerListsCS", _proc);
  22. //
  23. // macros for PeerEntry->DRWL
  24. //
  25. #define ACQUIRE_PEER_LOCK_EXCLUSIVE(PeerEntry, _proc) \
  26. ACQUIRE_DYNAMIC_WRITE_LOCK( \
  27. &PeerEntry->DRWL, &Globals.DynamicRWLStore)
  28. #define RELEASE_PEER_LOCK_EXCLUSIVE(PeerEntry, _proc) \
  29. RELEASE_DYNAMIC_WRITE_LOCK( \
  30. &PeerEntry->DRWL, &Globals.DynamicRWLStore)
  31. #define ACQUIRE_PEER_LOCK_SHARED(PeerEntry, _proc) \
  32. ACQUIRE_DYNAMIC_READ_LOCK( \
  33. &PeerEntry->DRWL, &Globals.DynamicRWLStore)
  34. #define RELEASE_PEER_LOCK_SHARED(PeerEntry, _proc) \
  35. RELEASE_DYNAMIC_READ_LOCK( \
  36. &PeerEntry->DRWL, &Globals.DynamicRWLStore)