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.

386 lines
11 KiB

  1. //=--------------------------------------------------------------------------=
  2. // MSScript.h
  3. //=--------------------------------------------------------------------------=
  4. // (C) Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. //
  13. // Declarations for Microsoft-provided script engines that support ActiveX Scripting.
  14. //
  15. #include "windows.h"
  16. #include "ole2.h"
  17. #ifndef MSSCRIPT_H
  18. #define MSSCRIPT_H
  19. //=--------------------------------------------------------------------------=
  20. //
  21. // GUID declarations
  22. //
  23. //=--------------------------------------------------------------------------=
  24. //
  25. // Class identifiers
  26. //
  27. // The GUID used to identify the coclass of the VB Script engine
  28. // {B54F3741-5B07-11cf-A4B0-00AA004A55E8}
  29. #define szCLSID_VBScript "{B54F3741-5B07-11cf-A4B0-00AA004A55E8}"
  30. DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4, 0xb0, 0x0, 0xaa, 0x0, 0x4a, 0x55, 0xe8);
  31. // The GUID used to identify the coclass for VB Script authoring
  32. // {B54F3742-5B07-11cf-A4B0-00AA004A55E8}
  33. #define szCLSID_VBScriptAuthor "{B54F3742-5B07-11cf-A4B0-00AA004A55E8}"
  34. DEFINE_GUID(CLSID_VBScriptAuthor, 0xb54f3742, 0x5b07, 0x11cf, 0xa4, 0xb0, 0x0, 0xaa, 0x0, 0x4a, 0x55, 0xe8);
  35. // The GUID used to identify the coclass for VB Script Encode engine
  36. // {B54F3743-5B07-11cf-A4B0-00AA004A55E8}
  37. #define szCLSID_VBScriptEncode "{B54F3743-5B07-11cf-A4B0-00AA004A55E8}"
  38. DEFINE_GUID(CLSID_VBScriptEncode, 0xb54f3743, 0x5b07, 0x11cf, 0xa4, 0xb0, 0x0, 0xaa, 0x0, 0x4a, 0x55, 0xe8);
  39. // The GUID used to identify the coclass of the JavaScript engine
  40. // {F414C260-6AC0-11CF-B6D1-00AA00BBBB58}
  41. #define szCLSID_JScript "{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}"
  42. DEFINE_GUID(CLSID_JScript, 0xf414c260, 0x6ac0, 0x11cf, 0xb6, 0xd1, 0x00, 0xaa, 0x00, 0xbb, 0xbb, 0x58);
  43. // The GUID used to identify the coclass for JavaScript authoring
  44. // {f414c261-6ac0-11cf-b6d1-00aa00bbbb58}
  45. #define szCLSID_JScriptAuthor "{f414c261-6ac0-11cf-b6d1-00aa00bbbb58}"
  46. DEFINE_GUID(CLSID_JScriptAuthor, 0xf414c261, 0x6ac0, 0x11cf, 0xb6, 0xd1, 0x00, 0xaa, 0x00, 0xbb, 0xbb, 0x58);
  47. // The GUID used to identify the coclass for JavaScript encode engine
  48. // {f414c262-6ac0-11cf-b6d1-00aa00bbbb58}
  49. #define szCLSID_JScriptEncode "{f414c262-6ac0-11cf-b6d1-00aa00bbbb58}"
  50. DEFINE_GUID(CLSID_JScriptEncode, 0xf414c262, 0x6ac0, 0x11cf, 0xb6, 0xd1, 0x00, 0xaa, 0x00, 0xbb, 0xbb, 0x58);
  51. // The GUID used to identify the coclass of the File System Object
  52. // {0D43FE01-F093-11CF-8940-00A0C9054228}
  53. #define szCLSID_FileSystemObject "{0D43FE01-F093-11CF-8940-00A0C9054228}"
  54. DEFINE_GUID(CLSID_FileSystemObject, 0x0D43FE01L, 0xF093, 0x11CF, 0x89, 0x40, 0x00, 0xA0, 0xC9, 0x05, 0x42, 0x28);
  55. // The GUID used to identify the coclass of the Dictionary
  56. // {EE09B103-97E0-11CF-978F-00A02463E06F}
  57. #define szCLSID_Dictionary "{EE09B103-97E0-11CF-978F-00A02463E06F}"
  58. DEFINE_GUID(CLSID_Dictionary, 0xEE09B103L, 0x97E0, 0x11CF, 0x97, 0x8F, 0x00, 0xA0, 0x24, 0x63, 0xE0, 0x6F);
  59. //
  60. // Interface identifiers
  61. //
  62. // The GUID used to identify the IJScriptDispatch interface
  63. // {A0AAC450-A77B-11CF-91D0-00AA00C14A7C}
  64. #define szIID_IJScriptDispatch "{A0AAC450-A77B-11CF-91D0-00AA00C14A7C}"
  65. DEFINE_GUID(IID_IJScriptDispatch, 0xa0aac450, 0xa77b, 0x11cf, 0x91, 0xd0, 0x0, 0xaa, 0x0, 0xc1, 0x4a, 0x7c);
  66. // The GUID used to identify the IFileSystemObject interface
  67. // {33E10B81-F012-11CF-8940-00A0C9054228}
  68. #define szIID_IFileSystemObject "{33E10B81-F012-11CF-8940-00A0C9054228}"
  69. DEFINE_GUID(IID_IFileSystemObject, 0x33E10B81L, 0xF012, 0x11CF, 0x89, 0x40, 0x00, 0xA0, 0xC9, 0x05, 0x42, 0x28);
  70. // The GUID used to identify the ITextStream interface
  71. // {53BAD8C1-E718-11CF-893D-00A0C9054228"
  72. #define szIID_ITextStream "{53BAD8C1-E718-11CF-893D-00A0C9054228}"
  73. DEFINE_GUID(IID_ITextStream, 0x53BAD8C1L, 0xE718, 0x11CF, 0x89, 0x3D, 0x00, 0xA0, 0xC9, 0x05, 0x42, 0x28);
  74. // The GUID used to identify the IDictionary interface
  75. // {42C642C1-97E1-11CF-978F-00A02463E06F}
  76. #define szIID_IDictionary "{42C642C1-97E1-11CF-978F-00A02463E06F}"
  77. DEFINE_GUID(IID_IDictionary, 0x42C642C1L, 0x97E1, 0x11CF, 0x97, 0x8F, 0x00, 0xA0, 0x24, 0x63, 0xE0, 0x6F);
  78. //
  79. // Library identifiers
  80. //
  81. // The GUID used to identify the Scripting library
  82. // {420B2830-E718-11CF-893D-00A0C9054228}
  83. #define szLIBID_Scripting "{420B2830-E718-11CF-893D-00A0C9054228}"
  84. DEFINE_GUID(LIBID_Scripting, 0x420B2830L, 0xE718, 0x11CF, 0x89, 0x3D, 0x00, 0xA0, 0xC9, 0x05, 0x42, 0x28);
  85. //=--------------------------------------------------------------------------=
  86. //
  87. // Interface declarations
  88. //
  89. //=--------------------------------------------------------------------------=
  90. #ifndef BEGIN_INTERFACE
  91. #define BEGIN_INTERFACE
  92. #endif
  93. //
  94. // IJScriptDispatch
  95. //
  96. // This is the interface for the extensible IDispatch objects used by Microsoft JScript.
  97. // Notable differences between standard Automation IDispatch objects and IJScriptDispatch
  98. // objects are:
  99. //
  100. // * case sensitive method names
  101. // * indexing functionality
  102. // * dynamic addition of properties
  103. // * enumeration of dispIDs and member names
  104. //
  105. #undef INTERFACE
  106. #define INTERFACE IJScriptDispatch
  107. DECLARE_INTERFACE_(IJScriptDispatch, IDispatch)
  108. {
  109. BEGIN_INTERFACE
  110. #ifndef NO_BASEINTERFACE_FUNCS
  111. /* IUnknown methods */
  112. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  113. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  114. STDMETHOD_(ULONG, Release)(THIS) PURE;
  115. /* IDispatch methods */
  116. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  117. STDMETHOD(GetTypeInfo)(
  118. THIS_
  119. UINT itinfo,
  120. LCID lcid,
  121. ITypeInfo FAR* FAR* pptinfo) PURE;
  122. STDMETHOD(GetIDsOfNames)(
  123. THIS_
  124. REFIID riid,
  125. OLECHAR FAR* FAR* rgszNames,
  126. UINT cNames,
  127. LCID lcid,
  128. DISPID FAR* rgdispid) PURE;
  129. STDMETHOD(Invoke)(
  130. THIS_
  131. DISPID dispidMember,
  132. REFIID riid,
  133. LCID lcid,
  134. WORD wFlags,
  135. DISPPARAMS FAR* pdispparams,
  136. VARIANT FAR* pvarResult,
  137. EXCEPINFO FAR* pexcepinfo,
  138. UINT FAR* puArgErr) PURE;
  139. #endif
  140. /* IJScriptDispatch methods */
  141. STDMETHOD(GetIDsOfNamesEx)(THIS_ REFIID riid, OLECHAR FAR * FAR * prgpsz, UINT cpsz, LCID lcid, DISPID FAR * prgid, DWORD grfdex) PURE;
  142. STDMETHOD(GetNextDispID)(THIS_ DISPID id, DISPID FAR * pid, BSTR FAR * pbstrName) PURE;
  143. };
  144. //
  145. // Scripting library interfaces
  146. //
  147. // These are the interfaces for the scripting library objects:
  148. // IDictionary, IFileSystemObject and ITextStream.
  149. //
  150. interface IFileSystemObject;
  151. interface ITextStream;
  152. typedef enum CompareMethod {
  153. BinaryCompare = 0,
  154. TextCompare = 1,
  155. DatabaseCompare = 2
  156. } CompareMethod;
  157. typedef enum IOMode {
  158. ForReading = 1,
  159. ForWriting = 2,
  160. ForAppending = 8
  161. } IOMode;
  162. typedef enum Tristate {
  163. TristateTrue = -1,
  164. TristateFalse = 0,
  165. TristateUseDefault = -2,
  166. TristateMixed = -2
  167. } Tristate;
  168. //
  169. // IFileSystemObject
  170. //
  171. #undef INTERFACE
  172. #define INTERFACE IFileSystemObject
  173. DECLARE_INTERFACE_(IFileSystemObject, IDispatch)
  174. {
  175. BEGIN_INTERFACE
  176. #ifndef NO_BASEINTERFACE_FUNCS
  177. /* IUnknown methods */
  178. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  179. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  180. STDMETHOD_(ULONG, Release)(THIS) PURE;
  181. /* IDispatch methods */
  182. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  183. STDMETHOD(GetTypeInfo)(
  184. THIS_
  185. UINT itinfo,
  186. LCID lcid,
  187. ITypeInfo FAR* FAR* pptinfo) PURE;
  188. STDMETHOD(GetIDsOfNames)(
  189. THIS_
  190. REFIID riid,
  191. OLECHAR FAR* FAR* rgszNames,
  192. UINT cNames,
  193. LCID lcid,
  194. DISPID FAR* rgdispid) PURE;
  195. STDMETHOD(Invoke)(
  196. THIS_
  197. DISPID dispidMember,
  198. REFIID riid,
  199. LCID lcid,
  200. WORD wFlags,
  201. DISPPARAMS FAR* pdispparams,
  202. VARIANT FAR* pvarResult,
  203. EXCEPINFO FAR* pexcepinfo,
  204. UINT FAR* puArgErr) PURE;
  205. #endif
  206. /* IFileSystemObject methods */
  207. STDMETHOD(CreateTextFile)(THIS_ BSTR FileName, IOMode IOMode, VARIANT_BOOL Overwrite, VARIANT_BOOL Unicode, ITextStream FAR* FAR* ppts) PURE;
  208. STDMETHOD(OpenTextFile)(THIS_ BSTR FileName, IOMode IOMode, VARIANT_BOOL Create, Tristate Format, ITextStream FAR* FAR* ppts) PURE;
  209. };
  210. //
  211. // ITextStream
  212. //
  213. #undef INTERFACE
  214. #define INTERFACE ITextStream
  215. DECLARE_INTERFACE_(ITextStream, IDispatch)
  216. {
  217. BEGIN_INTERFACE
  218. #ifndef NO_BASEINTERFACE_FUNCS
  219. /* IUnknown methods */
  220. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  221. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  222. STDMETHOD_(ULONG, Release)(THIS) PURE;
  223. /* IDispatch methods */
  224. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  225. STDMETHOD(GetTypeInfo)(
  226. THIS_
  227. UINT itinfo,
  228. LCID lcid,
  229. ITypeInfo FAR* FAR* pptinfo) PURE;
  230. STDMETHOD(GetIDsOfNames)(
  231. THIS_
  232. REFIID riid,
  233. OLECHAR FAR* FAR* rgszNames,
  234. UINT cNames,
  235. LCID lcid,
  236. DISPID FAR* rgdispid) PURE;
  237. STDMETHOD(Invoke)(
  238. THIS_
  239. DISPID dispidMember,
  240. REFIID riid,
  241. LCID lcid,
  242. WORD wFlags,
  243. DISPPARAMS FAR* pdispparams,
  244. VARIANT FAR* pvarResult,
  245. EXCEPINFO FAR* pexcepinfo,
  246. UINT FAR* puArgErr) PURE;
  247. #endif
  248. /* ITextStream methods */
  249. STDMETHOD(get_Line)(THIS_ long FAR* Line) PURE;
  250. STDMETHOD(get_Column)(THIS_ long FAR* Column) PURE;
  251. STDMETHOD(get_AtEndOfStream)(THIS_ VARIANT_BOOL FAR* EOS) PURE;
  252. STDMETHOD(get_AtEndOfLine)(THIS_ VARIANT_BOOL FAR* EOL) PURE;
  253. STDMETHOD(Read)(THIS_ long Characters, BSTR FAR* Text) PURE;
  254. STDMETHOD(ReadLine)(THIS_ BSTR FAR* Text) PURE;
  255. STDMETHOD(ReadAll)(THIS_ BSTR FAR* Text) PURE;
  256. STDMETHOD(Write)(THIS_ BSTR Text) PURE;
  257. STDMETHOD(WriteLine)(THIS_ BSTR Text) PURE;
  258. STDMETHOD(WriteBlankLines)(THIS_ long Lines) PURE;
  259. STDMETHOD(Skip)(THIS_ long Characters) PURE;
  260. STDMETHOD(SkipLine)(THIS) PURE;
  261. STDMETHOD(Close)(THIS) PURE;
  262. };
  263. //
  264. // IDictionary
  265. //
  266. #undef INTERFACE
  267. #define INTERFACE IDictionary
  268. DECLARE_INTERFACE_(IDictionary, IDispatch)
  269. {
  270. BEGIN_INTERFACE
  271. #ifndef NO_BASEINTERFACE_FUNCS
  272. /* IUnknown methods */
  273. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  274. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  275. STDMETHOD_(ULONG, Release)(THIS) PURE;
  276. /* IDispatch methods */
  277. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
  278. STDMETHOD(GetTypeInfo)(
  279. THIS_
  280. UINT itinfo,
  281. LCID lcid,
  282. ITypeInfo FAR* FAR* pptinfo) PURE;
  283. STDMETHOD(GetIDsOfNames)(
  284. THIS_
  285. REFIID riid,
  286. OLECHAR FAR* FAR* rgszNames,
  287. UINT cNames,
  288. LCID lcid,
  289. DISPID FAR* rgdispid) PURE;
  290. STDMETHOD(Invoke)(
  291. THIS_
  292. DISPID dispidMember,
  293. REFIID riid,
  294. LCID lcid,
  295. WORD wFlags,
  296. DISPPARAMS FAR* pdispparams,
  297. VARIANT FAR* pvarResult,
  298. EXCEPINFO FAR* pexcepinfo,
  299. UINT FAR* puArgErr) PURE;
  300. #endif
  301. /* IDictionary methods */
  302. STDMETHOD(putref_Item)(THIS_ VARIANT FAR* Key, VARIANT FAR* pItem) PURE;
  303. STDMETHOD(put_Item)(THIS_ VARIANT FAR* Key, VARIANT FAR* pItem) PURE;
  304. STDMETHOD(get_Item)(THIS_ VARIANT FAR* Key, VARIANT FAR* pRetItem) PURE;
  305. STDMETHOD(Add)(THIS_ VARIANT FAR* Key, VARIANT FAR* Item) PURE;
  306. STDMETHOD(get_Count)(THIS_ long FAR* pCount) PURE;
  307. STDMETHOD(Exists)(THIS_ VARIANT FAR* Key, VARIANT_BOOL FAR* pExists) PURE;
  308. STDMETHOD(Items)(THIS_ VARIANT FAR* pItemsArray) PURE;
  309. STDMETHOD(put_Key)(THIS_ VARIANT FAR* Key, VARIANT FAR* NewKey) PURE;
  310. STDMETHOD(Keys)(THIS_ VARIANT FAR* pKeysArray) PURE;
  311. STDMETHOD(Remove)(THIS_ VARIANT FAR* Key) PURE;
  312. STDMETHOD(RemoveAll)(THIS) PURE;
  313. STDMETHOD(put_CompareMode)(THIS_ CompareMethod comp) PURE;
  314. STDMETHOD(get_CompareMode)(THIS_ CompareMethod FAR* pcomp) PURE;
  315. STDMETHOD(_NewEnum)(THIS_ IUnknown * FAR* ppunk) PURE;
  316. STDMETHOD(get_HashVal)(THIS_ VARIANT FAR* Key, VARIANT FAR* HashVal) PURE;
  317. };
  318. #endif // MSSCRIPT_H
  319. // End of file