<div class="content" name="NetrLogonGetTimeServiceParentDomain" uuid="be27686c-2373-4743-9b65-5c97b2618bdd"><p>The <b>NetrLogonGetTimeServiceParentDomain</b> method SHOULD<a id="Appendix_A_Target_251"></a><a aria-label="Product behavior note 251" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_251" data-linktype="relative-path">&lt;251&gt;</a> return the name of the parent
domain of the current domain. The domain name returned by this method is
suitable for passing into the <span><a href="1d6fad9e-763d-495f-9bed-18c79304c3d7" data-linktype="relative-path">NetrLogonGetTrustRid</a></span>
method and <span><a href="79ca6e90-ccd2-429e-b5ac-8050b620eef6" data-linktype="relative-path">NetrLogonComputeClientDigest</a></span>
method.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrLogonGetTimeServiceParentDomain(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [out, string] wchar_t** DomainName,
   [out] int* PdcSameSite
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_44deb72d-c62b-4335-90e4-b9fd4dd782ed" data-linktype="relative-path">binding
handle</a></span>, as defined in section <span><a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a></span>.</p><p><b>DomainName: </b>A pointer to the buffer that
receives the null-terminated Unicode string that contains the name of the
parent domain. If the <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_604dcfcd-72f5-46e5-85c1-f3ce69956700" data-linktype="relative-path">DNS</a></span> domain name is
available, it is returned through this parameter; otherwise, the NetBIOS domain
name is returned.</p><p><b>PdcSameSite: </b>A pointer to the integer that
receives the value that indicates whether the <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a></span> for the domain <i>DomainName</i>
is in the same site as the server specified by <i>ServerName</i>. The Netlogon
client ignores this value if <i>ServerName</i> is not a <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">domain
controller</a></span>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>False 0</td>
  <td>The PDC is not in the same site as the server specified by ServerName.</td>
 </tr><tr>
  <td>True 1</td>
  <td>The PDC is in the same site as the server specified by ServerName.</td>
 </tr></tbody></table>
</dd></dl><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it returns a nonzero error code.</p><p>The server SHOULD<a id="Appendix_A_Target_252"></a><a aria-label="Product behavior note 252" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_252" data-linktype="relative-path">&lt;252&gt;</a> return
ERROR_ACCESS_DENIED if the caller is not local.</p><p>If the client does not have sufficient <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_d8092e10-b227-4b44-b015-511bb8178940" data-linktype="relative-path">privilege</a></span>,
the server MUST return ERROR_ACCESS_DENIED.</p><p>The domain name returned MUST be determined according to the
following rules:</p><ul><li><p><span><span> 
</span></span>On a non-DC machine, the returned domain name is the name of the
domain of which the <i>ServerName</i> is a member. If <i>ServerName</i> is not
valid, the server MUST return ERROR_INVALID_COMPUTERNAME.</p>
</li><li><p><span><span> 
</span></span>On a DC that is at the root of the <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_fd104241-4fb3-457c-b2c4-e0c18bb20b62" data-linktype="relative-path">forest</a></span>, <b>rootDomainNamingContext</b>
(<span><a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a></span>
section <span><a href="../ms-adts/7ee04fa8-8027-4c7e-9c4a-4cd4c0198a70" data-linktype="relative-path">3.1.1.3.2.16</a></span>)
is equal to <b>defaultNamingContext</b> ([MS-ADTS] section <span><a href="../ms-adts/c1ad47fb-e4a1-4240-a749-b8f07ee0ae91" data-linktype="relative-path">3.1.1.3.2.3</a></span>).
In this case, ERROR_NO_SUCH_DOMAIN is returned.</p>
</li><li><p><span><span> 
</span></span>On a DC that is at the root of a <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_e2c071f1-5977-4749-868f-6c5a04929476" data-linktype="relative-path">domain tree</a></span> in the
forest, the name of a <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a></span> domain that
is also at the root of a domain tree in the forest is returned.</p>
</li></ul><p>On any other DC, the name of the domain that is directly the
parent domain is returned.</p><p>The <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain&#39;s</a></span> information
MUST be retrieved from an implementation-specific directory. Based on this
retrieved information, if the domain has a DNS domain name, it MUST be
returned; otherwise, the NetBIOS domain name MUST be returned. This behavior is
functionally equivalent to locally invoking LsarQueryTrustedDomainInfo (<span><a href="../ms-lsad/1b5471ef-4c33-4a91-b079-dfcbb82f05cc" data-linktype="relative-path">[MS-LSAD]</a></span>
section <span><a href="../ms-lsad/862cdc4f-79e3-4973-8fd3-2e7836010eb5" data-linktype="relative-path">3.1.4.7.2</a></span>)
for the domain, where TrustedDomainSid is the domain <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_83f2020d-0804-4840-a5ac-e06439d50f8d" data-linktype="relative-path">SID</a></span> corresponding to
the appropriate domain name retrieved from a cached list, and InformationClass
is TrustedDomainInformationEx (policy handle is not needed locally), to return
the TrustedDomainInformationEx.Name string (DNS name) if it is present or
TrustedDomainInformationEx.Flat Name string (<span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS name</a></span>)
otherwise. </p><p>The <i>PdcSameSite</i> returned MUST be determined according
to the following rules:</p><ul><li><p><span><span> 
</span></span>On a non-DC machine, the value of <i>PdcSameSite</i> is set to
TRUE.</p>
</li><li><p><span><span> 
</span></span>On a DC machine, the server determines the PDC as specified in
[MS-ADTS] section <span><a href="../ms-adts/bf8afb5f-1ae0-45de-8445-8a717ea5124a" data-linktype="relative-path">3.1.1.1.11</a></span>.
Then the server determines the sites of both the server and PDC as specified in
[MS-ADTS] section <span><a href="../ms-adts/930d3ab8-7344-49f4-9615-a03d38279dff" data-linktype="relative-path">3.1.1.4.5.29</a></span>.
The server MUST compare the PDC site with its own site, and if the two match,
the <i>PdcSameSite</i> output parameter MUST be set to TRUE; otherwise, it MUST
be set to FALSE.</p>
</li></ul></div>