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.

152 lines
6.9 KiB

  1. /****************************************************************************
  2. *
  3. * (C) COPYRIGHT 2000, MICROSOFT CORP.
  4. *
  5. * FILE: wiacammc.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 12/16/2000
  10. *
  11. * DESCRIPTION:
  12. * Header for WIA camera microdriver.
  13. *
  14. *****************************************************************************/
  15. #pragma once
  16. #define WIACAMMICRO_API __declspec(dllexport) HRESULT __stdcall
  17. #include <pshpack8.h>
  18. /****************************************************************************\
  19. * Camera microdriver definitions
  20. \****************************************************************************/
  21. //
  22. // GetItemData state bit masks
  23. //
  24. const UINT MCAM_STATE_NEXT = 0x00;
  25. const UINT MCAM_STATE_FIRST = 0x01;
  26. const UINT MCAM_STATE_LAST = 0x02;
  27. const UINT MCAM_STATE_CANCEL = 0x04;
  28. //
  29. // Item type definition
  30. //
  31. enum {
  32. WiaMCamTypeUndef,
  33. WiaMCamTypeFolder,
  34. WiaMCamTypeOther,
  35. WiaMCamTypeImage,
  36. WiaMCamTypeAudio,
  37. WiaMCamTypeVideo
  38. };
  39. enum {
  40. WiaMCamEventItemAdded,
  41. WiaMCamEventItemDeleted,
  42. WiaMCamEventPropChanged
  43. };
  44. //
  45. // Other constants
  46. //
  47. const INT MCAM_VERSION = 100;
  48. const INT MCAM_EXT_LEN = 4;
  49. //
  50. // Structures
  51. //
  52. typedef struct _MCAM_DEVICE_INFO {
  53. INT iSize; // Size of this structure
  54. INT iMcamVersion; // Microcamera architecture version
  55. BYTE *pPrivateStorage; // Pointer to an area where the microdriver can store it's own device information
  56. BOOL bSyncNeeded; // Should be set if the driver can get out-of-sync with the camera (i.e. for serial cameras)
  57. BOOL bSlowConnection; // Indicates that the driver should optimize for a slow connection (i.e. serial)
  58. BOOL bExclusivePort; // Indicates that the device should be opened/closed for every operation (i.e. serial)
  59. BOOL bEventsSupported; // Set if the driver supports events
  60. PWSTR pwszFirmwareVer; // String representing the firmware version of the device, set to NULL if unknown
  61. LONG lPicturesTaken; // Number of pictures stored on the camera
  62. LONG lPicturesRemaining; // Space available on the camera, in pictures at the current resolution
  63. LONG lTotalItems; // Total number of items on the camera, including folders, images, audio, etc.
  64. SYSTEMTIME Time; // Current time on the device
  65. LONG Reserved[8]; // Reserved for future use
  66. } MCAM_DEVICE_INFO, *PMCAM_DEVICE_INFO;
  67. typedef struct _MCAM_ITEM_INFO {
  68. INT iSize; // Size of this structure
  69. BYTE *pPrivateStorage; // Pointer to an area where the microdriver can store it's own item information
  70. IWiaDrvItem *pDrvItem; // Pointer to the driver item created from this item--should not be used by microdriver
  71. struct _MCAM_ITEM_INFO *pParent; // Pointer to this item's parent, equal to NULL if this is a top level item
  72. struct _MCAM_ITEM_INFO *pNext; // Next item in the list
  73. struct _MCAM_ITEM_INFO *pPrev; // Previous item in the list
  74. PWSTR pwszName; // Name of the item without the extension
  75. SYSTEMTIME Time; // Last modified time of the item
  76. INT iType; // Type of the item (e.g. folder, image, etc.)
  77. const GUID *pguidFormat; // Format of the item
  78. const GUID *pguidThumbFormat; // Format of the thumbnail for the item
  79. LONG lWidth; // Width of the image in pixels, zero for non-images
  80. LONG lHeight; // Height of the image in pixels, zero for non-images
  81. LONG lDepth; // Pixel depth in pixels (e.g. 8, 16, 24)
  82. LONG lChannels; // Number of color channels per pixel (e.g. 1, 3)
  83. LONG lBitsPerChannel; // Number of bits per color channel, normally 8
  84. LONG lSize; // Size of the image in bytes
  85. LONG lSequenceNum; // If image is part of a sequence, the sequence number
  86. LONG lThumbWidth; // Width of thumbnail (can be set to zero until thumbnail is read by app)
  87. LONG lThumbHeight; // Height of thumbnail (can be set to zero until thumbnail is read by app)
  88. BOOL bHasAttachments; // Indicates whether an image has attachments
  89. BOOL bReadOnly; // Indicates if item can or cannot be deleted by app
  90. BOOL bCanSetReadOnly; // Indicates if the app can change the read-only status on and off
  91. WCHAR wszExt[MCAM_EXT_LEN]; // Filename extension
  92. LONG Reserved[8]; // Reserved for future use
  93. } MCAM_ITEM_INFO, *PMCAM_ITEM_INFO;
  94. typedef struct _MCAM_PROP_INFO {
  95. INT iSize; // Size of this structure
  96. struct _MCAM_PROP_INFO *pNext;
  97. WIA_PROPERTY_INFO *pWiaPropInfo;
  98. LONG Reserved[8];
  99. } MCAM_PROP_INFO, *PMCAM_PROP_INFO;
  100. typedef struct _MCAM_EVENT_INFO {
  101. INT iSize; // Size of this structure
  102. struct _MCAM_EVENT_INFO *pNext;
  103. INT iType; // Event type
  104. MCAM_ITEM_INFO *pItemInfo;
  105. MCAM_PROP_INFO *pPropInfo;
  106. LONG Reserved[8];
  107. } MCAM_EVENT_INFO, *PMCAM_EVENT_INFO;
  108. //
  109. // Interface to micro camera driver
  110. //
  111. WIACAMMICRO_API WiaMCamInit(MCAM_DEVICE_INFO **ppDeviceInfo);
  112. WIACAMMICRO_API WiaMCamUnInit(MCAM_DEVICE_INFO *pDeviceInfo);
  113. WIACAMMICRO_API WiaMCamOpen(MCAM_DEVICE_INFO *pDeviceInfo, PWSTR pwszPortName);
  114. WIACAMMICRO_API WiaMCamClose(MCAM_DEVICE_INFO *pDeviceInfo);
  115. WIACAMMICRO_API WiaMCamGetDeviceInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemList);
  116. WIACAMMICRO_API WiaMCamReadEvent(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_EVENT_INFO **ppEventList);
  117. WIACAMMICRO_API WiaMCamStopEvents(MCAM_DEVICE_INFO *pDeviceInfo);
  118. WIACAMMICRO_API WiaMCamGetItemInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  119. WIACAMMICRO_API WiaMCamFreeItemInfo(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItemInfo);
  120. WIACAMMICRO_API WiaMCamGetThumbnail(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, INT *pThumbSize, BYTE **ppThumb);
  121. WIACAMMICRO_API WiaMCamFreeThumbnail(MCAM_DEVICE_INFO *pDeviceInfo, BYTE *pThumb);
  122. WIACAMMICRO_API WiaMCamGetItemData(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, UINT uiState, BYTE *pBuf, DWORD dwLength);
  123. WIACAMMICRO_API WiaMCamDeleteItem(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem);
  124. WIACAMMICRO_API WiaMCamSetItemProt(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO *pItem, BOOL bReadOnly);
  125. WIACAMMICRO_API WiaMCamTakePicture(MCAM_DEVICE_INFO *pDeviceInfo, MCAM_ITEM_INFO **ppItemInfo);
  126. WIACAMMICRO_API WiaMCamStatus(MCAM_DEVICE_INFO *pDeviceInfo);
  127. WIACAMMICRO_API WiaMCamReset(MCAM_DEVICE_INFO *pDeviceInfo);
  128. #include <poppack.h>