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.

139 lines
4.3 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 1999
  4. *
  5. * TITLE: wiapsc.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ByronC
  10. *
  11. * DATE: 2 June, 1999
  12. *
  13. * DESCRIPTION:
  14. * Declarations and definitions for the WIA Property Storage class.
  15. * This class contains the IProperty storages used for an item's
  16. * properties (current value, old value, valid values and access flags).
  17. *
  18. *****************************************************************************/
  19. #define NUM_PROP_STG 7
  20. #define NUM_BACKUP_STG 4
  21. //
  22. // These defines indicate the index in which the specified property storage
  23. // and stream reside in the arrays i.e. m_pIPropStg[WIA_VALID_STG] will give
  24. // a pointer to the valid value storage, and m_pIStream[WIA_OLD_STG] will
  25. // give the pointer to the backing stream used by the old value property
  26. // storage. The normal storage indexes run from top to bottom, while their
  27. // corresponding backup storage indexes run from bottom to top - this is
  28. // to simplify the implementation of Backup()
  29. //
  30. #define WIA_CUR_STG 0
  31. #define WIA_VALID_STG 1
  32. #define WIA_ACCESS_STG 2
  33. #define WIA_OLD_STG 3
  34. #define WIA_ACCESS_BAK 4
  35. #define WIA_VALID_BAK 5
  36. #define WIA_CUR_BAK 6
  37. #define WIA_NUM_PROPS_ID 111111
  38. class CWiaPropStg {
  39. public:
  40. //
  41. // Methods to get a property storage/stream
  42. //
  43. IPropertyStorage* _stdcall CurStg(); // Current value storage
  44. IPropertyStorage* _stdcall OldStg(); // Old value storage
  45. IPropertyStorage* _stdcall ValidStg(); // Valid value storage
  46. IPropertyStorage* _stdcall AccessStg(); // Access flags storage
  47. IStream* _stdcall CurStm(); // Returns stream for Current values
  48. IStream* _stdcall OldStm(); // Returns stream for Old values
  49. IStream* _stdcall ValidStm(); // Returns stream for Valid values
  50. IStream* _stdcall AccessStm(); // Returns stream for Access flags
  51. //
  52. // Methods used in WriteMultiple.
  53. //
  54. HRESULT _stdcall NamesToPropIDs(
  55. LONG celt,
  56. PROPSPEC *pPropSpecIn,
  57. PROPSPEC **ppPropSpecOut);
  58. HRESULT _stdcall GetPropIDFromName(
  59. PROPSPEC *pPropSpecIn,
  60. PROPSPEC *pPropSpecOut);
  61. HRESULT _stdcall CheckPropertyAccess(
  62. BOOL bShowErrors,
  63. LONG cpspec,
  64. PROPSPEC *rgpspec);
  65. HRESULT _stdcall CheckPropertyType(
  66. IPropertyStorage *pIPropStg,
  67. LONG cpspec,
  68. PROPSPEC *rgpspec,
  69. PROPVARIANT *rgpvar);
  70. HRESULT _stdcall Backup();
  71. HRESULT _stdcall Undo();
  72. HRESULT _stdcall ReleaseBackups();
  73. //
  74. // Other public methods
  75. //
  76. HRESULT _stdcall WriteItemPropNames(
  77. LONG cItemProps,
  78. PROPID *ppId,
  79. LPOLESTR *ppszNames);
  80. HRESULT _stdcall GetPropertyStream(
  81. GUID *pCompatibilityId,
  82. LPSTREAM *ppstmProp);
  83. HRESULT _stdcall SetPropertyStream(
  84. GUID *pCompatibilityId,
  85. IWiaItem *pItem,
  86. LPSTREAM pstmProp);
  87. CWiaPropStg();
  88. HRESULT _stdcall Initialize();
  89. ~CWiaPropStg();
  90. private:
  91. //
  92. // Private helpers
  93. //
  94. HRESULT CopyItemProp(
  95. IPropertyStorage *pIPropStgSrc,
  96. IPropertyStorage *pIPropStgDst,
  97. PROPSPEC *pps,
  98. LPSTR pszErr);
  99. HRESULT CopyProps(
  100. IPropertyStorage *src,
  101. IPropertyStorage *dest);
  102. HRESULT CreateStorage(
  103. ULONG ulIndex);
  104. HRESULT CopyRWStreamProps(
  105. LPSTREAM pstmPropSrc,
  106. LPSTREAM pstmPropDst,
  107. GUID *pCompatibilityId);
  108. HRESULT GetPropsFromStorage(
  109. IPropertyStorage *pSrc,
  110. ULONG *cPSpec,
  111. PROPSPEC **ppPSpec,
  112. PROPVARIANT **ppVar);
  113. //
  114. // member variables
  115. //
  116. IPropertyStorage *m_pIPropStg[NUM_PROP_STG]; // Array of Property storages
  117. IStream *m_pIStream[NUM_PROP_STG]; // Array of Streams for the Prop storages
  118. };