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.

1014 lines
31 KiB

  1. /*++
  2. Copyright (c) 1986-1997 Microsoft Corporation
  3. Module Name:
  4. sti.h
  5. Abstract:
  6. This module contains the user mode still image APIs in COM format
  7. Revision History:
  8. --*/
  9. #ifndef _STICOM_
  10. #define _STICOM_
  11. //
  12. // Set packing
  13. //
  14. #include <pshpack8.h>
  15. //
  16. // Only use UNICODE STI interfaces
  17. //
  18. #define STI_UNICODE 1
  19. //
  20. // Include COM definitions
  21. //
  22. #ifndef _NO_COM
  23. #include <objbase.h>
  24. #endif
  25. #include <stireg.h>
  26. #include <stierr.h>
  27. //
  28. // Compiler pragmas
  29. //
  30. #pragma warning(disable:4200) // warning about zero-sized arrays being non-stadard C extension
  31. #define DLLEXP __declspec( dllexport )
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. #if defined( _WIN32 ) && !defined( _NO_COM)
  36. /*
  37. * Class IID's
  38. */
  39. // B323F8E0-2E68-11D0-90EA-00AA0060F86C
  40. DEFINE_GUID(CLSID_Sti, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C);
  41. /*
  42. * Interface IID's
  43. */
  44. // {641BD880-2DC8-11D0-90EA-00AA0060F86C}
  45. DEFINE_GUID(IID_IStillImageW, 0x641BD880L, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C);
  46. // {A7B1F740-1D7F-11D1-ACA9-00A02438AD48}
  47. DEFINE_GUID(IID_IStillImageA, 0xA7B1F740L, 0x1D7F, 0x11D1, 0xAC, 0xA9, 0x00, 0xA0, 0x24, 0x38, 0xAD, 0x48);
  48. // {6CFA5A80-2DC8-11D0-90EA-00AA0060F86C}
  49. DEFINE_GUID(IID_IStiDevice, 0x6CFA5A80L, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C);
  50. /*
  51. * Standard event GUIDs
  52. */
  53. // {740D9EE6-70F1-11d1-AD10-00A02438AD48}
  54. DEFINE_GUID(GUID_DeviceArrivedLaunch, 0x740d9ee6, 0x70f1, 0x11d1, 0xad, 0x10, 0x0, 0xa0, 0x24, 0x38, 0xad, 0x48);
  55. // {A6C5A715-8C6E-11d2-977A-0000F87A926F}
  56. DEFINE_GUID(GUID_ScanImage,
  57. 0xa6c5a715, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  58. // {B441F425-8C6E-11d2-977A-0000F87A926F}
  59. DEFINE_GUID(GUID_ScanPrintImage,
  60. 0xb441f425, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  61. // {C00EB793-8C6E-11d2-977A-0000F87A926F}
  62. DEFINE_GUID(GUID_ScanFaxImage,
  63. 0xc00eb793, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  64. // {C00EB795-8C6E-11d2-977A-0000F87A926F}
  65. DEFINE_GUID(GUID_STIUserDefined1,
  66. 0xc00eb795, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  67. // {C77AE9C5-8C6E-11d2-977A-0000F87A926F}
  68. DEFINE_GUID(GUID_STIUserDefined2,
  69. 0xc77ae9c5, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  70. // {C77AE9C6-8C6E-11d2-977A-0000F87A926F}
  71. DEFINE_GUID(GUID_STIUserDefined3,
  72. 0xc77ae9c6, 0x8c6e, 0x11d2, 0x97, 0x7a, 0x0, 0x0, 0xf8, 0x7a, 0x92, 0x6f);
  73. #endif
  74. //
  75. // Generic constants and definitions
  76. //
  77. #define STI_VERSION_FLAG_MASK 0xff000000
  78. #define STI_VERSION_FLAG_UNICODE 0x01000000
  79. #define GET_STIVER_MAJOR(dwVersion) (HIWORD(dwVersion) & ~STI_VERSION_FLAG_MASK)
  80. #define GET_STIVER_MINOR(dwVersion) LOWORD(dwVersion)
  81. #define STI_VERSION_REAL 0x00000002
  82. #define STI_VERSION_MIN_ALLOWED 0x00000002
  83. #ifdef UNICODE
  84. #define STI_VERSION (STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE)
  85. #else
  86. #define STI_VERSION (STI_VERSION_REAL)
  87. #endif
  88. //
  89. // Maximum length of internal device name
  90. //
  91. #define STI_MAX_INTERNAL_NAME_LENGTH 128
  92. // begin sti_device_information
  93. //
  94. // Device information definitions and prototypes
  95. // ----------------------------------------------
  96. //
  97. //
  98. // Following information is used for enumerating still image devices , currently configured
  99. // in the system. Presence of the device in the enumerated list does not mean availability
  100. // of the device, it only means that device was installed at least once and had not been removed since.
  101. //
  102. //
  103. // Type of device ( scanner, camera) is represented by DWORD value with
  104. // hi word containing generic device type , and lo word containing sub-type
  105. //
  106. typedef enum _STI_DEVICE_MJ_TYPE {
  107. StiDeviceTypeDefault = 0,
  108. StiDeviceTypeScanner = 1,
  109. StiDeviceTypeDigitalCamera = 2,
  110. StiDeviceTypeStreamingVideo = 3
  111. } STI_DEVICE_MJ_TYPE;
  112. typedef DWORD STI_DEVICE_TYPE;
  113. //
  114. // Macros to extract device type/subtype from single type field
  115. //
  116. #define GET_STIDEVICE_TYPE(dwDevType) HIWORD(dwDevType)
  117. #define GET_STIDEVICE_SUBTYPE(dwDevType) LOWORD(dwDevType)
  118. //
  119. // Device capabilities bits.
  120. // Various capabilities are grouped into separate bitmasks
  121. //
  122. typedef struct _STI_DEV_CAPS {
  123. DWORD dwGeneric;
  124. } STI_DEV_CAPS, *PSTI_DEV_CAPS;
  125. //
  126. // Generic capabilities mask contain 16 bits , common for all devices, maintained by MS
  127. // and 16 bits , which USD can use for proprietary capbailities reporting.
  128. //
  129. #define GET_STIDCOMMON_CAPS(dwGenericCaps) LOWORD(dwGenericCaps)
  130. #define GET_STIVENDOR_CAPS(dwGenericCaps) HIWORD(dwGenericCaps)
  131. #define STI_GENCAP_COMMON_MASK (DWORD)0x00ff
  132. //
  133. // Notifications are supported.
  134. // If this capability set , device can be subscribed to .
  135. //
  136. #define STI_GENCAP_NOTIFICATIONS 0x00000001
  137. //
  138. // Polling required .
  139. // This capability is used when previous is set to TRUE. Presence of it means
  140. // that device is not capable of issuing "truly" asyncronous notifications, but can
  141. // be polled to determine the moment when event happened
  142. #define STI_GENCAP_POLLING_NEEDED 0x00000002
  143. //
  144. // Generate event on device arrival
  145. // If this capability is set, still image service will generate event when device
  146. // instance is successfully initialized ( typically in response to PnP arrival)
  147. //
  148. // Note: on initial service enumeration events will nto be generated to avoid
  149. // end-user confusion.
  150. //
  151. #define STI_GENCAP_GENERATE_ARRIVALEVENT 0x00000004
  152. //
  153. // Auto port selection on non-PnP buses
  154. // This capability indicates that USD is able to detect non-PnP device on a
  155. // bus , device is supposed to be attached to.
  156. //
  157. #define STI_GENCAP_AUTO_PORTSELECT 0x00000008
  158. //
  159. // WIA capability bit.
  160. // This capability indicates that USD is WIA capable.
  161. //
  162. #define STI_GENCAP_WIA 0x00000010
  163. //
  164. // Subset driver bit.
  165. // This capability indicates that there is more featured driver exists. All
  166. // of inbox driver has this bit set. Fully featured (IHV) driver shouldn't have
  167. // this bit set.
  168. //
  169. #define STI_GENCAP_SUBSET 0x00000020
  170. //
  171. //
  172. // Type of bus connection for those in need to know
  173. //
  174. #define STI_HW_CONFIG_UNKNOWN 0x0001
  175. #define STI_HW_CONFIG_SCSI 0x0002
  176. #define STI_HW_CONFIG_USB 0x0004
  177. #define STI_HW_CONFIG_SERIAL 0x0008
  178. #define STI_HW_CONFIG_PARALLEL 0x0010
  179. //
  180. // Device information structure, this is not configurable. This data is returned from
  181. // device enumeration API and is used for populating UI or selecting which device
  182. // should be used in current session
  183. //
  184. typedef struct _STI_DEVICE_INFORMATIONW {
  185. DWORD dwSize;
  186. // Type of the hardware imaging device
  187. STI_DEVICE_TYPE DeviceType;
  188. // Device identifier for reference when creating device object
  189. WCHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  190. // Set of capabilities flags
  191. STI_DEV_CAPS DeviceCapabilities;
  192. // This includes bus type
  193. DWORD dwHardwareConfiguration;
  194. // Vendor description string
  195. LPWSTR pszVendorDescription;
  196. // Device description , provided by vendor
  197. LPWSTR pszDeviceDescription;
  198. // String , representing port on which device is accessible.
  199. LPWSTR pszPortName;
  200. // Control panel propery provider
  201. LPWSTR pszPropProvider;
  202. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  203. LPWSTR pszLocalName;
  204. } STI_DEVICE_INFORMATIONW, *PSTI_DEVICE_INFORMATIONW;
  205. typedef struct _STI_DEVICE_INFORMATIONA {
  206. DWORD dwSize;
  207. // Type of the hardware imaging device
  208. STI_DEVICE_TYPE DeviceType;
  209. // Device identifier for reference when creating device object
  210. CHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  211. // Set of capabilities flags
  212. STI_DEV_CAPS DeviceCapabilities;
  213. // This includes bus type
  214. DWORD dwHardwareConfiguration;
  215. // Vendor description string
  216. LPCSTR pszVendorDescription;
  217. // Device description , provided by vendor
  218. LPCSTR pszDeviceDescription;
  219. // String , representing port on which device is accessible.
  220. LPCSTR pszPortName;
  221. // Control panel propery provider
  222. LPCSTR pszPropProvider;
  223. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  224. LPCSTR pszLocalName;
  225. } STI_DEVICE_INFORMATIONA, *PSTI_DEVICE_INFORMATIONA;
  226. #if defined(UNICODE) || defined(STI_UNICODE)
  227. typedef STI_DEVICE_INFORMATIONW STI_DEVICE_INFORMATION;
  228. typedef PSTI_DEVICE_INFORMATIONW PSTI_DEVICE_INFORMATION;
  229. #else
  230. typedef STI_DEVICE_INFORMATIONA STI_DEVICE_INFORMATION;
  231. typedef PSTI_DEVICE_INFORMATIONA PSTI_DEVICE_INFORMATION;
  232. #endif
  233. //
  234. // EXTENDED STI INFORMATION TO COVER WIA
  235. //
  236. typedef struct _STI_WIA_DEVICE_INFORMATIONW {
  237. DWORD dwSize;
  238. // Type of the hardware imaging device
  239. STI_DEVICE_TYPE DeviceType;
  240. // Device identifier for reference when creating device object
  241. WCHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  242. // Set of capabilities flags
  243. STI_DEV_CAPS DeviceCapabilities;
  244. // This includes bus type
  245. DWORD dwHardwareConfiguration;
  246. // Vendor description string
  247. LPWSTR pszVendorDescription;
  248. // Device description , provided by vendor
  249. LPWSTR pszDeviceDescription;
  250. // String , representing port on which device is accessible.
  251. LPWSTR pszPortName;
  252. // Control panel propery provider
  253. LPWSTR pszPropProvider;
  254. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  255. LPWSTR pszLocalName;
  256. //
  257. // WIA values
  258. //
  259. LPWSTR pszUiDll;
  260. LPWSTR pszServer;
  261. } STI_WIA_DEVICE_INFORMATIONW, *PSTI_WIA_DEVICE_INFORMATIONW;
  262. typedef struct _STI_WIA_DEVICE_INFORMATIONA {
  263. DWORD dwSize;
  264. // Type of the hardware imaging device
  265. STI_DEVICE_TYPE DeviceType;
  266. // Device identifier for reference when creating device object
  267. CHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  268. // Set of capabilities flags
  269. STI_DEV_CAPS DeviceCapabilities;
  270. // This includes bus type
  271. DWORD dwHardwareConfiguration;
  272. // Vendor description string
  273. LPCSTR pszVendorDescription;
  274. // Device description , provided by vendor
  275. LPCSTR pszDeviceDescription;
  276. // String , representing port on which device is accessible.
  277. LPCSTR pszPortName;
  278. // Control panel propery provider
  279. LPCSTR pszPropProvider;
  280. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  281. LPCSTR pszLocalName;
  282. //
  283. // WIA values
  284. //
  285. LPCSTR pszUiDll;
  286. LPCSTR pszServer;
  287. } STI_WIA_DEVICE_INFORMATIONA, *PSTI_WIA_DEVICE_INFORMATIONA;
  288. #if defined(UNICODE) || defined(STI_UNICODE)
  289. typedef STI_WIA_DEVICE_INFORMATIONW STI_WIA_DEVICE_INFORMATION;
  290. typedef PSTI_WIA_DEVICE_INFORMATIONW PSTI_WIA_DEVICE_INFORMATION;
  291. #else
  292. typedef STI_WIA_DEVICE_INFORMATIONA STI_WIA_DEVICE_INFORMATION;
  293. typedef PSTI_WIA_DEVICE_INFORMATIONA PSTI_WIA_DEVICE_INFORMATION;
  294. #endif
  295. // end sti_device_information
  296. //
  297. // Device state information.
  298. // ------------------------
  299. //
  300. // Following types are used to inquire state characteristics of the device after
  301. // it had been opened.
  302. //
  303. // Device configuration structure contains configurable parameters reflecting
  304. // current state of the device
  305. //
  306. //
  307. // Device hardware status.
  308. //
  309. //
  310. // Individual bits for state acquiring through StatusMask
  311. //
  312. // State of hardware as known to USD
  313. #define STI_DEVSTATUS_ONLINE_STATE 0x0001
  314. // State of pending events ( as known to USD)
  315. #define STI_DEVSTATUS_EVENTS_STATE 0x0002
  316. //
  317. // Online state values
  318. //
  319. #define STI_ONLINESTATE_OPERATIONAL 0x00000001
  320. #define STI_ONLINESTATE_PENDING 0x00000002
  321. #define STI_ONLINESTATE_ERROR 0x00000004
  322. #define STI_ONLINESTATE_PAUSED 0x00000008
  323. #define STI_ONLINESTATE_PAPER_JAM 0x00000010
  324. #define STI_ONLINESTATE_PAPER_PROBLEM 0x00000020
  325. #define STI_ONLINESTATE_OFFLINE 0x00000040
  326. #define STI_ONLINESTATE_IO_ACTIVE 0x00000080
  327. #define STI_ONLINESTATE_BUSY 0x00000100
  328. #define STI_ONLINESTATE_TRANSFERRING 0x00000200
  329. #define STI_ONLINESTATE_INITIALIZING 0x00000400
  330. #define STI_ONLINESTATE_WARMING_UP 0x00000800
  331. #define STI_ONLINESTATE_USER_INTERVENTION 0x00001000
  332. #define STI_ONLINESTATE_POWER_SAVE 0x00002000
  333. //
  334. // Event processing parameters
  335. //
  336. #define STI_EVENTHANDLING_ENABLED 0x00000001
  337. #define STI_EVENTHANDLING_POLLING 0x00000002
  338. #define STI_EVENTHANDLING_PENDING 0x00000004
  339. typedef struct _STI_DEVICE_STATUS {
  340. DWORD dwSize;
  341. // Request field - bits of status to verify
  342. DWORD StatusMask;
  343. //
  344. // Fields are set when status mask contains STI_DEVSTATUS_ONLINE_STATE bit set
  345. //
  346. // Bitmask describing device state
  347. DWORD dwOnlineState;
  348. // Device status code as defined by vendor
  349. DWORD dwHardwareStatusCode;
  350. //
  351. // Fields are set when status mask contains STI_DEVSTATUS_EVENTS_STATE bit set
  352. //
  353. // State of device notification processing (enabled, pending)
  354. DWORD dwEventHandlingState;
  355. // If device is polled, polling interval in ms
  356. DWORD dwPollingInterval;
  357. } STI_DEVICE_STATUS,*PSTI_DEVICE_STATUS;
  358. //
  359. // Structure to describe diagnostic ( test ) request to be processed by USD
  360. //
  361. // Basic test for presence of associated hardware
  362. #define STI_DIAGCODE_HWPRESENCE 0x00000001
  363. //
  364. // Status bits for diagnostic
  365. //
  366. //
  367. // generic diagnostic errors
  368. //
  369. typedef struct _ERROR_INFOW {
  370. DWORD dwSize;
  371. // Generic error , describing results of last operation
  372. DWORD dwGenericError;
  373. // vendor specific error code
  374. DWORD dwVendorError;
  375. // String, describing in more details results of last operation if it failed
  376. WCHAR szExtendedErrorText[255];
  377. } STI_ERROR_INFOW,*PSTI_ERROR_INFOW;
  378. typedef struct _ERROR_INFOA {
  379. DWORD dwSize;
  380. DWORD dwGenericError;
  381. DWORD dwVendorError;
  382. CHAR szExtendedErrorText[255];
  383. } STI_ERROR_INFOA,*PSTI_ERROR_INFOA;
  384. #if defined(UNICODE) || defined(STI_UNICODE)
  385. typedef STI_ERROR_INFOW STI_ERROR_INFO;
  386. #else
  387. typedef STI_ERROR_INFOA STI_ERROR_INFO;
  388. #endif
  389. typedef STI_ERROR_INFO* PSTI_ERROR_INFO;
  390. typedef struct _STI_DIAG {
  391. DWORD dwSize;
  392. // Diagnostic request fields. Are set on request by caller
  393. // One of the
  394. DWORD dwBasicDiagCode;
  395. DWORD dwVendorDiagCode;
  396. // Response fields
  397. DWORD dwStatusMask;
  398. STI_ERROR_INFO sErrorInfo;
  399. } STI_DIAG,*LPSTI_DIAG;
  400. //
  401. typedef STI_DIAG DIAG;
  402. typedef LPSTI_DIAG LPDIAG;
  403. // end device state information.
  404. //
  405. // Flags passed to WriteToErrorLog call in a first parameter, indicating type of the message
  406. // which needs to be logged
  407. //
  408. #define STI_TRACE_INFORMATION 0x00000001
  409. #define STI_TRACE_WARNING 0x00000002
  410. #define STI_TRACE_ERROR 0x00000004
  411. //
  412. // Event notification mechansims.
  413. // ------------------------------
  414. //
  415. // Those are used to inform last subscribed caller of the changes in device state, initiated by
  416. // device.
  417. //
  418. // The only supported discipline of notification is stack. The last caller to subscribe will be notified
  419. // and will receive notification data. After caller unsubscribes , the previously subscribed caller will
  420. // become active.
  421. //
  422. // Notifications are sent to subscriber via window message. Window handle is passed as
  423. // parameter
  424. #define STI_SUBSCRIBE_FLAG_WINDOW 0x0001
  425. // Device notification is signalling Win32 event ( auto-set event). Event handle
  426. // is passed as a parameter
  427. #define STI_SUBSCRIBE_FLAG_EVENT 0x0002
  428. typedef struct _STISUBSCRIBE {
  429. DWORD dwSize;
  430. DWORD dwFlags;
  431. // Not used . Will be used for subscriber to set bit mask filtering different events
  432. DWORD dwFilter;
  433. // When STI_SUBSCRIBE_FLAG_WINDOW bit is set, following fields should be set
  434. // Handle of the window which will receive notification message
  435. HWND hWndNotify;
  436. // Handle of Win32 auto-reset event , which will be signalled whenever device has
  437. // notification pending
  438. HANDLE hEvent;
  439. // Code of notification message, sent to window
  440. UINT uiNotificationMessage;
  441. } STISUBSCRIBE,*LPSTISUBSCRIBE;
  442. #define MAX_NOTIFICATION_DATA 64
  443. //
  444. // Structure to describe notification information
  445. //
  446. typedef struct _STINOTIFY {
  447. DWORD dwSize; // Total size of the notification structure
  448. // GUID of the notification being retrieved
  449. GUID guidNotificationCode;
  450. // Vendor specific notification description
  451. BYTE abNotificationData[MAX_NOTIFICATION_DATA]; // USD specific
  452. } STINOTIFY,*LPSTINOTIFY;
  453. // end event_mechanisms
  454. //
  455. // STI device broadcasting
  456. //
  457. //
  458. // When STI Device is being added or removed, PnP broadacst is being sent , but it is not obvious
  459. // for application code to recognize if it is STI device and if so, what is the name of the
  460. // device. STI subsystem will analyze PnP broadcasts and rebroadcast another message via
  461. // BroadcastSystemMessage / WM_DEVICECHANGE / DBT_USERDEFINED .
  462. // String passed as user defined message contains STI prefix, action and device name
  463. #define STI_ADD_DEVICE_BROADCAST_ACTION "Arrival"
  464. #define STI_REMOVE_DEVICE_BROADCAST_ACTION "Removal"
  465. #define STI_ADD_DEVICE_BROADCAST_STRING "STI\\" STI_ADD_DEVICE_BROADCAST_ACTION "\\%s"
  466. #define STI_REMOVE_DEVICE_BROADCAST_STRING "STI\\" STI_REMOVE_DEVICE_BROADCAST_ACTION "\\%s"
  467. // end STI broadcasting
  468. //
  469. // Device create modes
  470. //
  471. // Device is being opened only for status querying and notifications receiving
  472. #define STI_DEVICE_CREATE_STATUS 0x00000001
  473. // Device is being opened for data transfer ( supersedes status mode)
  474. #define STI_DEVICE_CREATE_DATA 0x00000002
  475. #define STI_DEVICE_CREATE_BOTH 0x00000003
  476. //
  477. // Bit mask for legitimate mode bits, which can be used when calling CreateDevice
  478. //
  479. #define STI_DEVICE_CREATE_MASK 0x0000FFFF
  480. //
  481. // Flags controlling device enumeration
  482. //
  483. #define STIEDFL_ALLDEVICES 0x00000000
  484. #define STIEDFL_ATTACHEDONLY 0x00000001
  485. //
  486. // Control code , sent to the device through raw control interface
  487. //
  488. typedef DWORD STI_RAW_CONTROL_CODE;
  489. //
  490. // All raw codes below this one are reserved for future use.
  491. //
  492. #define STI_RAW_RESERVED 0x1000
  493. /*
  494. * COM Interfaces to STI
  495. */
  496. #ifdef __cplusplus
  497. /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
  498. interface IStillImageW;
  499. interface IStillImageA;
  500. interface IStiDevice;
  501. #endif
  502. #ifndef MIDL_PASS
  503. //DLLEXP STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter);
  504. //DLLEXP STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter);
  505. STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter);
  506. STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter);
  507. #if defined(UNICODE) || defined(STI_UNICODE)
  508. #define IID_IStillImage IID_IStillImageW
  509. #define IStillImage IStillImageW
  510. #define StiCreateInstance StiCreateInstanceW
  511. #else
  512. #define IID_IStillImage IID_IStillImageA
  513. #define IStillImage IStillImageA
  514. #define StiCreateInstance StiCreateInstanceA
  515. #endif
  516. typedef interface IStiDevice *LPSTILLIMAGEDEVICE;
  517. typedef interface IStillImage *PSTI;
  518. typedef interface IStiDevice *PSTIDEVICE;
  519. typedef interface IStillImageA *PSTIA;
  520. typedef interface IStiDeviceA *PSTIDEVICEA;
  521. typedef interface IStillImageW *PSTIW;
  522. typedef interface IStiDeviceW *PSTIDEVICEW;
  523. //DLLEXP STDMETHODIMP StiCreateInstance(HINSTANCE hinst, DWORD dwVer, PSTI *ppSti, LPUNKNOWN punkOuter);
  524. /*
  525. * IStillImage interface
  526. *
  527. * Top level STI access interface.
  528. *
  529. */
  530. #undef INTERFACE
  531. #define INTERFACE IStillImageW
  532. DECLARE_INTERFACE_(IStillImageW, IUnknown)
  533. {
  534. /*** IUnknown methods ***/
  535. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  536. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  537. STDMETHOD_(ULONG, Release) (THIS) PURE;
  538. /*** IStillImage methods ***/
  539. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
  540. STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
  541. STDMETHOD(GetDeviceInfo)(THIS_ LPWSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
  542. STDMETHOD(CreateDevice) (THIS_ LPWSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
  543. //
  544. // Device instance values. Used to associate various data with device.
  545. //
  546. STDMETHOD(GetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
  547. STDMETHOD(SetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
  548. //
  549. // For appllication started through push model launch, returns associated information
  550. //
  551. STDMETHOD(GetSTILaunchInformation)(THIS_ LPWSTR pwszDeviceName, DWORD *pdwEventCode,LPWSTR pwszEventName) PURE;
  552. STDMETHOD(RegisterLaunchApplication)(THIS_ LPWSTR pwszAppName,LPWSTR pwszCommandLine) PURE;
  553. STDMETHOD(UnregisterLaunchApplication)(THIS_ LPWSTR pwszAppName) PURE;
  554. //
  555. // To control state of notification handling. For polled devices this means state of monitor
  556. // polling, for true notification devices means enabling/disabling notification flow
  557. // from monitor to registered applications
  558. //
  559. STDMETHOD(EnableHwNotifications)(THIS_ LPCWSTR pwszDeviceName,BOOL bNewState) PURE;
  560. STDMETHOD(GetHwNotificationState)(THIS_ LPCWSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
  561. //
  562. // When device is installed but not accessible, application may request bus refresh
  563. // which in some cases will make device known. This is mainly used for nonPnP buses
  564. // like SCSI, when device was powered on after PnP enumeration
  565. //
  566. //
  567. STDMETHOD(RefreshDeviceBus)(THIS_ LPCWSTR pwszDeviceName) PURE;
  568. //
  569. // Launch application to emulate event on a device. Used by "control center" style components,
  570. // which intercept device event , analyze and later force launch based on certain criteria.
  571. //
  572. STDMETHOD(LaunchApplicationForDevice)(THIS_ LPWSTR pwszDeviceName,LPWSTR pwszAppName,LPSTINOTIFY pStiNotify);
  573. //
  574. // For non-PnP devices with non-known bus type connection, setup extension, associated with the
  575. // device can set it's parameters
  576. //
  577. STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONW);
  578. //
  579. // Write message to STI error log
  580. //
  581. STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage) PURE;
  582. #ifdef NOT_IMPLEMENTED
  583. //
  584. // TO register application for receiving various STI notifications
  585. //
  586. STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
  587. STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
  588. #endif //NOT_IMPLEMENTED
  589. };
  590. typedef struct IStillImageW *LPSTILLIMAGEW;
  591. #undef INTERFACE
  592. #define INTERFACE IStillImageA
  593. DECLARE_INTERFACE_(IStillImageA, IUnknown)
  594. {
  595. /*** IUnknown methods ***/
  596. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  597. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  598. STDMETHOD_(ULONG, Release) (THIS) PURE;
  599. /*** IStillImage methods ***/
  600. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
  601. STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
  602. STDMETHOD(GetDeviceInfo)(THIS_ LPCSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
  603. STDMETHOD(CreateDevice) (THIS_ LPCSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
  604. //
  605. // Device instance values. Used to associate various data with device.
  606. //
  607. STDMETHOD(GetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
  608. STDMETHOD(SetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
  609. //
  610. // For appllication started through push model launch, returns associated information
  611. //
  612. STDMETHOD(GetSTILaunchInformation)(THIS_ LPSTR pwszDeviceName, DWORD *pdwEventCode,LPSTR pwszEventName) PURE;
  613. STDMETHOD(RegisterLaunchApplication)(THIS_ LPCSTR pwszAppName,LPCSTR pwszCommandLine) PURE;
  614. STDMETHOD(UnregisterLaunchApplication)(THIS_ LPCSTR pwszAppName) PURE;
  615. //
  616. // To control state of notification handling. For polled devices this means state of monitor
  617. // polling, for true notification devices means enabling/disabling notification flow
  618. // from monitor to registered applications
  619. //
  620. STDMETHOD(EnableHwNotifications)(THIS_ LPCSTR pwszDeviceName,BOOL bNewState) PURE;
  621. STDMETHOD(GetHwNotificationState)(THIS_ LPCSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
  622. //
  623. // When device is installed but not accessible, application may request bus refresh
  624. // which in some cases will make device known. This is mainly used for nonPnP buses
  625. // like SCSI, when device was powered on after PnP enumeration
  626. //
  627. //
  628. STDMETHOD(RefreshDeviceBus)(THIS_ LPCSTR pwszDeviceName) PURE;
  629. //
  630. // Launch application to emulate event on a device. Used by "control center" style components,
  631. // which intercept device event , analyze and later force launch based on certain criteria.
  632. //
  633. STDMETHOD(LaunchApplicationForDevice)(THIS_ LPCSTR pwszDeviceName,LPCSTR pwszAppName,LPSTINOTIFY pStiNotify);
  634. //
  635. // For non-PnP devices with non-known bus type connection, setup extension, associated with the
  636. // device can set it's parameters
  637. //
  638. STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONA);
  639. //
  640. // Write message to STI error log
  641. //
  642. STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCSTR pszMessage) PURE;
  643. #ifdef NOT_IMPLEMENTED
  644. //
  645. // TO register application for receiving various STI notifications
  646. //
  647. STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
  648. STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
  649. #endif //NOT_IMPLEMENTED
  650. };
  651. typedef struct IStillImageA *LPSTILLIMAGEA;
  652. #if defined(UNICODE) || defined(STI_UNICODE)
  653. #define IStillImageVtbl IStillImageWVtbl
  654. #else
  655. #define IStillImageVtbl IStillImageAVtbl
  656. #endif
  657. typedef struct IStillImage *LPSTILLIMAGE;
  658. #if !defined(__cplusplus) || defined(CINTERFACE)
  659. #define IStillImage_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  660. #define IStillImage_AddRef(p) (p)->lpVtbl->AddRef(p)
  661. #define IStillImage_Release(p) (p)->lpVtbl->Release(p)
  662. #define IStillImage_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
  663. #define IStillImage_GetDeviceList(p,a,b,c,d) (p)->lpVtbl->GetDeviceList(p,a,b,c,d)
  664. #define IStillImage_GetDeviceInfo(p,a,b) (p)->lpVtbl->GetDeviceInfo(p,a,b)
  665. #define IStillImage_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d)
  666. #define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->GetDeviceValue(p,a,b,c,d,e)
  667. #define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->SetDeviceValue(p,a,b,c,d,e)
  668. #define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->lpVtbl->GetSTILaunchInformation(p,a,b,c)
  669. #define IStillImage_RegisterLaunchApplication(p,a,b) (p)->lpVtbl->RegisterLaunchApplication(p,a,b)
  670. #define IStillImage_UnregisterLaunchApplication(p,a) (p)->lpVtbl->UnregisterLaunchApplication(p,a)
  671. #define IStillImage_EnableHwNotifications(p,a,b) (p)->lpVtbl->EnableHwNotifications(p,a,b)
  672. #define IStillImage_GetHwNotificationState(p,a,b) (p)->lpVtbl->GetHwNotificationState(p,a,b)
  673. #define IStillImage_RefreshDeviceBus(p,a) (p)->lpVtbl->RefreshDeviceBus(p,a)
  674. #endif
  675. /*
  676. * IStillImage_Device interface
  677. *
  678. * This is generic per device interface. Specialized interfaces are also
  679. * available
  680. */
  681. #undef INTERFACE
  682. #define INTERFACE IStiDevice
  683. DECLARE_INTERFACE_(IStiDevice, IUnknown)
  684. {
  685. /*** IUnknown methods ***/
  686. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  687. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  688. STDMETHOD_(ULONG, Release) (THIS) PURE;
  689. /*** IStiDevice methods ***/
  690. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,LPCWSTR pwszDeviceName,DWORD dwVersion,DWORD dwMode) PURE;
  691. STDMETHOD(GetCapabilities) (THIS_ PSTI_DEV_CAPS pDevCaps) PURE;
  692. STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE;
  693. STDMETHOD(DeviceReset)(THIS ) PURE;
  694. STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE;
  695. STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ;
  696. STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE;
  697. STDMETHOD(LockDevice) (THIS_ DWORD dwTimeOut) PURE;
  698. STDMETHOD(UnLockDevice) (THIS ) PURE;
  699. STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  700. STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  701. STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  702. STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  703. //
  704. // Subscription is used to enable "control center" style applications , where flow of
  705. // notifications should be redirected from monitor itself to another "launcher"
  706. //
  707. STDMETHOD(Subscribe)(THIS_ LPSTISUBSCRIBE lpSubsribe) PURE;
  708. STDMETHOD(GetLastNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE;
  709. STDMETHOD(UnSubscribe)(THIS ) PURE;
  710. STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE;
  711. };
  712. #if !defined(__cplusplus) || defined(CINTERFACE)
  713. #define IStiDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  714. #define IStiDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
  715. #define IStiDevice_Release(p) (p)->lpVtbl->Release(p)
  716. #define IStiDevice_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
  717. #define IStiDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  718. #define IStiDevice_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
  719. #define IStiDevice_DeviceReset(p) (p)->lpVtbl->DeviceReset(p)
  720. #define IStiDevice_LockDevice(p,a) (p)->lpVtbl->LockDevice(p,a)
  721. #define IStiDevice_UnLockDevice(p) (p)->lpVtbl->UnLockDevice(p)
  722. #define IStiDevice_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a)
  723. #define IStiDevice_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f)
  724. #define IStiDevice_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a)
  725. #define IStiDevice_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c)
  726. #define IStiDevice_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c)
  727. #define IStiDevice_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c)
  728. #define IStiDevice_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c)
  729. #define IStiDevice_Subscribe(p,a) (p)->lpVtbl->Subscribe(p,a)
  730. #define IStiDevice_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a)
  731. #define IStiDevice_UnSubscribe(p) (p)->lpVtbl->UnSubscribe(p)
  732. #define IStiDevice_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a)
  733. #endif
  734. #endif // MIDL_PASS
  735. #ifdef __cplusplus
  736. };
  737. #endif
  738. //
  739. // Reset packing
  740. //
  741. #include <poppack.h>
  742. #endif // _STICOM_