Problem: The function MprAdminGetPDCServer does not return a valid RAS server name on Windows Server 2008 (SP 1). If the function is called with a valid domain name on a Windows Server 2008 Primary Domain Controller, i.e.
MprAdminGetPDCServer("test.local", NULL, pRasServer)
it returns NO_ERROR and the parameter pRasServer is filled with „\\server.test.
„.
The domain consists only of one PDC, „server.test.local
„. The same problem occurs in a subdomain, where also the suffix of the domain name is missing, i.e. „\\server.sub.test.
„.
On a Windows Server 2000, 2003 and 2003 R2 the function returns the RAS server correctly, eg. „\\server.test.local
„.
Solution: In Server 2003 there was no limit placed on the length of the output server name. In Server 2008 the length of the output string is required to be UNCLEN+1
, UNCLEN
is 17. To prevent buffer overruns, Microsoft now uses a safe string copy and the string limit is limited to UNCLEN+1
characters. A problem can arise when using DNS names since they are typically longer than NetBIOS names.
MprAdminGetPDCServer will take either a DNS or a NetBIOS name and the returned DC name will be of the same type. So if you pass it the NetBIOS domain you should just get back \\SERVER
.
(Thanks to the Microsoft Support for the solution)