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.

81 lines
3.8 KiB

  1. /*
  2. ************************************************************************
  3. *
  4. * SYNC.H
  5. *
  6. * Copyright (C) 1997-1998 Microsoft Corporation. All Rights Reserved.
  7. *
  8. *
  9. *
  10. *************************************************************************
  11. */
  12. typedef enum {
  13. SyncInsertHead,
  14. SyncInsertTail,
  15. SyncRemoveHead,
  16. SyncRemoveTail,
  17. SyncRemove
  18. } SynchronizeCmd;
  19. typedef struct {
  20. PLIST_ENTRY Head;
  21. PLIST_ENTRY Entry;
  22. SynchronizeCmd Command;
  23. } SynchronizeList;
  24. extern BOOLEAN SynchronizedListFunc(IN PVOID Context);
  25. #define NDISSynchronizedInsertHeadList(head, entry, interrupt) \
  26. { \
  27. SynchronizeList ListData; \
  28. \
  29. ListData.Head = (head); \
  30. ListData.Entry = (entry); \
  31. ListData.Command = SyncInsertHead; \
  32. (void)NdisMSynchronizeWithInterrupt((interrupt), SynchronizedListFunc, &ListData); \
  33. }
  34. #define NDISSynchronizedInsertTailList(head, entry, interrupt) \
  35. { \
  36. SynchronizeList ListData; \
  37. \
  38. ListData.Head = (head); \
  39. ListData.Entry = (entry); \
  40. ListData.Command = SyncInsertTail; \
  41. (void)NdisMSynchronizeWithInterrupt((interrupt), SynchronizedListFunc, &ListData); \
  42. }
  43. #define NDISSynchronizedRemoveEntryList(entry, interrupt) \
  44. { \
  45. SynchronizeList ListData; \
  46. \
  47. ListData.Entry = (entry); \
  48. ListData.Command = SyncRemove; \
  49. (void)NdisMSynchronizeWithInterrupt((interrupt), SynchronizedListFunc, &ListData); \
  50. }
  51. static PLIST_ENTRY __inline NDISSynchronizedRemoveHeadList(PLIST_ENTRY Head,
  52. PNDIS_MINIPORT_INTERRUPT Interrupt)
  53. {
  54. SynchronizeList ListData; \
  55. ListData.Head = Head;
  56. ListData.Command = SyncRemoveHead;
  57. (void)NdisMSynchronizeWithInterrupt(Interrupt, SynchronizedListFunc, &ListData);
  58. return ListData.Entry;
  59. }
  60. static PLIST_ENTRY __inline NDISSynchronizedRemoveTailList(PLIST_ENTRY Head,
  61. PNDIS_MINIPORT_INTERRUPT Interrupt)
  62. {
  63. SynchronizeList ListData; \
  64. ListData.Head = Head;
  65. ListData.Command = SyncRemoveTail;
  66. (void)NdisMSynchronizeWithInterrupt(Interrupt, SynchronizedListFunc, &ListData);
  67. return ListData.Entry;
  68. }