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.

112 lines
3.9 KiB

  1. #ifndef _INC_DSKQUOTA_NTDS_H
  2. #define _INC_DSKQUOTA_NTDS_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: ntds.h
  5. Description: Contains declaration for class NTDS.
  6. This class provides a simple wrapper around NT Directory Service
  7. name translation features. It has no data and no virtual functions.
  8. Revision History:
  9. Date Description Programmer
  10. -------- --------------------------------------------------- ----------
  11. 06/01/97 Initial creation. BrianAu
  12. */
  13. ///////////////////////////////////////////////////////////////////////////////
  14. #ifndef __SSPI_H__
  15. # define SECURITY_WIN32
  16. # include <security.h> // For TranslateName
  17. #endif
  18. class NTDS
  19. {
  20. public:
  21. NTDS(VOID) { }
  22. ~NTDS(VOID) { }
  23. HRESULT LookupAccountByName(
  24. LPCTSTR pszSystem,
  25. LPCTSTR pszLogonName,
  26. CString *pstrContainerName,
  27. CString *pstrDisplayName,
  28. PSID pSid,
  29. LPDWORD pdwSid,
  30. PSID_NAME_USE peUse);
  31. HRESULT LookupAccountBySid(
  32. LPCTSTR pszSystem,
  33. PSID pSid,
  34. CString *pstrContainerName,
  35. CString *pstrLogonName,
  36. CString *pstrDisplayName,
  37. PSID_NAME_USE peUse);
  38. HRESULT TranslateFQDNsToLogonNames(
  39. const CArray<CString>& rgstrFQDNs,
  40. CArray<CString> *prgstrLogonNames);
  41. HRESULT TranslateFQDNToLogonName(
  42. LPCTSTR pszFQDN,
  43. CString *pstrLogonName);
  44. static void CreateSamLogonName(LPCTSTR pszSamDomain, LPCTSTR pszSamUser, CString *pstrSamLogonName);
  45. static LPCTSTR FindFQDNInADsPath(LPCTSTR pszADsPath);
  46. static LPCTSTR FindSamAccountInADsPath(LPCTSTR pszADsPath);
  47. private:
  48. HRESULT LookupSamAccountName(
  49. LPCTSTR pszSystem,
  50. LPCTSTR pszLogonName,
  51. CString *pstrContainerName,
  52. CString *pstrDisplayName,
  53. PSID pSid,
  54. LPDWORD pdwSid,
  55. PSID_NAME_USE peUse);
  56. HRESULT LookupDsAccountName(
  57. LPCTSTR pszSystem,
  58. LPCTSTR pszLogonName,
  59. CString *pstrContainerName,
  60. CString *pstrDisplayName,
  61. PSID pSid,
  62. LPDWORD pdwSid,
  63. PSID_NAME_USE peUse);
  64. HRESULT GetSamAccountDisplayName(
  65. LPCTSTR pszLogonName,
  66. CString *pstrDisplayName);
  67. HRESULT GetDsAccountDisplayName(
  68. LPCTSTR pszLogonName,
  69. CString *pstrDisplayName);
  70. HRESULT TranslateNameInternal(
  71. LPCTSTR pszAccountName,
  72. EXTENDED_NAME_FORMAT AccountNameFormat,
  73. EXTENDED_NAME_FORMAT DesiredNameFormat,
  74. CString *pstrTranslatedName);
  75. HRESULT LookupAccountNameInternal(
  76. LPCTSTR pszSystemName,
  77. LPCTSTR pszAccountName,
  78. PSID Sid,
  79. LPDWORD pcbSid,
  80. CString *pstrReferencedDomainName,
  81. PSID_NAME_USE peUse);
  82. HRESULT LookupAccountSidInternal(
  83. LPCTSTR pszSystemName,
  84. PSID Sid,
  85. CString *pstrName,
  86. CString *pstrReferencedDomainName,
  87. PSID_NAME_USE peUse);
  88. };
  89. #endif // _INC_DSKQUOTA_NTDS_H