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.

295 lines
11 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // Contents: IDispatchEx description
  7. //
  8. //----------------------------------------------------------------------------
  9. cpp_quote("//=--------------------------------------------------------------------------=")
  10. cpp_quote("// DispEx.h")
  11. cpp_quote("//=--------------------------------------------------------------------------=")
  12. cpp_quote("// (C) Copyright 1997 Microsoft Corporation. All Rights Reserved.")
  13. cpp_quote("//")
  14. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  15. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  16. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  17. cpp_quote("// PARTICULAR PURPOSE.")
  18. cpp_quote("//=--------------------------------------------------------------------------=")
  19. cpp_quote("")
  20. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  21. cpp_quote("")
  22. cpp_quote("//---------------------------------------------------------------------------=")
  23. cpp_quote("// IDispatchEx Interfaces.")
  24. cpp_quote("//")
  25. cpp_quote("")
  26. cpp_quote("#ifndef DISPEX_H_")
  27. cpp_quote("#define DISPEX_H_")
  28. cpp_quote("")
  29. interface IDispatchEx;
  30. interface IDispError;
  31. interface IVariantChangeType;
  32. #ifndef DO_NO_IMPORTS
  33. import "ocidl.idl";
  34. import "oleidl.idl";
  35. import "oaidl.idl";
  36. import "servprov.idl";
  37. #endif
  38. cpp_quote("")
  39. cpp_quote("#include \"servprov.h\"")
  40. cpp_quote("")
  41. cpp_quote("#ifndef _NO_DISPATCHEX_GUIDS")
  42. cpp_quote("")
  43. cpp_quote("// {A6EF9860-C720-11d0-9337-00A0C90DCAA9}")
  44. cpp_quote("DEFINE_GUID(IID_IDispatchEx, 0xa6ef9860, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  45. cpp_quote("")
  46. cpp_quote("// {A6EF9861-C720-11d0-9337-00A0C90DCAA9}")
  47. cpp_quote("DEFINE_GUID(IID_IDispError, 0xa6ef9861, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  48. cpp_quote("")
  49. cpp_quote("// {A6EF9862-C720-11d0-9337-00A0C90DCAA9}")
  50. cpp_quote("DEFINE_GUID(IID_IVariantChangeType, 0xa6ef9862, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  51. cpp_quote("")
  52. cpp_quote("// {1F101481-BCCD-11d0-9336-00A0C90DCAA9}")
  53. cpp_quote("DEFINE_GUID(SID_VariantConversion, 0x1f101481, 0xbccd, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  54. cpp_quote("")
  55. cpp_quote("// {4717CC40-BCB9-11d0-9336-00A0C90DCAA9}")
  56. cpp_quote("DEFINE_GUID(SID_GetCaller, 0x4717cc40, 0xbcb9, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  57. cpp_quote("")
  58. cpp_quote("// {CA04B7E6-0D21-11d1-8CC5-00C04FC2B085}")
  59. cpp_quote("DEFINE_GUID(IID_IObjectIdentity, 0xca04b7e6, 0xd21, 0x11d1, 0x8c, 0xc5, 0x0, 0xc0, 0x4f, 0xc2, 0xb0, 0x85);")
  60. cpp_quote("")
  61. #if VER5
  62. cpp_quote("// {c5598e60-b307-11d1-b27d-006008c3fbfb}")
  63. cpp_quote("DEFINE_GUID(IID_ICanHandleException, 0xc5598e60, 0xb307, 0x11d1, 0xb2, 0x7d, 0x0, 0x60, 0x08, 0xc3, 0xfb, 0xfb);")
  64. cpp_quote("")
  65. #endif //VER5
  66. cpp_quote("#define SID_GetScriptSite IID_IActiveScriptSite")
  67. cpp_quote("")
  68. cpp_quote("#endif // _NO_DISPATCHEX_GUIDS")
  69. cpp_quote("")
  70. cpp_quote("")
  71. cpp_quote("#ifndef _NO_DISPATCHEX_CONSTS")
  72. cpp_quote("")
  73. cpp_quote("// Input flags for GetDispID")
  74. cpp_quote("#define fdexNameCaseSensitive 0x00000001L")
  75. cpp_quote("#define fdexNameEnsure 0x00000002L")
  76. cpp_quote("#define fdexNameImplicit 0x00000004L")
  77. cpp_quote("#define fdexNameCaseInsensitive 0x00000008L")
  78. cpp_quote("#define fdexNameInternal 0x00000010L")
  79. cpp_quote("#define fdexNameNoDynamicProperties 0x00000020L")
  80. cpp_quote("")
  81. cpp_quote("// Output flags for GetMemberProperties")
  82. cpp_quote("#define fdexPropCanGet 0x00000001L")
  83. cpp_quote("#define fdexPropCannotGet 0x00000002L")
  84. cpp_quote("#define fdexPropCanPut 0x00000004L")
  85. cpp_quote("#define fdexPropCannotPut 0x00000008L")
  86. cpp_quote("#define fdexPropCanPutRef 0x00000010L")
  87. cpp_quote("#define fdexPropCannotPutRef 0x00000020L")
  88. cpp_quote("#define fdexPropNoSideEffects 0x00000040L")
  89. cpp_quote("#define fdexPropDynamicType 0x00000080L")
  90. cpp_quote("#define fdexPropCanCall 0x00000100L")
  91. cpp_quote("#define fdexPropCannotCall 0x00000200L")
  92. cpp_quote("#define fdexPropCanConstruct 0x00000400L")
  93. cpp_quote("#define fdexPropCannotConstruct 0x00000800L")
  94. cpp_quote("#define fdexPropCanSourceEvents 0x00001000L")
  95. cpp_quote("#define fdexPropCannotSourceEvents 0x00002000L")
  96. cpp_quote("")
  97. cpp_quote("#define grfdexPropCanAll \\")
  98. cpp_quote(" (fdexPropCanGet | fdexPropCanPut | fdexPropCanPutRef | \\")
  99. cpp_quote(" fdexPropCanCall | fdexPropCanConstruct | fdexPropCanSourceEvents)")
  100. cpp_quote("#define grfdexPropCannotAll \\")
  101. cpp_quote(" (fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef | \\")
  102. cpp_quote(" fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents)")
  103. cpp_quote("#define grfdexPropExtraAll \\")
  104. cpp_quote(" (fdexPropNoSideEffects | fdexPropDynamicType)")
  105. cpp_quote("#define grfdexPropAll \\")
  106. cpp_quote(" (grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll)")
  107. cpp_quote("")
  108. cpp_quote("// Input flags for GetNextDispID")
  109. cpp_quote("#define fdexEnumDefault 0x00000001L")
  110. cpp_quote("#define fdexEnumAll 0x00000002L")
  111. cpp_quote("")
  112. cpp_quote("// Additional flags for Invoke - when object member is")
  113. cpp_quote("// used as a constructor.")
  114. cpp_quote("#define DISPATCH_CONSTRUCT 0x4000")
  115. cpp_quote("")
  116. cpp_quote("// Standard DISPIDs")
  117. cpp_quote("#define DISPID_THIS (-613)")
  118. cpp_quote("#define DISPID_STARTENUM DISPID_UNKNOWN")
  119. cpp_quote("")
  120. cpp_quote("#endif //_NO_DISPATCHEX_CONSTS")
  121. cpp_quote("")
  122. [
  123. object,
  124. uuid(A6EF9860-C720-11d0-9337-00A0C90DCAA9),
  125. pointer_default(unique)
  126. ]
  127. interface IDispatchEx : IDispatch
  128. {
  129. // NOTES:
  130. // (*) grfdex can contain any subset of the bits
  131. // { fdexNameCaseSensitive, fdexNameEnsure, fdexNameImplicit, fdexNameCaseSensitive }.
  132. HRESULT GetDispID(
  133. [in] BSTR bstrName,
  134. [in] DWORD grfdex,
  135. [out] DISPID *pid);
  136. // NOTES:
  137. // (*) pvarRes, pei and pspCaller may be NULL.
  138. // (*) When DISPATCH_METHOD is set in wFlags, there may be a "named
  139. // parameter" for the "this" value. The dispID will be DISPID_THIS and
  140. // it must be the first named parameter.
  141. // (*) There is a new value for wFlags: DISPATCH_CONSTRUCT. This indicates
  142. // that the item is being used as a constructor.
  143. // (*) The legal values for wFlags are:
  144. // DISPATCH_PROPERTYGET
  145. // DISPATCH_METHOD
  146. // DISPATCH_PROPERTYGET | DISPATCH_METHOD
  147. // DISPATCH_PROPERTYPUT
  148. // DISPATCH_PROPERTYPUTREF
  149. // DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF
  150. // DISPATCH_CONSTRUCT
  151. // (*) IDispatchEx::Invoke should support the same values that
  152. // IDispatchEx::InvokeEx supports (eg, DISPID_THIS, DISPATCH_CONSTRUCT).
  153. [local]
  154. HRESULT InvokeEx(
  155. [in] DISPID id,
  156. [in] LCID lcid,
  157. [in] WORD wFlags,
  158. [in] DISPPARAMS *pdp,
  159. [out] VARIANT *pvarRes, // Can be NULL.
  160. [out] EXCEPINFO *pei, // Can be NULL.
  161. [in, unique] IServiceProvider *pspCaller); // Can be NULL.
  162. [call_as(InvokeEx)]
  163. HRESULT RemoteInvokeEx(
  164. [in] DISPID id,
  165. [in] LCID lcid,
  166. [in] DWORD dwFlags, // Hiword used for private marshalling flags.
  167. [in] DISPPARAMS *pdp,
  168. [out] VARIANT *pvarRes,
  169. [out] EXCEPINFO *pei,
  170. [in, unique] IServiceProvider *pspCaller,
  171. [in] UINT cvarRefArg,
  172. [in, size_is(cvarRefArg)] UINT *rgiRefArg,
  173. [in, out, size_is(cvarRefArg)] VARIANT *rgvarRefArg);
  174. // NOTES:
  175. // (*) grfdex may contain fdexNameCaseSensitive or fdexNameCaseInsensitive
  176. // (*) If the member doesn't exist, return S_OK.
  177. // (*) If the member exists but can't be deleted, return S_FALSE.
  178. // (*) If the member is deleted, the DISPID still needs to be valid for
  179. // GetNextDispID and if a member of the same name is recreated, the
  180. // dispID should be the same.
  181. HRESULT DeleteMemberByName([in] BSTR bstrName, [in] DWORD grfdex);
  182. // NOTES:
  183. // (*) If the member doesn't exist, return S_OK.
  184. // (*) If the member exists but can't be deleted, return S_FALSE.
  185. // (*) If the member is deleted, the DISPID still needs to be valid for
  186. // GetNextDispID and if a member of the same name is recreated, the
  187. // dispID should be the same.
  188. HRESULT DeleteMemberByDispID([in] DISPID id);
  189. HRESULT GetMemberProperties(
  190. [in] DISPID id,
  191. [in] DWORD grfdexFetch,
  192. [out] DWORD *pgrfdex);
  193. HRESULT GetMemberName(
  194. [in] DISPID id,
  195. [out] BSTR *pbstrName);
  196. HRESULT GetNextDispID(
  197. [in] DWORD grfdex,
  198. [in] DISPID id,
  199. [out] DISPID *pid);
  200. HRESULT GetNameSpaceParent([out] IUnknown **ppunk);
  201. };
  202. [
  203. object,
  204. uuid(A6EF9861-C720-11d0-9337-00A0C90DCAA9),
  205. pointer_default(unique)
  206. ]
  207. interface IDispError : IUnknown
  208. {
  209. HRESULT QueryErrorInfo(
  210. [in] GUID guidErrorType,
  211. [out] IDispError **ppde);
  212. HRESULT GetNext([out] IDispError **ppde);
  213. // EXCEPINFO information
  214. HRESULT GetHresult([out] HRESULT *phr);
  215. HRESULT GetSource([out] BSTR *pbstrSource);
  216. HRESULT GetHelpInfo([out] BSTR *pbstrFileName, [out] DWORD *pdwContext);
  217. HRESULT GetDescription([out] BSTR *pbstrDescription);
  218. };
  219. [
  220. object,
  221. uuid(A6EF9862-C720-11d0-9337-00A0C90DCAA9),
  222. pointer_default(unique)
  223. ]
  224. interface IVariantChangeType : IUnknown
  225. {
  226. // NOTES:
  227. // (*) pvarDst and pvarSrc may be equal.
  228. // (*) pvarDst should be initialized to a valid variant value.
  229. // VariantClear will be called on it.
  230. HRESULT ChangeType(
  231. [in, out, unique] VARIANT *pvarDst,
  232. [in, unique] VARIANT *pvarSrc,
  233. [in] LCID lcid,
  234. [in] VARTYPE vtNew);
  235. };
  236. [
  237. object,
  238. uuid(CA04B7E6-0D21-11d1-8CC5-00C04FC2B085),
  239. pointer_default(unique)
  240. ]
  241. interface IObjectIdentity : IUnknown
  242. {
  243. HRESULT IsEqualObject(
  244. [in] IUnknown *punk
  245. );
  246. };
  247. #if VER5
  248. [
  249. object,
  250. uuid(c5598e60-b307-11d1-b27d-006008c3fbfb),
  251. pointer_default(unique)
  252. ]
  253. interface ICanHandleException : IUnknown
  254. {
  255. //If a call to InvokeEx, or similar, results in an exception, the
  256. //called method can use this interface to determine if the caller
  257. //is capable of dealing with the exception. The first parameter is
  258. //an EXCEPINFO structure containing the information that will be reported
  259. //to the host if no error handlers are found. The second
  260. //parameter is a value associated with the exception, such as the value
  261. //thrown by a throw statement. This parameter may be NULL.
  262. //These values can be used by the caller to decide whether or
  263. //not it can handle the exception. If the caller can handle the exception
  264. //the function returns S_OK. Otherwise it returns E_FAIL.
  265. HRESULT CanHandleException([in] EXCEPINFO *pExcepInfo, [in] VARIANT *pvar);
  266. };
  267. #endif //VER5
  268. cpp_quote("#endif //DISPEX_H_")