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.

289 lines
10 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1998
  6. //
  7. // File: mprsnap.idl
  8. //
  9. //--------------------------------------------------------------------------
  10. // mprsnap.idl : IDL source for MPRSNAP DLLs
  11. //
  12. #ifndef _MPRSNAP_IDL_
  13. #define _MPRSNAP_IDL_
  14. import "wtypes.idl";
  15. typedef BYTE * PBYTE;
  16. //----------------------------------------------------------------------------
  17. // Struct: InfoBlock
  18. //
  19. // Contains the information for a single block in an infobase.
  20. //----------------------------------------------------------------------------
  21. typedef struct _InfoBlock
  22. {
  23. DWORD dwType; // block type (e.g. IP_RIP, IPX_PROTOCOL_SAP)
  24. DWORD dwSize; // size in bytes of each entry in 'pData'
  25. DWORD dwCount; // number of structures in 'pData'
  26. PBYTE pData; // block data bytes
  27. } InfoBlock;
  28. /*---------------------------------------------------------------------------
  29. IEnumInfoBlock
  30. ---------------------------------------------------------------------------*/
  31. [
  32. object,
  33. uuid(66A2DB01-D706-11d0-A37B-00C04FC9DA04),
  34. local,
  35. pointer_default(unique),
  36. ]
  37. interface IEnumInfoBlock : IUnknown
  38. {
  39. HRESULT Next( [in] ULONG uNum,
  40. [out] InfoBlock **ppBlock,
  41. [out] ULONG * pNumReturned );
  42. HRESULT Skip( [in] ULONG uNum );
  43. HRESULT Reset();
  44. HRESULT Clone( [out] IEnumInfoBlock **ppBlockEnum );
  45. };
  46. cpp_quote("#define DeclareIEnumInfoBlockMembers(IPURE) \\")
  47. cpp_quote(" STDMETHOD(Next)(ULONG uNum, InfoBlock **ppBlock, \\")
  48. cpp_quote(" ULONG *pNumReturned) IPURE; \\")
  49. cpp_quote(" STDMETHOD(Skip)(ULONG uNum) IPURE; \\")
  50. cpp_quote(" STDMETHOD(Reset)() IPURE; \\")
  51. cpp_quote(" STDMETHOD(Clone)(IEnumInfoBlock **ppBlockEnum) IPURE; \\")
  52. /*---------------------------------------------------------------------------
  53. IInfoBase
  54. ---------------------------------------------------------------------------*/
  55. [
  56. object,
  57. uuid(66a2db00-d706-11d0-a37b-00c04fc9da04),
  58. local,
  59. pointer_default(unique),
  60. ]
  61. interface IInfoBase : IUnknown
  62. {
  63. import "unknwn.idl";
  64. // import "wtypes.idl";
  65. //--------------------------------------------------------------------
  66. // Function: Load
  67. //
  68. // Loads value named 'pszValue' from subkey 'pszKey' of 'hkey'
  69. //--------------------------------------------------------------------
  70. HRESULT Load( [in] HKEY hKey,
  71. [in,string] LPCOLESTR pszKey,
  72. [in,string] LPCOLESTR pszValue);
  73. //--------------------------------------------------------------------
  74. // Function: Save
  75. //
  76. // saves value named 'pszValue' to subkey 'pszKey' of 'hkey';
  77. // 'pszKey' cannot be a path
  78. //--------------------------------------------------------------------
  79. HRESULT Save( [in] HKEY hKey,
  80. [in,string] LPCOLESTR pszKey,
  81. [in,string] LPCOLESTR pszValue);
  82. //--------------------------------------------------------------------
  83. // Function: Unload
  84. //
  85. // unloads current infobase contents
  86. //--------------------------------------------------------------------
  87. HRESULT Unload();
  88. //--------------------------------------------------------------------
  89. // Function: CopyFrom
  90. //
  91. // copies contents of infobase 'src'
  92. //--------------------------------------------------------------------
  93. HRESULT CopyFrom( [in] IInfoBase * pSrc );
  94. //--------------------------------------------------------------------
  95. // Function: LoadFrom
  96. //
  97. // loads from byte-array 'pBase'
  98. //--------------------------------------------------------------------
  99. HRESULT LoadFrom( [in] DWORD dwSize,
  100. [in,size_is(dwSize)] PBYTE pBase);
  101. //--------------------------------------------------------------------
  102. // Function: WriteTo
  103. //
  104. // sets 'pBase' to point to allocated memory into which
  105. // opaque info is written; saves size of '*pBase' in 'dwSize'
  106. //--------------------------------------------------------------------
  107. HRESULT WriteTo( [out] PBYTE *ppBase,
  108. [out] DWORD *pdwSize);
  109. //--------------------------------------------------------------------
  110. // Function: GetBlock
  111. //
  112. // retrieves 'dwNth' block of type 'dwType' from the list of blocks
  113. // The block does NOT need to be freed up (this assumes that this
  114. // local, not remote).
  115. //--------------------------------------------------------------------
  116. HRESULT GetBlock( [in] DWORD dwType,
  117. [out] InfoBlock **ppBlock,
  118. [in] DWORD dwNth);
  119. //--------------------------------------------------------------------
  120. // Function: SetBlock
  121. //
  122. // Replaces 'dwNth' block of type 'dwType' with a copy of 'pBlock'.
  123. // Note that this copies the data for the block from 'pBlock->pData'.
  124. //--------------------------------------------------------------------
  125. HRESULT SetBlock( [in] DWORD dwType,
  126. [in] InfoBlock *pBlock,
  127. [in] DWORD dwNth);
  128. //--------------------------------------------------------------------
  129. // Function: AddBlock
  130. //
  131. // Add's a new block of type 'dwType' to the list of blocks
  132. //
  133. // This will make a copy of pData (this behavior differs from SetData()).
  134. //
  135. // Defaults: dwCount=1, bRemoveFirst=FALSE
  136. //--------------------------------------------------------------------
  137. HRESULT AddBlock( [in] DWORD dwType,
  138. [in] DWORD dwSize,
  139. [in] PBYTE pData,
  140. [in] DWORD dwCount,
  141. [in] BOOL bRemoveFirst);
  142. //--------------------------------------------------------------------
  143. // Function: GetData
  144. //
  145. // Retrieves the data for the 'dwNth' block of type 'dwType'.
  146. // Do NOT free up the data here.
  147. //--------------------------------------------------------------------
  148. HRESULT GetData( [in] DWORD dwType,
  149. [in] DWORD dwNth,
  150. [out] PBYTE * ppData);
  151. //--------------------------------------------------------------------
  152. // Function: SetData
  153. //
  154. // Replaces the data for the 'dwNth' block of type 'dwType'.
  155. // Note that this does not copy 'pData'; the block is changed
  156. // to point to 'pData', and thus 'pData' should not be a pointer
  157. // to data on the stack, and it should not be deleted.
  158. // Furthermore, it must have been allocated using 'new'.
  159. //--------------------------------------------------------------------
  160. HRESULT SetData( [in] DWORD dwType,
  161. [in] DWORD dwSize,
  162. [in] PBYTE pData,
  163. [in] DWORD dwCount,
  164. [in] DWORD dwNth);
  165. //--------------------------------------------------------------------
  166. // Function: RemoveBlock
  167. //
  168. // Removes the 'dwNth' block of type 'dwType' from the list of blocks.
  169. //--------------------------------------------------------------------
  170. HRESULT RemoveBlock( [in] DWORD dwType,
  171. [in] DWORD dwNth);
  172. //--------------------------------------------------------------------
  173. // Function: BlockExists
  174. //
  175. // Returns S_OK if a block of the specified type is in the block-list,
  176. // S_FALSE otherwise
  177. //--------------------------------------------------------------------
  178. HRESULT BlockExists( [in] DWORD dwType );
  179. //--------------------------------------------------------------------
  180. // Function: ProtocolExists
  181. //
  182. // Returns TRUE if the given routing-protocol exists in the info-base;
  183. // this is so if the block is present and non-empty.
  184. //--------------------------------------------------------------------
  185. HRESULT ProtocolExists( [in] DWORD dwProtocol );
  186. //--------------------------------------------------------------------
  187. // Function: RemoveAllBlocks
  188. //
  189. // Removes all blocks from the list of blocks.
  190. //--------------------------------------------------------------------
  191. HRESULT RemoveAllBlocks ();
  192. //--------------------------------------------------------------------
  193. // Function: QueryBlockList
  194. //
  195. // Returns a reference to the list of blocks;
  196. // the returned list contains items of type 'SInfoBlock',
  197. // and the list must not be modified.
  198. //--------------------------------------------------------------------
  199. HRESULT QueryBlockList([out] IEnumInfoBlock **ppBlockEnum);
  200. //--------------------------------------------------------------------
  201. // Function: GetInfo
  202. //
  203. // Returns information about the infobase. This is useful for
  204. // determining if this is a new infobase or not.
  205. //
  206. // Returns the size (in bytes) of the InfoBase as well as the
  207. // number of blocks.
  208. //--------------------------------------------------------------------
  209. HRESULT GetInfo([out] DWORD *pdwSize, [out] int *pcBlocks);
  210. };
  211. cpp_quote("#define DeclareIInfoBaseMembers(IPURE) \\")
  212. cpp_quote(" STDMETHOD(Load)(HKEY hKey, \\")
  213. cpp_quote(" LPCOLESTR pszKey, \\")
  214. cpp_quote(" LPCOLESTR pszValue) IPURE; \\")
  215. cpp_quote(" STDMETHOD(Save)(HKEY hKey, \\")
  216. cpp_quote(" LPCOLESTR pszKey, \\")
  217. cpp_quote(" LPCOLESTR pszValue) IPURE; \\")
  218. cpp_quote(" STDMETHOD(Unload)() IPURE; \\")
  219. cpp_quote(" STDMETHOD(CopyFrom)(IInfoBase * pSrc) IPURE; \\")
  220. cpp_quote(" STDMETHOD(LoadFrom)(DWORD dwSize, \\")
  221. cpp_quote(" PBYTE pBase) IPURE; \\")
  222. cpp_quote(" STDMETHOD(WriteTo)(PBYTE *ppBase, \\")
  223. cpp_quote(" DWORD *pdwSize) IPURE; \\")
  224. cpp_quote(" STDMETHOD(GetBlock)(DWORD dwType, \\")
  225. cpp_quote(" InfoBlock **ppBlock, \\")
  226. cpp_quote(" DWORD dwNth) IPURE; \\")
  227. cpp_quote(" STDMETHOD(SetBlock)(DWORD dwType, \\")
  228. cpp_quote(" InfoBlock *pBlock, \\")
  229. cpp_quote(" DWORD dwNth) IPURE; \\")
  230. cpp_quote(" STDMETHOD(AddBlock)(DWORD dwType, \\")
  231. cpp_quote(" DWORD dwSize, \\")
  232. cpp_quote(" PBYTE pData, \\")
  233. cpp_quote(" DWORD dwCount, \\")
  234. cpp_quote(" BOOL bRemoveFirst) IPURE; \\")
  235. cpp_quote(" STDMETHOD(GetData)(DWORD dwType, \\")
  236. cpp_quote(" DWORD dwNth, \\")
  237. cpp_quote(" PBYTE * ppData) IPURE; \\")
  238. cpp_quote(" STDMETHOD(SetData)(DWORD dwType, \\")
  239. cpp_quote(" DWORD dwSize, \\")
  240. cpp_quote(" PBYTE pData, \\")
  241. cpp_quote(" DWORD dwCount, \\")
  242. cpp_quote(" DWORD dwNth) IPURE; \\")
  243. cpp_quote(" STDMETHOD(RemoveBlock)(DWORD dwType, \\")
  244. cpp_quote(" DWORD dwNth) IPURE; \\")
  245. cpp_quote(" STDMETHOD(BlockExists)(DWORD dwType ) IPURE; \\")
  246. cpp_quote(" STDMETHOD(ProtocolExists)(DWORD dwProtocol ) IPURE; \\")
  247. cpp_quote(" STDMETHOD(RemoveAllBlocks)() IPURE; \\")
  248. cpp_quote(" STDMETHOD(QueryBlockList)(IEnumInfoBlock **ppBlockEnum) IPURE; \\")
  249. cpp_quote(" STDMETHOD(GetInfo)(DWORD *pdwSize, int *pcBlocks) IPURE; \\")
  250. #endif // _MPRSNAP_IDL_