To determine if a Domain Controller is a Global Catalog you can use
DsGetDomainControllerInfo and infolevel 2, this returns a DS_DOMAIN_CONTROLLER_INFO_2 structure (fIsGc flag):
Delphi-Quellcode:
DS_DOMAIN_CONTROLLER_INFO_2W =
record
NetbiosName: LPWSTR;
// might be NULL
DnsHostName: LPWSTR;
// might be NULL
SiteName: LPWSTR;
// might be NULL
SiteObjectName: LPWSTR;
// might be NULL
ComputerObjectName: LPWSTR;
// might be NULL
ServerObjectName: LPWSTR;
// might be NULL
NtdsDsaObjectName: LPWSTR;
// might be NULL
fIsPdc: BOOL;
fDsEnabled: BOOL;
fIsGc: BOOL;
// Valid iff SiteObjectName non-NULL.
SiteObjectGuid:
GUID;
// Valid iff ComputerObjectName non-NULL.
ComputerObjectGuid:
GUID;
// Valid iff ServerObjectName non-NULL;
ServerObjectGuid:
GUID;
// Valid iff fDsEnabled is TRUE.
NtdsDsaObjectGuid:
GUID;
end;