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
2.0 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. memprint.h
  5. Abstract:
  6. Include file for in-memory DbgPrint function. Including this file
  7. will change DbgPrints to a routine which puts the display text in a
  8. circular buffer in memory. By default, the text is then sent to the
  9. console via DbgPrint. By changing the value of the MemPrintFlags
  10. flag, however, the text may be routed to a file instead, thereby
  11. significantly speeding up the DbgPrint operation.
  12. Author:
  13. David Treadwell (davidtr) 05-Oct-1990
  14. Revision History:
  15. --*/
  16. #ifndef _MEMPRINT_
  17. #define _MEMPRINT_
  18. #define MEM_PRINT_FLAG_CONSOLE 0x01
  19. #define MEM_PRINT_FLAG_FILE 0x02
  20. #define MEM_PRINT_FLAG_HEADER 0x04
  21. extern ULONG MemPrintFlags;
  22. #ifdef MIPS
  23. #define MEM_PRINT_DEF_BUFFER_SIZE 16384
  24. #else
  25. #define MEM_PRINT_DEF_BUFFER_SIZE 65536
  26. #endif
  27. //
  28. // The subbuffer count is the number of subbuffers within the circular
  29. // buffer. A subbuffer is the method used to buffer data between
  30. // MemPrint and writing to disk--when a subbuffer is filled, its
  31. // contents are written to the log file. This value should be a power
  32. // of two between two and sixty-four (two is necessary to allow writing
  33. // to disk and RAM simultaneously, sixty-four is the maximum number of
  34. // things a thread can wait on at once).
  35. //
  36. //
  37. #define MEM_PRINT_DEF_SUBBUFFER_COUNT 16
  38. #define MEM_PRINT_MAX_SUBBUFFER_COUNT 64
  39. #define MEM_PRINT_LOG_FILE_NAME "\\SystemRoot\\Logfile"
  40. //
  41. // Exported routines. MemPrintInitialize sets up the circular buffer
  42. // and other memory, MemPrint writes text to the console and/or a
  43. // log file, and MemPrintFlush writes the current subbuffer to disk
  44. // whether or not it is full.
  45. //
  46. VOID
  47. MemPrintInitialize (
  48. VOID
  49. );
  50. VOID
  51. MemPrint (
  52. CHAR *Format, ...
  53. );
  54. VOID
  55. MemPrintFlush (
  56. VOID
  57. );
  58. #define DbgPrint MemPrint
  59. #endif // def _MEMPRINT_