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.

158 lines
4.0 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. {
  27. public:
  28. ////////////////////
  29. // ATL Interface Map
  30. ////////////////////
  31. BEGIN_COM_MAP(CSdoMachine)
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. COM_INTERFACE_ENTRY(ISdoMachine)
  34. END_COM_MAP()
  35. DECLARE_NOT_AGGREGATABLE(CSdoMachine)
  36. DECLARE_REGISTRY_RESOURCEID(IDR_SdoMachine)
  37. CSdoMachine();
  38. ~CSdoMachine();
  39. //////////////////////
  40. // ISdoMachine Methods
  41. //////////////////////////////////////////////////////////////////////////////
  42. STDMETHOD(Attach)(
  43. /*[in]*/ BSTR computerName
  44. );
  45. //////////////////////////////////////////////////////////////////////////////
  46. STDMETHOD(GetDictionarySDO)(
  47. /*[out]*/ IUnknown** ppDictionarySdo
  48. );
  49. //////////////////////////////////////////////////////////////////////////////
  50. STDMETHOD(GetServiceSDO)(
  51. /*[in]*/ IASDATASTORE dataStore,
  52. /*[in]*/ BSTR serviceName,
  53. /*[out]*/ IUnknown** ppServiceSdo
  54. );
  55. //////////////////////////////////////////////////////////////////////////////
  56. STDMETHOD(GetUserSDO)(
  57. /*[in]*/ IASDATASTORE dataStore,
  58. /*[in]*/ BSTR userName,
  59. /*[out]*/ IUnknown** ppUserSdo
  60. );
  61. //////////////////////////////////////////////////////////////////////////////
  62. STDMETHOD (GetOSType)(
  63. /*[out]*/ IASOSTYPE* eOSType
  64. );
  65. //////////////////////////////////////////////////////////////////////////////
  66. STDMETHOD (GetDomainType)(
  67. /*[out]*/ IASDOMAINTYPE* DomainType
  68. );
  69. //////////////////////////////////////////////////////////////////////////////
  70. STDMETHOD (IsDirectoryAvailable)(
  71. /*[out]*/ VARIANT_BOOL* boolDirectoryAvailable
  72. );
  73. //////////////////////////////////////////////////////////////////////////////
  74. STDMETHOD (GetAttachedComputer)(
  75. /*[out]*/ BSTR* bstrComputerName
  76. );
  77. //////////////////////////////////////////////////////////////////////////////
  78. STDMETHOD (GetSDOSchema)(
  79. /*[out]*/ IUnknown** ppSDOSchema
  80. );
  81. private:
  82. typedef enum { MACHINE_MAX_SERVICES = 3 };
  83. CSdoMachine(const CSdoMachine&);
  84. CSdoMachine& operator = (CSdoMachine&);
  85. //////////////////////////////////////////////////////////////////////////////
  86. HRESULT CreateSDOSchema(void);
  87. //////////////////////////////////////////////////////////////////////////////
  88. HRESULT InitializeSDOSchema(void);
  89. // Returns TRUE if the attached machine has a DS.
  90. BOOL hasDirectory() throw ();
  91. // Attach status
  92. //
  93. bool m_fAttached;
  94. // Schema initialization state (lazy initialization)
  95. //
  96. bool m_fSchemaInitialized;
  97. // SDO Schema
  98. //
  99. ISdoSchema* m_pSdoSchema;
  100. // IDispatch interface to dictionary SDO
  101. //
  102. IUnknown* m_pSdoDictionary;
  103. // IAS data store connection
  104. //
  105. CDsConnectionIAS m_dsIAS;
  106. // Directory data store connection
  107. //
  108. CDsConnectionAD m_dsAD;
  109. // Information about attached computer
  110. //
  111. CSdoServerInfo m_objServerInfo;
  112. enum DirectoryType
  113. {
  114. Directory_Unknown,
  115. Directory_None,
  116. Directory_Available
  117. };
  118. DirectoryType dsType;
  119. // Supported services
  120. //
  121. static LPCWSTR m_SupportedServices[MACHINE_MAX_SERVICES];
  122. };
  123. #endif // _INC_SDO_MACHINE_H_