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.

149 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: ndstruct.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef HEADER_NDSTRUCT
  11. #define HEADER_NDSTRUCT
  12. typedef struct _NETBT_TRANSPORT {
  13. LIST_ENTRY Next;
  14. //
  15. // Flags describing this Netbt transport
  16. //
  17. DWORD Flags;
  18. #define BOUND_TO_REDIR 0x001 // Transport is bound to the redir
  19. #define BOUND_TO_BOWSER 0x002 // Transport is bound to the bowser
  20. #define IP_ADDRESS_IN_DNS 0x004 // IP address is registered in DNS
  21. //
  22. // IP Address for this transport
  23. //
  24. ULONG IpAddress;
  25. //
  26. // Name of the transport (Must be the last field in the structure)
  27. //
  28. WCHAR pswzTransportName[1];
  29. } NETBT_TRANSPORT, *PNETBT_TRANSPORT;
  30. //
  31. // Structure describing a single tested domain
  32. //
  33. typedef struct _TESTED_DOMAIN {
  34. LIST_ENTRY Next;
  35. //
  36. // Name of the domain.
  37. //
  38. // Queryable domain is NULL for the domain we're a member of so we can
  39. // pass NULL to DsGetDcName for that domain. Doing so has better query
  40. // characteristics since it tries both the Netbios and DNS domain names.
  41. //
  42. //LPWSTR DomainName;
  43. LPWSTR NetbiosDomainName; // NULL if not known
  44. LPWSTR DnsDomainName; // NULL if not known
  45. LPWSTR PrintableDomainName; // Pointer to a non-NULL domain name string
  46. LPWSTR QueryableDomainName; // Can be NULL for domain we're a member of
  47. BOOL fPrimaryDomain; // True if the domain is domain we're a member of
  48. //BOOL IsNetbios; // True if DomainName is syntactically a Netbios name
  49. //BOOL IsDns; // True if DomainName is syntactically a Dns name
  50. //
  51. // Domain Sid of the domain (if known)
  52. //
  53. BOOL fDomainSid; // do we have the domain sid?
  54. PSID DomainSid;
  55. //
  56. // DcInfo for a DS_PREFERRED DC in the domain.
  57. //
  58. PDOMAIN_CONTROLLER_INFOW DcInfo;
  59. BOOL fTriedToFindDcInfo;
  60. //
  61. // List of DCs to test.
  62. //
  63. LIST_ENTRY TestedDcs;
  64. } TESTED_DOMAIN, *PTESTED_DOMAIN;
  65. //
  66. // Structure describing a single tested DC
  67. //
  68. typedef struct _TESTED_DC {
  69. LIST_ENTRY Next;
  70. //
  71. // Name of the DC
  72. //
  73. // This will be the DNS DC name if we know it. Otherwise it will be the
  74. // Netbios DC name.
  75. //
  76. LPWSTR ComputerName;
  77. WCHAR NetbiosDcName[CNLEN+1];
  78. ULONG Rid;
  79. //
  80. // IP Address of the DC
  81. // NULL: Not yet known
  82. //
  83. LPWSTR DcIpAddress;
  84. //
  85. // Backlink to domain this DC belongs to
  86. //
  87. PTESTED_DOMAIN TestedDomain;
  88. //
  89. // Flags describing this DC.
  90. //
  91. ULONG Flags;
  92. #define DC_IS_DOWN 0x001 // DC cannot be pinged
  93. #define DC_IS_NT5 0x002 // DC is running NT 5 (or newer)
  94. #define DC_IS_NT4 0x004 // DC is running NT 4 (or older)
  95. #define DC_PINGED 0x008 // The DC pinged
  96. #define DC_FAILED_PING 0x010 // The DC ping failed
  97. } TESTED_DC, *PTESTED_DC;
  98. //
  99. // Generic interface to DsGetDcName
  100. typedef DWORD (WINAPI DSGETDCNAMEW)(
  101. IN LPCWSTR ComputerName OPTIONAL,
  102. IN LPCWSTR DomainName OPTIONAL,
  103. IN GUID *DomainGuid OPTIONAL,
  104. IN LPCWSTR SiteName OPTIONAL,
  105. IN ULONG Flags,
  106. OUT PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  107. );
  108. #endif