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.

98 lines
3.1 KiB

  1. // SecTranslator.h : Declaration of the CSecTranslator
  2. #ifndef __SECTRANSLATOR_H_
  3. #define __SECTRANSLATOR_H_
  4. #include "resource.h" // main symbols
  5. //#import "\bin\McsVarSetMin.tlb" no_namespace, named_guids
  6. //#import "VarSet.tlb" no_namespace, named_guids rename("property", "aproperty") //#imported via sdstat.hpp below
  7. #include "STArgs.hpp"
  8. #include "SDStat.hpp"
  9. #include "EaLen.hpp"
  10. #include "TNode.hpp"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CSecTranslator
  13. class ATL_NO_VTABLE CSecTranslator :
  14. public CComObjectRootEx<CComMultiThreadModel>,
  15. public CComCoClass<CSecTranslator, &CLSID_SecTranslator>,
  16. public ISecTranslator
  17. {
  18. public:
  19. CSecTranslator()
  20. {
  21. m_pUnkMarshaler = NULL;
  22. m_exchServer[0] = 0;
  23. m_Profile[0] = 0;
  24. m_Container[0] = 0;
  25. m_CacheFile[0] = 0;
  26. m_domain[0] = 0;
  27. m_username[0] = 0;
  28. m_password[0] = 0;
  29. m_LocalOnly = FALSE;
  30. }
  31. DECLARE_REGISTRY_RESOURCEID(IDR_SECTRANSLATOR)
  32. DECLARE_NOT_AGGREGATABLE(CSecTranslator)
  33. DECLARE_GET_CONTROLLING_UNKNOWN()
  34. DECLARE_PROTECT_FINAL_CONSTRUCT()
  35. BEGIN_COM_MAP(CSecTranslator)
  36. COM_INTERFACE_ENTRY(ISecTranslator)
  37. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  38. END_COM_MAP()
  39. HRESULT FinalConstruct()
  40. {
  41. return CoCreateFreeThreadedMarshaler(
  42. GetControllingUnknown(), &m_pUnkMarshaler.p);
  43. }
  44. void FinalRelease()
  45. {
  46. m_pUnkMarshaler.Release();
  47. }
  48. CComPtr<IUnknown> m_pUnkMarshaler;
  49. // ISecTranslator
  50. public:
  51. STDMETHOD(Process)(IUnknown * pWorkItemIn);
  52. protected:
  53. SecurityTranslatorArgs m_Args;
  54. WCHAR m_exchServer[LEN_Computer];
  55. WCHAR m_Profile[LEN_DistName];
  56. WCHAR m_Container[LEN_DistName];
  57. WCHAR m_CacheFile[MAX_PATH];
  58. WCHAR m_domain[LEN_Domain];
  59. WCHAR m_username[LEN_Account];
  60. WCHAR m_password[LEN_Password];
  61. WCHAR m_SourceSid[LEN_Account];
  62. WCHAR m_TargetSid[LEN_Account];
  63. BOOL m_LocalOnly;
  64. TNodeList m_ConnectionList;
  65. void LoadSettingsFromVarSet(IVarSet * pVarSet);
  66. void ExportStatsToVarSet(IVarSet * pVarSet, TSDResolveStats * stat);
  67. void DoResolution(TSDResolveStats * stat);
  68. void DoLocalGroupResolution(TSDResolveStats * stat);
  69. void DoExchangeResolution(TSDResolveStats * stat, IVarSet * pVarSet);
  70. void DoUserRightsTranslation(TSDResolveStats * stat);
  71. void CleanupSessions();
  72. BOOL LoadCacheFromVarSet(IVarSet * pVarSet);
  73. BOOL LoadCacheFromFile(WCHAR const * filename, IVarSet * pVarSet);
  74. BOOL GetRIDsFromEA();
  75. BOOL BuildCacheFile(WCHAR const * filename);
  76. BOOL RemoveExchangeServiceAccountFromCache();
  77. BOOL EstablishASession(WCHAR const * serverName);
  78. HRESULT LoadMigratedObjects(IVarSet * pVarSetIn);
  79. BOOL LoadCacheFromMapFile(WCHAR const * filename, IVarSet * pVarSet);
  80. FILE* OpenMappingFile(LPCTSTR pszFileName);
  81. _bstr_t GetADC(_bstr_t sDomainName);
  82. };
  83. #endif //__SECTRANSLATOR_H_