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.

221 lines
7.6 KiB

  1. /*++
  2. Copyright (c) 1986-1997 Microsoft Corporation
  3. Module Name:
  4. stiusd.h
  5. Abstract:
  6. Definitions file for creating STI User-mode Still-image Drivers ( USD).
  7. Author:
  8. Revision History:
  9. --*/
  10. #ifndef _STIUSD_
  11. #define _STIUSD_
  12. // Include COM definitions
  13. #define COM_NO_WINDOWS_H
  14. //
  15. #pragma intrinsic(memcmp,memset)
  16. //
  17. // Include COM definitions
  18. //
  19. #ifndef _NO_COM
  20. #include <objbase.h>
  21. #endif
  22. #include <stireg.h>
  23. #include <stierr.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /*
  28. * Class IID's
  29. */
  30. /*
  31. * Interface IID's
  32. */
  33. #if defined( _WIN32 ) && !defined( _NO_COM)
  34. // {0C9BB460-51AC-11D0-90EA-00AA0060F86C}
  35. DEFINE_GUID(IID_IStiUSD, 0x0C9BB460L, 0x51AC, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C);
  36. // {128A9860-52DC-11D0-9EDF-444553540000}
  37. DEFINE_GUID(IID_IStiDeviceControl, 0x128A9860L, 0x52DC, 0x11D0, 0x9E, 0xDF, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
  38. #endif
  39. /*
  40. * Data structures
  41. */
  42. typedef struct _STI_USD_CAPS {
  43. DWORD dwVersion; // STI version used to build this USD
  44. DWORD dwGenericCaps;
  45. } STI_USD_CAPS,*PSTI_USD_CAPS;
  46. //
  47. // Claims to support device notifications asyncronously ( without polling)
  48. //
  49. #define STI_USD_GENCAP_NATIVE_PUSHSUPPORT STI_GENCAP_NOTIFICATIONS
  50. //
  51. // Asks to open device automatically ( not implemented now)
  52. //
  53. // #define STI_USD_GENCAP_OPEN_DEVICE_FOR_ME 0x00000002
  54. typedef DWORD USD_CONTROL_CODE;
  55. /*
  56. * Generic constants and definitions
  57. */
  58. //
  59. // Internally used flags for open device mode.
  60. // USD receives this bit only when associated device instance is created by monitor process
  61. //
  62. #define STI_DEVICE_CREATE_FOR_MONITOR 0x01000000
  63. #ifdef __cplusplus
  64. struct IStiUSD;
  65. struct IStiDeviceControl;
  66. #endif
  67. typedef struct IStiUSD *PSTIUSD;
  68. typedef struct IStiDeviceControl *PSTIDEVICECONTROL;
  69. /*
  70. * IStiDeviceControl interface
  71. *
  72. * Instance of object supporting this interface is passed to USD at the moment
  73. * of device object initialization.
  74. */
  75. #undef INTERFACE
  76. #define INTERFACE IStiDeviceControl
  77. DECLARE_INTERFACE_(IStiDeviceControl, IUnknown)
  78. {
  79. /*** IUnknown methods ***/
  80. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  81. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  82. STDMETHOD_(ULONG, Release) (THIS) PURE;
  83. /*** IStiDeviceControl methods ***/
  84. STDMETHOD(Initialize) (THIS_ DWORD dwDeviceType,DWORD dwMode,LPCWSTR pwszPortName,DWORD dwFlags )PURE;
  85. STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  86. STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  87. STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  88. STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  89. STDMETHOD(RawDeviceControl)(THIS_ USD_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ;
  90. STDMETHOD(GetLastError)(THIS_ LPDWORD lpdwLastError) PURE;
  91. STDMETHOD(GetMyDevicePortName)(THIS_ LPWSTR lpszDevicePath,DWORD cwDevicePathSize ) PURE;
  92. STDMETHOD(GetMyDeviceHandle)(THIS_ LPHANDLE lph) PURE;
  93. STDMETHOD(GetMyDeviceOpenMode)(THIS_ LPDWORD pdwOpenMode ) PURE;
  94. STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage,DWORD dwErrorCode) PURE;
  95. } ;
  96. #if !defined(__cplusplus) || defined(CINTERFACE)
  97. #define IStiDeviceControl_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  98. #define IStiDeviceControl_AddRef(p) (p)->lpVtbl->AddRef(p)
  99. #define IStiDeviceControl_Release(p) (p)->lpVtbl->Release(p)
  100. #define IStiDeviceControl_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
  101. #define IStiDeviceControl_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c)
  102. #define IStiDeviceControl_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c)
  103. #define IStiDeviceControl_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c)
  104. #define IStiDeviceControl_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c)
  105. #define IStiDeviceControl_RawDeviceControl(p,a,b,c,d,e,f) (p)->lpVtbl->RawDeviceControl(p,a,b,c,d,e,f)
  106. #define IStiDeviceControl_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a)
  107. #define IStiDeviceControl_GetMyDevicePortName(p,a,b) (p)->lpVtbl->GetMyDevicePortName(p,a,b)
  108. #define IStiDeviceControl_GetMyDeviceHandle(p,a) (p)->lpVtbl->GetMyDeviceHandle(p,a)
  109. #define IStiDeviceControl_GetMyDeviceOpenMode(p,a) (p)->lpVtbl->GetMyDeviceOpenMode(p,a)
  110. #define IStiDeviceControl_WriteToErrorLog(p,a,b,c) (p)->lpVtbl->WriteToErrorLog(p,a,b,c)
  111. #endif
  112. /*
  113. * IStiUSD interface
  114. */
  115. #undef INTERFACE
  116. #define INTERFACE IStiUSD
  117. DECLARE_INTERFACE_(IStiUSD, IUnknown)
  118. {
  119. /*** IUnknown methods ***/
  120. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  121. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  122. STDMETHOD_(ULONG, Release) (THIS) PURE;
  123. /*** IStiUSD methods ***/
  124. STDMETHOD(Initialize) (THIS_ PSTIDEVICECONTROL pHelDcb,DWORD dwStiVersion,HKEY hParametersKey) PURE;
  125. STDMETHOD(GetCapabilities) (THIS_ PSTI_USD_CAPS pDevCaps) PURE;
  126. STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE;
  127. STDMETHOD(DeviceReset)(THIS ) PURE;
  128. STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE;
  129. STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ;
  130. STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE;
  131. STDMETHOD(LockDevice) (THIS ) PURE;
  132. STDMETHOD(UnLockDevice) (THIS ) PURE;
  133. STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  134. STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  135. STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  136. STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE;
  137. STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hEvent) PURE;
  138. STDMETHOD(GetNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE;
  139. STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE;
  140. } ;
  141. #if !defined(__cplusplus) || defined(CINTERFACE)
  142. #define IStiUSD_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  143. #define IStiUSD_AddRef(p) (p)->lpVtbl->AddRef(p)
  144. #define IStiUSD_Release(p) (p)->lpVtbl->Release(p)
  145. #define IStiUSD_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  146. #define IStiUSD_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a)
  147. #define IStiUSD_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
  148. #define IStiUSD_DeviceReset(p) (p)->lpVtbl->DeviceReset(p)
  149. #define IStiUSD_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a)
  150. #define IStiUSD_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f)
  151. #define IStiUSD_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a)
  152. #define IStiUSD_LockDevice(p) (p)->lpVtbl->LockDevice(p)
  153. #define IStiUSD_UnLockDevice(p) (p)->lpVtbl->UnLockDevice(p)
  154. #define IStiUSD_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c)
  155. #define IStiUSD_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c)
  156. #define IStiUSD_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c)
  157. #define IStiUSD_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c)
  158. #define IStiUSD_SetNotificationHandle(p,a) (p)->lpVtbl->SetNotificationHandle(p,a)
  159. #define IStiUSD_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a)
  160. #define IStiUSD_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a)
  161. #endif
  162. #ifdef __cplusplus
  163. };
  164. #endif
  165. #endif // _STIUSD_