From 9acae7b80b9de3958f2b554f2151d82b7fdf6517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 21 Nov 2024 14:11:50 +0100 Subject: [PATCH] steam_helper: Remove now unnecessary OpenXR registry initialization. CW-Bug-Id: #24510 --- steam_helper/steam.cpp | 52 ++++++------------------------------------ 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/steam_helper/steam.cpp b/steam_helper/steam.cpp index 4c2995ad..77e156b8 100644 --- a/steam_helper/steam.cpp +++ b/steam_helper/steam.cpp @@ -445,7 +445,6 @@ static void *get_winevulkan_unix_lib_handle(HMODULE hvulkan) static DWORD WINAPI initialize_vr_data(void *arg) { - int (WINAPI *p__wineopenxr_get_extensions_internal)(char **instance_extensions, char **device_extensions, uint32_t *physdev_vid, uint32_t *physdev_pid); vr::IVRClientCore* (*vrclient_VRClientCoreFactory)(const char *name, int *return_code); uint32_t instance_extensions_count, device_count; VkPhysicalDevice *phys_devices = NULL; @@ -455,7 +454,6 @@ static DWORD WINAPI initialize_vr_data(void *arg) VkApplicationInfo app_info = {}; char *buffer = NULL, *new_buffer; vr::IVRClientCore* client_core; - char *xr_inst_ext, *xr_dev_ext; vr::IVRCompositor* compositor; VkInstance vk_instance = NULL; BOOL vr_initialized = FALSE; @@ -645,51 +643,15 @@ static DWORD WINAPI initialize_vr_data(void *arg) vr_initialized = FALSE; } - if ((hwineopenxr = LoadLibraryA("wineopenxr.dll"))) - { - p__wineopenxr_get_extensions_internal = reinterpret_cast - (GetProcAddress(hwineopenxr, "__wineopenxr_get_extensions_internal")); - if (p__wineopenxr_get_extensions_internal) - { - uint32_t vid, pid; - if (!p__wineopenxr_get_extensions_internal(&xr_inst_ext, &xr_dev_ext, &vid, &pid)) - { - WINE_TRACE("Got XR extensions.\n"); - if ((status = RegSetValueExA(vr_key, "openxr_vulkan_instance_extensions", 0, REG_SZ, - (BYTE *)xr_inst_ext, strlen(xr_inst_ext) + 1))) - { - WINE_ERR("Could not set openxr_vulkan_instance_extensions value, status %#x.\n", status); - goto done; - } - if ((status = RegSetValueExA(vr_key, "openxr_vulkan_device_extensions", 0, REG_SZ, - (BYTE *)xr_dev_ext, strlen(xr_dev_ext) + 1))) - { - WINE_ERR("Could not set openxr_vulkan_device_extensions value, status %#x.\n", status); - goto done; - } - if ((status = RegSetValueExA(vr_key, "openxr_vulkan_device_vid", 0, REG_DWORD, - (BYTE *)&vid, sizeof(vid)))) - { - WINE_ERR("Could not set openxr_vulkan_device_vid value, status %#x.\n", status); - goto done; - } - if ((status = RegSetValueExA(vr_key, "openxr_vulkan_device_pid", 0, REG_DWORD, - (BYTE *)&pid, sizeof(pid)))) - { - WINE_ERR("Could not set openxr_vulkan_device_pid value, status %#x.\n", status); - goto done; - } - } - } - else - { - WINE_ERR("__wineopenxr_get_extensions_internal not found in wineopenxr.dll.\n"); - } - FreeLibrary(hwineopenxr); - } + if (!(hwineopenxr = LoadLibraryA("wineopenxr.dll"))) WARN("Could not load wineopenxr.dll, err %u.\n", GetLastError()); else { - WINE_WARN("Could not load wineopenxr.dll, err %u.\n", GetLastError()); + BOOL (CDECL *init)(void); + + if ((init = (decltype(init))GetProcAddress(hwineopenxr, "wineopenxr_init_registry"))) init(); + else ERR("Failed to find wineopenxr_init_registry export\n"); + + FreeLibrary(hwineopenxr); } vr_status = 1;