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.

85 lines
1.9 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: dfdeb.hxx
  7. //
  8. // Contents: Docfile debug header
  9. //
  10. // Functions: DfDebug
  11. // DfSetResLimit
  12. // DfGetResLimit
  13. // DfPrintAllocs
  14. // HaveResource
  15. // ModifyResLimit
  16. //
  17. // History: 13-May-92 DrewB Created
  18. //
  19. //---------------------------------------------------------------
  20. #ifndef __DFDEB_HXX__
  21. #define __DFDEB_HXX__
  22. #if DBG == 1
  23. // Resources that can be controlled
  24. #define DBR_MEMORY 0
  25. #define DBR_XSCOMMITS 1
  26. #define DBR_FAILCOUNT 2
  27. #define DBR_FAILLIMIT 3
  28. #define DBR_FAILTYPES 4
  29. // Resources that can be queried
  30. #define DBRQ_MEMORY_ALLOCATED 5
  31. // Internal resources
  32. #define DBRI_ALLOC_LIST 6
  33. #define DBRI_LOGFILE_LIST 7
  34. // Control flags
  35. #define DBRF_LOGGING 8
  36. //Number of shared heaps allocated
  37. #define DBRQ_HEAPS 9
  38. // Control whether sifting is enabled
  39. #define DBRF_SIFTENABLE 10
  40. #define CDBRESOURCES 11
  41. // Simulated failure types
  42. typedef enum {
  43. DBF_MEMORY = 1,
  44. DBF_DISKFULL = 2,
  45. DBF_DISKREAD = 4,
  46. DBF_DISKWRITE = 8
  47. } DBFAILURE;
  48. // Logging control flags (e.g. DfSetResLimit(DBRF_LOGGING, DFLOG_MIN);)
  49. #define DFLOG_OFF 0x00000000
  50. #define DFLOG_ON 0x02000000
  51. #define DFLOG_PIDTID 0x04000000
  52. STDAPI_(void) DfDebug(ULONG ulLevel, ULONG ulMSFLevel);
  53. STDAPI_(void) DfSetResLimit(UINT iRes, LONG lLimit);
  54. STDAPI_(LONG) DfGetResLimit(UINT iRes);
  55. STDAPI_(void) DfSetFailureType(LONG lTypes);
  56. BOOL SimulateFailure(DBFAILURE failure);
  57. STDAPI_(LONG) DfGetMemAlloced(void);
  58. STDAPI_(void) DfPrintAllocs(void);
  59. // Internal APIs
  60. BOOL HaveResource(UINT iRes, LONG lRequest);
  61. LONG ModifyResLimit(UINT iRes, LONG lChange);
  62. #endif // DBG == 1
  63. #endif // #ifndef __DFDEB_HXX__