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.

126 lines
4.6 KiB

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-2001 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10. #ifndef __ATLDEBUGAPI_H__
  11. #define __ATLDEBUGAPI_H__
  12. #pragma once
  13. #ifdef __cplusplus
  14. namespace ATL
  15. {
  16. extern "C" {
  17. #endif
  18. #define ATL_TRACE_MAX_NAME_SIZE 64
  19. typedef enum ATLTRACESTATUS
  20. {
  21. ATLTRACESTATUS_INHERIT, ATLTRACESTATUS_ENABLED, ATLTRACESTATUS_DISABLED
  22. } ATLTRACESTATUS;
  23. DWORD_PTR __stdcall AtlTraceOpenProcess( DWORD idProcess );
  24. void __stdcall AtlTraceCloseProcess( DWORD_PTR dwProcess );
  25. void __stdcall AtlTraceSnapshotProcess( DWORD_PTR dwProcess );
  26. DWORD_PTR __stdcall AtlTraceRegister(HINSTANCE hInst,
  27. int (__cdecl *fnCrtDbgReport)(int,const char *,int,const char *,const char *,...));
  28. BOOL __stdcall AtlTraceUnregister(DWORD_PTR dwModule);
  29. DWORD_PTR __stdcall AtlTraceRegisterCategoryA(DWORD_PTR dwModule, const CHAR szCategoryName[ATL_TRACE_MAX_NAME_SIZE]);
  30. DWORD_PTR __stdcall AtlTraceRegisterCategoryU(DWORD_PTR dwModule, const WCHAR szCategoryName[ATL_TRACE_MAX_NAME_SIZE]);
  31. BOOL __stdcall AtlTraceModifyProcess(DWORD_PTR dwProcess, UINT nLevel, BOOL bEnabled, BOOL bFuncAndCategoryNames, BOOL bFileNameAndLineNo);
  32. BOOL __stdcall AtlTraceModifyModule(DWORD_PTR dwProcess, DWORD_PTR dwModule, UINT nLevel, ATLTRACESTATUS eStatus);
  33. BOOL __stdcall AtlTraceModifyCategory(DWORD_PTR dwProcess, DWORD_PTR dwCategory, UINT nLevel, ATLTRACESTATUS eStatus);
  34. BOOL __stdcall AtlTraceGetProcess(DWORD_PTR dwProcess, UINT *pnLevel, BOOL *pbEnabled, BOOL *pbFuncAndCategoryNames, BOOL *pbFileNameAndLineNo);
  35. BOOL __stdcall AtlTraceGetModule(DWORD_PTR dwProcess, DWORD_PTR dwModule, UINT *pnLevel, ATLTRACESTATUS *pStatus);
  36. BOOL __stdcall AtlTraceGetCategory(DWORD_PTR dwProcess, DWORD_PTR dwCategory, UINT *pnLevel, ATLTRACESTATUS *pStatus);
  37. void __stdcall AtlTraceGetUpdateEventNameA(CHAR *pszEventName);
  38. void __stdcall AtlTraceGetUpdateEventNameU(WCHAR *pszEventName);
  39. /*void __cdecl AtlTraceA(HINSTANCE hInst, UINT nCategory, UINT nLevel, const CHAR *pszFormat, ...);
  40. void __cdecl AtlTraceU(HINSTANCE hInst, UINT nCategory, UINT nLevel, const WCHAR *pszFormat, ...);*/
  41. void __cdecl AtlTraceVA(DWORD_PTR dwModule, const char *pszFileName, int nLineNo,
  42. DWORD_PTR dwCategory, UINT nLevel, const CHAR *pszFormat, va_list ptr);
  43. void __cdecl AtlTraceVU(DWORD_PTR dwModule,const char *pszFileName, int nLineNo,
  44. DWORD_PTR dwCategory, UINT nLevel, const WCHAR *pszFormat, va_list ptr);
  45. BOOL __stdcall AtlTraceLoadSettingsA(const CHAR *pszFileName, BOOL bForceLoad);
  46. BOOL __stdcall AtlTraceLoadSettingsU(const WCHAR *pszFileName, BOOL bForceLoad);
  47. BOOL __stdcall AtlTraceSaveSettingsA(const CHAR *pszFileName);
  48. BOOL __stdcall AtlTraceSaveSettingsU(const WCHAR *pszFileName);
  49. typedef struct ATLTRACESETTINGS
  50. {
  51. UINT nLevel;
  52. ATLTRACESTATUS eStatus;
  53. } ATLTRACESETTINGS;
  54. typedef struct ATLTRACEPROCESSSETTINGS
  55. {
  56. UINT nLevel;
  57. BOOL bEnabled, bFuncAndCategoryNames, bFileNameAndLineNo;
  58. } ATLTRACEPROCESSSETTINGS;
  59. typedef struct ATLTRACEPROCESSINFO
  60. {
  61. WCHAR szName[ATL_TRACE_MAX_NAME_SIZE], szPath[MAX_PATH];
  62. DWORD dwId;
  63. ATLTRACEPROCESSSETTINGS settings;
  64. int nModules;
  65. } ATLTRACEPROCESSINFO;
  66. typedef struct ATLTRACEMODULEINFO
  67. {
  68. WCHAR szName[ATL_TRACE_MAX_NAME_SIZE], szPath[MAX_PATH];
  69. ATLTRACESETTINGS settings;
  70. DWORD_PTR dwModule;
  71. int nCategories;
  72. } ATLTRACEMODULEINFO;
  73. typedef struct ATLTRACECATEGORYINFO
  74. {
  75. WCHAR szName[ATL_TRACE_MAX_NAME_SIZE];
  76. ATLTRACESETTINGS settings;
  77. DWORD_PTR dwCategory;
  78. } ATLTRACECATEGORYINFO;
  79. BOOL __stdcall AtlTraceGetProcessInfo(DWORD_PTR dwProcess, ATLTRACEPROCESSINFO* pProcessInfo);
  80. void __stdcall AtlTraceGetModuleInfo(DWORD_PTR dwProcess, int iModule, ATLTRACEMODULEINFO* pModuleInfo);
  81. void __stdcall AtlTraceGetCategoryInfo(DWORD_PTR dwProcess, DWORD_PTR dwModule, int iCategory, ATLTRACECATEGORYINFO* pAtlTraceCategoryInfo);
  82. #ifdef UNICODE
  83. #define AtlTraceRegisterCategory AtlTraceRegisterCategoryU
  84. #define AtlTraceGetUpdateEventName AtlTraceGetUpdateEventNameU
  85. #define AtlTrace AtlTraceU
  86. #define AtlTraceV AtlTraceVU
  87. #define AtlTraceLoadSettings AtlTraceLoadSettingsU
  88. #define AtlTraceSaveSettings AtlTraceSaveSettingsU
  89. #else
  90. #define AtlTraceRegisterCategory AtlTraceRegisterCategoryA
  91. #define AtlTraceGetUpdateEventName AtlTraceGetUpdateEventNameA
  92. #define AtlTrace AtlTraceA
  93. #define AtlTraceV AtlTraceVA
  94. #define AtlTraceLoadSettings AtlTraceLoadSettingsA
  95. #define AtlTraceSaveSettings AtlTraceSaveSettingsA
  96. #endif
  97. #ifdef __cplusplus
  98. };
  99. }; // namespace ATL
  100. #endif
  101. #endif // __ATLDEBUGAPI_H__