📄 sti.h
字号:
//
// Control code , sent to the device through raw control interface
//
typedef DWORD STI_RAW_CONTROL_CODE;
//
// All raw codes below this one are reserved for future use.
//
#define STI_RAW_RESERVED 0x1000
/*
* COM Interfaces to STI
*/
#ifdef __cplusplus
/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
interface IStillImageW;
interface IStillImageA;
interface IStiDevice;
#endif
#ifndef MIDL_PASS
//DLLEXP STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter);
//DLLEXP STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter);
STDMETHODIMP StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, interface IStillImageW **ppSti, LPUNKNOWN punkOuter);
STDMETHODIMP StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, interface IStillImageA **ppSti, LPUNKNOWN punkOuter);
#if defined(UNICODE) || defined(STI_UNICODE)
#define IID_IStillImage IID_IStillImageW
#define IStillImage IStillImageW
#define StiCreateInstance StiCreateInstanceW
#else
#define IID_IStillImage IID_IStillImageA
#define IStillImage IStillImageA
#define StiCreateInstance StiCreateInstanceA
#endif
typedef interface IStiDevice *LPSTILLIMAGEDEVICE;
typedef interface IStillImage *PSTI;
typedef interface IStiDevice *PSTIDEVICE;
typedef interface IStillImageA *PSTIA;
typedef interface IStiDeviceA *PSTIDEVICEA;
typedef interface IStillImageW *PSTIW;
typedef interface IStiDeviceW *PSTIDEVICEW;
//DLLEXP STDMETHODIMP StiCreateInstance(HINSTANCE hinst, DWORD dwVer, PSTI *ppSti, LPUNKNOWN punkOuter);
/*
* IStillImage interface
*
* Top level STI access interface.
*
*/
#undef INTERFACE
#define INTERFACE IStillImageW
DECLARE_INTERFACE_(IStillImageW, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
/*** IStillImage methods ***/
STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
STDMETHOD(GetDeviceInfo)(THIS_ LPWSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
STDMETHOD(CreateDevice) (THIS_ LPWSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
//
// Device instance values. Used to associate various data with device.
//
STDMETHOD(GetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
STDMETHOD(SetDeviceValue)(THIS_ LPWSTR pwszDeviceName,LPWSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
//
// For appllication started through push model launch, returns associated information
//
STDMETHOD(GetSTILaunchInformation)(THIS_ LPWSTR pwszDeviceName, DWORD *pdwEventCode,LPWSTR pwszEventName) PURE;
STDMETHOD(RegisterLaunchApplication)(THIS_ LPWSTR pwszAppName,LPWSTR pwszCommandLine) PURE;
STDMETHOD(UnregisterLaunchApplication)(THIS_ LPWSTR pwszAppName) PURE;
//
// To control state of notification handling. For polled devices this means state of monitor
// polling, for true notification devices means enabling/disabling notification flow
// from monitor to registered applications
//
STDMETHOD(EnableHwNotifications)(THIS_ LPCWSTR pwszDeviceName,BOOL bNewState) PURE;
STDMETHOD(GetHwNotificationState)(THIS_ LPCWSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
//
// When device is installed but not accessible, application may request bus refresh
// which in some cases will make device known. This is mainly used for nonPnP buses
// like SCSI, when device was powered on after PnP enumeration
//
//
STDMETHOD(RefreshDeviceBus)(THIS_ LPCWSTR pwszDeviceName) PURE;
//
// Launch application to emulate event on a device. Used by "control center" style components,
// which intercept device event , analyze and later force launch based on certain criteria.
//
STDMETHOD(LaunchApplicationForDevice)(THIS_ LPWSTR pwszDeviceName,LPWSTR pwszAppName,LPSTINOTIFY pStiNotify);
//
// For non-PnP devices with non-known bus type connection, setup extension, associated with the
// device can set it's parameters
//
STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONW);
//
// Write message to STI error log
//
STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage) PURE;
#ifdef NOT_IMPLEMENTED
//
// TO register application for receiving various STI notifications
//
STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
#endif //NOT_IMPLEMENTED
};
typedef struct IStillImageW *LPSTILLIMAGEW;
#undef INTERFACE
#define INTERFACE IStillImageA
DECLARE_INTERFACE_(IStillImageA, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
/*** IStillImage methods ***/
STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,DWORD dwVersion) PURE;
STDMETHOD(GetDeviceList)(THIS_ DWORD dwType,DWORD dwFlags,DWORD *pdwItemsReturned,LPVOID *ppBuffer) PURE;
STDMETHOD(GetDeviceInfo)(THIS_ LPCSTR pwszDeviceName, LPVOID *ppBuffer) PURE;
STDMETHOD(CreateDevice) (THIS_ LPCSTR pwszDeviceName, DWORD dwMode, PSTIDEVICE *pDevice,LPUNKNOWN punkOuter) PURE;
//
// Device instance values. Used to associate various data with device.
//
STDMETHOD(GetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,LPDWORD pType,LPBYTE pData,LPDWORD cbData);
STDMETHOD(SetDeviceValue)(THIS_ LPCSTR pwszDeviceName,LPCSTR pValueName,DWORD Type,LPBYTE pData,DWORD cbData);
//
// For appllication started through push model launch, returns associated information
//
STDMETHOD(GetSTILaunchInformation)(THIS_ LPSTR pwszDeviceName, DWORD *pdwEventCode,LPSTR pwszEventName) PURE;
STDMETHOD(RegisterLaunchApplication)(THIS_ LPCSTR pwszAppName,LPCSTR pwszCommandLine) PURE;
STDMETHOD(UnregisterLaunchApplication)(THIS_ LPCSTR pwszAppName) PURE;
//
// To control state of notification handling. For polled devices this means state of monitor
// polling, for true notification devices means enabling/disabling notification flow
// from monitor to registered applications
//
STDMETHOD(EnableHwNotifications)(THIS_ LPCSTR pwszDeviceName,BOOL bNewState) PURE;
STDMETHOD(GetHwNotificationState)(THIS_ LPCSTR pwszDeviceName,BOOL *pbCurrentState) PURE;
//
// When device is installed but not accessible, application may request bus refresh
// which in some cases will make device known. This is mainly used for nonPnP buses
// like SCSI, when device was powered on after PnP enumeration
//
//
STDMETHOD(RefreshDeviceBus)(THIS_ LPCSTR pwszDeviceName) PURE;
//
// Launch application to emulate event on a device. Used by "control center" style components,
// which intercept device event , analyze and later force launch based on certain criteria.
//
STDMETHOD(LaunchApplicationForDevice)(THIS_ LPCSTR pwszDeviceName,LPCSTR pwszAppName,LPSTINOTIFY pStiNotify);
//
// For non-PnP devices with non-known bus type connection, setup extension, associated with the
// device can set it's parameters
//
STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONA);
//
// Write message to STI error log
//
STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCSTR pszMessage) PURE;
#ifdef NOT_IMPLEMENTED
//
// TO register application for receiving various STI notifications
//
STIMETHOD(RegisterDeviceNotification(THIS_ LPWSTR pwszAppName,LPSUBSCRIBE lpSubscribe) PURE;
STIMETHOD(UnregisterDeviceNotification(THIS_ ) PURE;
#endif //NOT_IMPLEMENTED
};
typedef struct IStillImageA *LPSTILLIMAGEA;
#if defined(UNICODE) || defined(STI_UNICODE)
#define IStillImageVtbl IStillImageWVtbl
#else
#define IStillImageVtbl IStillImageAVtbl
#endif
typedef struct IStillImage *LPSTILLIMAGE;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IStillImage_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IStillImage_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IStillImage_Release(p) (p)->lpVtbl->Release(p)
#define IStillImage_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IStillImage_GetDeviceList(p,a,b,c,d) (p)->lpVtbl->GetDeviceList(p,a,b,c,d)
#define IStillImage_GetDeviceInfo(p,a,b) (p)->lpVtbl->GetDeviceInfo(p,a,b)
#define IStillImage_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d)
#define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->GetDeviceValue(p,a,b,c,d,e)
#define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->SetDeviceValue(p,a,b,c,d,e)
#define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->lpVtbl->GetSTILaunchInformation(p,a,b,c)
#define IStillImage_RegisterLaunchApplication(p,a,b) (p)->lpVtbl->RegisterLaunchApplication(p,a,b)
#define IStillImage_UnregisterLaunchApplication(p,a) (p)->lpVtbl->UnregisterLaunchApplication(p,a)
#define IStillImage_EnableHwNotifications(p,a,b) (p)->lpVtbl->EnableHwNotifications(p,a,b)
#define IStillImage_GetHwNotificationState(p,a,b) (p)->lpVtbl->GetHwNotificationState(p,a,b)
#define IStillImage_RefreshDeviceBus(p,a) (p)->lpVtbl->RefreshDeviceBus(p,a)
#endif
/*
* IStillImage_Device interface
*
* This is generic per device interface. Specialized interfaces are also
* available
*/
#undef INTERFACE
#define INTERFACE IStiDevice
DECLARE_INTERFACE_(IStiDevice, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
STDMETHOD_(ULONG, Release) (THIS) PURE;
/*** IStiDevice methods ***/
STDMETHOD(Initialize) (THIS_ HINSTANCE hinst,LPCWSTR pwszDeviceName,DWORD dwVersion,DWORD dwMode) PURE;
STDMETHOD(GetCapabilities) (THIS_ PSTI_DEV_CAPS pDevCaps) PURE;
STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE;
STDMETHOD(DeviceReset)(THIS ) PURE;
STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE;
STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ;
STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE;
STDMETHOD(LockDevice) (THIS_ DWORD dwTimeOut) PURE;
STDMETHOD(UnLockDevice) (THIS ) PURE;
STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
//
// Subscription is used to enable "control center" style applications , where flow of
// notifications should be redirected from monitor itself to another "launcher"
//
STDMETHOD(Subscribe)(THIS_ LPSTISUBSCRIBE lpSubsribe) PURE;
STDMETHOD(GetLastNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE;
STDMETHOD(UnSubscribe)(THIS ) PURE;
STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IStiDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IStiDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IStiDevice_Release(p) (p)->lpVtbl->Release(p)
#define IStiDevice_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
#define IStiDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
#define IStiDevice_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IStiDevice_DeviceReset(p) (p)->lpVtbl->DeviceReset(p)
#define IStiDevice_LockDevice(p,a) (p)->lpVtbl->LockDevice(p,a)
#define IStiDevice_UnLockDevice(p) (p)->lpVtbl->UnLockDevice(p)
#define IStiDevice_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a)
#define IStiDevice_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f)
#define IStiDevice_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a)
#define IStiDevice_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c)
#define IStiDevice_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c)
#define IStiDevice_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c)
#define IStiDevice_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c)
#define IStiDevice_Subscribe(p,a) (p)->lpVtbl->Subscribe(p,a)
#define IStiDevice_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a)
#define IStiDevice_UnSubscribe(p) (p)->lpVtbl->UnSubscribe(p)
#define IStiDevice_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a)
#endif
#endif // MIDL_PASS
#ifdef __cplusplus
};
#endif
//
// Reset packing
//
#include <poppack.h>
#endif // _STICOM_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -