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.

100 lines
2.0 KiB

  1. //
  2. // These are taken from NTRTL.H. Currently including ntrtl.h causes
  3. // errors because of a conflict with some other header file.
  4. //
  5. //
  6. // VOID
  7. // InitializeListHead(
  8. // PLIST_ENTRY ListHead
  9. // );
  10. //
  11. #define InitializeListHead(ListHead) (\
  12. (ListHead)->Flink = (ListHead)->Blink = (ListHead))
  13. //
  14. // BOOLEAN
  15. // IsListEmpty(
  16. // PLIST_ENTRY ListHead
  17. // );
  18. //
  19. #define IsListEmpty(ListHead) \
  20. ((ListHead)->Flink == (ListHead))
  21. //
  22. // PLIST_ENTRY
  23. // RemoveHeadList(
  24. // PLIST_ENTRY ListHead
  25. // );
  26. //
  27. #define RemoveHeadList(ListHead) \
  28. (ListHead)->Flink;\
  29. {RemoveEntryList((ListHead)->Flink)}
  30. //
  31. // PLIST_ENTRY
  32. // RemoveTailList(
  33. // PLIST_ENTRY ListHead
  34. // );
  35. //
  36. #define RemoveTailList(ListHead) \
  37. (ListHead)->Blink;\
  38. {RemoveEntryList((ListHead)->Blink)}
  39. //
  40. // VOID
  41. // RemoveEntryList(
  42. // PLIST_ENTRY Entry
  43. // );
  44. //
  45. #define RemoveEntryList(Entry) {\
  46. PLIST_ENTRY _EX_Blink;\
  47. PLIST_ENTRY _EX_Flink;\
  48. _EX_Flink = (Entry)->Flink;\
  49. _EX_Blink = (Entry)->Blink;\
  50. _EX_Blink->Flink = _EX_Flink;\
  51. _EX_Flink->Blink = _EX_Blink;\
  52. }
  53. //
  54. // VOID
  55. // InsertTailList(
  56. // PLIST_ENTRY ListHead,
  57. // PLIST_ENTRY Entry
  58. // );
  59. //
  60. #define InsertTailList(ListHead,Entry) {\
  61. PLIST_ENTRY _EX_Blink;\
  62. PLIST_ENTRY _EX_ListHead;\
  63. _EX_ListHead = (ListHead);\
  64. _EX_Blink = _EX_ListHead->Blink;\
  65. (Entry)->Flink = _EX_ListHead;\
  66. (Entry)->Blink = _EX_Blink;\
  67. _EX_Blink->Flink = (Entry);\
  68. _EX_ListHead->Blink = (Entry);\
  69. }
  70. //
  71. // VOID
  72. // InsertHeadList(
  73. // PLIST_ENTRY ListHead,
  74. // PLIST_ENTRY Entry
  75. // );
  76. //
  77. #define InsertHeadList(ListHead,Entry) {\
  78. PLIST_ENTRY _EX_Flink;\
  79. PLIST_ENTRY _EX_ListHead;\
  80. _EX_ListHead = (ListHead);\
  81. _EX_Flink = _EX_ListHead->Flink;\
  82. (Entry)->Flink = _EX_Flink;\
  83. (Entry)->Blink = _EX_ListHead;\
  84. _EX_Flink->Blink = (Entry);\
  85. _EX_ListHead->Flink = (Entry);\
  86. }