<div class="content"><p>The W32TimeQueryProviderStatus method returns operational
information for a specified <a href="cb180d77-0c53-490e-9d37-df7576ef5465#gt_9338a1cf-ec11-4e27-a042-dda5324a44fb" data-linktype="relative-path">time
provider</a> (either an NTP or a hardware time provider) within the <a href="cb180d77-0c53-490e-9d37-df7576ef5465#gt_9846d08d-ad98-4bb9-a1e7-1f0bfbdd1113" data-linktype="relative-path">time service&#39;s</a> list of time
providers.<a id="Appendix_A_Target_39"></a><a aria-label="Product behavior note 39" href="bb576d39-587b-484a-86a4-e1d378cf9497#Appendix_A_39" data-linktype="relative-path">&lt;39&gt;</a> The <a href="cb180d77-0c53-490e-9d37-df7576ef5465#gt_9c5903c1-1477-4181-b451-3ba1e34a0c0c" data-linktype="relative-path">MIDL</a> syntax of this method
is specified as follows.</p><dl>
<dd>
<div><pre> unsigned long W32TimeQueryProviderStatus(
   [in] handle_t hRPCBinding,
   [in] unsigned __int32 ulFlags,
   [in, string] wchar_t* pwszProvider,
   [out, ref] PW32TIME_PROVIDER_INFO* pProviderInfo
 );
</pre></div>
</dd></dl><p><b>hRPCBinding: </b><a href="cb180d77-0c53-490e-9d37-df7576ef5465#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> primitive binding
handle as specified in <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a>
part 3, sections Interface Definition Language and Stubs.</p><p><b>ulFlags: </b>Reserved. This parameter MUST be set
to zero and MUST be ignored on receipt.</p><p><b>pwszProvider: </b>Name of the time provider to
query. This name is implementation specific.<a id="Appendix_A_Target_40"></a><a aria-label="Product behavior note 40" href="bb576d39-587b-484a-86a4-e1d378cf9497#Appendix_A_40" data-linktype="relative-path">&lt;40&gt;</a></p><p><b>pProviderInfo: </b>A pointer that receives a
pointer to a <a href="1db85b71-e3f6-48f4-916e-c209e1e5f2a8" data-linktype="relative-path">W32TIME_PROVIDER_INFO</a>
structure containing operational information for the time provider.</p><p><b>Return Values: </b>This method MUST return zero on
success; on failure, it returns a nonzero <a href="cb180d77-0c53-490e-9d37-df7576ef5465#gt_a0f899ec-e1a5-4e04-8abc-80df987c6fb4" data-linktype="relative-path">error code</a>. The values
transmitted in this field are implementation specific. All nonzero values MUST
be treated as equivalent for protocol purposes.<a id="Appendix_A_Target_41"></a><a aria-label="Product behavior note 41" href="bb576d39-587b-484a-86a4-e1d378cf9497#Appendix_A_41" data-linktype="relative-path">&lt;41&gt;</a></p><p>When W32TimeQueryProviderStatus is invoked, the server
SHOULD examine its <b>TimeProviderList</b> to locate the time provider
corresponding to the name <i>pwszProvider</i>. If the provider cannot be
located, the server MUST return ERROR_NOT_FOUND, as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>;
otherwise, the server MUST return the associated time provider information
structure, as specified in section 2.2.1, and populate it as follows:</p><ol><li><p><span>    </span>pProviderInfo.ulProviderType
MUST be set to 0.</p>
</li><li><p><span>    </span>pProviderInfo.ProviderData.pNtpProviderData.ulSize
MUST be set with the size, in bytes, of the <a href="38cfb2cc-e996-4ec0-bc96-aad3fb7ca5d8" data-linktype="relative-path">W32TIME_NTP_PROVIDER_DATA</a>
structure.</p>
</li><li><p><span>    </span>pProviderInfo.ProviderData.pNtpProviderData.ulError
MUST be set to zero if the NTP time provider is functioning correctly;
otherwise, it MUST be set to an implementation-specific nonzero unsigned
integer value.</p>
</li><li><p><span>    </span>pProviderInfo.ProviderData.pNtpProviderData.ulErrorMsgId
MUST be set to an implementation-specific positive integer value that maps to a
human-readable message that describes the failure indicated in the
pProviderInfo.ProviderData.pNtpProviderData.ulError field.</p>
</li><li><p><span>    </span>pProviderInfo.ProviderData.pNtpProviderData.cPeerInfo
MUST be the count of active time peers that synchronize with this NTP time
provider.</p>
</li><li><p><span>    </span>For each active
time peer to return, the server MUST fill an element in the
pProviderInfo.ProviderData.pNtpProviderData.pPeerInfo field according to the
following table.</p>
<table><thead>
  <tr>
   <th>
   <p>Element
   field</p>
   </th>
   <th>
   <p>Value</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>ulSize</p>
  </td>
  <td>
  <p>The size, in
  bytes, of the W32TIME_NTP_PEER_INFO structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>ulResolveAttempts</p>
  </td>
  <td>
  <p>The <b>ResolvedAttempts</b>
  element value (see section <a href="28e3c644-cb9d-4925-8c80-288f6339d9e0" data-linktype="relative-path">3.2.1.3</a>)</p>
  </td>
 </tr><tr>
  <td>
  <p>u64TimeRemaining</p>
  </td>
  <td>
  <p>The <b>TimeRemaining</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>u64LastSuccessfulSync</p>
  </td>
  <td>
  <p>The <b>LastSuccessfulSync</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>ulLastSyncError</p>
  </td>
  <td>
  <p>The <b>LastSyncError</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>ulLastSyncErrorMsgId</p>
  </td>
  <td>
  <p>The <b>LastSyncErrorMessageId</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>ulValidDataCounter</p>
  </td>
  <td>
  <p>The <b>ValidDataCounter</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>ulAuthTypeMsgId</p>
  </td>
  <td>
  <p>The <b>AuthenticationTypeMessageId</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>wszUniqueName</p>
  </td>
  <td>
  <p>The <b>PeerName</b>
  element value (see section 3.2.1.3)</p>
  </td>
 </tr><tr>
  <td>
  <p>ulMode</p>
  </td>
  <td>
  <p>The current
  NTP association mode (peer.mode), as specified in <a href="https://go.microsoft.com/fwlink/?LinkId=90272" data-linktype="external">[RFC1305]</a> section
  3.2.1, &#34;Common Variables&#34;.</p>
  </td>
 </tr><tr>
  <td>
  <p>ulStratum</p>
  </td>
  <td>
  <p>The stratum
  (peer.stratum), as specified in [RFC1305] section 3.2.3, &#34;Peer
  Variables&#34;.</p>
  </td>
 </tr><tr>
  <td>
  <p>ulReachability</p>
  </td>
  <td>
  <p>The
  reachability register (peer.reach), as specified in [RFC1305] section 3.2.3,
  &#34;Peer Variables&#34;.</p>
  </td>
 </tr><tr>
  <td>
  <p>ulPeerPollInterval</p>
  </td>
  <td>
  <p>The Peer Poll
  Interval (peer.peerpoll), as specified in [RFC1305] section 3.2.3, &#34;Peer
  Variables&#34;.</p>
  </td>
 </tr><tr>
  <td>
  <p>ulHostPollInterval</p>
  </td>
  <td>
  <p>The Host Poll
  Interval (peer.hostpoll), as specified in [RFC1305] section 3.2.3, &#34;Peer
  Variables&#34;.</p>
  </td>
 </tr></tbody></table>
</li></ol><p> </p></div>