// refBegin VkImportMemoryWin32HandleInfoNV - import Win32 memory created on the same physical device

To import memory created on the same physical device but outside of the
current Vulkan instance, add a slink:VkImportMemoryWin32HandleInfoNV
structure to the pname:pNext chain of the slink:VkMemoryAllocateInfo
structure, specifying a handle to and the type of the memory.

The sname:VkImportMemoryWin32HandleInfoNV structure is defined as:

include::../../api/structs/VkImportMemoryWin32HandleInfoNV.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to an extension-specific structure.
  * pname:handleType is `0` or a bit specifying the type of memory handle in
    pname:handle.
    See elink:VkExternalMemoryHandleTypeFlagBitsNV below for a description
    of the supported bits.
  * pname:handle is a Windows code:HANDLE referring to the memory.

If pname:handleType is `0`, this structure is ignored by consumers of the
slink:VkMemoryAllocateInfo structure it is chained from.

.Valid Usage
****
  * [[VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327]]
    pname:handleType must: not have more than one bit set.
  * [[VUID-VkImportMemoryWin32HandleInfoNV-handle-01328]]
    pname:handle must: be a valid handle to memory, obtained as specified by
    pname:handleType.
****

include::../../validity/structs/VkImportMemoryWin32HandleInfoNV.txt[]

Bits which can: be set in pname:handleType are:

// refBegin VkExternalMemoryHandleTypeFlagBitsNV - Bitmask specifying external memory handle types
include::../../api/enums/VkExternalMemoryHandleTypeFlagBitsNV.txt[]

  * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV or
    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV indicate a
    handle to memory returned by flink:vkGetMemoryWin32HandleNV or, in the
    case of ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV, one
    duplicated from such a handle using `DuplicateHandle()`.
  * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV indicates a
    valid NT handle to memory returned by
    `IDXGIResource1::ftext:CreateSharedHandle()`, or a handle duplicated
    from such a handle using `DuplicateHandle()`.
  * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV indicates a
    handle to memory returned by `IDXGIResource::GetSharedHandle()`.

ifdef::editing-notes[]
[NOTE]
.editing-note
==================
(Jon) If additional (non-Win32) bits are added to the possible memory types,
this type should move to the `VK_NV_external_memory_capabilities` section,
and each bit would then be protected by ifdefs for the extension it's
defined by.
==================
endif::editing-notes[]

// refEnd VkExternalMemoryHandleTypeFlagBitsNV
