Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

sti.h

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1986-1997 Microsoft Corporation 00004 00005 Module Name: 00006 00007 sti.h 00008 00009 Abstract: 00010 00011 This module contains the user mode still image APIs in COM format 00012 00013 Revision History: 00014 00015 00016 --*/ 00017 00018 #ifndef _STICOM_ 00019 #define _STICOM_ 00020 00021 // 00022 // Set packing 00023 // 00024 #include <pshpack8.h> 00025 00026 // 00027 // Only use UNICODE STI interfaces 00028 // 00029 #define STI_UNICODE 1 00030 00031 // 00032 // Include COM definitions 00033 // 00034 #ifndef _NO_COM 00035 #include <objbase.h> 00036 #endif 00037 00038 #include <stireg.h> 00039 #include <stierr.h> 00040 00041 // 00042 // Compiler pragmas 00043 // 00044 #pragma warning(disable:4200) // warning about zero-sized arrays being non-stadard C extension 00045 00046 #define DLLEXP __declspec( dllexport ) 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00052 #if defined( _WIN32 ) && !defined( _NO_COM) 00053 00054 /* 00055 * Class IID's 00056 */ 00057 00058 // B323F8E0-2E68-11D0-90EA-00AA0060F86C 00059 DEFINE_GUID(CLSID_Sti, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); 00060 00061 /* 00062 * Interface IID's 00063 */ 00064 00065 // {641BD880-2DC8-11D0-90EA-00AA0060F86C} 00066 DEFINE_GUID(IID_IStillImageW, 0x641BD880L, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); 00067 00068 // {A7B1F740-1D7F-11D1-ACA9-00A02438AD48} 00069 DEFINE_GUID(IID_IStillImageA, 0xA7B1F740L, 0x1D7F, 0x11D1, 0xAC, 0xA9, 0x00, 0xA0, 0x24, 0x38, 0xAD, 0x48); 00070 00071 00072 // {6CFA5A80-2DC8-11D0-90EA-00AA0060F86C} 00073 DEFINE_GUID(IID_IStiDevice, 0x6CFA5A80L, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); 00074 00075 #endif 00076 00077 // 00078 // Generic constants and definitions 00079 // 00080 #define STI_VERSION 0x00000002 00081 #define STI_VERSION_MIN_ALLOWED 0x00000002 00082 00083 #define GET_STIVER_MAJOR(dwVersion) HIWORD(dwVersion) 00084 #define GET_STIVER_MINOR(dwVersion) LOWORD(dwVersion) 00085 00086 // 00087 // Maximum length of internal device name 00088 // 00089 #define STI_MAX_INTERNAL_NAME_LENGTH 128 00090 00091 // begin sti_device_information 00092 00093 // 00094 // Device information definitions and prototypes 00095 // ---------------------------------------------- 00096 // 00097 00098 // 00099 // Following information is used for enumerating still image devices , currently configured 00100 // in the system. Presence of the device in the enumerated list does not mean availability 00101 // of the device, it only means that device was installed at least once and had not been removed since. 00102 // 00103 00104 // 00105 // Type of device ( scanner, camera) is represented by DWORD value with 00106 // hi word containing generic device type , and lo word containing sub-type 00107 // 00108 typedef enum _STI_DEVICE_MJ_TYPE { 00109 StiDeviceTypeDefault = 0, 00110 StiDeviceTypeScanner = 1, 00111 StiDeviceTypeDigitalCamera = 2 00112 } STI_DEVICE_MJ_TYPE; 00113 00114 typedef DWORD STI_DEVICE_TYPE; 00115 00116 // 00117 // Macros to extract device type/subtype from single type field 00118 // 00119 #define GET_STIDEVICE_TYPE(dwDevType) HIWORD(dwDevType) 00120 #define GET_STIDEVICE_SUBTYPE(dwDevType) LOWORD(dwDevType) 00121 00122 // 00123 // Device capabilities bits. 00124 // Various capabilities are grouped into separate bitmasks 00125 // 00126 00127 typedef struct _STI_DEV_CAPS { 00128 DWORD dwGeneric; 00129 } STI_DEV_CAPS, *PSTI_DEV_CAPS; 00130 00131 00132 // 00133 // Notifications are supported. 00134 // If this capability set , device can be subscribed to . 00135 // 00136 #define STI_GENCAP_NOTIFICATIONS 0x00000001 00137 00138 // 00139 // Polling required . 00140 // This capability is used when previous is set to TRUE. Presence of it means 00141 // that device is not capable of issuing "truly" asyncronous notifications, but can 00142 // be polled to determine the moment when event happened 00143 #define STI_GENCAP_POLLING_NEEDED 0x00000002 00144 00145 00146 // 00147 // Type of bus connection for those in need to know 00148 // 00149 #define STI_HW_CONFIG_UNKNOWN 0x0001 00150 #define STI_HW_CONFIG_SCSI 0x0002 00151 #define STI_HW_CONFIG_USB 0x0004 00152 #define STI_HW_CONFIG_SERIAL 0x0008 00153 #define STI_HW_CONFIG_PARALLEL 0x0010 00154 00155 // 00156 // Device information structure, this is not configurable. This data is returned from 00157 // device enumeration API and is used for populating UI or selecting which device 00158 // should be used in current session 00159 // 00160 typedef struct _STI_DEVICE_INFORMATIONW { 00161 DWORD dwSize; 00162 00163 // Type of the hardware imaging device 00164 STI_DEVICE_TYPE DeviceType; 00165 00166 // Device identifier for reference when creating device object 00167 WCHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH]; 00168 00169 // Set of capabilities flags 00170 STI_DEV_CAPS DeviceCapabilities; 00171 00172 // This includes bus type 00173 DWORD dwHardwareConfiguration; 00174 00175 // Vendor description string 00176 LPWSTR pszVendorDescription; 00177 00178 // Device description , provided by vendor 00179 LPWSTR pszDeviceDescription; 00180 00181 // String , representing port on which device is accessible. 00182 LPWSTR pszPortName; 00183 00184 // Control panel propery provider 00185 LPWSTR pszPropProvider; 00186 00187 // Local specific ("friendly") name of the device, mainly used for showing in the UI 00188 LPWSTR pszLocalName; 00189 00190 } STI_DEVICE_INFORMATIONW, *PSTI_DEVICE_INFORMATIONW; 00191 00192 typedef struct _STI_DEVICE_INFORMATIONA { 00193 DWORD dwSize; 00194 00195 // Type of the hardware imaging device 00196 STI_DEVICE_TYPE DeviceType; 00197 00198 // Device identifier for reference when creating device object 00199 CHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH]; 00200 00201 // Set of capabilities flags 00202 STI_DEV_CAPS DeviceCapabilities; 00203 00204 // This includes bus type 00205 DWORD dwHardwareConfiguration; 00206 00207 // Vendor description string 00208 LPCSTR pszVendorDescription; 00209 00210 // Device description , provided by vendor 00211 LPCSTR pszDeviceDescription; 00212 00213 // String , representing port on which device is accessible. 00214 LPCSTR pszPortName; 00215 00216 // Control panel propery provider 00217 LPCSTR pszPropProvider; 00218 00219 // Local specific ("friendly") name of the device, mainly used for showing in the UI 00220 LPCSTR pszLocalName; 00221 00222 } STI_DEVICE_INFORMATIONA, *PSTI_DEVICE_INFORMATIONA; 00223 00224 #if defined(UNICODE) || defined(STI_UNICODE) 00225 typedef STI_DEVICE_INFORMATIONW STI_DEVICE_INFORMATION; 00226 typedef PSTI_DEVICE_INFORMATIONW PSTI_DEVICE_INFORMATION; 00227 #else 00228 typedef STI_DEVICE_INFORMATIONA STI_DEVICE_INFORMATION; 00229 typedef PSTI_DEVICE_INFORMATIONA PSTI_DEVICE_INFORMATION; 00230 #endif 00231 00232 // end sti_device_information 00233 00234 // 00235 // Device state information. 00236 // ------------------------ 00237 // 00238 // Following types are used to inquire state characteristics of the device after 00239 // it had been opened. 00240 // 00241 // Device configuration structure contains configurable parameters reflecting 00242 // current state of the device 00243 // 00244 // 00245 // Device hardware status. 00246 // 00247 00248 // 00249 // Individual bits for state acquiring through StatusMask 00250 // 00251 00252 // State of hardware as known to USD 00253 #define STI_DEVSTATUS_ONLINE_STATE 0x0001 00254 00255 // State of pending events ( as known to USD) 00256 #define STI_DEVSTATUS_EVENTS_STATE 0x0002 00257 00258 // 00259 // Online state values 00260 // 00261 #define STI_ONLINESTATE_OPERATIONAL 0x00000001 00262 #define STI_ONLINESTATE_PENDING 0x00000002 00263 #define STI_ONLINESTATE_ERROR 0x00000004 00264 #define STI_ONLINESTATE_PAUSED 0x00000008 00265 #define STI_ONLINESTATE_PAPER_JAM 0x00000010 00266 #define STI_ONLINESTATE_PAPER_PROBLEM 0x00000020 00267 #define STI_ONLINESTATE_OFFLINE 0x00000040 00268 #define STI_ONLINESTATE_IO_ACTIVE 0x00000080 00269 #define STI_ONLINESTATE_BUSY 0x00000100 00270 #define STI_ONLINESTATE_TRANSFERRING 0x00000200 00271 #define STI_ONLINESTATE_INITIALIZING 0x00000400 00272 #define STI_ONLINESTATE_WARMING_UP 0x00000800 00273 #define STI_ONLINESTATE_USER_INTERVENTION 0x00001000 00274 #define STI_ONLINESTATE_POWER_SAVE 0x00002000 00275 00276 // 00277 // Event processing parameters 00278 // 00279 #define STI_EVENTHANDLING_ENABLED 0x00000001 00280 #define STI_EVENTHANDLING_POLLING 0x00000002 00281 #define STI_EVENTHANDLING_PENDING 0x00000004 00282 00283 typedef struct _STI_DEVICE_STATUS { 00284 00285 DWORD dwSize; 00286 00287 // Request field - bits of status to verify 00288 DWORD StatusMask; 00289 00290 // 00291 // Fields are set when status mask contains STI_DEVSTATUS_ONLINE_STATE bit set 00292 // 00293 // Bitmask describing device state 00294 DWORD dwOnlineState; 00295 00296 // Device status code as defined by vendor 00297 DWORD dwHardwareStatusCode; 00298 00299 // 00300 // Fields are set when status mask contains STI_DEVSTATUS_EVENTS_STATE bit set 00301 // 00302 00303 // State of device notification processing (enabled, pending) 00304 DWORD dwEventHandlingState; 00305 00306 // If device is polled, polling interval in ms 00307 DWORD dwPollingInterval; 00308 00309 } STI_DEVICE_STATUS,*PSTI_DEVICE_STATUS; 00310 00311 // 00312 // Structure to describe diagnostic ( test ) request to be processed by USD 00313 // 00314 00315 // Basic test for presence of associated hardware 00316 #define STI_DIAGCODE_HWPRESENCE 0x00000001 00317 00318 // 00319 // Status bits for diagnostic 00320 // 00321 00322 // 00323 // generic diagnostic errors 00324 // 00325 00326 typedef struct _ERROR_INFOW { 00327 00328 DWORD dwSize; 00329 00330 // Generic error , describing results of last operation 00331 DWORD dwGenericError; 00332 00333 // vendor specific error code 00334 DWORD dwVendorError; 00335 00336 // String, describing in more details results of last operation if it failed 00337 WCHAR szExtendedErrorText[255]; 00338 00339 } STI_ERROR_INFOW,*PSTI_ERROR_INFOW; 00340 00341 typedef struct _ERROR_INFOA { 00342 00343 DWORD dwSize; 00344 00345 DWORD dwGenericError; 00346 DWORD dwVendorError; 00347 00348 CHAR szExtendedErrorText[255]; 00349 00350 } STI_ERROR_INFOA,*PSTI_ERROR_INFOA; 00351 00352 #if defined(UNICODE) || defined(STI_UNICODE) 00353 typedef STI_ERROR_INFOW STI_ERROR_INFO; 00354 #else 00355 typedef STI_ERROR_INFOA STI_ERROR_INFO; 00356 #endif 00357 00358 typedef STI_ERROR_INFO* PSTI_ERROR_INFO; 00359 00360 typedef struct _STI_DIAG { 00361 00362 DWORD dwSize; 00363 00364 // Diagnostic request fields. Are set on request by caller 00365 00366 // One of the 00367 DWORD dwBasicDiagCode; 00368 DWORD dwVendorDiagCode; 00369 00370 // Response fields 00371 DWORD dwStatusMask; 00372 00373 STI_ERROR_INFO sErrorInfo; 00374 00375 } STI_DIAG,*LPSTI_DIAG; 00376 00377 // 00378 typedef STI_DIAG DIAG; 00379 typedef LPSTI_DIAG LPDIAG; 00380 00381 00382 // end device state information. 00383 00384 // 00385 // Flags passed to WriteToErrorLog call in a first parameter, indicating type of the message 00386 // which needs to be logged 00387 // 00388 #define STI_TRACE_INFORMATION 0x00000001 00389 #define STI_TRACE_WARNING 0x00000002 00390 #define STI_TRACE_ERROR 0x00000004 00391 00392 // 00393 // Event notification mechansims. 00394 // ------------------------------ 00395 // 00396 // Those are used to inform last subscribed caller of the changes in device state, initiated by 00397 // device. 00398 // 00399 // The only supported discipline of notification is stack. The last caller to subscribe will be notified 00400 // and will receive notification data. After caller unsubscribes , the previously subscribed caller will 00401 // become active. 00402 // 00403 00404 // Notifications are sent to subscriber via window message. Window handle is passed as 00405 // parameter 00406 #define STI_SUBSCRIBE_FLAG_WINDOW 0x0001 00407 00408 // Device notification is signalling Win32 event ( auto-set event). Event handle 00409 // is passed as a parameter 00410 #define STI_SUBSCRIBE_FLAG_EVENT 0x0002 00411 00412 typedef struct _STISUBSCRIBE { 00413 00414 DWORD dwSize; 00415 00416 DWORD dwFlags; 00417 00418 // Not used . Will be used for subscriber to set bit mask filtering different events 00419 DWORD dwFilter; 00420 00421 // When STI_SUBSCRIBE_FLAG_WINDOW bit is set, following fields should be set 00422 // Handle of the window which will receive notification message 00423 HWND hWndNotify; 00424 00425 // Handle of Win32 auto-reset event , which will be signalled whenever device has 00426 // notification pending 00427 HANDLE hEvent; 00428 00429 // Code of notification message, sent to window 00430 UINT uiNotificationMessage; 00431 00432 } STISUBSCRIBE,*LPSTISUBSCRIBE; 00433 00434 #define MAX_NOTIFICATION_DATA 64 00435 00436 00437 // 00438 // Structure to describe notification information 00439 // 00440 typedef struct _STINOTIFY { 00441 00442 DWORD dwSize; // Total size of the notification structure 00443 00444 // GUID of the notification being retrieved 00445 GUID guidNotificationCode; 00446 00447 // Vendor specific notification description 00448 BYTE abNotificationData[MAX_NOTIFICATION_DATA]; // USD specific 00449 00450 } STINOTIFY,*LPSTINOTIFY; 00451 00452 00453 // end event_mechanisms 00454 00455 // 00456 // STI device broadcasting 00457 // 00458 00459 // 00460 // When STI Device is being added or removed, PnP broadacst is being sent , but it is not obvious 00461 // for application code to recognize if it is STI device and if so, what is the name of the 00462 // device. STI subsystem will analyze PnP broadcasts and rebroadcast another message via 00463 // BroadcastSystemMessage / WM_DEVICECHANGE / DBT_USERDEFINED . 00464 00465 // String passed as user defined message contains STI prefix, action and device name 00466 00467 #define STI_ADD_DEVICE_BROADCAST_ACTION "Arrival" 00468 #define STI_REMOVE_DEVICE_BROADCAST_ACTION "Removal" 00469 00470 #define STI_ADD_DEVICE_BROADCAST_STRING "STI\\" STI_ADD_DEVICE_BROADCAST_ACTION "\\%s" 00471 #define STI_REMOVE_DEVICE_BROADCAST_STRING "STI\\" STI_REMOVE_DEVICE_BROADCAST_ACTION "\\%s" 00472 00473 00474 // end STI broadcasting 00475 00476 00477 // 00478 // Device create modes 00479 // 00480 00481 // Device is being opened only for status querying and notifications receiving 00482 #define STI_DEVICE_CREATE_STATUS 0x00000001 00483 00484 // Device is being opened for data transfer ( supersedes status mode) 00485 #define STI_DEVICE_CREATE_DATA 0x00000002 00486 00487 #define STI_DEVICE_CREATE_BOTH 0x00000003 00488 00489 // 00490 // Bit mask for legitimate mode bits, which can be used when calling CreateDevice 00491 // 00492 #define STI_DEVICE_CREATE_MASK 0x0000FFFF 00493 00494 // 00495 // Flags controlling device enumeration 00496 // 00497 #define STIEDFL_ALLDEVICES 0x00000000 00498 #define STIEDFL_ATTACHEDONLY 0x00000001 00499 00500 // 00501 // Control code , sent to the device through raw control interface 00502 // 00503 typedef DWORD STI_RAW_CONTROL_CODE; 00504 00505 // 00506 // All raw codes below this one are reserved for future use. 00507 // 00508 #define STI_RAW_RESERVED 0x1000 00509 00510 /* 00511 * COM Interfaces to STI 00512 */ 00513 00514 #ifdef __cplusplus 00515 00516 /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */ 00517 interface IStillImageW; 00518 interface IStillImageA; 00519 00520 interface IStiDevice; 00521 00522 #endif 00523 00524 #ifndef MIDL_PASS 00525 00526 DLLEXP STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter); 00527 DLLEXP STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter); 00528 00529 #if defined(UNICODE) || defined(STI_UNICODE) 00530 #define IID_IStillImage IID_IStillImageW 00531 #define IStillImage IStillImageW 00532 #define StiCreateInstance StiCreateInstanceW 00533 #else 00534 #define IID_IStillImage IID_IStillImageA 00535 #define IStillImage IStillImageA 00536 #define StiCreateInstance StiCreateInstanceA 00537 #endif 00538 00539 typedef interface IStiDevice *LPSTILLIMAGEDEVICE; 00540 00541 typedef interface IStillImage *PSTI; 00542 typedef interface IStiDevice *PSTIDEVICE; 00543 00544 typedef interface IStillImageA *PSTIA; 00545 typedef interface IStiDeviceA *PSTIDEVICEA; 00546 00547 typedef interface IStillImageW *PSTIW; 00548 typedef interface IStiDeviceW *PSTIDEVICEW; 00549 00550 //DLLEXP STDMETHODIMP StiCreateInstance(HINSTANCE hinst, DWORD dwVer, PSTI *ppSti, LPUNKNOWN punkOuter); 00551 00552 /* 00553 * IStillImage interface 00554 * 00555 * Top level STI access interface. 00556 * 00557 */ 00558 00559 #undef INTERFACE 00560 #define INTERFACE IStillImageW 00561 DECLARE_INTERFACE_(IStillImageW, IUnknown) 00562 { 00563 /*** IUnknown methods ***/ 00564 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; 00565 STDMETHOD_(ULONG, AddRef) (THIS) PURE; 00566 STDMETHOD_(ULONG, Release) (THIS) PURE; 00567 00568 /*** IStillImage methods ***/ 00569 STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE; 00570 00571 STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE; 00572 STDMETHOD(GetDeviceInfo)(THIS_ LPWSTR pwszDeviceName, LPVOID *ppBuffer) PURE; 00573 00574 STDMETHOD(CreateDevice) (THIS_ LPWSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE; 00575 00576 // 00577 // Device instance values. Used to associate various data with device. 00578 // 00579 STDMETHOD(GetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData); 00580 STDMETHOD(SetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData); 00581 00582 // 00583 // For appllication started through push model launch, returns associated information 00584 // 00585 STDMETHOD(GetSTILaunchInformation)(THIS_ LPWSTR pwszDeviceName, DWORD *pdwEventCode,LPWSTR pwszEventName) PURE; 00586 STDMETHOD(RegisterLaunchApplication)(THIS_ LPWSTR pwszAppName,LPWSTR pwszCommandLine) PURE; 00587 STDMETHOD(UnregisterLaunchApplication)(THIS_ LPWSTR pwszAppName) PURE; 00588 00589 // 00590 // To control state of notification handling. For polled devices this means state of monitor 00591 // polling, for true notification devices means enabling/disabling notification flow 00592 // from monitor to registered applications 00593 // 00594 STDMETHOD(EnableHwNotifications)(THIS_ LPCWSTR pwszDeviceName,BOOL bNewState) PURE; 00595 STDMETHOD(GetHwNotificationState)(THIS_ LPCWSTR pwszDeviceName,BOOL *pbCurrentState) PURE; 00596 00597 // 00598 // When device is installed but not accessible, application may request bus refresh 00599 // which in some cases will make device known. This is mainly used for nonPnP buses 00600 // like SCSI, when device was powered on after PnP enumeration 00601 // 00602 // 00603 STDMETHOD(RefreshDeviceBus)(THIS_ LPCWSTR pwszDeviceName) PURE; 00604 00605 // 00606 // Launch application to emulate event on a device. Used by "control center" style components, 00607 // which intercept device event , analyze and later force launch based on certain criteria. 00608 // 00609 STDMETHOD(LaunchApplicationForDevice)(THIS_ LPWSTR pwszDeviceName,LPWSTR pwszAppName,LPSTINOTIFY pStiNotify); 00610 00611 // 00612 // For non-PnP devices with non-known bus type connection, setup extension, associated with the 00613 // device can set it's parameters 00614 // 00615 STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONW); 00616 00617 // 00618 // Write message to STI error log 00619 // 00620 STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage) PURE; 00621 00622 #ifdef NOT_IMPLEMENTED 00623 00624 // 00625 // TO register application for receiving various STI notifications 00626 // 00627 STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE; 00628 STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE; 00629 00630 #endif //NOT_IMPLEMENTED 00631 00632 }; 00633 00634 typedef struct IStillImageW *LPSTILLIMAGEW; 00635 00636 #undef INTERFACE 00637 #define INTERFACE IStillImageA 00638 DECLARE_INTERFACE_(IStillImageA, IUnknown) 00639 { 00640 /*** IUnknown methods ***/ 00641 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; 00642 STDMETHOD_(ULONG, AddRef) (THIS) PURE; 00643 STDMETHOD_(ULONG, Release) (THIS) PURE; 00644 00645 /*** IStillImage methods ***/ 00646 STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE; 00647 00648 STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE; 00649 STDMETHOD(GetDeviceInfo)(THIS_ LPCSTR pwszDeviceName, LPVOID *ppBuffer) PURE; 00650 00651 STDMETHOD(CreateDevice) (THIS_ LPCSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE; 00652 00653 // 00654 // Device instance values. Used to associate various data with device. 00655 // 00656 STDMETHOD(GetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData); 00657 STDMETHOD(SetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData); 00658 00659 // 00660 // For appllication started through push model launch, returns associated information 00661 // 00662 STDMETHOD(GetSTILaunchInformation)(THIS_ LPCSTR pwszDeviceName, DWORD *pdwEventCode,LPSTR pwszEventName) PURE; 00663 STDMETHOD(RegisterLaunchApplication)(THIS_ LPCSTR pwszAppName,LPCSTR pwszCommandLine) PURE; 00664 STDMETHOD(UnregisterLaunchApplication)(THIS_ LPCSTR pwszAppName) PURE; 00665 00666 // 00667 // To control state of notification handling. For polled devices this means state of monitor 00668 // polling, for true notification devices means enabling/disabling notification flow 00669 // from monitor to registered applications 00670 // 00671 STDMETHOD(EnableHwNotifications)(THIS_ LPCSTR pwszDeviceName,BOOL bNewState) PURE; 00672 STDMETHOD(GetHwNotificationState)(THIS_ LPCSTR pwszDeviceName,BOOL *pbCurrentState) PURE; 00673 00674 // 00675 // When device is installed but not accessible, application may request bus refresh 00676 // which in some cases will make device known. This is mainly used for nonPnP buses 00677 // like SCSI, when device was powered on after PnP enumeration 00678 // 00679 // 00680 STDMETHOD(RefreshDeviceBus)(THIS_ LPCSTR pwszDeviceName) PURE; 00681 00682 // 00683 // Launch application to emulate event on a device. Used by "control center" style components, 00684 // which intercept device event , analyze and later force launch based on certain criteria. 00685 // 00686 STDMETHOD(LaunchApplicationForDevice)(THIS_ LPCSTR pwszDeviceName,LPCSTR pwszAppName,LPSTINOTIFY pStiNotify); 00687 00688 00689 // 00690 // For non-PnP devices with non-known bus type connection, setup extension, associated with the 00691 // device can set it's parameters 00692 // 00693 STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONA); 00694 00695 // 00696 // Write message to STI error log 00697 // 00698 STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCSTR pszMessage) PURE; 00699 00700 #ifdef NOT_IMPLEMENTED 00701 00702 // 00703 // TO register application for receiving various STI notifications 00704 // 00705 STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE; 00706 STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE; 00707 00708 #endif //NOT_IMPLEMENTED 00709 00710 }; 00711 00712 typedef struct IStillImageA *LPSTILLIMAGEA; 00713 00714 #if defined(UNICODE) || defined(STI_UNICODE) 00715 #define IStillImageVtbl IStillImageWVtbl 00716 #else 00717 #define IStillImageVtbl IStillImageAVtbl 00718 #endif 00719 00720 typedef struct IStillImage *LPSTILLIMAGE; 00721 00722 #if !defined(__cplusplus) || defined(CINTERFACE) 00723 #define IStillImage_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 00724 #define IStillImage_AddRef(p) (p)->lpVtbl->AddRef(p) 00725 #define IStillImage_Release(p) (p)->lpVtbl->Release(p) 00726 #define IStillImage_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) 00727 00728 #define IStillImage_GetDeviceList(p,a,b,c,d) (p)->lpVtbl->GetDeviceList(p,a,b,c,d) 00729 #define IStillImage_GetDeviceInfo(p,a,b) (p)->lpVtbl->GetDeviceInfo(p,a,b) 00730 #define IStillImage_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d) 00731 #define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->GetDeviceValue(p,a,b,c,d,e) 00732 #define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->SetDeviceValue(p,a,b,c,d,e) 00733 #define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->lpVtbl->GetSTILaunchInformation(p,a,b,c) 00734 #define IStillImage_RegisterLaunchApplication(p,a,b) (p)->lpVtbl->RegisterLaunchApplication(p,a,b) 00735 #define IStillImage_UnregisterLaunchApplication(p,a) (p)->lpVtbl->UnregisterLaunchApplication(p,a) 00736 #define IStillImage_EnableHwNotifications(p,a,b) (p)->lpVtbl->EnableHwNotifications(p,a,b) 00737 #define IStillImage_GetHwNotificationState(p,a,b) (p)->lpVtbl->GetHwNotificationState(p,a,b) 00738 #define IStillImage_RefreshDeviceBus(p,a) (p)->lpVtbl->RefreshDeviceBus(p,a) 00739 00740 #endif 00741 00742 /* 00743 * IStillImage_Device interface 00744 * 00745 * This is generic per device interface. Specialized interfaces are also 00746 * available 00747 */ 00748 #undef INTERFACE 00749 #define INTERFACE IStiDevice 00750 DECLARE_INTERFACE_(IStiDevice, IUnknown) 00751 { 00752 /*** IUnknown methods ***/ 00753 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; 00754 STDMETHOD_(ULONG, AddRef) (THIS) PURE; 00755 STDMETHOD_(ULONG, Release) (THIS) PURE; 00756 00757 /*** IStiDevice methods ***/ 00758 STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,LPCWSTR pwszDeviceName,DWORD dwVersion,DWORD dwMode) PURE; 00759 00760 STDMETHOD(GetCapabilities) (THIS_ PSTI_DEV_CAPS pDevCaps) PURE; 00761 00762 STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE; 00763 00764 STDMETHOD(DeviceReset)(THIS ) PURE; 00765 STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE; 00766 00767 STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ; 00768 00769 STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE; 00770 00771 STDMETHOD(LockDevice) (THIS_ DWORD dwTimeOut) PURE; 00772 STDMETHOD(UnLockDevice) (THIS ) PURE; 00773 00774 STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; 00775 STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; 00776 00777 STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; 00778 STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; 00779 00780 // 00781 // Subscription is used to enable "control center" style applications , where flow of 00782 // notifications should be redirected from monitor itself to another "launcher" 00783 // 00784 STDMETHOD(Subscribe)(THIS_ LPSTISUBSCRIBE lpSubsribe) PURE; 00785 STDMETHOD(GetLastNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE; 00786 STDMETHOD(UnSubscribe)(THIS ) PURE; 00787 00788 STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE; 00789 }; 00790 00791 #if !defined(__cplusplus) || defined(CINTERFACE) 00792 #define IStiDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 00793 #define IStiDevice_AddRef(p) (p)->lpVtbl->AddRef(p) 00794 #define IStiDevice_Release(p) (p)->lpVtbl->Release(p) 00795 #define IStiDevice_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d) 00796 00797 #define IStiDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) 00798 #define IStiDevice_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) 00799 #define IStiDevice_DeviceReset(p) (p)->lpVtbl->DeviceReset(p) 00800 #define IStiDevice_LockDevice(p,a) (p)->lpVtbl->LockDevice(p,a) 00801 #define IStiDevice_UnLockDevice(p) (p)->lpVtbl->LockDevice(p) 00802 00803 #define IStiDevice_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a) 00804 #define IStiDevice_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f) 00805 #define IStiDevice_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a) 00806 #define IStiDevice_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c) 00807 #define IStiDevice_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c) 00808 #define IStiDevice_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c) 00809 #define IStiDevice_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c) 00810 00811 #define IStiDevice_Subscribe(p,a) (p)->lpVtbl->Subscribe(p,a) 00812 #define IStiDevice_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a) 00813 #define IStiDevice_UnSubscribe(p) (p)->lpVtbl->UnSubscribe(p) 00814 00815 #define IStiDevice_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a) 00816 00817 #endif 00818 00819 #endif // MIDL_PASS 00820 00821 #ifdef __cplusplus 00822 }; 00823 #endif 00824 00825 // 00826 // Reset packing 00827 // 00828 #include <poppack.h> 00829 00830 #endif // _STICOM_ 00831 00832 00833

Generated on Sat May 15 19:41:52 2004 for test by doxygen 1.3.7