Source code of Windows XP (NT5)
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.

99 lines
3.4 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. CCredentials &Credentials
  58. ) = 0;
  59. //
  60. // Set the value of a property into the property cache.
  61. //
  62. // If the passed-in VARIANT is of the wrong type for this property,
  63. // this should return E_ADS_CANT_CONVERT_DATATYPE. If the passed-in
  64. // index (which is the same index as returned from locateproperty()) is
  65. // invalid, this should return DISP_E_MEMBERNOTFOUND.
  66. //
  67. virtual HRESULT
  68. IPropertyCache::putproperty(
  69. DWORD dwIndex,
  70. VARIANT varValue
  71. ) = 0;
  72. };
  73. //
  74. // This is an "interface" that encapsulates the methods of an ADSI object
  75. // that need to be called from the property cache. This is *not* a COM
  76. // interface, just a regular C++ struct with all fully virtual methods.
  77. //
  78. // This should be implemented by any object that contains a property cache;
  79. // the IGetAttributeSyntax interface pointer of the container is passed to
  80. // the createpropertycache() function.
  81. //
  82. struct IGetAttributeSyntax {
  83. virtual HRESULT
  84. GetAttributeSyntax(
  85. LPWSTR szPropertyName,
  86. PDWORD pdwSyntaxID
  87. ) = 0;
  88. };
  89. #define DECLARE_IGetAttributeSyntax_METHODS \
  90. virtual HRESULT \
  91. GetAttributeSyntax(LPWSTR szPropertyName, PDWORD pdwSyntaxID);
  92. #endif // __IPROPERTYCACHE_HXX__