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.

110 lines
3.9 KiB

  1. // Trust.h: Definition of the CTrust class
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_TRUST_H__BB315DAC_1A59_4EAC_99A0_2BFEFE6F1501__INCLUDED_)
  5. #define AFX_TRUST_H__BB315DAC_1A59_4EAC_99A0_2BFEFE6F1501__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "resource.h" // main symbols
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CTrust
  12. #include "ErrDct.hpp"
  13. typedef void (*PPROCESSFN)(void * arg,void * data);
  14. class CTrust :
  15. public ITrust,
  16. public CComObjectRoot,
  17. public IDispatchImpl<IMcsDomPlugIn, &IID_IMcsDomPlugIn, &LIBID_TRUSTMGRLib>,
  18. public CComCoClass<CTrust,&CLSID_Trust>,
  19. public ISecPlugIn
  20. {
  21. public:
  22. CTrust() {}
  23. BEGIN_COM_MAP(CTrust)
  24. COM_INTERFACE_ENTRY(ITrust)
  25. COM_INTERFACE_ENTRY(IMcsDomPlugIn)
  26. COM_INTERFACE_ENTRY(ISecPlugIn)
  27. END_COM_MAP()
  28. //DECLARE_NOT_AGGREGATABLE(CTrust)
  29. // Remove the comment from the line above if you don't want your object to
  30. // support aggregation.
  31. DECLARE_REGISTRY_RESOURCEID(IDR_Trust)
  32. // ITrust
  33. public:
  34. STDMETHOD(CreateTrust)(BSTR domTrusting, BSTR domTrusted, BOOL bBidirectional);
  35. STDMETHOD(QueryTrust)(BSTR domainSource, BSTR domainTrust, /*[out]*/IUnknown ** pVarSet);
  36. STDMETHOD(QueryTrusts)(BSTR domainSource,BSTR domainTarget,/*[in]*/BSTR sLogFile,/*out*/IUnknown ** pVarSet);
  37. STDMETHOD(CreateTrustWithCreds)(BSTR domTrusting, BSTR domTrusted,
  38. BSTR credTrustingDomain, BSTR credTrustingAccount, BSTR credTrustingPassword,
  39. BSTR credTrustedDomain, BSTR credTrustedAccount, BSTR credTrustedPassword, BOOL bBidirectional);
  40. // IMcsDomPlugIn
  41. public:
  42. STDMETHOD(GetRequiredFiles)(/* [out] */SAFEARRAY ** pArray);
  43. STDMETHOD(GetRegisterableFiles)(/* [out] */SAFEARRAY ** pArray);
  44. STDMETHOD(GetDescription)(/* [out] */ BSTR * description);
  45. STDMETHOD(PreMigrationTask)(/* [in] */IUnknown * pVarSet);
  46. STDMETHOD(PostMigrationTask)(/* [in] */IUnknown * pVarSet);
  47. STDMETHOD(GetName)(/* [out] */BSTR * name);
  48. STDMETHOD(GetResultString)(/* [in] */IUnknown * pVarSet,/* [out] */ BSTR * text);
  49. STDMETHOD(StoreResults)(/* [in] */IUnknown * pVarSet);
  50. STDMETHOD(ConfigureSettings)(/*[in]*/IUnknown * pVarSet);
  51. // ISecPlugIn
  52. public:
  53. STDMETHOD(Verify)(/*[in,out]*/ULONG * data,/*[in]*/ULONG cbData);
  54. protected:
  55. long EnumerateTrustingDomains(WCHAR * domain,BOOL bIsTarget,IVarSet * pVarSet,long ndxStart);
  56. long EnumerateTrustedDomains(WCHAR * domain,BOOL bIsTarget,IVarSet * pVarSet, long ndxStart);
  57. LONG FindInboundTrust(IVarSet * pVarSet,WCHAR * sName,LONG max);
  58. HRESULT
  59. CTrust::CheckAndCreate(
  60. WCHAR * trustingDomain,
  61. WCHAR * trustedDomain,
  62. WCHAR * credDomainTrusting,
  63. WCHAR * credAccountTrusting,
  64. WCHAR * credPasswordTrusting,
  65. WCHAR * credDomainTrusted,
  66. WCHAR * credAccountTrusted,
  67. WCHAR * credPasswordTrusted,
  68. BOOL bCreate,
  69. BOOL bBidirectional
  70. );
  71. HRESULT
  72. CTrust::CheckAndCreateTrustingSide(
  73. WCHAR * trustingDomain,
  74. WCHAR * trustedDomain,
  75. WCHAR * trustingComp,
  76. WCHAR * trustedComp,
  77. WCHAR * trustedDNSName,
  78. BYTE * trustedSid,
  79. BOOL bCreate,
  80. BOOL bBidirectional
  81. );
  82. HRESULT
  83. CTrust::CheckAndCreateTrustedSide(
  84. WCHAR * trustingDomain,
  85. WCHAR * trustedDomain,
  86. WCHAR * trustingComp,
  87. WCHAR * trustedComp,
  88. WCHAR * trustingDNSName,
  89. BYTE * trustingSid,
  90. BOOL bCreate,
  91. BOOL bBidirectional
  92. );
  93. };
  94. #endif // !defined(AFX_TRUST_H__BB315DAC_1A59_4EAC_99A0_2BFEFE6F1501__INCLUDED_)