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.

98 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: iprops.hxx
  7. //
  8. // Contents: Generalized property cache interfaces.
  9. //
  10. // History: 07-21-97 t-blakej Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifndef __IPROPERTYCACHE_HXX__
  14. #define __IPROPERTYCACHE_HXX__
  15. //
  16. // This is an "interface" that encapsulates the methods of an ADSI
  17. // property cache that need to be called from the dispatch manager.
  18. // This is *not* a COM interface, just a regular C++ struct with all
  19. // fully virtual methods.
  20. //
  21. struct IPropertyCache {
  22. //
  23. // Find a property by name in the property cache.
  24. //
  25. // If the property doesn't exist in the cache, the cache should make
  26. // sure the property exists for this object and add a "blank" entry for
  27. // this property. "pdwIndex" should be set to an integer (such as an
  28. // array index) which can easily identify this property. If this
  29. // property doesn't exist for this object (i.e. not in the schema for
  30. // this object), this should return an error.
  31. //
  32. // Note that the returned index is used to generate a Automation
  33. // DISPID, and its value is cached by VB. So if a property is added to
  34. // the cache, it should not be erased or moved (e.g. have its index
  35. // changed) for the lifetime of the object. Also, due to limitations
  36. // of the dispatch manager, the index must be less than 65536.
  37. //
  38. virtual HRESULT
  39. IPropertyCache::locateproperty(
  40. LPWSTR szPropertyName,
  41. PDWORD pdwIndex
  42. ) = 0;
  43. //
  44. // Get the value of a property from the property cache.
  45. //
  46. // If there is no data in the property cache, the cache should read the
  47. // object's data in from the server, and cache all unmodified
  48. // properties. If this property has no data on the server, this should
  49. // return E_ADS_PROPERTY_NOT_FOUND. If the passed-in index (which is
  50. // the same index as returned from locateproperty()) is invalid, this
  51. // should return DISP_E_MEMBERNOTFOUND.
  52. //
  53. virtual HRESULT
  54. IPropertyCache::getproperty(
  55. DWORD dwIndex,
  56. VARIANT *pVarResult
  57. ) = 0;
  58. //
  59. // Set the value of a property into the property cache.
  60. //
  61. // If the passed-in VARIANT is of the wrong type for this property,
  62. // this should return E_ADS_CANT_CONVERT_DATATYPE. If the passed-in
  63. // index (which is the same index as returned from locateproperty()) is
  64. // invalid, this should return DISP_E_MEMBERNOTFOUND.
  65. //
  66. virtual HRESULT
  67. IPropertyCache::putproperty(
  68. DWORD dwIndex,
  69. VARIANT varValue
  70. ) = 0;
  71. };
  72. //
  73. // This is an "interface" that encapsulates the methods of an ADSI object
  74. // that need to be called from the property cache. This is *not* a COM
  75. // interface, just a regular C++ struct with all fully virtual methods.
  76. //
  77. // This should be implemented by any object that contains a property cache;
  78. // the IGetAttributeSyntax interface pointer of the container is passed to
  79. // the createpropertycache() function.
  80. //
  81. struct IGetAttributeSyntax {
  82. virtual HRESULT
  83. GetAttributeSyntax(
  84. LPWSTR szPropertyName,
  85. PDWORD pdwSyntaxID
  86. ) = 0;
  87. };
  88. #define DECLARE_IGetAttributeSyntax_METHODS \
  89. virtual HRESULT \
  90. GetAttributeSyntax(LPWSTR szPropertyName, PDWORD pdwSyntaxID);
  91. #endif // __IPROPERTYCACHE_HXX__