Source code of Windows XP (NT5)
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.

51 lines
1.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: memory.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. #include <sysinc.h>
  11. #include <string.h>
  12. #include <rpc.h>
  13. #include <util.hxx>
  14. #ifdef DEBUGRPC
  15. #define RPC_GUARD 0xA1
  16. typedef struct _RPC_MEMORY_BLOCK
  17. {
  18. // First,forward and backward links to other RPC heap allocations.
  19. // These are first allow easy debugging with the dl command
  20. struct _RPC_MEMORY_BLOCK *next;
  21. struct _RPC_MEMORY_BLOCK *previous;
  22. // Specifies the size of the block of memory in bytes.
  23. unsigned long size;
  24. // Thread id of allocator
  25. unsigned long tid;
  26. void * AllocStackTrace[4];
  27. // (Pad to make header 0 mod 8) 0 when allocated, 0xF0F0F0F0 when freed.
  28. unsigned long free;
  29. // Reserve an extra 4 bytes as the front guard of each block.
  30. unsigned char frontguard[4];
  31. // Data will appear here. Note that the header must be 0 mod 8.
  32. // Reserve an extra 4 bytes as the rear guard of each block.
  33. unsigned char rearguard[4];
  34. } RPC_MEMORY_BLOCK;
  35. #endif // DEBUGRPC