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.

58 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. leaks.h
  5. Abstract:
  6. header for leak filter dll
  7. Author:
  8. Charlie Wickham (charlwi) 28-Sep-1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. //
  14. // keep a table of caller and caller's caller for open handles. indexed by
  15. // handle value divided by 4. !leaks in clusexts will display this info.
  16. //
  17. typedef enum _LEAKS_HANDLE_TYPE {
  18. LeaksEvent = 1,
  19. LeaksRegistry,
  20. LeaksToken
  21. } LEAKS_HANDLE_TYPE;
  22. typedef struct _HANDLE_TABLE {
  23. PVOID Caller;
  24. PVOID CallersCaller;
  25. LEAKS_HANDLE_TYPE HandleType;
  26. BOOL InUse;
  27. } HANDLE_TABLE, *PHANDLE_TABLE;
  28. #define MAX_HANDLE 4096
  29. #define HANDLE_DELTA 4
  30. #define HINDEX( _h ) (((DWORD) _h ) / HANDLE_DELTA )
  31. #define SetHandleTable( _h, _inuse, _htype ) \
  32. { \
  33. RtlGetCallersAddress(&callersAddress, \
  34. &callersCaller ); \
  35. HandleTable[ HINDEX( _h )].InUse = _inuse; \
  36. HandleTable[ HINDEX( _h )].HandleType = _htype; \
  37. HandleTable[ HINDEX( _h )].Caller = callersAddress; \
  38. HandleTable[ HINDEX( _h )].CallersCaller = callersCaller; \
  39. }
  40. /* end leaks.h */