Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/Proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gofman <pgofman@codeweavers.com>2021-02-04 04:09:03 +0300
committerAndrew Eikum <aeikum@codeweavers.com>2021-03-31 22:08:10 +0300
commit92b8b209f2d48429062c050003940f3c6330d27c (patch)
tree987f7f7a2f892246c5c75ad7d3469ce90373e37a /vrclient_x64
parent7ef07bb07fb0c85560ae55a9c2f21b12dca63c6c (diff)
vrclient_x64: Translate action manifest path in startup info.
Diffstat (limited to 'vrclient_x64')
-rw-r--r--vrclient_x64/vrclient_x64/json_converter.cpp37
-rw-r--r--vrclient_x64/vrclient_x64/vrclient_main.c14
-rw-r--r--vrclient_x64/vrclient_x64/vrclient_private.h4
-rw-r--r--vrclient_x64/vrclient_x64/winIVRCompositor.c13
4 files changed, 63 insertions, 5 deletions
diff --git a/vrclient_x64/vrclient_x64/json_converter.cpp b/vrclient_x64/vrclient_x64/json_converter.cpp
index 076d95b3..83fd2ec0 100644
--- a/vrclient_x64/vrclient_x64/json_converter.cpp
+++ b/vrclient_x64/vrclient_x64/json_converter.cpp
@@ -106,4 +106,41 @@ char *json_convert_paths(const char *input)
return NULL;
}
+char *json_convert_startup_info(const char *startup_info)
+{
+ char dst_path[PATH_MAX];
+ std::string src_path;
+ Json::Reader reader;
+ Json::Value root;
+ size_t len;
+ char *ret;
+
+ if(!startup_info || !reader.parse(startup_info, root))
+ return NULL;
+
+ if (!root.isMember("action_manifest_path") || !root["action_manifest_path"].isString())
+ return NULL;
+
+ src_path = root["action_manifest_path"].asString();
+ WINE_TRACE("action_manifest_path %s.\n", src_path.c_str());
+
+ if (!vrclient_dos_path_to_unix_path(src_path.c_str(), dst_path))
+ {
+ WINE_ERR("error converting path %s.\n", src_path.c_str());
+ return NULL;
+ }
+ WINE_TRACE("converted path %s.\n", dst_path);
+
+ root["action_manifest_path"] = dst_path;
+
+ Json::FastWriter writer;
+
+ std::string contents(writer.write(root));
+ ret = (char *)malloc(contents.length() + 1);
+ len = contents.copy(ret, contents.length());
+ ret[len] = 0;
+
+ return ret;
+}
+
}
diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c
index 019ea1df..59aa8b59 100644
--- a/vrclient_x64/vrclient_x64/vrclient_main.c
+++ b/vrclient_x64/vrclient_x64/vrclient_main.c
@@ -373,13 +373,19 @@ EVRInitError ivrclientcore_init(EVRInitError (*cpp_func)(void *, EVRApplicationT
void *linux_side, EVRApplicationType application_type, const char *startup_info,
unsigned int version, struct client_core_data *user_data)
{
+ char *startup_info_converted;
EVRInitError error;
TRACE("%p, %#x, %p\n", linux_side, application_type, startup_info);
+ startup_info_converted = json_convert_startup_info(startup_info);
InitializeCriticalSection(&user_data->critical_section);
- error = cpp_func(linux_side, application_type, startup_info);
+ error = cpp_func(linux_side, application_type, startup_info_converted
+ ? startup_info_converted : startup_info);
+
+ free(startup_info_converted);
+
if (error)
WARN("error %#x\n", error);
return error;
@@ -1452,11 +1458,15 @@ uint32_t ivrcompositor_get_vulkan_device_extensions_required(
void *linux_side, VkPhysicalDevice_T *phys_dev, char *value, uint32_t bufsize,
unsigned int version)
{
+ uint32_t ret;
+
load_vk_unwrappers();
phys_dev = get_native_VkPhysicalDevice(phys_dev);
- return cpp_func(linux_side, phys_dev, value, bufsize);
+ ret = cpp_func(linux_side, phys_dev, value, bufsize);
+ TRACE("ret %u, value %s.\n", ret, value);
+ return ret;
}
#pragma pack( push, 8 )
diff --git a/vrclient_x64/vrclient_x64/vrclient_private.h b/vrclient_x64/vrclient_x64/vrclient_private.h
index f0cb8867..b4e0af0e 100644
--- a/vrclient_x64/vrclient_x64/vrclient_private.h
+++ b/vrclient_x64/vrclient_x64/vrclient_private.h
@@ -11,6 +11,9 @@ extern "C" {
#endif
char *json_convert_paths(const char *input);
+char *json_convert_startup_info(const char *startup_info);
+
+bool vrclient_dos_path_to_unix_path(const char *src, char *dst);
#if __cplusplus
}
@@ -48,7 +51,6 @@ typedef struct __winX winX;
void *create_win_interface(const char *name, void *linux_side);
unsigned int vrclient_unix_path_to_dos_path(bool api_result, const char *src, char *dst, uint32_t dst_bytes);
-bool vrclient_dos_path_to_unix_path(const char *src, char *dst);
void *create_LinuxMatchmakingServerListResponse(void *win);
#ifndef __cplusplus
diff --git a/vrclient_x64/vrclient_x64/winIVRCompositor.c b/vrclient_x64/vrclient_x64/winIVRCompositor.c
index eae87067..9116eceb 100644
--- a/vrclient_x64/vrclient_x64/winIVRCompositor.c
+++ b/vrclient_x64/vrclient_x64/winIVRCompositor.c
@@ -302,8 +302,12 @@ void __thiscall winIVRCompositor_IVRCompositor_026_UnlockGLSharedTextureForAcces
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_026_GetVulkanInstanceExtensionsRequired, 12)
uint32_t __thiscall winIVRCompositor_IVRCompositor_026_GetVulkanInstanceExtensionsRequired(winIVRCompositor_IVRCompositor_026 *_this, char * pchValue, uint32_t unBufferSize)
{
+ uint32_t ret;
+
TRACE("%p\n", _this);
- return cppIVRCompositor_IVRCompositor_026_GetVulkanInstanceExtensionsRequired(_this->linux_side, pchValue, unBufferSize);
+ ret = cppIVRCompositor_IVRCompositor_026_GetVulkanInstanceExtensionsRequired(_this->linux_side, pchValue, unBufferSize);
+ TRACE("ret %u, value %s.\n", ret, pchValue);
+ return ret;
}
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_026_GetVulkanDeviceExtensionsRequired, 16)
@@ -1314,7 +1318,12 @@ DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_022_GetVulkanInstanceExte
uint32_t __thiscall winIVRCompositor_IVRCompositor_022_GetVulkanInstanceExtensionsRequired(winIVRCompositor_IVRCompositor_022 *_this, char * pchValue, uint32_t unBufferSize)
{
TRACE("%p\n", _this);
- return cppIVRCompositor_IVRCompositor_022_GetVulkanInstanceExtensionsRequired(_this->linux_side, pchValue, unBufferSize);
+ uint32_t ret;
+
+ TRACE("%p\n", _this);
+ ret = cppIVRCompositor_IVRCompositor_022_GetVulkanInstanceExtensionsRequired(_this->linux_side, pchValue, unBufferSize);
+ TRACE("ret %u, value %s.\n", ret, pchValue);
+ return ret;
}
DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_022_GetVulkanDeviceExtensionsRequired, 16)