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.

833 lines
27 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. #endif
  51. //
  52. // Generic constants and definitions
  53. //
  54. #define STI_VERSION 0x00000002
  55. #define STI_VERSION_MIN_ALLOWED 0x00000002
  56. #define GET_STIVER_MAJOR(dwVersion) HIWORD(dwVersion)
  57. #define GET_STIVER_MINOR(dwVersion) LOWORD(dwVersion)
  58. //
  59. // Maximum length of internal device name
  60. //
  61. #define STI_MAX_INTERNAL_NAME_LENGTH 128
  62. // begin sti_device_information
  63. //
  64. // Device information definitions and prototypes
  65. // ----------------------------------------------
  66. //
  67. //
  68. // Following information is used for enumerating still image devices , currently configured
  69. // in the system. Presence of the device in the enumerated list does not mean availability
  70. // of the device, it only means that device was installed at least once and had not been removed since.
  71. //
  72. //
  73. // Type of device ( scanner, camera) is represented by DWORD value with
  74. // hi word containing generic device type , and lo word containing sub-type
  75. //
  76. typedef enum _STI_DEVICE_MJ_TYPE {
  77. StiDeviceTypeDefault = 0,
  78. StiDeviceTypeScanner = 1,
  79. StiDeviceTypeDigitalCamera = 2
  80. } STI_DEVICE_MJ_TYPE;
  81. typedef DWORD STI_DEVICE_TYPE;
  82. //
  83. // Macros to extract device type/subtype from single type field
  84. //
  85. #define GET_STIDEVICE_TYPE(dwDevType) HIWORD(dwDevType)
  86. #define GET_STIDEVICE_SUBTYPE(dwDevType) LOWORD(dwDevType)
  87. //
  88. // Device capabilities bits.
  89. // Various capabilities are grouped into separate bitmasks
  90. //
  91. typedef struct _STI_DEV_CAPS {
  92. DWORD dwGeneric;
  93. } STI_DEV_CAPS, *PSTI_DEV_CAPS;
  94. //
  95. // Notifications are supported.
  96. // If this capability set , device can be subscribed to .
  97. //
  98. #define STI_GENCAP_NOTIFICATIONS 0x00000001
  99. //
  100. // Polling required .
  101. // This capability is used when previous is set to TRUE. Presence of it means
  102. // that device is not capable of issuing "truly" asyncronous notifications, but can
  103. // be polled to determine the moment when event happened
  104. #define STI_GENCAP_POLLING_NEEDED 0x00000002
  105. //
  106. // Type of bus connection for those in need to know
  107. //
  108. #define STI_HW_CONFIG_UNKNOWN 0x0001
  109. #define STI_HW_CONFIG_SCSI 0x0002
  110. #define STI_HW_CONFIG_USB 0x0004
  111. #define STI_HW_CONFIG_SERIAL 0x0008
  112. #define STI_HW_CONFIG_PARALLEL 0x0010
  113. //
  114. // Device information structure, this is not configurable. This data is returned from
  115. // device enumeration API and is used for populating UI or selecting which device
  116. // should be used in current session
  117. //
  118. typedef struct _STI_DEVICE_INFORMATIONW {
  119. DWORD dwSize;
  120. // Type of the hardware imaging device
  121. STI_DEVICE_TYPE DeviceType;
  122. // Device identifier for reference when creating device object
  123. WCHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  124. // Set of capabilities flags
  125. STI_DEV_CAPS DeviceCapabilities;
  126. // This includes bus type
  127. DWORD dwHardwareConfiguration;
  128. // Vendor description string
  129. LPWSTR pszVendorDescription;
  130. // Device description , provided by vendor
  131. LPWSTR pszDeviceDescription;
  132. // String , representing port on which device is accessible.
  133. LPWSTR pszPortName;
  134. // Control panel propery provider
  135. LPWSTR pszPropProvider;
  136. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  137. LPWSTR pszLocalName;
  138. } STI_DEVICE_INFORMATIONW, *PSTI_DEVICE_INFORMATIONW;
  139. typedef struct _STI_DEVICE_INFORMATIONA {
  140. DWORD dwSize;
  141. // Type of the hardware imaging device
  142. STI_DEVICE_TYPE DeviceType;
  143. // Device identifier for reference when creating device object
  144. CHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  145. // Set of capabilities flags
  146. STI_DEV_CAPS DeviceCapabilities;
  147. // This includes bus type
  148. DWORD dwHardwareConfiguration;
  149. // Vendor description string
  150. LPCSTR pszVendorDescription;
  151. // Device description , provided by vendor
  152. LPCSTR pszDeviceDescription;
  153. // String , representing port on which device is accessible.
  154. LPCSTR pszPortName;
  155. // Control panel propery provider
  156. LPCSTR pszPropProvider;
  157. // Local specific ("friendly") name of the device, mainly used for showing in the UI
  158. LPCSTR pszLocalName;
  159. } STI_DEVICE_INFORMATIONA, *PSTI_DEVICE_INFORMATIONA;
  160. #if defined(UNICODE) || defined(STI_UNICODE)
  161. typedef STI_DEVICE_INFORMATIONW STI_DEVICE_INFORMATION;
  162. typedef PSTI_DEVICE_INFORMATIONW PSTI_DEVICE_INFORMATION;
  163. #else
  164. typedef STI_DEVICE_INFORMATIONA STI_DEVICE_INFORMATION;
  165. typedef PSTI_DEVICE_INFORMATIONA PSTI_DEVICE_INFORMATION;
  166. #endif
  167. // end sti_device_information
  168. //
  169. // Device state information.
  170. // ------------------------
  171. //
  172. // Following types are used to inquire state characteristics of the device after
  173. // it had been opened.
  174. //
  175. // Device configuration structure contains configurable parameters reflecting
  176. // current state of the device
  177. //
  178. //
  179. // Device hardware status.
  180. //
  181. //
  182. // Individual bits for state acquiring through StatusMask
  183. //
  184. // State of hardware as known to USD
  185. #define STI_DEVSTATUS_ONLINE_STATE 0x0001
  186. // State of pending events ( as known to USD)
  187. #define STI_DEVSTATUS_EVENTS_STATE 0x0002
  188. //
  189. // Online state values
  190. //
  191. #define STI_ONLINESTATE_OPERATIONAL 0x00000001
  192. #define STI_ONLINESTATE_PENDING 0x00000002
  193. #define STI_ONLINESTATE_ERROR 0x00000004
  194. #define STI_ONLINESTATE_PAUSED 0x00000008
  195. #define STI_ONLINESTATE_PAPER_JAM 0x00000010
  196. #define STI_ONLINESTATE_PAPER_PROBLEM 0x00000020
  197. #define STI_ONLINESTATE_OFFLINE 0x00000040
  198. #define STI_ONLINESTATE_IO_ACTIVE 0x00000080
  199. #define STI_ONLINESTATE_BUSY 0x00000100
  200. #define STI_ONLINESTATE_TRANSFERRING 0x00000200
  201. #define STI_ONLINESTATE_INITIALIZING 0x00000400
  202. #define STI_ONLINESTATE_WARMING_UP 0x00000800
  203. #define STI_ONLINESTATE_USER_INTERVENTION 0x00001000
  204. #define STI_ONLINESTATE_POWER_SAVE 0x00002000
  205. //
  206. // Event processing parameters
  207. //
  208. #define STI_EVENTHANDLING_ENABLED 0x00000001
  209. #define STI_EVENTHANDLING_POLLING 0x00000002
  210. #define STI_EVENTHANDLING_PENDING 0x00000004
  211. typedef struct _STI_DEVICE_STATUS {
  212. DWORD dwSize;
  213. // Request field - bits of status to verify
  214. DWORD StatusMask;
  215. //
  216. // Fields are set when status mask contains STI_DEVSTATUS_ONLINE_STATE bit set
  217. //
  218. // Bitmask describing device state
  219. DWORD dwOnlineState;
  220. // Device status code as defined by vendor
  221. DWORD dwHardwareStatusCode;
  222. //
  223. // Fields are set when status mask contains STI_DEVSTATUS_EVENTS_STATE bit set
  224. //
  225. // State of device notification processing (enabled, pending)
  226. DWORD dwEventHandlingState;
  227. // If device is polled, polling interval in ms
  228. DWORD dwPollingInterval;
  229. } STI_DEVICE_STATUS,*PSTI_DEVICE_STATUS;
  230. //
  231. // Structure to describe diagnostic ( test ) request to be processed by USD
  232. //
  233. // Basic test for presence of associated hardware
  234. #define STI_DIAGCODE_HWPRESENCE 0x00000001
  235. //
  236. // Status bits for diagnostic
  237. //
  238. //
  239. // generic diagnostic errors
  240. //
  241. typedef struct _ERROR_INFOW {
  242. DWORD dwSize;
  243. // Generic error , describing results of last operation
  244. DWORD dwGenericError;
  245. // vendor specific error code
  246. DWORD dwVendorError;
  247. // String, describing in more details results of last operation if it failed
  248. WCHAR szExtendedErrorText[255];
  249. } STI_ERROR_INFOW,*PSTI_ERROR_INFOW;
  250. typedef struct _ERROR_INFOA {
  251. DWORD dwSize;
  252. DWORD dwGenericError;
  253. DWORD dwVendorError;
  254. CHAR szExtendedErrorText[255];
  255. } STI_ERROR_INFOA,*PSTI_ERROR_INFOA;
  256. #if defined(UNICODE) || defined(STI_UNICODE)
  257. typedef STI_ERROR_INFOW STI_ERROR_INFO;
  258. #else
  259. typedef STI_ERROR_INFOA STI_ERROR_INFO;
  260. #endif
  261. typedef STI_ERROR_INFO* PSTI_ERROR_INFO;
  262. typedef struct _STI_DIAG {
  263. DWORD dwSize;
  264. // Diagnostic request fields. Are set on request by caller
  265. // One of the
  266. DWORD dwBasicDiagCode;
  267. DWORD dwVendorDiagCode;
  268. // Response fields
  269. DWORD dwStatusMask;
  270. STI_ERROR_INFO sErrorInfo;
  271. } STI_DIAG,*LPSTI_DIAG;
  272. //
  273. typedef STI_DIAG DIAG;
  274. typedef LPSTI_DIAG LPDIAG;
  275. // end device state information.
  276. //
  277. // Flags passed to WriteToErrorLog call in a first parameter, indicating type of the message
  278. // which needs to be logged
  279. //
  280. #define STI_TRACE_INFORMATION 0x00000001
  281. #define STI_TRACE_WARNING 0x00000002
  282. #define STI_TRACE_ERROR 0x00000004
  283. //
  284. // Event notification mechansims.
  285. // ------------------------------
  286. //
  287. // Those are used to inform last subscribed caller of the changes in device state, initiated by
  288. // device.
  289. //
  290. // The only supported discipline of notification is stack. The last caller to subscribe will be notified
  291. // and will receive notification data. After caller unsubscribes , the previously subscribed caller will
  292. // become active.
  293. //
  294. // Notifications are sent to subscriber via window message. Window handle is passed as
  295. // parameter
  296. #define STI_SUBSCRIBE_FLAG_WINDOW 0x0001
  297. // Device notification is signalling Win32 event ( auto-set event). Event handle
  298. // is passed as a parameter
  299. #define STI_SUBSCRIBE_FLAG_EVENT 0x0002
  300. typedef struct _STISUBSCRIBE {
  301. DWORD dwSize;
  302. DWORD dwFlags;
  303. // Not used . Will be used for subscriber to set bit mask filtering different events
  304. DWORD dwFilter;
  305. // When STI_SUBSCRIBE_FLAG_WINDOW bit is set, following fields should be set
  306. // Handle of the window which will receive notification message
  307. HWND hWndNotify;
  308. // Handle of Win32 auto-reset event , which will be signalled whenever device has
  309. // notification pending
  310. HANDLE hEvent;
  311. // Code of notification message, sent to window
  312. UINT uiNotificationMessage;
  313. } STISUBSCRIBE,*LPSTISUBSCRIBE;
  314. #define MAX_NOTIFICATION_DATA 64
  315. //
  316. // Structure to describe notification information
  317. //
  318. typedef struct _STINOTIFY {
  319. DWORD dwSize; // Total size of the notification structure
  320. // GUID of the notification being retrieved
  321. GUID guidNotificationCode;
  322. // Vendor specific notification description
  323. BYTE abNotificationData[MAX_NOTIFICATION_DATA]; // USD specific
  324. } STINOTIFY,*LPSTINOTIFY;
  325. // end event_mechanisms
  326. //
  327. // STI device broadcasting
  328. //
  329. //
  330. // When STI Device is being added or removed, PnP broadacst is being sent , but it is not obvious
  331. // for application code to recognize if it is STI device and if so, what is the name of the
  332. // device. STI subsystem will analyze PnP broadcasts and rebroadcast another message via
  333. // BroadcastSystemMessage / WM_DEVICECHANGE / DBT_USERDEFINED .
  334. // String passed as user defined message contains STI prefix, action and device name
  335. #define STI_ADD_DEVICE_BROADCAST_ACTION "Arrival"
  336. #define STI_REMOVE_DEVICE_BROADCAST_ACTION "Removal"
  337. #define STI_ADD_DEVICE_BROADCAST_STRING "STI\\" STI_ADD_DEVICE_BROADCAST_ACTION "\\%s"
  338. #define STI_REMOVE_DEVICE_BROADCAST_STRING "STI\\" STI_REMOVE_DEVICE_BROADCAST_ACTION "\\%s"
  339. // end STI broadcasting
  340. //
  341. // Device create modes
  342. //
  343. // Device is being opened only for status querying and notifications receiving
  344. #define STI_DEVICE_CREATE_STATUS 0x00000001
  345. // Device is being opened for data transfer ( supersedes status mode)
  346. #define STI_DEVICE_CREATE_DATA 0x00000002
  347. #define STI_DEVICE_CREATE_BOTH 0x00000003
  348. //
  349. // Bit mask for legitimate mode bits, which can be used when calling CreateDevice
  350. //
  351. #define STI_DEVICE_CREATE_MASK 0x0000FFFF
  352. //
  353. // Flags controlling device enumeration
  354. //
  355. #define STIEDFL_ALLDEVICES 0x00000000
  356. #define STIEDFL_ATTACHEDONLY 0x00000001
  357. //
  358. // Control code , sent to the device through raw control interface
  359. //
  360. typedef DWORD STI_RAW_CONTROL_CODE;
  361. //
  362. // All raw codes below this one are reserved for future use.
  363. //
  364. #define STI_RAW_RESERVED 0x1000
  365. /*
  366. * COM Interfaces to STI
  367. */
  368. #ifdef __cplusplus
  369. /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
  370. interface IStillImageW;
  371. interface IStillImageA;
  372. interface IStiDevice;
  373. #endif
  374. #ifndef MIDL_PASS
  375. DLLEXP STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter);
  376. DLLEXP STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter);
  377. #if defined(UNICODE) || defined(STI_UNICODE)
  378. #define IID_IStillImage IID_IStillImageW
  379. #define IStillImage IStillImageW
  380. #define StiCreateInstance StiCreateInstanceW
  381. #else
  382. #define IID_IStillImage IID_IStillImageA
  383. #define IStillImage IStillImageA
  384. #define StiCreateInstance StiCreateInstanceA
  385. #endif
  386. typedef interface IStiDevice *LPSTILLIMAGEDEVICE;
  387. typedef interface IStillImage *PSTI;
  388. typedef interface IStiDevice *PSTIDEVICE;
  389. typedef interface IStillImageA *PSTIA;
  390. typedef interface IStiDeviceA *PSTIDEVICEA;
  391. typedef interface IStillImageW *PSTIW;
  392. typedef interface IStiDeviceW *PSTIDEVICEW;
  393. //DLLEXP STDMETHODIMP StiCreateInstance(HINSTANCE hinst, DWORD dwVer, PSTI *ppSti, LPUNKNOWN punkOuter);
  394. /*
  395. * IStillImage interface
  396. *
  397. * Top level STI access interface.
  398. *
  399. */
  400. #undef INTERFACE
  401. #define INTERFACE IStillImageW
  402. DECLARE_INTERFACE_(IStillImageW, IUnknown)
  403. {
  404. /*** IUnknown methods ***/
  405. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  406. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  407. STDMETHOD_(ULONG, Release) (THIS) PURE;
  408. /*** IStillImage methods ***/
  409. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
  410. STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
  411. STDMETHOD(GetDeviceInfo)(THIS_ LPWSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
  412. STDMETHOD(CreateDevice) (THIS_ LPWSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
  413. //
  414. // Device instance values. Used to associate various data with device.
  415. //
  416. STDMETHOD(GetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
  417. STDMETHOD(SetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
  418. //
  419. // For appllication started through push model launch, returns associated information
  420. //
  421. STDMETHOD(GetSTILaunchInformation)(THIS_ LPWSTR pwszDeviceName, DWORD *pdwEventCode,LPWSTR pwszEventName) PURE;
  422. STDMETHOD(RegisterLaunchApplication)(THIS_ LPWSTR pwszAppName,LPWSTR pwszCommandLine) PURE;
  423. STDMETHOD(UnregisterLaunchApplication)(THIS_ LPWSTR pwszAppName) PURE;
  424. //
  425. // To control state of notification handling. For polled devices this means state of monitor
  426. // polling, for true notification devices means enabling/disabling notification flow
  427. // from monitor to registered applications
  428. //
  429. STDMETHOD(EnableHwNotifications)(THIS_ LPCWSTR pwszDeviceName,BOOL bNewState) PURE;
  430. STDMETHOD(GetHwNotificationState)(THIS_ LPCWSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
  431. //
  432. // When device is installed but not accessible, application may request bus refresh
  433. // which in some cases will make device known. This is mainly used for nonPnP buses
  434. // like SCSI, when device was powered on after PnP enumeration
  435. //
  436. //
  437. STDMETHOD(RefreshDeviceBus)(THIS_ LPCWSTR pwszDeviceName) PURE;
  438. //
  439. // Launch application to emulate event on a device. Used by "control center" style components,
  440. // which intercept device event , analyze and later force launch based on certain criteria.
  441. //
  442. STDMETHOD(LaunchApplicationForDevice)(THIS_ LPWSTR pwszDeviceName,LPWSTR pwszAppName,LPSTINOTIFY pStiNotify);
  443. //
  444. // For non-PnP devices with non-known bus type connection, setup extension, associated with the
  445. // device can set it's parameters
  446. //
  447. STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONW);
  448. //
  449. // Write message to STI error log
  450. //
  451. STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage) PURE;
  452. #ifdef NOT_IMPLEMENTED
  453. //
  454. // TO register application for receiving various STI notifications
  455. //
  456. STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
  457. STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
  458. #endif //NOT_IMPLEMENTED
  459. };
  460. typedef struct IStillImageW *LPSTILLIMAGEW;
  461. #undef INTERFACE
  462. #define INTERFACE IStillImageA
  463. DECLARE_INTERFACE_(IStillImageA, IUnknown)
  464. {
  465. /*** IUnknown methods ***/
  466. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  467. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  468. STDMETHOD_(ULONG, Release) (THIS) PURE;
  469. /*** IStillImage methods ***/
  470. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
  471. STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
  472. STDMETHOD(GetDeviceInfo)(THIS_ LPCSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
  473. STDMETHOD(CreateDevice) (THIS_ LPCSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
  474. //
  475. // Device instance values. Used to associate various data with device.
  476. //
  477. STDMETHOD(GetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
  478. STDMETHOD(SetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
  479. //
  480. // For appllication started through push model launch, returns associated information
  481. //
  482. STDMETHOD(GetSTILaunchInformation)(THIS_ LPCSTR pwszDeviceName, DWORD *pdwEventCode,LPSTR pwszEventName) PURE;
  483. STDMETHOD(RegisterLaunchApplication)(THIS_ LPCSTR pwszAppName,LPCSTR pwszCommandLine) PURE;
  484. STDMETHOD(UnregisterLaunchApplication)(THIS_ LPCSTR pwszAppName) PURE;
  485. //
  486. // To control state of notification handling. For polled devices this means state of monitor
  487. // polling, for true notification devices means enabling/disabling notification flow
  488. // from monitor to registered applications
  489. //
  490. STDMETHOD(EnableHwNotifications)(THIS_ LPCSTR pwszDeviceName,BOOL bNewState) PURE;
  491. STDMETHOD(GetHwNotificationState)(THIS_ LPCSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
  492. //
  493. // When device is installed but not accessible, application may request bus refresh
  494. // which in some cases will make device known. This is mainly used for nonPnP buses
  495. // like SCSI, when device was powered on after PnP enumeration
  496. //
  497. //
  498. STDMETHOD(RefreshDeviceBus)(THIS_ LPCSTR pwszDeviceName) PURE;
  499. //
  500. // Launch application to emulate event on a device. Used by "control center" style components,
  501. // which intercept device event , analyze and later force launch based on certain criteria.
  502. //
  503. STDMETHOD(LaunchApplicationForDevice)(THIS_ LPCSTR pwszDeviceName,LPCSTR pwszAppName,LPSTINOTIFY pStiNotify);
  504. //
  505. // For non-PnP devices with non-known bus type connection, setup extension, associated with the
  506. // device can set it's parameters
  507. //
  508. STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONA);
  509. //
  510. // Write message to STI error log
  511. //
  512. STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCSTR pszMessage) PURE;
  513. #ifdef NOT_IMPLEMENTED
  514. //
  515. // TO register application for receiving various STI notifications
  516. //
  517. STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
  518. STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
  519. #endif //NOT_IMPLEMENTED
  520. };
  521. typedef struct IStillImageA *LPSTILLIMAGEA;
  522. #if defined(UNICODE) || defined(STI_UNICODE)
  523. #define IStillImageVtbl IStillImageWVtbl
  524. #else
  525. #define IStillImageVtbl IStillImageAVtbl
  526. #endif
  527. typedef struct IStillImage *LPSTILLIMAGE;
  528. #if !defined(__cplusplus) || defined(CINTERFACE)
  529. #define IStillImage_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  530. #define IStillImage_AddRef(p) (p)->lpVtbl->AddRef(p)
  531. #define IStillImage_Release(p) (p)->lpVtbl->Release(p)
  532. #define IStillImage_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
  533. #define IStillImage_GetDeviceList(p,a,b,c,d) (p)->lpVtbl->GetDeviceList(p,a,b,c,d)
  534. #define IStillImage_GetDeviceInfo(p,a,b) (p)->lpVtbl->GetDeviceInfo(p,a,b)
  535. #define IStillImage_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d)
  536. #define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->GetDeviceValue(p,a,b,c,d,e)
  537. #define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->SetDeviceValue(p,a,b,c,d,e)
  538. #define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->lpVtbl->GetSTILaunchInformation(p,a,b,c)
  539. #define IStillImage_RegisterLaunchApplication(p,a,b) (p)->lpVtbl->RegisterLaunchApplication(p,a,b)
  540. #define IStillImage_UnregisterLaunchApplication(p,a) (p)->lpVtbl->UnregisterLaunchApplication(p,a)
  541. #define IStillImage_EnableHwNotifications(p,a,b) (p)->lpVtbl->EnableHwNotifications(p,a,b)
  542. #define IStillImage_GetHwNotificationState(p,a,b) (p)->lpVtbl->GetHwNotificationState(p,a,b)
  543. #define IStillImage_RefreshDeviceBus(p,a) (p)->lpVtbl->RefreshDeviceBus(p,a)
  544. #endif
  545. /*
  546. * IStillImage_Device interface
  547. *
  548. * This is generic per device interface. Specialized interfaces are also
  549. * available
  550. */
  551. #undef INTERFACE
  552. #define INTERFACE IStiDevice
  553. DECLARE_INTERFACE_(IStiDevice, IUnknown)
  554. {
  555. /*** IUnknown methods ***/
  556. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  557. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  558. STDMETHOD_(ULONG, Release) (THIS) PURE;
  559. /*** IStiDevice methods ***/
  560. STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,LPCWSTR pwszDeviceName,DWORD dwVersion,DWORD dwMode) PURE;
  561. STDMETHOD(GetCapabilities) (THIS_ PSTI_DEV_CAPS pDevCaps) PURE;
  562. STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE;
  563. STDMETHOD(DeviceReset)(THIS ) PURE;
  564. STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE;
  565. STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ;
  566. STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE;
  567. STDMETHOD(LockDevice) (THIS_ DWORD dwTimeOut) PURE;
  568. STDMETHOD(UnLockDevice) (THIS ) PURE;
  569. STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  570. STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  571. STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  572. STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  573. //
  574. // Subscription is used to enable "control center" style applications , where flow of
  575. // notifications should be redirected from monitor itself to another "launcher"
  576. //
  577. STDMETHOD(Subscribe)(THIS_ LPSTISUBSCRIBE lpSubsribe) PURE;
  578. STDMETHOD(GetLastNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE;
  579. STDMETHOD(UnSubscribe)(THIS ) PURE;
  580. STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE;
  581. };
  582. #if !defined(__cplusplus) || defined(CINTERFACE)
  583. #define IStiDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  584. #define IStiDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
  585. #define IStiDevice_Release(p) (p)->lpVtbl->Release(p)
  586. #define IStiDevice_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
  587. #define IStiDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  588. #define IStiDevice_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
  589. #define IStiDevice_DeviceReset(p) (p)->lpVtbl->DeviceReset(p)
  590. #define IStiDevice_LockDevice(p,a) (p)->lpVtbl->LockDevice(p,a)
  591. #define IStiDevice_UnLockDevice(p) (p)->lpVtbl->LockDevice(p)
  592. #define IStiDevice_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a)
  593. #define IStiDevice_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f)
  594. #define IStiDevice_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a)
  595. #define IStiDevice_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c)
  596. #define IStiDevice_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c)
  597. #define IStiDevice_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c)
  598. #define IStiDevice_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c)
  599. #define IStiDevice_Subscribe(p,a) (p)->lpVtbl->Subscribe(p,a)
  600. #define IStiDevice_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a)
  601. #define IStiDevice_UnSubscribe(p) (p)->lpVtbl->UnSubscribe(p)
  602. #define IStiDevice_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a)
  603. #endif
  604. #endif // MIDL_PASS
  605. #ifdef __cplusplus
  606. };
  607. #endif
  608. //
  609. // Reset packing
  610. //
  611. #include <poppack.h>
  612. #endif // _STICOM_