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.

166 lines
4.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 1997-1998 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: sdomachine.h
  6. //
  7. // Project: Everest
  8. //
  9. // Description: SDO Machine Class Declaration
  10. //
  11. // Author: TLP 9/1/98
  12. //
  13. ///////////////////////////////////////////////////////////////////////////
  14. #ifndef _INC_SDO_MACHINE_H_
  15. #define _INC_SDO_MACHINE_H_
  16. #include "resource.h" // main symbols
  17. #include <ias.h>
  18. #include <sdoiaspriv.h>
  19. #include "dsconnection.h"
  20. #include "sdoserverinfo.h"
  21. //////////////////////////////////////////////////////////////////////////////
  22. class ATL_NO_VTABLE CSdoMachine :
  23. public CComObjectRootEx<CComMultiThreadModel>,
  24. public CComCoClass<CSdoMachine,&CLSID_SdoMachine>,
  25. public IDispatchImpl<ISdoMachine, &IID_ISdoMachine, &LIBID_SDOIASLib>,
  26. public IASProductLimits,
  27. private IASTraceInitializer
  28. {
  29. public:
  30. ////////////////////
  31. // ATL Interface Map
  32. ////////////////////
  33. BEGIN_COM_MAP(CSdoMachine)
  34. COM_INTERFACE_ENTRY(IDispatch)
  35. COM_INTERFACE_ENTRY(ISdoMachine)
  36. COM_INTERFACE_ENTRY_IID(__uuidof(IASProductLimits), IASProductLimits)
  37. END_COM_MAP()
  38. DECLARE_NOT_AGGREGATABLE(CSdoMachine)
  39. DECLARE_REGISTRY_RESOURCEID(IDR_SdoMachine)
  40. CSdoMachine();
  41. ~CSdoMachine();
  42. //////////////////////
  43. // ISdoMachine Methods
  44. //////////////////////////////////////////////////////////////////////////////
  45. STDMETHOD(Attach)(
  46. /*[in]*/ BSTR computerName
  47. );
  48. //////////////////////////////////////////////////////////////////////////////
  49. STDMETHOD(GetDictionarySDO)(
  50. /*[out]*/ IUnknown** ppDictionarySdo
  51. );
  52. //////////////////////////////////////////////////////////////////////////////
  53. STDMETHOD(GetServiceSDO)(
  54. /*[in]*/ IASDATASTORE dataStore,
  55. /*[in]*/ BSTR serviceName,
  56. /*[out]*/ IUnknown** ppServiceSdo
  57. );
  58. //////////////////////////////////////////////////////////////////////////////
  59. STDMETHOD(GetUserSDO)(
  60. /*[in]*/ IASDATASTORE dataStore,
  61. /*[in]*/ BSTR userName,
  62. /*[out]*/ IUnknown** ppUserSdo
  63. );
  64. //////////////////////////////////////////////////////////////////////////////
  65. STDMETHOD (GetOSType)(
  66. /*[out]*/ IASOSTYPE* eOSType
  67. );
  68. //////////////////////////////////////////////////////////////////////////////
  69. STDMETHOD (GetDomainType)(
  70. /*[out]*/ IASDOMAINTYPE* DomainType
  71. );
  72. //////////////////////////////////////////////////////////////////////////////
  73. STDMETHOD (IsDirectoryAvailable)(
  74. /*[out]*/ VARIANT_BOOL* boolDirectoryAvailable
  75. );
  76. //////////////////////////////////////////////////////////////////////////////
  77. STDMETHOD (GetAttachedComputer)(
  78. /*[out]*/ BSTR* bstrComputerName
  79. );
  80. //////////////////////////////////////////////////////////////////////////////
  81. STDMETHOD (GetSDOSchema)(
  82. /*[out]*/ IUnknown** ppSDOSchema
  83. );
  84. // IASProductLimits.
  85. STDMETHOD(get_Limits)(IAS_PRODUCT_LIMITS* pVal);
  86. private:
  87. typedef enum { MACHINE_MAX_SERVICES = 3 };
  88. CSdoMachine(const CSdoMachine&);
  89. CSdoMachine& operator = (CSdoMachine&);
  90. //////////////////////////////////////////////////////////////////////////////
  91. HRESULT CreateSDOSchema(void);
  92. //////////////////////////////////////////////////////////////////////////////
  93. HRESULT InitializeSDOSchema(void);
  94. // Returns TRUE if the attached machine has a DS.
  95. BOOL hasDirectory() throw ();
  96. // Attach status
  97. //
  98. bool m_fAttached;
  99. // Schema initialization state (lazy initialization)
  100. //
  101. bool m_fSchemaInitialized;
  102. // SDO Schema
  103. //
  104. ISdoSchema* m_pSdoSchema;
  105. // IDispatch interface to dictionary SDO
  106. //
  107. IUnknown* m_pSdoDictionary;
  108. // IAS data store connection
  109. //
  110. CDsConnectionIAS m_dsIAS;
  111. // Directory data store connection
  112. //
  113. CDsConnectionAD m_dsAD;
  114. // Information about attached computer
  115. //
  116. CSdoServerInfo m_objServerInfo;
  117. enum DirectoryType
  118. {
  119. Directory_Unknown,
  120. Directory_None,
  121. Directory_Available
  122. };
  123. DirectoryType dsType;
  124. IAS_PRODUCT_LIMITS m_Limits;
  125. // Supported services
  126. //
  127. static LPCWSTR m_SupportedServices[MACHINE_MAX_SERVICES];
  128. };
  129. #endif // _INC_SDO_MACHINE_H_