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.

163 lines
3.7 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: dspath.h
  4. //
  5. // Synopsis: This file holds the declarations of the
  6. // CDSPath class. The class object exports
  7. // the IDataStoreObject interface which is
  8. // used by the Dictionary SDO to obtain the
  9. // datastore path
  10. //
  11. //
  12. // History: 09/25/98 MKarki Created
  13. //
  14. // Copyright (C) 1997-98 Microsoft Corporation
  15. // All rights reserved.
  16. //
  17. //----------------------------------------------------------------
  18. #ifndef _DSPATH_H_
  19. #define _DSPATH_H_
  20. #include "resource.h"
  21. //
  22. // name of the property it holds
  23. //
  24. const WCHAR PROPERTY_DICTIONARY_PATH[] = L"Path";
  25. //
  26. // CDSPath class declaration
  27. //
  28. class CDSPath:
  29. public CComObjectRootEx<CComMultiThreadModel>,
  30. public IDispatchImpl<IDataStoreObject,
  31. &__uuidof (IDataStoreObject),
  32. &LIBID_SDOIASLibPrivate>
  33. {
  34. public:
  35. //
  36. //-----------IDataStoreObject methods-------------------
  37. //
  38. //
  39. // get the value for the current property in the data
  40. // store object
  41. //
  42. STDMETHOD(GetValue)(
  43. /*[in]*/ BSTR bstrName,
  44. /*[out, retval]*/ VARIANT* pVal
  45. )
  46. {
  47. HRESULT hr = E_INVALIDARG;
  48. _ASSERT (NULL != pVal);
  49. if (0 == _wcsicmp ((PWCHAR) bstrName, PROPERTY_DICTIONARY_PATH))
  50. {
  51. hr = ::VariantCopy (pVal, &m_vtPath);
  52. }
  53. return (hr);
  54. }
  55. STDMETHOD(get_Container)(
  56. /*[out, retval]*/ IDataStoreContainer** pVal
  57. )
  58. {return (E_NOTIMPL);}
  59. STDMETHOD(GetValueEx)(
  60. /*[in]*/ BSTR bstrName,
  61. /*[out, retval]*/ VARIANT* pVal
  62. )
  63. {return (E_NOTIMPL);}
  64. STDMETHOD(get_Name)(
  65. /*[out, retval]*/ BSTR* pVal
  66. )
  67. { return (E_NOTIMPL);}
  68. STDMETHOD(get_Class)(
  69. /*[out, retval]*/ BSTR* pVal
  70. )
  71. { return (E_NOTIMPL); }
  72. STDMETHOD(get_GUID)(
  73. /*[out, retval]*/ BSTR* pVal
  74. )
  75. { return (E_NOTIMPL); }
  76. STDMETHOD(PutValue)(
  77. /*[in]*/ BSTR bstrName,
  78. /*[in]*/ VARIANT* pVal
  79. )
  80. { return (E_NOTIMPL); }
  81. STDMETHOD(Update)()
  82. { return (E_NOTIMPL); }
  83. STDMETHOD(Restore)()
  84. { return (E_NOTIMPL); }
  85. STDMETHOD(get_Count)(
  86. /*[out, retval]*/ LONG *pVal
  87. )
  88. { return (E_NOTIMPL); }
  89. STDMETHOD(Item)(
  90. /*[in]*/ BSTR bstrName,
  91. /*[out, retval]*/ IDataStoreProperty **ppObject
  92. )
  93. { return (E_NOTIMPL); }
  94. STDMETHOD(get__NewEnum)(
  95. /*[out, retval]*/ IUnknown** pVal
  96. )
  97. { return (E_NOTIMPL); }
  98. public:
  99. CDSPath () {InternalAddRef ();}
  100. ~CDSPath (){}
  101. //
  102. // initialize the Data Store container object
  103. //
  104. HRESULT Initialize (
  105. /*[in]*/ LPCWSTR pwszPath
  106. )
  107. {
  108. _ASSERT (NULL != pwszPath);
  109. m_vtPath = pwszPath;
  110. return (S_OK);
  111. }
  112. //
  113. // ATL interface information
  114. //
  115. BEGIN_COM_MAP(CDSPath)
  116. COM_INTERFACE_ENTRY(IDataStoreObject)
  117. COM_INTERFACE_ENTRY2(IDispatch, IDataStoreObject)
  118. END_COM_MAP()
  119. private:
  120. //
  121. // variant holding the dictionary path
  122. //
  123. _variant_t m_vtPath;
  124. }; // end of CDSPath class declaration
  125. //
  126. // this is for creating the CDSPath class object
  127. // through new
  128. //
  129. typedef CComObjectNoLock<CDSPath> DS_PATH_OBJ;
  130. #endif //_DSPATH_H_