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.

121 lines
3.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: spropmap.hxx
  7. //
  8. // Contents: Standard Property + Volatile Property mapper
  9. //
  10. // Classes: CStandardPropMapper
  11. //
  12. // History: 1-03-97 srikants Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <ciintf.h>
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CPropSpecPidMap
  20. //
  21. // Purpose: Property to PidMap array element
  22. //
  23. // History: 1-03-97 srikants Moved From qcat.hxx
  24. //
  25. //----------------------------------------------------------------------------
  26. class CPropSpecPidMap
  27. {
  28. public:
  29. CPropSpecPidMap( CFullPropSpec const & ps, PROPID pid )
  30. {
  31. _ps = ps;
  32. _pid = pid;
  33. }
  34. CFullPropSpec const & PS()
  35. {
  36. return( _ps );
  37. }
  38. PROPID Pid()
  39. {
  40. return( _pid );
  41. }
  42. private:
  43. CFullPropSpec _ps;
  44. PROPID _pid;
  45. };
  46. DECL_DYNARRAY( CPropSpecArray, CPropSpecPidMap )
  47. //+---------------------------------------------------------------------------
  48. //
  49. // Class: CStandardPropMapper
  50. //
  51. // Purpose: A mapper from Property to Pids for "Standard" properties
  52. // and "volatile" properties.
  53. //
  54. // History: 1-03-97 srikants Created
  55. //
  56. //----------------------------------------------------------------------------
  57. class CStandardPropMapper : INHERIT_VIRTUAL_UNWIND, public IPropertyMapper
  58. {
  59. INLINE_UNWIND(CStandardPropMapper)
  60. public:
  61. //
  62. // From IUnknown
  63. //
  64. virtual SCODE STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject );
  65. virtual ULONG STDMETHODCALLTYPE AddRef();
  66. virtual ULONG STDMETHODCALLTYPE Release();
  67. //
  68. // From IPropertyMapper
  69. //
  70. virtual SCODE STDMETHODCALLTYPE PropertyToPropid( FULLPROPSPEC const *pFullPropSpec,
  71. BOOL fCreate,
  72. PROPID *pPropId);
  73. virtual SCODE STDMETHODCALLTYPE PropidToProperty( PROPID pid,
  74. FULLPROPSPEC **ppPropSpec);
  75. //
  76. // Local methods
  77. //
  78. CStandardPropMapper();
  79. PROPID StandardPropertyToPropId ( CFullPropSpec const & ps );
  80. PROPID PropertyToPropId ( CFullPropSpec const & ps, BOOL fCreate = FALSE );
  81. private:
  82. //
  83. // This array will hold the mapping of GUID\DISPID and GUID\Name to pid.
  84. // "Real" pids are allocated sequentially, and are good only for the life
  85. // of the catalog object.
  86. //
  87. PROPID _pidNextAvailable; // Next available pid
  88. ULONG _cps; // # elements in _aps
  89. CPropSpecArray _aps; // The mapping.
  90. ULONG _cRefs; // Refcount
  91. };