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.

412 lines
14 KiB

  1. // Debug Property
  2. import "ocidl.idl";
  3. import "oleidl.idl";
  4. interface IDebugProperty;
  5. interface IDebugExtendedProperty;
  6. interface IEnumDebugPropertyInfo;
  7. interface IEnumDebugExtendedPropertyInfo;
  8. interface IPerPropertyBrowsing2;
  9. /* IDebugProperty Intro
  10. *
  11. * The IDebugProperty interface provides a language-neutral way to browse entities such as:
  12. *
  13. * - object properties, methods, and events
  14. * - interfaces
  15. * - local variables
  16. * -�etc.
  17. *
  18. * IDebugProperty is not intended to be a general replacement for ITypeInfo.
  19. * For example, it does not include enough low-level information to construct vtable
  20. * calls or implement IDispatch.
  21. *
  22. * Instead, IDebugProperty is intended to provide human-readable information to
  23. * allow IDE users to browse and modify objects at design
  24. * or run-time. Because of this more limited scope, IDebugProperty is much easier
  25. * to use and to implement than ITypeInfo.
  26. *
  27. * INTERFACE NOTES:
  28. * ===============
  29. * 1) Run-time type vs. declared type
  30. * The type of a DebugProperty can be determined via two methods. When the type
  31. * is obtained via GetPropertyInfo, the type is the *run-time* type. However,
  32. * when the type obtained via a GetMemberEnum on the parent, the type is the
  33. * *declared* type. In other words, object 'A' will give you its run-time
  34. * type, but A's parent will give you A's declared type.
  35. *
  36. * ISSUE: other guids? guidSuperClass, guidMostDerived?
  37. * ISSUE: too many QIs to get IDebugExtendedProp
  38. * ISSUE: out of attrib bits
  39. * ISSUE: specify filters (thru guids?)
  40. */
  41. typedef enum tagOBJECT_ATTRIB_FLAG
  42. {
  43. // -----------------------------------------------------------------------
  44. // OBJECT ATTRIBUTES
  45. // AD1 type was OBJECT_ATTRIB, enums were OBJECTATTRIB_foo, struct was PropertyInfo
  46. // AD2 type is OBJECTATTRIB, enums are OBJECT_ATTRIB_foo,struct is DebugPropertyInfo
  47. // confusing, oh yes indeed, please someone come up with a better solution
  48. // ---------------------
  49. // Slot Characteristics
  50. OBJECT_ATTRIB_NO_ATTRIB = 0x00000000,
  51. OBJECT_ATTRIB_NO_NAME = 0x00000001, // this slot has no name
  52. OBJECT_ATTRIB_NO_TYPE = 0x00000002, // this slot has no type
  53. OBJECT_ATTRIB_NO_VALUE = 0x00000004, // this slot has no value
  54. OBJECT_ATTRIB_VALUE_IS_INVALID = 0x00000008, // the value in this slot is invalid
  55. OBJECT_ATTRIB_VALUE_IS_OBJECT = 0x00000010, // value is an object that can be expanded into a new object browser
  56. OBJECT_ATTRIB_VALUE_IS_ENUM = 0x00000020, // value has enumerated values that might go into a drop down
  57. OBJECT_ATTRIB_VALUE_IS_CUSTOM = 0x00000040, // value has a custom viewer (use custom view CLSID)
  58. OBJECT_ATTRIB_OBJECT_IS_EXPANDABLE =0x00000070, // the object has children
  59. OBJECT_ATTRIB_VALUE_HAS_CODE = 0x00000080, // the value has associated code
  60. // ---------------------
  61. // Attributes about a slot's type
  62. OBJECT_ATTRIB_TYPE_IS_OBJECT = 0x00000100, // the type has an object browser
  63. OBJECT_ATTRIB_TYPE_HAS_CODE = 0x00000200, // the type has associated code
  64. OBJECT_ATTRIB_TYPE_IS_EXPANDABLE = 0x00000100, // the type is expandable
  65. OBJECT_ATTRIB_SLOT_IS_CATEGORY = 0x00000400, // indication that this slot is a category
  66. OBJECT_ATTRIB_VALUE_READONLY = 0x00000800, // the value is read-only
  67. // ---------------------
  68. // Common attributes
  69. // field access control
  70. OBJECT_ATTRIB_ACCESS_PUBLIC = 0x00001000,
  71. OBJECT_ATTRIB_ACCESS_PRIVATE = 0x00002000,
  72. OBJECT_ATTRIB_ACCESS_PROTECTED = 0x00004000,
  73. OBJECT_ATTRIB_ACCESS_FINAL = 0x00008000,
  74. // storage types
  75. OBJECT_ATTRIB_STORAGE_GLOBAL = 0x00010000,
  76. OBJECT_ATTRIB_STORAGE_STATIC = 0x00020000,
  77. OBJECT_ATTRIB_STORAGE_FIELD = 0x00040000,
  78. // type modifiers
  79. OBJECT_ATTRIB_STORAGE_VIRTUAL = 0x00080000, // this slot is virtual (do we need pure virtual?)
  80. OBJECT_ATTRIB_TYPE_IS_CONSTANT = 0x00100000, // this slot is a constant value
  81. OBJECT_ATTRIB_TYPE_IS_SYNCHRONIZED =0x00200000, // this slot is thread synchronized
  82. OBJECT_ATTRIB_TYPE_IS_VOLATILE = 0x00400000, // this slot is volatile WRT persistent storage
  83. OBJECT_ATTRIB_HAS_EXTENDED_ATTRIBS =0x00800000, // has attributes above and beyond these predefined bits
  84. // ---------------------
  85. // Kind information (I'm not sure how useful these are)
  86. OBJECT_ATTRIB_IS_CLASS = 0x01000000,
  87. OBJECT_ATTRIB_IS_FUNCTION = 0x02000000,
  88. OBJECT_ATTRIB_IS_VARIABLE = 0x04000000,
  89. OBJECT_ATTRIB_IS_PROPERTY = 0x08000000,
  90. OBJECT_ATTRIB_IS_MACRO = 0x10000000,
  91. OBJECT_ATTRIB_IS_TYPE = 0x20000000,
  92. OBJECT_ATTRIB_IS_INHERITED = 0x40000000,
  93. OBJECT_ATTRIB_IS_INTERFACE = 0x80000000,
  94. } OBJECT_ATTRIB_FLAGS;
  95. // -----------------------------------------------------------------------
  96. // DebugPropertyInfo
  97. // Basic info that all IDebugProperty implementations must support
  98. typedef enum tagPROP_INFO_FLAGS
  99. {
  100. // Flags used to specify DebugPropertyInfo (and ExtendedDebugPropertyInfo) fields
  101. PROP_INFO_NAME = 0x001, // init the bstrName field
  102. PROP_INFO_TYPE = 0x002, // init the bstrType field
  103. PROP_INFO_VALUE = 0x004, // init the bstrValue field
  104. PROP_INFO_FULLNAME = 0x020, // init the full name field
  105. PROP_INFO_ATTRIBUTES = 0x008, // init the dwAttrib field
  106. PROP_INFO_DEBUGPROP = 0x010, // init the pDebugProp field
  107. PROP_INFO_AUTOEXPAND = 0x8000000, // make the Value result auto-expand
  108. } PROP_INFO_FLAGS;
  109. const DWORD PROP_INFO_STANDARD = PROP_INFO_NAME | PROP_INFO_TYPE | PROP_INFO_VALUE | PROP_INFO_ATTRIBUTES;
  110. const DWORD PROP_INFO_ALL = PROP_INFO_NAME | PROP_INFO_TYPE | PROP_INFO_VALUE | PROP_INFO_FULLNAME | PROP_INFO_ATTRIBUTES | PROP_INFO_DEBUGPROP;
  111. typedef struct tagDebugPropertyInfo
  112. {
  113. DWORD m_dwValidFields; // which DebugPropertyInfo fields were successfully initialized
  114. BSTR m_bstrName; // property name
  115. BSTR m_bstrType; // property type, as formatted string
  116. BSTR m_bstrValue; // property value, as formatted string
  117. BSTR m_bstrFullName; // property's full name, like pObject->m_fFlag
  118. DWORD m_dwAttrib; // property attributes (ORed OBJECT_ATTRIB_* above)
  119. IDebugProperty* m_pDebugProp; // IDebugProperty object corresponding to this DebugPropertyInfo
  120. } DebugPropertyInfo;
  121. // -----------------------------------------------------------------------
  122. // Extended info that some IDebugProperty implementations support
  123. typedef enum tagEX_PROP_INFO_FLAGS
  124. {
  125. // Flags used to specify ExtendedDebugPropertyInfo fields
  126. EX_PROP_INFO_ID = 0x0100, // init the nDISPID field
  127. EX_PROP_INFO_NTYPE = 0x0200, // init the nType field
  128. EX_PROP_INFO_NVALUE = 0x0400, // init the varValue field
  129. EX_PROP_INFO_LOCKBYTES = 0x0800, // init the plb field
  130. EX_PROP_INFO_DEBUGEXTPROP = 0x1000, // init the pDebugExtProp field
  131. } EX_PROP_INFO_FLAGS;
  132. typedef struct tagExtendedDebugPropertyInfo
  133. {
  134. // members from DebugPropertyInfo
  135. DWORD dwValidFields; // which ExtendedDebugPropertyInfo fields were successfully initialized
  136. LPOLESTR pszName; // property name
  137. LPOLESTR pszType; // property type, as formatted string
  138. LPOLESTR pszValue; // property value, as formatted string
  139. LPOLESTR pszFullName; // property's full name, like pObject->m_fFlag
  140. DWORD dwAttrib; // property attributes (ORed OBJECT_ATTRIB_* above)
  141. IDebugProperty* pDebugProp; // IDebugProperty object corresponding to this DebugPropertyInfo
  142. // extra members
  143. DWORD nDISPID; // DISPID of this child (DISPID_NIL, if n/a or none)
  144. DWORD nType; // property type
  145. VARIANT varValue; // property value (if value can physically fit in VARIANT)
  146. ILockBytes* plbValue; // property value (actual data bytes)
  147. IDebugExtendedProperty* pDebugExtProp; // IDebugExtendedProperty object corresponding to this DebugPropertyInfo
  148. } ExtendedDebugPropertyInfo;
  149. // -----------------------------------------------------------------------
  150. // IDebugProperty
  151. [
  152. object,
  153. uuid(51973C50-CB0C-11d0-B5C9-00A0244A0E7A),,
  154. pointer_default(unique)
  155. ]
  156. interface IDebugProperty : IUnknown
  157. {
  158. // Get Information for this object
  159. // By setting various PROPERTY_INFO_FLAGS, any subset of the basic info
  160. // contained in DebugPropertyInfo can be fetched
  161. [local]
  162. HRESULT GetPropertyInfo(
  163. // OR together PROP_INFO_* defines
  164. [in] DWORD dwFieldSpec,
  165. [in] UINT nRadix,
  166. [out] DebugPropertyInfo* pPropertyInfo);
  167. // The following custom marshaller works around a marshalling bug
  168. [call_as(GetPropertyInfo)]
  169. HRESULT RemoteGetPropertyInfo(
  170. [in] DWORD dwFieldSpec,
  171. [in] UINT nRadix,
  172. [out] DWORD *dwValidFields,
  173. [out] BSTR *pbstrName,
  174. [out] BSTR *pbstrType,
  175. [out] BSTR *pbstrValue,
  176. [out] BSTR *pbstrFullName,
  177. [out] DWORD *pdwAttrib,
  178. [in, out, unique] IDebugProperty **ppDebugProperty);
  179. // Get ExtendedInfo for this object
  180. //
  181. // An array of GUIDs and result VARIANTs is passed so that multiple items
  182. // of extended info can be fetched at the same time. If a variant cannot
  183. // be initialized for some reason, the vt field should be set to VT_ERROR.
  184. // The currently defined extended info guids are described below.
  185. // A QI is typically required to obtain interfaces on the right from
  186. // IUnknowns in the variant.
  187. // GUID VALUE
  188. //
  189. // guidDefinitionContext IDebugDocumentContext2
  190. // ISSUE: Add additional GUIDS, such as:
  191. // <guidSomeRandomBSTR> BSTR
  192. // <guidSomeRandomI4> I4
  193. HRESULT GetExtendedInfo(
  194. [in] ULONG cInfos,
  195. [in, size_is(cInfos)] GUID* rgguidExtendedInfo, // this arg causes MIDL_CANT_COPE
  196. [out, size_is(cInfos)] VARIANT* rgvar);
  197. // Set the value of this object as a string
  198. HRESULT SetValueAsString(
  199. [in] LPCOLESTR pszValue,
  200. [in] UINT nRadix);
  201. // Get enumerator for props of members
  202. HRESULT EnumMembers(
  203. // OR together PROP_INFO_* defines
  204. [in] DWORD dwFieldSpec,
  205. [in] UINT nRadix,
  206. [in] REFIID refiid,
  207. [out] IEnumDebugPropertyInfo **ppepi);
  208. // Get the parent property
  209. HRESULT GetParent(
  210. [out] IDebugProperty **ppDebugProp);
  211. };
  212. [
  213. object,
  214. uuid(51973C51-CB0C-11d0-B5C9-00A0244A0E7A),
  215. pointer_default(unique)
  216. ]
  217. interface IEnumDebugPropertyInfo : IUnknown
  218. {
  219. // Enumerate information for sub-objects
  220. // get the next celt elements, if possible
  221. [local]
  222. HRESULT Next(
  223. [in] ULONG celt,
  224. [out] DebugPropertyInfo *pi,
  225. [out] ULONG *pcEltsfetched
  226. );
  227. [call_as(Next)]
  228. HRESULT __stdcall RemoteNext(
  229. [in] ULONG celt,
  230. [in, out,unique,size_is(celt),length_is(*pcEltsfetched)] DebugPropertyInfo *pinfo,
  231. [out] ULONG *pcEltsfetched
  232. );
  233. // skip the next celt slots
  234. HRESULT Skip(
  235. [in] ULONG celt);
  236. // restart from the beginning
  237. HRESULT Reset(void);
  238. // clone this property browser at the current enumeration state
  239. HRESULT Clone(
  240. [out] IEnumDebugPropertyInfo **ppepi);
  241. HRESULT GetCount(
  242. [out] ULONG* pcelt);
  243. };
  244. [
  245. object,
  246. uuid(51973C52-CB0C-11d0-B5C9-00A0244A0E7A),
  247. pointer_default(unique)
  248. ]
  249. interface IDebugExtendedProperty : IDebugProperty
  250. {
  251. // Get Information for this object
  252. // By setting various EXPROPERTY_INFO_FLAGS and PROPERTY_INFO_FLAGS,
  253. // any subset of the basic info contained in ExtendedDebugPropertyInfo
  254. // can be fetched
  255. HRESULT GetExtendedPropertyInfo(
  256. // OR together EX_PROP_INFO_* defines
  257. [in] DWORD dwFieldSpec,
  258. [in] UINT nRadix,
  259. [out] ExtendedDebugPropertyInfo *pExtendedPropertyInfo); // this arg is BAD
  260. // Get enumerator for props of members
  261. HRESULT EnumExtendedMembers(
  262. // OR together EX_PROP_INFO_* defines
  263. [in] DWORD dwFieldSpec,
  264. [in] UINT nRadix,
  265. [out] IEnumDebugExtendedPropertyInfo **ppeepi);
  266. };
  267. [
  268. object,
  269. uuid(51973C53-CB0C-11d0-B5C9-00A0244A0E7A),
  270. pointer_default(unique)
  271. ]
  272. interface IEnumDebugExtendedPropertyInfo : IUnknown
  273. {
  274. // Enumerate information for sub-objects
  275. // get the next celt elements, if possible
  276. HRESULT Next(
  277. [in] ULONG celt,
  278. [out, size_is(celt), length_is(*pceltFetched)] ExtendedDebugPropertyInfo *rgExtendedPropertyInfo,
  279. [out] ULONG *pceltFetched);
  280. // skip the next celt slots
  281. HRESULT Skip(
  282. [in] ULONG celt);
  283. // restart from the beginning
  284. HRESULT Reset(void);
  285. // clone this property browser at the current enumeration state
  286. HRESULT Clone(
  287. [out] IEnumDebugExtendedPropertyInfo **pedpe);
  288. HRESULT GetCount(
  289. [out] ULONG* pcelt);
  290. };
  291. [
  292. object,
  293. uuid(51973C54-CB0C-11d0-B5C9-00A0244A0E7A),
  294. pointer_default(unique)
  295. ]
  296. interface IPerPropertyBrowsing2 : IUnknown
  297. {
  298. // Get a string to display for those types which are inheritly non-viewable
  299. // Note: The returned string is *not* a legal value for the property,
  300. // just an indication to the user of what the property is.
  301. HRESULT GetDisplayString(
  302. [in] DISPID dispid,
  303. [out] BSTR *pBstr);
  304. // Return the CLSID of the property page which can be used to edit this
  305. // property.
  306. HRESULT MapPropertyToPage(
  307. [in] DISPID dispid,
  308. [out] CLSID *pClsidPropPage);
  309. // These methods allow the caller to fill a listbox with a set of strings
  310. // which _represent_ potential values for this property. When an item
  311. // is chosen, the cookie is passed back to the object, so that the object
  312. // can set itself to the corresponding value.
  313. HRESULT GetPredefinedStrings(
  314. [in] DISPID dispid,
  315. [out] CALPOLESTR *pCaStrings,
  316. [out] CADWORD *pCaCookies);
  317. HRESULT SetPredefinedValue(
  318. [in] DISPID dispid,
  319. [in] DWORD dwCookie);
  320. };
  321. // the IDebugPropertyEnumType interfaces are really defined for their IIDs,
  322. // we have no need currently to *implement* any of them, but we might one day
  323. // These IIDs are passed to EnumMembers for filtering the enumerator.
  324. [
  325. object,
  326. uuid(51973C55-CB0C-11d0-B5C9-00A0244A0E7A),
  327. pointer_default(unique)
  328. ]
  329. interface IDebugPropertyEnumType_All : IUnknown
  330. {
  331. HRESULT GetName([out] BSTR *);
  332. };
  333. [
  334. object,
  335. uuid(51973C56-CB0C-11d0-B5C9-00A0244A0E7A),
  336. pointer_default(unique)
  337. ]
  338. interface IDebugPropertyEnumType_Locals : IDebugPropertyEnumType_All
  339. {
  340. };
  341. [
  342. object,
  343. uuid(51973C57-CB0C-11d0-B5C9-00A0244A0E7A),
  344. pointer_default(unique)
  345. ]
  346. interface IDebugPropertyEnumType_Arguments : IDebugPropertyEnumType_All
  347. {
  348. };
  349. [
  350. object,
  351. uuid(51973C58-CB0C-11d0-B5C9-00A0244A0E7A),
  352. pointer_default(unique)
  353. ]
  354. interface IDebugPropertyEnumType_LocalsPlusArgs : IDebugPropertyEnumType_All
  355. {
  356. };
  357. [
  358. object,
  359. uuid(51973C59-CB0C-11d0-B5C9-00A0244A0E7A),
  360. pointer_default(unique)
  361. ]
  362. interface IDebugPropertyEnumType_Registers : IDebugPropertyEnumType_All
  363. {
  364. };