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.

85 lines
3.9 KiB

  1. /****************************************************************************
  2. *
  3. * (C) COPYRIGHT 2000, MICROSOFT CORP.
  4. *
  5. * FILE: CCamMicro.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 12/14/2000
  10. *
  11. * DESCRIPTION:
  12. * Implements a simple class to wrap the microdriver DLL. This
  13. * class could instead call the SDK for a camera.
  14. *
  15. *****************************************************************************/
  16. #pragma once
  17. //
  18. // Function pointer type definitions
  19. //
  20. typedef HRESULT (__stdcall *FPInit)(MCAM_DEVICE_INFO **ppDeviceInfo);
  21. typedef HRESULT (__stdcall *FPUnInit)(MCAM_DEVICE_INFO *pDeviceInfo);
  22. typedef HRESULT (__stdcall *FPOpen)(MCAM_DEVICE_INFO *pDeviceInfo, PWSTR pwszPortName);
  23. typedef HRESULT (__stdcall *FPClose)(MCAM_DEVICE_INFO *pDeviceInfo);
  24. typedef HRESULT (__stdcall *FPGetDeviceInfo)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemList);
  25. typedef HRESULT (__stdcall *FPReadEvent)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_EVENT_INFO **pEventList);
  26. typedef HRESULT (__stdcall *FPStopEvents)(MCAM_DEVICE_INFO *pDeviceInfo);
  27. typedef HRESULT (__stdcall *FPGetItemInfo)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  28. typedef HRESULT (__stdcall *FPFreeItemInfo)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  29. typedef HRESULT (__stdcall *FPGetThumbnail)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, INT *pThumbSize, BYTE **ppThumb);
  30. typedef HRESULT (__stdcall *FPGetItemData)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, UINT uiState, BYTE *pBuf, DWORD dwLength);
  31. typedef HRESULT (__stdcall *FPDeleteItem)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem);
  32. typedef HRESULT (__stdcall *FPSetItemProt)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, BOOL bReadOnly);
  33. typedef HRESULT (__stdcall *FPTakePicture)(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemInfo);
  34. typedef HRESULT (__stdcall *FPStatus)(MCAM_DEVICE_INFO *pDeviceInfo);
  35. typedef HRESULT (__stdcall *FPReset)(MCAM_DEVICE_INFO *pDeviceInfo);
  36. //
  37. // Wrapper class
  38. //
  39. class CCamMicro {
  40. public:
  41. CCamMicro();
  42. ~CCamMicro();
  43. HRESULT Init(PTSTR ptszMicroDriverName, MCAM_DEVICE_INFO **ppDeviceInfo);
  44. HRESULT UnInit(MCAM_DEVICE_INFO *pDeviceInfo);
  45. HRESULT Open(MCAM_DEVICE_INFO *pDeviceInfo, PWSTR pwszPortName);
  46. HRESULT Close(MCAM_DEVICE_INFO *pDeviceInfo);
  47. HRESULT GetDeviceInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemList);
  48. HRESULT ReadEvent(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_EVENT_INFO **ppEventList);
  49. HRESULT StopEvents(MCAM_DEVICE_INFO *pDeviceInfo);
  50. HRESULT GetItemInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  51. HRESULT FreeItemInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  52. HRESULT GetThumbnail(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, INT *pThumbSize, BYTE **ppThumb);
  53. HRESULT GetItemData(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, UINT uiState, BYTE *pBuf, DWORD dwLength);
  54. HRESULT DeleteItem(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem);
  55. HRESULT SetItemProt(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, BOOL bReadOnly);
  56. HRESULT TakePicture(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemInfo);
  57. HRESULT Status(MCAM_DEVICE_INFO *pDeviceInfo);
  58. HRESULT Reset(MCAM_DEVICE_INFO *pDeviceInfo);
  59. private:
  60. HMODULE m_hModule;
  61. FPInit m_pInit;
  62. FPUnInit m_pUnInit;
  63. FPOpen m_pOpen;
  64. FPClose m_pClose;
  65. FPGetDeviceInfo m_pGetDeviceInfo;
  66. FPReadEvent m_pReadEvent;
  67. FPStopEvents m_pStopEvents;
  68. FPGetItemInfo m_pGetItemInfo;
  69. FPFreeItemInfo m_pFreeItemInfo;
  70. FPGetThumbnail m_pGetThumbnail;
  71. FPGetItemData m_pGetItemData;
  72. FPDeleteItem m_pDeleteItem;
  73. FPSetItemProt m_pSetItemProt;
  74. FPTakePicture m_pTakePicture;
  75. FPStatus m_pStatus;
  76. FPReset m_pReset;
  77. };