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.

121 lines
2.2 KiB

  1. #ifndef __UTILFUN_H__
  2. #define __UTILFUN_H__
  3. //
  4. //
  5. // attempt to imitate the std::tree structures
  6. //
  7. class _BRN {
  8. public:
  9. _BRN * _Left;
  10. _BRN * _Parent;
  11. _BRN * _Right;
  12. ULONG_PTR Values[3]; // Key Value Color
  13. };
  14. class _BRN_HEAD {
  15. public:
  16. _BRN * _Left;
  17. _BRN * _Parent;
  18. _BRN * _Right;
  19. };
  20. class _QM {
  21. public:
  22. _BRN * _Left;
  23. _BRN * _Parent;
  24. _BRN * _Right;
  25. };
  26. class _Map {
  27. public:
  28. ULONG_PTR Unused;
  29. _QM * pQm;
  30. bool b;
  31. ULONG_PTR Size;
  32. };
  33. //
  34. //
  35. //
  36. class _Node_List {
  37. public:
  38. _Node_List * _Next;
  39. _Node_List * _Prev;
  40. void * _Value;
  41. };
  42. class _List {
  43. public:
  44. void * _Allocator;
  45. _Node_List * _Head;
  46. SIZE_T _Size;
  47. };
  48. class _Vector {
  49. public:
  50. void * _Allocator;
  51. void * _First;
  52. void * _Last;
  53. void * _End;
  54. };
  55. class _Deque {
  56. public:
  57. class iterator {
  58. public:
  59. void * _First;
  60. void * _Last;
  61. void * _Next;
  62. void * _Map;
  63. };
  64. void * _Allocator;
  65. iterator _First, _Last;
  66. void * _Map;
  67. SIZE_T _Mapsize, _Size;
  68. };
  69. typedef DWORD (WINAPI * pfnCallBack1)(VOID * pData1);
  70. typedef DWORD (WINAPI * pfnCallBack2)(VOID * pData1,VOID * pData2);
  71. typedef DWORD (WINAPI * pfnCallBack3)(VOID * pData1,VOID * pData2,VOID * pContext);
  72. void
  73. PrintMapCB(_Map * pMap,BOOL Verbose, pfnCallBack2 CallBack);
  74. void
  75. PrintMap(_Map * pMap,BOOL Verbose);
  76. DWORD
  77. CallBackObj(void * pKey, void * pValue);
  78. void
  79. PrintListCB(_List * pList_OOP, pfnCallBack1 CallBack);
  80. void
  81. PrintDequeCB(MEMORY_ADDRESS pDeque_OOP,pfnCallBack2 CallBack);
  82. BOOL
  83. GetVTable(MEMORY_ADDRESS pThis_OOP);
  84. void
  85. EnumReverseLinkedListCB(IN LIST_ENTRY * pListHead,
  86. IN DWORD cbSizeOfStructure,
  87. IN DWORD cbListEntryOffset,
  88. IN pfnCallBack2 CallBack);
  89. void
  90. EnumLinkedListCB(IN LIST_ENTRY * pListHead,
  91. IN DWORD cbSizeOfStructure,
  92. IN DWORD cbListEntryOffset,
  93. IN pfnCallBack2 CallBack,
  94. IN VOID * Context = NULL);
  95. //
  96. // For Dumping CThreadRecord
  97. //
  98. typedef DWORD (WINAPI * pfnDumpRequest)(ULONG_PTR pRequest);
  99. #endif /*__UTILFUN_H__*/