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.

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