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.

108 lines
2.6 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: WiaLink.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: OrenR
  10. *
  11. * DATE: 2000/11/06
  12. *
  13. * DESCRIPTION: Establishes the link between WiaVideo and the Wia Video Driver
  14. *
  15. *****************************************************************************/
  16. #ifndef _WIALINK_H_
  17. #define _WIALINK_H_
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CWiaLink
  20. class CWiaLink
  21. {
  22. public:
  23. ///////////////////////////////
  24. // Constructor
  25. //
  26. CWiaLink();
  27. ///////////////////////////////
  28. // Destructor
  29. //
  30. virtual ~CWiaLink();
  31. ///////////////////////////////
  32. // Init
  33. //
  34. HRESULT Init(const CSimpleString *pstrWiaDeviceID,
  35. class CWiaVideo *pWiaVideo);
  36. ///////////////////////////////
  37. // Term
  38. //
  39. HRESULT Term();
  40. ///////////////////////////////
  41. // StartMonitoring
  42. //
  43. HRESULT StartMonitoring();
  44. ///////////////////////////////
  45. // StopMonitoring
  46. //
  47. HRESULT StopMonitoring();
  48. ///////////////////////////////
  49. // GetDevice
  50. //
  51. HRESULT GetDevice(IWiaItem **ppWiaRootItem);
  52. ///////////////////////////////
  53. // GetDeviceStorage
  54. //
  55. HRESULT GetDeviceStorage(IWiaPropertyStorage **ppWiaPropertyStorage);
  56. ///////////////////////////////
  57. // SignalNewImage
  58. //
  59. HRESULT SignalNewImage(const CSimpleString *pstrNewImageFileName);
  60. ///////////////////////////////
  61. // ThreadProc
  62. //
  63. HRESULT ThreadProc(void *pArgs);
  64. ///////////////////////////////
  65. // IsEnabled
  66. //
  67. BOOL IsEnabled()
  68. {
  69. return m_bEnabled;
  70. }
  71. private:
  72. HRESULT CreateWiaEvents(HANDLE *phTakePictureEvent,
  73. HANDLE *phPictureReadyEvent);
  74. static DWORD WINAPI StartThreadProc(void *pArgs);
  75. CRITICAL_SECTION m_csLock;
  76. CSimpleString m_strDeviceID;
  77. class CWiaVideo *m_pWiaVideo;
  78. CComPtr<IGlobalInterfaceTable> m_pGIT;
  79. DWORD m_dwWiaItemCookie;
  80. DWORD m_dwPropertyStorageCookie;
  81. HANDLE m_hTakePictureEvent;
  82. HANDLE m_hPictureReadyEvent;
  83. HANDLE m_hTakePictureThread;
  84. BOOL m_bExitThread;
  85. BOOL m_bEnabled;
  86. };
  87. #endif // _WIALINK_H_