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.

200 lines
4.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Copyright (C) Microsoft Corporation, 1992 - 1997
  4. //
  5. // File: metapenm.hxx
  6. //
  7. // Contents: Enumerator for metadata properties
  8. //
  9. // History: 12-Dec-96 SitaramR Created
  10. //
  11. //--------------------------------------------------------------------------
  12. #pragma once
  13. #include <propret.hxx>
  14. #include <catalog.hxx>
  15. #include <ciintf.h>
  16. class PCatalog;
  17. //+-------------------------------------------------------------------------
  18. //
  19. // Class: CMetaPropEnum
  20. //
  21. // Purpose: Enumerate metadata properties
  22. //
  23. // History: 13-Apr-96 KyleP Created
  24. //
  25. //--------------------------------------------------------------------------
  26. class CMetaPropEnum : public CGenericPropRetriever, ICiCScopeEnumerator
  27. {
  28. INLINE_UNWIND( CMetaPropEnum );
  29. public:
  30. //
  31. // From IUnknown
  32. //
  33. virtual SCODE STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject );
  34. virtual ULONG STDMETHODCALLTYPE AddRef();
  35. virtual ULONG STDMETHODCALLTYPE Release();
  36. //
  37. // From CGenericPropRetriever
  38. //
  39. SCODE STDMETHODCALLTYPE BeginPropertyRetrieval( WORKID wid );
  40. SCODE STDMETHODCALLTYPE CheckSecurity( ACCESS_MASK am,
  41. BOOL *pfGranted);
  42. SCODE STDMETHODCALLTYPE IsInScope( BOOL *pfInScope);
  43. //
  44. // From ICiCScopeEnumerator
  45. //
  46. SCODE STDMETHODCALLTYPE Begin();
  47. SCODE STDMETHODCALLTYPE CurrentDocument( WORKID *pWorkId);
  48. SCODE STDMETHODCALLTYPE NextDocument( WORKID *pWorkId );
  49. SCODE STDMETHODCALLTYPE RatioFinished( ULONG *pulDenominator,
  50. ULONG *pulNumerator);
  51. SCODE STDMETHODCALLTYPE End();
  52. //
  53. // Local methods
  54. //
  55. CMetaPropEnum( PCatalog & cat,
  56. ICiQueryPropertyMapper *pQueryPropMapper,
  57. CSecurityCache & secCache,
  58. BOOL fUsePathAlias );
  59. protected:
  60. virtual ~CMetaPropEnum();
  61. WORKID NextObject();
  62. //
  63. // Stat properties.
  64. //
  65. inline UNICODE_STRING const * GetName();
  66. inline UNICODE_STRING const * GetPath();
  67. inline UNICODE_STRING const * GetShortName();
  68. inline UNICODE_STRING const * GetVirtualPath();
  69. inline LONGLONG CreateTime();
  70. inline LONGLONG ModifyTime();
  71. inline LONGLONG AccessTime();
  72. inline LONGLONG ObjectSize();
  73. inline ULONG Attributes();
  74. inline ULONG StorageType();
  75. inline DWORD StorageLevel();
  76. inline BOOL IsModifiable();
  77. BOOL GetPropGuid( GUID & guid );
  78. PROPID GetPropPropid();
  79. UNICODE_STRING const * GetPropName();
  80. UNICODE_STRING _Name; // Property name (or propid)
  81. UNICODE_STRING _Path; // GUID
  82. private:
  83. enum { ccStringizedGuid = 36 };
  84. WORKID _widCurrent; // Wid on which the meta prop enumerator
  85. // is currently positioned
  86. unsigned _iBmk; // Bookmark into properties
  87. WCHAR _awcGuid[ccStringizedGuid + 1]; // 'Path' aka GUID
  88. WCHAR _awcPropId[11]; // 'Name' aka PropId
  89. CFullPropSpec _psCurrent; // Propspec
  90. unsigned _cbCurrent; // Size in cache
  91. ULONG _typeCurrent; // Type in cache
  92. DWORD _storeLevelCurrent; // Propstore level (prim or sec) in cache
  93. BOOL _fModifiableCurrent; // Can meta data be modified after initial setting?
  94. };
  95. inline UNICODE_STRING const * CMetaPropEnum::GetName()
  96. {
  97. return( &_Name );
  98. }
  99. inline UNICODE_STRING const * CMetaPropEnum::GetPath()
  100. {
  101. return( &_Path );
  102. }
  103. inline UNICODE_STRING const * CMetaPropEnum::GetShortName()
  104. {
  105. return( &_Name );
  106. }
  107. inline UNICODE_STRING const * CMetaPropEnum::GetVirtualPath()
  108. {
  109. return 0;
  110. }
  111. inline LONGLONG CMetaPropEnum::CreateTime()
  112. {
  113. return 0xFFFFFFFFFFFFFFFF;
  114. }
  115. inline LONGLONG CMetaPropEnum::ModifyTime()
  116. {
  117. return 0xFFFFFFFFFFFFFFFF;
  118. }
  119. inline LONGLONG CMetaPropEnum::AccessTime()
  120. {
  121. return 0xFFFFFFFFFFFFFFFF;
  122. }
  123. inline LONGLONG CMetaPropEnum::ObjectSize()
  124. {
  125. return _cbCurrent;
  126. }
  127. inline ULONG CMetaPropEnum::Attributes()
  128. {
  129. return 0xFFFFFFFF;
  130. }
  131. inline ULONG CMetaPropEnum::StorageType()
  132. {
  133. if ( 0 == _cbCurrent )
  134. return 0xFFFFFFFF;
  135. else
  136. return _typeCurrent;
  137. }
  138. inline DWORD CMetaPropEnum::StorageLevel()
  139. {
  140. if ( 0 == _cbCurrent )
  141. return INVALID_STORE_LEVEL;
  142. else
  143. return _storeLevelCurrent;
  144. }
  145. inline BOOL CMetaPropEnum::IsModifiable()
  146. {
  147. if ( 0 == _cbCurrent )
  148. return FALSE;
  149. else
  150. return _fModifiableCurrent;
  151. }