mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-31 19:08:30 +00:00
u_handles: Add Win32 handle utilities
This commit is contained in:
parent
5522c7317a
commit
835beedcca
|
@ -43,6 +43,28 @@ ref_graphics_handle(xrt_graphics_buffer_handle_t handle)
|
||||||
return dup(handle);
|
return dup(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_WIN32_HANDLE)
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
release_graphics_handle(xrt_graphics_buffer_handle_t handle)
|
||||||
|
{
|
||||||
|
CloseHandle(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline xrt_graphics_buffer_handle_t
|
||||||
|
ref_graphics_handle(xrt_graphics_buffer_handle_t handle)
|
||||||
|
{
|
||||||
|
HANDLE self = GetCurrentProcess();
|
||||||
|
HANDLE result = NULL;
|
||||||
|
if (DuplicateHandle(self, handle, self, &result, 0, FALSE,
|
||||||
|
DUPLICATE_SAME_ACCESS) != 0) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error "need port"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xrt_graphics_buffer_handle_t
|
xrt_graphics_buffer_handle_t
|
||||||
|
|
Loading…
Reference in a new issue