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.

224 lines
3.0 KiB

  1. #ifndef __CORE_H__
  2. #define __CORE_H__
  3. typedef struct _PropertyInfo PROPERTYINFO;
  4. typedef struct _PropertyInfo *PPROPERTYINFO;
  5. typedef struct _ClassInfo CLASSINFO;
  6. class CPropertyCache;
  7. #include "cumiobj.hxx"
  8. #include "indunk.hxx"
  9. class CCoreADsObject
  10. {
  11. public:
  12. CCoreADsObject::CCoreADsObject();
  13. CCoreADsObject::~CCoreADsObject();
  14. HRESULT
  15. get_CoreName(BSTR * retval);
  16. HRESULT
  17. get_CoreADsPath(BSTR * retval);
  18. HRESULT
  19. get_CoreParent(BSTR * retval);
  20. HRESULT
  21. get_CoreSchema(BSTR * retval);
  22. HRESULT
  23. get_CoreADsClass(BSTR * retval);
  24. HRESULT
  25. get_CoreGUID(BSTR * retval);
  26. DWORD
  27. CCoreADsObject::GetObjectState()
  28. {
  29. return(_dwObjectState);
  30. }
  31. void
  32. CCoreADsObject::SetObjectState(DWORD dwObjectState)
  33. {
  34. _dwObjectState = dwObjectState;
  35. }
  36. HRESULT
  37. InitializeCoreObject(
  38. LPWSTR Parent,
  39. LPWSTR Name,
  40. LPWSTR ClassName,
  41. LPWSTR Schema,
  42. REFCLSID rclsid,
  43. DWORD dwObjectState
  44. );
  45. STDMETHOD(GetInfo)(THIS_ DWORD dwApiLevel, BOOL fExplicit);
  46. STDMETHOD(ImplicitGetInfo)(void);
  47. HRESULT InitUmiObject(
  48. CWinNTCredentials& Credentials,
  49. PROPERTYINFO *pSchema,
  50. DWORD dwSchemaSize,
  51. CPropertyCache * pPropertyCache,
  52. IUnknown *pUnkInner,
  53. CADsExtMgr *pExtMgr,
  54. REFIID riid,
  55. LPVOID *ppvObj,
  56. CLASSINFO *pClassInfo = NULL
  57. );
  58. IUnknown *GetOuterUnknown(void)
  59. {
  60. return(_pUnkOuter);
  61. }
  62. void SetOuterUnknown(IUnknown *pUnkOuter)
  63. {
  64. HRESULT hr = S_OK;
  65. ADsAssert(pUnkOuter != NULL);
  66. _pUnkOuter = pUnkOuter;
  67. //
  68. // ignore error return from QI. If the aggregator doesn't support
  69. // IDispatch, the inner object's IDispatch doesn't delegate to
  70. // the outer object.
  71. //
  72. hr = pUnkOuter->QueryInterface(IID_IDispatch, (void **)&_pDispatch);
  73. if(SUCCEEDED(hr))
  74. //
  75. // Release interface (since inner object can't hold on to a
  76. // reference on the outer object), but, hold on the pointer.
  77. //
  78. _pDispatch->Release();
  79. }
  80. DWORD _dwNumComponents;
  81. LPWSTR _CompClasses[MAXCOMPONENTS];
  82. POBJECTINFO _pObjectInfo;
  83. OBJECTINFO _ObjectInfo;
  84. protected:
  85. HRESULT GetNumComponents(void);
  86. DWORD _dwObjectState;
  87. LPWSTR _Name;
  88. LPWSTR _ADsPath;
  89. LPWSTR _Parent;
  90. LPWSTR _ADsClass;
  91. LPWSTR _ADsGuid;
  92. LPWSTR _Schema;
  93. IUnknown *_pUnkOuter;
  94. IDispatch *_pDispatch;
  95. };
  96. #define ADS_OBJECT_BOUND 1
  97. #define ADS_OBJECT_UNBOUND 2
  98. #endif // __CORE_H__