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.

125 lines
2.7 KiB

  1. class CPropertyValue;
  2. class CPropertyValue : INHERIT_TRACKING,
  3. public ISupportErrorInfo,
  4. public IADsPropertyValue,
  5. public IADsPropertyValue2,
  6. public IADsValue
  7. {
  8. public:
  9. /* IUnknown methods */
  10. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  11. DECLARE_STD_REFCOUNTING
  12. DECLARE_IDispatch_METHODS
  13. DECLARE_ISupportErrorInfo_METHODS
  14. DECLARE_IADsPropertyValue_METHODS
  15. DECLARE_IADsValue_METHODS
  16. CPropertyValue::CPropertyValue();
  17. CPropertyValue::~CPropertyValue();
  18. STDMETHODIMP ConvertADsValueToPropertyValue2(
  19. THIS_ PADSVALUE pADsValue,
  20. LPWSTR pszServerName,
  21. CCredentials* pCredentials,
  22. BOOL fNTDSType
  23. );
  24. STDMETHODIMP ConvertPropertyValueToADsValue2(
  25. THIS_ PADSVALUE pADsValue,
  26. LPWSTR pszServerName,
  27. LPWSTR pszUserName,
  28. LPWSTR pszPassWord,
  29. LONG dwFlags,
  30. BOOL fNTDSType
  31. );
  32. STDMETHODIMP getOctetStringFromSecDesc(VARIANT FAR *retval);
  33. STDMETHODIMP getSecurityDescriptorFromOctStr(VARIANT FAR *retval);
  34. static
  35. HRESULT
  36. CPropertyValue::CreatePropertyValue(
  37. REFIID riid,
  38. void **ppvObj
  39. );
  40. static
  41. HRESULT
  42. CPropertyValue::AllocatePropertyValueObject(
  43. CPropertyValue ** ppPropertyValue
  44. );
  45. //
  46. // constants that we need as we cannot init static consts.
  47. //
  48. enum {
  49. VAL_IDISPATCH_UNKNOWN = 0,
  50. VAL_IDISPATCH_SECDESC_ONLY = 1, // only ptr to idisp
  51. VAL_IDISPATCH_SECDESC_ALL = 2, // ptr and data in _ADsValue
  52. };
  53. //
  54. // Meant for use from adscopy only.
  55. //
  56. PADSVALUE
  57. CPropertyValue::getADsValue()
  58. {
  59. return (&_ADsValue);
  60. }
  61. DWORD getExtendedDataTypeInfo()
  62. {
  63. return _dwDataType;
  64. }
  65. //
  66. // Does not bump up the ref count
  67. //
  68. IDispatch * getDispatchPointer()
  69. {
  70. return _pDispatch;
  71. }
  72. protected:
  73. //
  74. // Helpers to handle DnWithBin and DnWithStr
  75. //
  76. STDMETHODIMP getDNWithBinary(IDispatch FAR * FAR * ppDispatch);
  77. STDMETHODIMP putDNWithBinary(IDispatch * pDNWithBinary);
  78. STDMETHODIMP getDNWithString(IDispatch FAR * FAR * ppDispatch);
  79. STDMETHODIMP putDNWithString(IDispatch * pDNWithString);
  80. STDMETHODIMP getProvSpecific(VARIANT FAR * retval );
  81. STDMETHODIMP putProvSpecific(VARIANT VarProviderSpecific);
  82. //
  83. // Wrapper that calls AdsClear on _ADsValue after cleaning
  84. // up the other member variable
  85. //
  86. void ClearData();
  87. CDispatchMgr FAR * _pDispMgr;
  88. ADSVALUE _ADsValue;
  89. DWORD _dwDataType;
  90. IDispatch *_pDispatch;
  91. };