<div class="content" name="RpcWinStationOpenSessionDirectory" uuid="8bd66837-81b7-4da0-809e-f797bd3a5b41"><p>The RpcWinStationOpenSessionDirectory method pings the
Session Directory to see if it can accept <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> calls. The
caller MUST be either SYSTEM or an <span><a href="c41d3367-04c9-4c93-babf-9b5de834eb29#gt_eb335f5b-619b-46ed-9138-06e9910108c3" data-linktype="relative-path">administrator</a></span>. The
method performs access checks as defined in sections <span><a href="44ae75e5-6414-4225-8d53-31426d7990a8" data-linktype="relative-path">3.1.2</a></span> and <span><a href="d8999c6c-1ce3-4e9c-b24d-464651a2904b" data-linktype="relative-path">3.1.3</a></span>.
The method fails if both checks fail. For more information about the Session
Directory, see <span><a href="https://go.microsoft.com/fwlink/?LinkId=90204" data-linktype="external">[MSFT-SDLBTS]</a></span>.<a id="Appendix_A_Target_213"></a><a aria-label="Product behavior note 213" href="7ce7f717-461b-4f18-9829-6690168c7707#Appendix_A_213" data-linktype="relative-path">&lt;213&gt;</a></p><dl>
<dd>
<div><pre> BOOLEAN RpcWinStationOpenSessionDirectory(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in, string, max_is(64)] PWCHAR pszServerName
 );
</pre></div>
</dd></dl><p><b>hServer: </b>Handle to the server object. This is
of type <span><a href="49484cdf-2feb-4de9-a588-5d01cf8995dc" data-linktype="relative-path">SERVER_HANDLE</a></span>. The <i>hServer</i>
argument MUST be obtained from a previous call to <span><a href="fd6f339d-f5dd-452c-a9a9-ec753c22a36a" data-linktype="relative-path">RpcWinStationOpenServer</a></span>.</p><p><b>pResult: </b> Failure error code if the call to
RpcWinStationOpenSessionDirectory failed. If the call was successful, this
parameter MUST be STATUS_SUCCESS (0x00000000).</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>STATUS_SUCCESS 0x00000000</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>STATUS_UNSUCCESSFUL 0xC0000001</td>
  <td>The server is not in application server mode on an advanced servers Stock Keeping Unit (SKU).</td>
 </tr><tr>
  <td>STATUS_ACCESS_DENIED 0xC0000022</td>
  <td>The caller is not SYSTEM nor an administrator.</td>
 </tr></tbody></table>
</dd></dl><p><b>pszServerName: </b>The name of the server hosting
session directory to which to attempt connection.</p><p><b>Return Values: </b> Returns TRUE if the call
succeeded, and FALSE if the method failed. On failure, pResult indicates the
failure status code.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x01 TRUE</td>
  <td>Successful completion.</td>
 </tr><tr>
  <td>0x00 FALSE</td>
  <td>Method call failed.</td>
 </tr></tbody></table>
</dd></dl><p> </p></div>