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.

96 lines
1.6 KiB

  1. #ifndef _DUMP_H_
  2. #define _DUMP_H_
  3. //
  4. // Constant declarations
  5. //
  6. #define DUMP_BUFFER_SIZE 200 * 1024
  7. #define DUMP_LOG_NAME "Profiler.dump"
  8. typedef enum _DUMPTYPES
  9. {
  10. ThreadStartId = 0,
  11. ExeFlowId,
  12. DllBaseInfoId,
  13. MapInfoId,
  14. ErrorInfoId,
  15. } DUMPTYPES;
  16. //
  17. // Structure definitions
  18. //
  19. typedef struct _THREADSTART
  20. {
  21. DUMPTYPES dwType;
  22. DWORD dwThreadId;
  23. DWORD dwStartAddress;
  24. } THREADSTART, *PTHREADSTART;
  25. typedef struct _EXEFLOW
  26. {
  27. DUMPTYPES dwType;
  28. DWORD dwThreadId;
  29. DWORD dwAddress;
  30. DWORD dwCallLevel;
  31. } EXEFLOW, *PEXEFLOW;
  32. typedef struct _DLLBASEINFO
  33. {
  34. DUMPTYPES dwType;
  35. DWORD dwBase;
  36. DWORD dwLength;
  37. CHAR szDLLName[32];
  38. } DLLBASEINFO, *PDLLBASEINFO;
  39. typedef struct _MAPINFO
  40. {
  41. DUMPTYPES dwType;
  42. DWORD dwAddress;
  43. DWORD dwMaxMapLength;
  44. } MAPINFO, *PMAPINFO;
  45. typedef struct _ERRORINFO
  46. {
  47. DWORD dwType;
  48. CHAR szMessage[MAX_PATH];
  49. } ERRORINFO, *PERRORINFO;
  50. //
  51. // Function definitions
  52. //
  53. BOOL
  54. InitializeDumpData(VOID);
  55. BOOL
  56. AddToDump(PBYTE pBuffer,
  57. DWORD dwLength,
  58. BOOL bFlushImmediate);
  59. BOOL
  60. FlushBuffer(VOID);
  61. VOID
  62. FlushForTermination(VOID);
  63. BOOL
  64. WriteThreadStart(DWORD dwThreadId,
  65. DWORD dwStartAddress);
  66. BOOL
  67. WriteExeFlow(DWORD dwThreadId,
  68. DWORD dwAddress,
  69. DWORD dwCallLevel);
  70. BOOL
  71. WriteDllInfo(CHAR *szDLL,
  72. DWORD dwBaseAddress,
  73. DWORD dwLength);
  74. BOOL
  75. WriteMapInfo(DWORD dwAddress,
  76. DWORD dwMaxMapLength);
  77. BOOL
  78. WriteError(CHAR *szMessage);
  79. #endif //_DUMP_H_