PIXPlugin.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //==================================================================================================
  2. // PIXPlugin.h
  3. //
  4. // Microsoft PIX Plugin Header
  5. //
  6. // Copyright (c) Microsoft Corporation, All rights reserved
  7. //==================================================================================================
  8. #pragma once
  9. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13. //==================================================================================================
  14. // PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with.
  15. //==================================================================================================
  16. #define PIX_PLUGIN_SYSTEM_VERSION 0x101
  17. //==================================================================================================
  18. // PIXCOUNTERID - A unique identifier for each PIX plugin counter.
  19. //==================================================================================================
  20. typedef int PIXCOUNTERID;
  21. //==================================================================================================
  22. // PIXCOUNTERDATATYPE - Indicates what type of data the counter produces.
  23. //==================================================================================================
  24. enum PIXCOUNTERDATATYPE
  25. {
  26. PCDT_RESERVED,
  27. PCDT_FLOAT,
  28. PCDT_INT,
  29. PCDT_INT64,
  30. PCDT_STRING,
  31. };
  32. //==================================================================================================
  33. // PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX.
  34. //==================================================================================================
  35. struct PIXPLUGININFO
  36. {
  37. // Filled in by caller:
  38. HINSTANCE hinst;
  39. // Filled in by PIXGetPluginInfo:
  40. WCHAR* pstrPluginName; // Name of plugin
  41. int iPluginVersion; // Version of this particular plugin
  42. int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for
  43. };
  44. //==================================================================================================
  45. // PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX
  46. // to allow PIX to determine information about the counters in the plugin.
  47. //==================================================================================================
  48. struct PIXCOUNTERINFO
  49. {
  50. PIXCOUNTERID counterID; // Used to uniquely ID this counter
  51. WCHAR* pstrName; // String name of the counter
  52. PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter
  53. };
  54. //==================================================================================================
  55. // PIXGetPluginInfo - This returns basic information about this plugin to PIX.
  56. //==================================================================================================
  57. BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo );
  58. //==================================================================================================
  59. // PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX.
  60. // These PIXCOUNTERINFOs allow PIX to enumerate the counters contained
  61. // in this plugin.
  62. //==================================================================================================
  63. BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList );
  64. //==================================================================================================
  65. // PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter.
  66. //==================================================================================================
  67. BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc );
  68. //==================================================================================================
  69. // PIXBeginExperiment - This called by PIX once per counter when instrumentation starts.
  70. //==================================================================================================
  71. BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication );
  72. //==================================================================================================
  73. // PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the
  74. // counter value for that frame. Note that the pointer to the return data must
  75. // continue to point to valid counter data until the next call to PIXEndFrame (or
  76. // PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same
  77. // pointer for multiple counters, or point to a local variable that will go out of
  78. // scope. See the sample PIX plugin for an example of how to structure a plugin
  79. // properly.
  80. //==================================================================================================
  81. BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData );
  82. //==================================================================================================
  83. // PIXEndExperiment - This is called by PIX once per counter when instrumentation ends.
  84. //==================================================================================================
  85. BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id );
  86. #ifdef __cplusplus
  87. };
  88. #endif
  89. //==================================================================================================
  90. // eof: PIXPlugin.h
  91. //==================================================================================================