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.

87 lines
2.0 KiB

  1. #ifndef _Nametranslate
  2. #define _NameTrsnslate
  3. #include "ntdsapi.h"
  4. class CNameTranslate;
  5. typedef struct _DomainToHandle {
  6. LPWSTR szDomain;
  7. HANDLE hDS;
  8. } DomainToHandle;
  9. #define STRINGPLEX_INC 10
  10. class CDomainToHandle
  11. {
  12. public:
  13. CDomainToHandle();
  14. ~CDomainToHandle();
  15. HRESULT Init();
  16. void Free();
  17. HRESULT AddElement(LPWSTR szValue, HANDLE hDS);
  18. HRESULT Find(LPWSTR szValue, HANDLE *phDS);
  19. DWORD NumElements();
  20. private:
  21. DomainToHandle *m_rgMap;
  22. DWORD m_cszMax;
  23. DWORD m_iszNext;
  24. };
  25. class CNameTranslate : INHERIT_TRACKING,
  26. public IADsNameTranslate
  27. {
  28. public:
  29. /* IUnknown methods */
  30. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) ;
  31. DECLARE_STD_REFCOUNTING
  32. DECLARE_IDispatch_METHODS
  33. STDMETHOD(Init)(THIS_ long lnType, BSTR bstrADsPath);
  34. STDMETHOD(InitEx)(THIS_ long lnType, BSTR bstrADsPath,
  35. BSTR bstrUser,BSTR bstrDomain,BSTR bstrPassword);
  36. STDMETHOD(Set)(THIS_ long dwSetType, BSTR bstrADsPath);
  37. STDMETHOD(Get)(THIS_ long dwFormatType, BSTR FAR *pbstrADsPath);
  38. STDMETHOD(GetEx)(THIS_ long dwFormatType, VARIANT FAR *pbstrADsPath);
  39. STDMETHOD(SetEx)(THIS_ long dwFormatType, VARIANT bstrADsPath);
  40. STDMETHOD(put_ChaseReferral)(THIS_ long lnChase) ; \
  41. CNameTranslate::CNameTranslate();
  42. CNameTranslate::~CNameTranslate();
  43. static
  44. HRESULT
  45. CNameTranslate::CreateNameTranslate(
  46. REFIID riid,
  47. void **ppvObj
  48. );
  49. static
  50. HRESULT
  51. CNameTranslate::AllocateNameTranslateObject(
  52. CNameTranslate ** ppNameTranslate
  53. );
  54. private:
  55. HANDLE _hDS;
  56. WCHAR _szGuid[MAX_TOKEN_LENGTH];
  57. LPWSTR *_rgszGuid;
  58. HANDLE *_rgDomainHandle;
  59. DWORD _cGuid;
  60. BOOLEAN _bChaseReferral;
  61. BOOLEAN _bAuthSet;
  62. RPC_AUTH_IDENTITY_HANDLE _AuthIdentity;
  63. CDomainToHandle *_pDomainHandle;
  64. protected:
  65. CDispatchMgr FAR * _pDispMgr;
  66. };
  67. #endif