3.5.4.3.6 DsrGetSiteName (Opnum 28)

The DsrGetSiteName method SHOULD<161> return the site name for the specified computer that receives this call.

 NET_API_STATUS DsrGetSiteName(
   [in, unique, string] LOGONSRV_HANDLE ComputerName,
   [out, string] wchar_t** SiteName
 );

ComputerName: The custom binding handle (defined in section 3.5.4.1).

SiteName: A null-terminated Unicode string that contains the name of the site in which the computer that receives this call resides.

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

0x0000077F

ERROR_NO_SITENAME

No site name is available for this machine.

If the computer has been configured with a SiteName, it MUST return the SiteName immediately.

If the DynamicSiteNameSetTime plus the DynamicSiteNameTimeout is less than the current time (meaning that the DynamicSiteNameSetTime is older than allowed by DynamicSiteNameTimeout), then:

  • The server MUST locate a domain controller in the domain. The server SHOULD<162> implement alternate means to locate DCs: for example, a static list in a file, or the two methods detailed in [MS-ADTS] section 6.3.6. If the server cannot locate a DC for the domain, then the server MUST return ERROR_NO_SUCH_DOMAIN.

  • The server then populates the SiteName parameter with the NETLOGON_SAM_LOGON_RESPONSE_EX message ([MS-ADTS] section 6.3.1.9) by setting the SiteName parameter to NETLOGON_SAM_LOGON_RESPONSE_EX.ClientSiteName. The server stores the discovered site name in DynamicSiteName.

  • The server sets the DynamicSiteNameSetTime to the current time.

Otherwise, DynamicSiteName MUST be returned immediately as the SiteName parameter.

If it is determined that the server that receives this call has no site name, the server MUST return ERROR_NO_SITENAME.

This method also returns errors based on Common Error Processing Rules B and C, specified in section 3.

Show: