vkGetMemoryWin32HandleNV(3)

# vkGetMemoryWin32HandleNV(3) Manual Page

## Name

vkGetMemoryWin32HandleNV - retrieve Win32 handle to a device memory object

Loading… please wait.

## C Specification

To retrieve the handle corresponding to a device memory object created with VkExportMemoryAllocateInfoNV::`handleTypes` set to include `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV` or `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV`, call:

    // Provided by VK_NV_external_memory_win32
    VkResult vkGetMemoryWin32HandleNV(
        VkDevice                                    device,
        VkDeviceMemory                              memory,
        VkExternalMemoryHandleTypeFlagsNV           handleType,
        HANDLE*                                     pHandle);

## Parameters

- `device` is the logical device that owns the memory.

- `memory` is the VkDeviceMemory object.

- `handleType` is a bitmask of VkExternalMemoryHandleTypeFlagBitsNV containing a single bit specifying the type of handle requested.

- `handle` is a pointer to a Windows `HANDLE` in which the handle is returned.

## Description

Valid Usage

- `handleType` must be a flag specified in VkExportMemoryAllocateInfoNV::`handleTypes` when allocating `memory`

Valid Usage (Implicit)

- `device` must be a valid VkDevice handle

- `memory` must be a valid VkDeviceMemory handle

- `handleType` must be a valid combination of VkExternalMemoryHandleTypeFlagBitsNV values

- `handleType` must not be `0`

- `pHandle` must be a valid pointer to a `HANDLE` value

- `memory` must have been created, allocated, or retrieved from `device`

Return Codes

On success, this command returns

  - `VK_SUCCESS`

On failure, this command returns

  - `VK_ERROR_TOO_MANY_OBJECTS`

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

## See Also

VkDevice, VkDeviceMemory, VkExternalMemoryHandleTypeFlagsNV

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0