<div class="content" name="RpcGetTimes" uuid="4a7d8496-a6c4-4162-adaf-7897baa8c4ff"><p>The RpcGetTimes method gets the connected, disconnected, and
logged-on time for the specified session on the <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_b416f72e-cf04-4d80-bf93-f5753f3b0998" data-linktype="relative-path">terminal server</a></span>.
This method MUST be called after <span><a href="56ede88b-913b-4911-9540-389fddf879e5" data-linktype="relative-path">RpcOpenSession</a></span>. The
caller MUST have WINSTATION_QUERY permission for the session. The method checks
whether the caller has WINSTATION_QUERY permission (section <span><a href="4507e852-be3d-45b6-bc47-8ca0b552c94d" data-linktype="relative-path">3.1.1</a></span>)
by setting it as the Access Request mask, and fails if the caller does not have
the permission. </p><dl>
<dd>
<div><pre> HRESULT RpcGetTimes(
   [in] SESSION_HANDLE hSession,
   [out] hyper* pConnectTime,
   [out] hyper* pDisconnectTime,
   [out] hyper* pLogonTime
 );
</pre></div>
</dd></dl><p><b>hSession: </b>Handle to the session returned by
RpcOpenSession. This is of type <span><a href="08a45954-8173-43c6-aa10-7aeda48e8dc2" data-linktype="relative-path">SESSION_HANDLE</a></span>.</p><p><b>pConnectTime: </b> The most recent time of a
connection to the session.</p><dl>
<dd>
<p>Time is measured as the number of 100-nanosecond
intervals since January 1, 1601 (UTC). </p>
</dd></dl><p><b>pDisconnectTime: </b>The most recent time of a
disconnection from the session.</p><dl>
<dd>
<p>Time is measured as the number of 100-nanosecond
intervals since January 1, 1601 (UTC). </p>
</dd></dl><p><b>pLogonTime: </b>The most recent time of a logon to
the session.</p><dl>
<dd>
<p>Time is measured as the number of 100-nanosecond
intervals since January 1, 1601 (UTC). </p>
</dd></dl><p><b>Return Values: </b> The method MUST return S_OK
(0x00000000) on success; otherwise, it MUST return an implementation-specific
negative value.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>Successful completion.</td>
 </tr></tbody></table>
</dd></dl><p> </p></div>