# C1.Util.DX.Direct3D11.Device.OpenSharedResource

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct3D11_Device_OpenSharedResource_" data-uid="C1.Util.DX.Direct3D11.Device.OpenSharedResource*">OpenSharedResource Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct3D11_Device_OpenSharedResource_" data-uid="C1.Util.DX.Direct3D11.Device.OpenSharedResource*"></a>
<h4 id="C1_Util_DX_Direct3D11_Device_OpenSharedResource__1_System_IntPtr_" data-uid="C1.Util.DX.Direct3D11.Device.OpenSharedResource``1(System.IntPtr)">OpenSharedResource&lt;T&gt;(nint)</h4>
<div class="markdown level1 summary"><p>Give a device access to a shared resource created on a different Direct3d device.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public T OpenSharedResource&lt;T&gt;(nint resourceHandle) where T : ComObject</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenSharedResource(Of T As ComObject)(resourceHandle As IntPtr) As T</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><span class="parametername">resourceHandle</span></td>
      <td><p>A resource handle. See remarks.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">T</span></td>
      <td><p>This method returns a reference to the resource we are gaining access to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the resource we are gaining access to.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_Direct3D11_Device_OpenSharedResource_" data-uid="C1.Util.DX.Direct3D11.Device.OpenSharedResource*"></a>
<h4 id="C1_Util_DX_Direct3D11_Device_OpenSharedResource_System_IntPtr_System_Guid_" data-uid="C1.Util.DX.Direct3D11.Device.OpenSharedResource(System.IntPtr,System.Guid)">OpenSharedResource(nint, Guid)</h4>
<div class="markdown level1 summary"><p>HRESULT ID3D11Device::OpenSharedResource([In] void* hResource,[In] const GUID&amp; ReturnedInterface,[Out, Optional] void** ppResource)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public nint OpenSharedResource(nint hResource, Guid returnedInterface)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenSharedResource(hResource As IntPtr, returnedInterface As Guid) As IntPtr</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><span class="parametername">hResource</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></td>
      <td><span class="parametername">returnedInterface</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
