# C1.Util.DX.DXGI.Resource1.CreateSharedHandle

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXGI_Resource1_CreateSharedHandle_" data-uid="C1.Util.DX.DXGI.Resource1.CreateSharedHandle*">CreateSharedHandle Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXGI_Resource1_CreateSharedHandle_" data-uid="C1.Util.DX.DXGI.Resource1.CreateSharedHandle*"></a>
<h4 id="C1_Util_DX_DXGI_Resource1_CreateSharedHandle_System_String_C1_Util_DX_DXGI_SharedResourceFlags_System_Nullable_C1_Util_DX_Storage_SecurityAttributes__" data-uid="C1.Util.DX.DXGI.Resource1.CreateSharedHandle(System.String,C1.Util.DX.DXGI.SharedResourceFlags,System.Nullable{C1.Util.DX.Storage.SecurityAttributes})">CreateSharedHandle(string, SharedResourceFlags, SecurityAttributes?)</h4>
<div class="markdown level1 summary"><p>Creates a handle to a shared resource. You can then use the returned handle with multiple Direct3D devices.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IntPtr CreateSharedHandle(string name, SharedResourceFlags dwAccess, SecurityAttributes? attributesRef = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateSharedHandle(name As String, dwAccess As SharedResourceFlags, Optional attributesRef As SecurityAttributes? = Nothing) 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.string">string</a></td>
      <td><span class="parametername">name</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.SharedResourceFlags.html">SharedResourceFlags</a></td>
      <td><span class="parametername">dwAccess</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Storage.SecurityAttributes.html">SecurityAttributes</a>?</td>
      <td><span class="parametername">attributesRef</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">IntPtr</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DXGI_Resource1_CreateSharedHandle_" data-uid="C1.Util.DX.DXGI.Resource1.CreateSharedHandle*"></a>
<h4 id="C1_Util_DX_DXGI_Resource1_CreateSharedHandle_System_Nullable_C1_Util_DX_Storage_SecurityAttributes__C1_Util_DX_DXGI_SharedResourceFlags_System_String_" data-uid="C1.Util.DX.DXGI.Resource1.CreateSharedHandle(System.Nullable{C1.Util.DX.Storage.SecurityAttributes},C1.Util.DX.DXGI.SharedResourceFlags,System.String)">CreateSharedHandle(SecurityAttributes?, SharedResourceFlags, string)</h4>
<div class="markdown level1 summary"><p>HRESULT IDXGIResource1::CreateSharedHandle([In, Optional] const SECURITY_ATTRIBUTES* pAttributes,[In] DXGI_SHARED_RESOURCE_FLAGS dwAccess,[In, Optional] const wchar_t* lpName,[Out] void** pHandle)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IntPtr CreateSharedHandle(SecurityAttributes? attributesRef, SharedResourceFlags dwAccess, string lpName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CreateSharedHandle(attributesRef As SecurityAttributes?, dwAccess As SharedResourceFlags, lpName As String) 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="C1.Util.DX.Storage.SecurityAttributes.html">SecurityAttributes</a>?</td>
      <td><span class="parametername">attributesRef</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.DXGI.SharedResourceFlags.html">SharedResourceFlags</a></td>
      <td><span class="parametername">dwAccess</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">lpName</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">IntPtr</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
