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.

151 lines
4.5 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 1997
  4. *
  5. * TITLE: DevInfo.h
  6. *
  7. * VERSION: 2.0
  8. *
  9. * AUTHOR: ReedB
  10. *
  11. * DATE: 26 Dec, 1997
  12. *
  13. * DESCRIPTION:
  14. * Declaration and definitions for WIA device enumerator and
  15. * WIA device information objects.
  16. *
  17. *******************************************************************************/
  18. class CEnumWIADevInfo : public IEnumWIA_DEV_INFO
  19. {
  20. public:
  21. // IUnknown methods
  22. HRESULT _stdcall QueryInterface(const IID& iid, void** ppv);
  23. ULONG _stdcall AddRef();
  24. ULONG _stdcall Release();
  25. private:
  26. // IEnumWIA_DEV_INFO methods
  27. HRESULT __stdcall Next(
  28. ULONG celt,
  29. IWiaPropertyStorage **rgelt,
  30. ULONG *pceltFetched);
  31. HRESULT __stdcall Skip(ULONG celt);
  32. HRESULT __stdcall Reset(void);
  33. HRESULT __stdcall Clone(IEnumWIA_DEV_INFO **ppIEnum);
  34. HRESULT __stdcall GetCount(ULONG*);
  35. // Helpers
  36. public:
  37. // Constructor, initialization and destructor methods.
  38. CEnumWIADevInfo();
  39. HRESULT Initialize(LONG lFlags);
  40. ~CEnumWIADevInfo();
  41. private:
  42. ULONG m_cRef; // Reference count for this object.
  43. LONG m_lType; // Original enumeration device type.
  44. IWiaPropertyStorage **m_pIWiaPropStg; // Pointers Dev. Info. property storages
  45. ULONG m_cDevices; // Number of WIA devices.
  46. ULONG m_ulIndex; // Index for IEnumWIA_DEV_INFO methods.
  47. };
  48. class CWIADevInfo : public IWiaPropertyStorage
  49. {
  50. public:
  51. // IUnknown methods
  52. HRESULT _stdcall QueryInterface(const IID& iid, void** ppv);
  53. ULONG _stdcall AddRef();
  54. ULONG _stdcall Release();
  55. public:
  56. // IWiaPropertyStorage methods
  57. HRESULT _stdcall ReadMultiple(
  58. ULONG cpspec,
  59. const PROPSPEC rgpspec[],
  60. PROPVARIANT rgpropvar[]);
  61. HRESULT _stdcall WriteMultiple(
  62. ULONG cpspec,
  63. const PROPSPEC rgpspec[],
  64. const PROPVARIANT rgpropvar[],
  65. PROPID propidNameFirst);
  66. HRESULT _stdcall ReadPropertyNames(
  67. ULONG cpropid,
  68. const PROPID rgpropid[],
  69. LPOLESTR rglpwstrName[]);
  70. HRESULT _stdcall WritePropertyNames(
  71. ULONG cpropid,
  72. const PROPID rgpropid[],
  73. const LPOLESTR rglpwstrName[]);
  74. HRESULT _stdcall Enum(
  75. IEnumSTATPROPSTG **ppenum);
  76. HRESULT _stdcall GetPropertyAttributes(
  77. ULONG cpspec,
  78. PROPSPEC rgpspec[],
  79. ULONG rgflags[],
  80. PROPVARIANT rgpropvar[]);
  81. HRESULT _stdcall GetCount(
  82. ULONG *pulNumProps);
  83. HRESULT _stdcall GetPropertyStream(
  84. GUID *pCompatibilityId,
  85. IStream **ppIStream);
  86. HRESULT _stdcall SetPropertyStream(
  87. GUID *pCompatibilityId,
  88. IStream *pIStream);
  89. HRESULT _stdcall DeleteMultiple(
  90. ULONG cpspec,
  91. PROPSPEC const rgpspec[]);
  92. HRESULT _stdcall DeletePropertyNames(
  93. ULONG cpropid,
  94. PROPID const rgpropid[]);
  95. HRESULT _stdcall SetClass(
  96. REFCLSID clsid);
  97. HRESULT _stdcall Commit(
  98. DWORD grfCommitFlags);
  99. HRESULT _stdcall Revert();
  100. HRESULT _stdcall Stat(
  101. STATPROPSETSTG *pstatpsstg);
  102. HRESULT _stdcall SetTimes(
  103. FILETIME const * pctime,
  104. FILETIME const * patime,
  105. FILETIME const * pmtime);
  106. private:
  107. // Helpers
  108. HRESULT UpdateDeviceProperties(
  109. ULONG cpspec,
  110. const PROPSPEC *rgpspec,
  111. const PROPVARIANT *rgpropvar);
  112. public:
  113. // Constructor, initialization and destructor methods.
  114. CWIADevInfo();
  115. HRESULT Initialize();
  116. ~CWIADevInfo();
  117. IPropertyStorage *m_pIPropStg; // Device info. property storage.
  118. private:
  119. ULONG m_cRef; // Reference count for this object.
  120. ITypeInfo* m_pITypeInfo; // Pointer to type information.
  121. IStream *m_pIStm; // Pointer to a property stream
  122. };