mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-14 15:48:11 +03:00
vrclient_x64: Translate action manifest path in startup info.
This commit is contained in:
parent
7ef07bb07f
commit
92b8b209f2
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 )
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user