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.

453 lines
13 KiB

  1. /****************************************************************************
  2. *
  3. * (C) COPYRIGHT 1998-2000, MICROSOFT CORP.
  4. *
  5. * FILE: wiamindr.idl
  6. *
  7. * VERSION: 2.0
  8. *
  9. * DATE: 8/28/1998
  10. *
  11. * DESCRIPTION:
  12. * IDL source for the WIA mini driver.
  13. *
  14. *****************************************************************************/
  15. interface IWiaMiniDrv;
  16. interface IWiaMiniDrvCallBack;
  17. interface IWiaDrvItem;
  18. interface IWiaItem;
  19. interface IWiaPropertyStorage;
  20. import "unknwn.idl";
  21. import "oaidl.idl";
  22. import "propidl.idl";
  23. import "wia.idl";
  24. /**************************************************************************\
  25. *
  26. * MINIDRV_TRANSFER_CONTEXT - Minidriver data transfer context
  27. *
  28. \**************************************************************************/
  29. typedef struct _MINIDRV_TRANSFER_CONTEXT{
  30. LONG lSize;
  31. LONG lWidthInPixels;
  32. LONG lLines;
  33. LONG lDepth;
  34. LONG lXRes;
  35. LONG lYRes;
  36. LONG lCompression;
  37. GUID guidFormatID;
  38. LONG tymed;
  39. LONG hFile;
  40. LONG cbOffset;
  41. LONG lBufferSize;
  42. LONG lActiveBuffer;
  43. LONG lNumBuffers;
  44. BYTE *pBaseBuffer;
  45. BYTE *pTransferBuffer;
  46. BOOL bTransferDataCB;
  47. BOOL bClassDrvAllocBuf;
  48. LONG lClientAddress;
  49. IWiaMiniDrvCallBack *pIWiaMiniDrvCallBack;
  50. LONG lImageSize;
  51. LONG lHeaderSize;
  52. LONG lItemSize;
  53. LONG cbWidthInBytes;
  54. LONG lPage;
  55. LONG lCurIfdOffset;
  56. LONG lPrevIfdOffset;
  57. } MINIDRV_TRANSFER_CONTEXT, *PMINIDRV_TRANSFER_CONTEXT;
  58. /*******************************************************************************
  59. *
  60. * WIA_DEV_CAP_DRV - Device capabilities
  61. *
  62. *******************************************************************************/
  63. typedef struct _WIA_DEV_CAP_DRV {
  64. GUID *guid;
  65. ULONG ulFlags;
  66. LPOLESTR wszName;
  67. LPOLESTR wszDescription;
  68. LPOLESTR wszIcon;
  69. } WIA_DEV_CAP_DRV,*PWIA_DEV_CAP_DRV;
  70. /*******************************************************************************
  71. *
  72. * IWiaMiniDrvItem interface
  73. *
  74. *******************************************************************************/
  75. [
  76. object,
  77. uuid(d8cdee14-3c6c-11d2-9a35-00c04fa36145),
  78. helpstring("WIA Mini Driver Interface"),
  79. pointer_default(unique)
  80. ]
  81. interface IWiaMiniDrv : IUnknown
  82. {
  83. [helpstring("Initialize WIA, build item tree, etc")]
  84. HRESULT drvInitializeWia(
  85. [in] BYTE*,
  86. [in] LONG,
  87. [in] BSTR,
  88. [in] BSTR,
  89. [in] IUnknown*,
  90. [in] IUnknown*,
  91. [out] IWiaDrvItem**,
  92. [out] IUnknown**,
  93. [out] LONG*);
  94. [helpstring("Acquire data from the device item")]
  95. HRESULT drvAcquireItemData(
  96. [in] BYTE*,
  97. [in] LONG,
  98. [in, out] PMINIDRV_TRANSFER_CONTEXT,
  99. [out] LONG*);
  100. [helpstring("Initialize the device item properties")]
  101. HRESULT drvInitItemProperties(
  102. [in] BYTE*,
  103. [in] LONG,
  104. [out] LONG*);
  105. [helpstring("Mini driver validatation of the device item properties")]
  106. HRESULT drvValidateItemProperties(
  107. [in] BYTE*,
  108. [in] LONG,
  109. [in] ULONG,
  110. [in] const PROPSPEC*,
  111. [out] LONG*);
  112. [helpstring("Mini driver write of the device item properties")]
  113. HRESULT drvWriteItemProperties(
  114. [in] BYTE*,
  115. [in] LONG,
  116. [in] PMINIDRV_TRANSFER_CONTEXT,
  117. [out] LONG*);
  118. [helpstring("Mini driver read of the device item properties")]
  119. HRESULT drvReadItemProperties(
  120. [in] BYTE*,
  121. [in] LONG,
  122. [in] ULONG,
  123. [in] const PROPSPEC*,
  124. [out] LONG*);
  125. [helpstring("Lock Device")]
  126. HRESULT drvLockWiaDevice(
  127. [in] BYTE*,
  128. [in] LONG,
  129. [out] LONG*);
  130. [helpstring("UnLock Device")]
  131. HRESULT drvUnLockWiaDevice(
  132. [in] BYTE*,
  133. [in] LONG,
  134. [out] LONG*);
  135. [helpstring("Look at item and create sub-items if needed")]
  136. HRESULT drvAnalyzeItem(
  137. [in] BYTE*,
  138. [in] LONG,
  139. [in] LONG*);
  140. [helpstring("Map a device error value to a string")]
  141. HRESULT drvGetDeviceErrorStr(
  142. [in] LONG,
  143. [in] LONG,
  144. [out] LPOLESTR*,
  145. [out] LONG*);
  146. [helpstring("Issue a device command")]
  147. HRESULT drvDeviceCommand(
  148. [in] BYTE*,
  149. [in] LONG,
  150. [in] const GUID*,
  151. [out] IWiaDrvItem**,
  152. [out] LONG*);
  153. [helpstring("Get the device capabilities")]
  154. HRESULT drvGetCapabilities(
  155. [in] BYTE*,
  156. [in] LONG,
  157. [out] LONG*,
  158. [out] WIA_DEV_CAP_DRV**,
  159. [out] LONG*);
  160. [helpstring("Delete the item from the device")]
  161. HRESULT drvDeleteItem(
  162. [in] BYTE*,
  163. [in] LONG,
  164. [out] LONG*);
  165. [helpstring("Free driver item context")]
  166. HRESULT drvFreeDrvItemContext(
  167. [in] LONG,
  168. [in] BYTE*,
  169. [out] LONG*);
  170. [helpstring("Get the FORMAT and TYMED")]
  171. HRESULT drvGetWiaFormatInfo(
  172. [in] BYTE*,
  173. [in] LONG,
  174. [out] LONG*,
  175. [out] WIA_FORMAT_INFO**,
  176. [out] LONG*);
  177. [helpstring("Notify Pnp event received by device manager")]
  178. HRESULT drvNotifyPnpEvent(
  179. [in] const GUID *pEventGUID,
  180. [in] BSTR bstrDeviceID,
  181. [in] ULONG ulReserved);
  182. [helpstring("UnInitialize WIA, remove resources attached to item, etc")]
  183. HRESULT drvUnInitializeWia(
  184. [in] BYTE*);
  185. };
  186. /*******************************************************************************
  187. *
  188. * IWiaMiniDrvCallBack interface
  189. *
  190. *******************************************************************************/
  191. [
  192. object,
  193. uuid(33a57d5a-3de8-11d2-9a36-00c04fa36145),
  194. helpstring("WIA Mini Driver Call Back Interface"),
  195. pointer_default(unique)
  196. ]
  197. interface IWiaMiniDrvCallBack : IUnknown
  198. {
  199. [id(1), helpstring("Acquire data from the device")]
  200. HRESULT MiniDrvCallback(
  201. [in] LONG lReason,
  202. [in] LONG lStatus,
  203. [in] LONG lPercentComplete,
  204. [in] LONG lOffset,
  205. [in] LONG lLength,
  206. [in] PMINIDRV_TRANSFER_CONTEXT pTranCtx,
  207. [in] LONG lReserved);
  208. };
  209. /**************************************************************************\
  210. *
  211. * IWiaDrvItem interface
  212. *
  213. \**************************************************************************/
  214. [
  215. object,
  216. uuid(1f02b5c5-b00c-11d2-a094-00c04f72dc3c),
  217. helpstring("WIA Mini Driver DrvItem Interface"),
  218. pointer_default(unique)
  219. ]
  220. interface IWiaDrvItem : IUnknown
  221. {
  222. HRESULT GetItemFlags(
  223. [out] LONG*);
  224. HRESULT GetDeviceSpecContext(
  225. [out] BYTE**);
  226. HRESULT GetFullItemName(
  227. [out] BSTR*);
  228. HRESULT GetItemName(
  229. [out] BSTR*);
  230. HRESULT AddItemToFolder(
  231. [in] IWiaDrvItem*);
  232. HRESULT UnlinkItemTree(
  233. [in] LONG);
  234. HRESULT RemoveItemFromFolder(
  235. [in] LONG);
  236. HRESULT FindItemByName(
  237. [in] LONG,
  238. [in] BSTR,
  239. [out] IWiaDrvItem**);
  240. HRESULT FindChildItemByName(
  241. [in] BSTR,
  242. [out] IWiaDrvItem**);
  243. HRESULT GetParentItem(
  244. [out] IWiaDrvItem**);
  245. HRESULT GetFirstChildItem(
  246. [out] IWiaDrvItem**);
  247. HRESULT GetNextSiblingItem(
  248. [out] IWiaDrvItem**);
  249. HRESULT DumpItemData(
  250. [out] BSTR*);
  251. };
  252. /*******************************************************************************
  253. *
  254. * WIA_PROPERTY_INFO - Stores default access and valid values for item properties
  255. *
  256. *******************************************************************************/
  257. typedef struct _WIA_PROPERTY_INFO
  258. {
  259. ULONG lAccessFlags;
  260. VARTYPE vt;
  261. union {
  262. struct {
  263. LONG Min;
  264. LONG Nom;
  265. LONG Max;
  266. LONG Inc;
  267. } Range;
  268. struct {
  269. DOUBLE Min;
  270. DOUBLE Nom;
  271. DOUBLE Max;
  272. DOUBLE Inc;
  273. } RangeFloat;
  274. struct {
  275. LONG cNumList;
  276. LONG Nom;
  277. BYTE *pList;
  278. } List;
  279. struct {
  280. LONG cNumList;
  281. DOUBLE Nom;
  282. BYTE *pList;
  283. } ListFloat;
  284. struct {
  285. LONG cNumList;
  286. GUID Nom;
  287. GUID *pList;
  288. } ListGuid;
  289. struct {
  290. LONG cNumList;
  291. BSTR Nom;
  292. BSTR *pList;
  293. } ListBStr;
  294. struct {
  295. LONG Nom;
  296. LONG ValidBits;
  297. } Flag;
  298. struct {
  299. LONG Dummy;
  300. } None;
  301. } ValidVal;
  302. }WIA_PROPERTY_INFO, *PWIA_PROPERTY_INFO;
  303. /*******************************************************************************
  304. *
  305. * WIA_PROPERTY_CONTEXT - Stores property id and flag indicating whether the
  306. * application is changing the property
  307. *
  308. *******************************************************************************/
  309. typedef struct _WIA_PROPERTY_CONTEXT{
  310. ULONG cProps;
  311. PROPID *pProps;
  312. BOOL *pChanged;
  313. } WIA_PROPERTY_CONTEXT, *PWIA_PROPERTY_CONTEXT;
  314. /*******************************************************************************
  315. *
  316. * WIAS_CHANGED_VALUE_INFO - Stores current and previous values for a property
  317. *
  318. *******************************************************************************/
  319. typedef struct _WIAS_CHANGED_VALUE_INFO{
  320. BOOL bChanged;
  321. LONG vt;
  322. union {
  323. LONG lVal;
  324. FLOAT fltVal;
  325. BSTR bstrVal;
  326. GUID guidVal;
  327. } Old;
  328. union {
  329. LONG lVal;
  330. FLOAT fltVal;
  331. BSTR bstrVal;
  332. GUID guidVal;
  333. } Current;
  334. } WIAS_CHANGED_VALUE_INFO, *PWIAS_CHANGED_VALUE_INFO;
  335. /*******************************************************************************
  336. *
  337. * WIAS_DOWN_SAMPLE_INFO - Used by wiasDownSampleBuffer
  338. *
  339. *******************************************************************************/
  340. typedef struct _WIAS_DOWN_SAMPLE_INFO {
  341. ULONG ulOriginalWidth;
  342. ULONG ulOriginalHeight;
  343. ULONG ulBitsPerPixel;
  344. ULONG ulXRes;
  345. ULONG ulYRes;
  346. ULONG ulDownSampledWidth;
  347. ULONG ulDownSampledHeight;
  348. ULONG ulActualSize;
  349. ULONG ulDestBufSize;
  350. ULONG ulSrcBufSize;
  351. BYTE *pSrcBuffer;
  352. BYTE *pDestBuffer;
  353. } WIAS_DOWN_SAMPLE_INFO, *PWIAS_DOWN_SAMPLE_INFO;
  354. /*******************************************************************************
  355. *
  356. * WIAS_ENDORSER_VALUE - Stores endorser strings
  357. *
  358. *******************************************************************************/
  359. typedef struct _WIAS_ENDORSER_VALUE {
  360. LPWSTR wszTokenName;
  361. LPWSTR wszValue;
  362. } WIAS_ENDORSER_VALUE, *PWIAS_ENDORSER_VALUE;
  363. /*******************************************************************************
  364. *
  365. * WIAS_ENDORSER_INFO - Stores token/value pairs for endorser
  366. *
  367. *******************************************************************************/
  368. typedef struct _WIAS_ENDORSER_INFO {
  369. ULONG ulPageCount;
  370. ULONG ulNumEndorserValues;
  371. WIAS_ENDORSER_VALUE *pEndorserValues;
  372. } WIAS_ENDORSER_INFO, *PWIAS_ENDORSER_INFO;
  373. cpp_quote("#include \"wiamdef.h\"")