Freigeben über


3.5.4.3.4 NetrGetDCName (Opnum 11)

The NetrGetDCName method MAY<161> be used to retrieve the NetBIOS name of the PDC for the specified domain.

 NET_API_STATUS NetrGetDCName(
   [in, string] LOGONSRV_HANDLE ServerName,
   [in, unique, string] wchar_t* DomainName,
   [out, string] wchar_t** Buffer
 );

ServerName: The custom binding handle, as defined in section 3.5.4.1, that represents the connection to a domain controller.

DomainName: A null-terminated Unicode string that specifies the NetBIOS name of the domain.

Buffer: A pointer to a null-terminated Unicode string that contains the NetBIOS name of the PDC for the specified domain. The server name returned by this method is prefixed by two backslashes (\\).

Return Values: The method returns 0x00000000 on success; otherwise, it MUST return a nonzero error code and SHOULD return the following error code.

Return Value/Code

Description

0x00000035

ERROR_ BAD_ NETPATH

The network path was not found.

If the DomainName parameter is not NULL and is not a valid NetBIOS name format, the server MUST return NERR_DCNotFound ([MS-ERREF] section 2.2).

The server MUST attempt to locate a PDC for the domain specified by the client. The server MUST return NERR_DCNotFound if the PDC could not be located for the specified domain. The server SHOULD<162> implement alternate means of locating DCs: for example, a static list in a file, or two methods detailed in [MS-ADTS] section 6.3.6.

NetrGetDcName returns the name of the discovered PDC.