<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/be27686c-2373-4743-9b65-5c97b2618bdd" data-linktype="external">msdn link</a></p><p>The <b>NetrLogonGetTimeServiceParentDomain</b> method SHOULD<a id="Appendix_A_Target_241"></a><a aria-label="Product behavior note 241" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_241" data-linktype="relative-path">&lt;241&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 <a href="1d6fad9e-763d-495f-9bed-18c79304c3d7" data-linktype="relative-path">NetrLogonGetTrustRid</a>
method and <a href="79ca6e90-ccd2-429e-b5ac-8050b620eef6" data-linktype="relative-path">NetrLogonComputeClientDigest</a>
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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_44deb72d-c62b-4335-90e4-b9fd4dd782ed" data-linktype="relative-path">binding handle</a>, as defined
in section <a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a>.</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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_604dcfcd-72f5-46e5-85c1-f3ce69956700" data-linktype="relative-path">DNS</a>
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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a> 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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">domain controller</a>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>False</p>
  <p>0</p>
  </td>
  <td>
  <p>The PDC is not in the same site as the server
  specified by <i>ServerName</i>.</p>
  </td>
 </tr><tr>
  <td>
  <p>True</p>
  <p>1</p>
  </td>
  <td>
  <p>The PDC is in the same site as the server specified by
  <i>ServerName</i>.</p>
  </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_242"></a><a aria-label="Product behavior note 242" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_242" data-linktype="relative-path">&lt;242&gt;</a> return
ERROR_ACCESS_DENIED if the caller is not local.</p><p>If the client does not have sufficient <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_d8092e10-b227-4b44-b015-511bb8178940" data-linktype="relative-path">privilege</a>, 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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_fd104241-4fb3-457c-b2c4-e0c18bb20b62" data-linktype="relative-path">forest</a>, <b>rootDomainNamingContext</b>
(<a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a>
section <a href="../ms-adts/7ee04fa8-8027-4c7e-9c4a-4cd4c0198a70" data-linktype="relative-path">3.1.1.3.2.16</a>)
is equal to <b>defaultNamingContext</b> ([MS-ADTS] section <a href="../ms-adts/c1ad47fb-e4a1-4240-a749-b8f07ee0ae91" data-linktype="relative-path">3.1.1.3.2.3</a>).
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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_e2c071f1-5977-4749-868f-6c5a04929476" data-linktype="relative-path">domain tree</a> in the forest,
the name of a <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a>
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 <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain&#39;s</a>
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 (<a href="../ms-lsad/1b5471ef-4c33-4a91-b079-dfcbb82f05cc" data-linktype="relative-path">[MS-LSAD]</a>
section <a href="../ms-lsad/862cdc4f-79e3-4973-8fd3-2e7836010eb5" data-linktype="relative-path">3.1.4.7.2</a>)
for the domain, where TrustedDomainSid is the domain <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_83f2020d-0804-4840-a5ac-e06439d50f8d" data-linktype="relative-path">SID</a> 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 (<a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS name</a>) 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 <a href="../ms-adts/bf8afb5f-1ae0-45de-8445-8a717ea5124a" data-linktype="relative-path">3.1.1.1.11</a>.
Then the server determines the sites of both the server and PDC as specified in
[MS-ADTS] section <a href="../ms-adts/930d3ab8-7344-49f4-9615-a03d38279dff" data-linktype="relative-path">3.1.1.4.5.29</a>.
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>