diff --git a/vrclient_x64/gen_wrapper.py b/vrclient_x64/gen_wrapper.py index bdd93fac..1b8d3f18 100755 --- a/vrclient_x64/gen_wrapper.py +++ b/vrclient_x64/gen_wrapper.py @@ -99,7 +99,83 @@ path_conversions = [ "w2l_names": ["pchActionManifestPath"], "w2l_arrays": [False], "return_is_size": False - } + }, + { + "parent_name": "SetOverlayFromFile", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchFilePath"], + "w2l_arrays": [False], + "return_is_size": False + }, + { + "parent_name": "AddApplicationManifest", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchApplicationManifestFullPath"], + "w2l_arrays": [False], + "return_is_size": False + }, + { + "parent_name": "RemoveApplicationManifest", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchApplicationManifestFullPath"], + "w2l_arrays": [False], + "return_is_size": False + }, + { + "parent_name": "RequestScreenshot", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchPreviewFilename", "pchVRFilename"], + "w2l_arrays": [False, False], + "return_is_size": False + }, + { + "parent_name": "TakeStereoScreenshot", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchPreviewFilename", "pchVRFilename"], + "w2l_arrays": [False, False], + "return_is_size": False + }, + { + "parent_name": "SubmitScreenshot", + "l2w_names":[], + "l2w_lens":[], + "w2l_names": ["pchSourcePreviewFilename", "pchSourceVRFilename"], + "w2l_arrays": [False, False], + "return_is_size": False + }, + { + "parent_name": "GetScreenshotPropertyFilename", + "l2w_names":["pchFilename"], + "l2w_lens":["cchFilename"], + "w2l_names": [], + "w2l_arrays": [], + "return_is_size": True + }, +# {#maybe? +# "parent_name": "GetRenderModelOriginalPath", +# "l2w_names":[pchOriginalPath], +# "l2w_lens":[unOriginalPathLen], +# "w2l_names": [], +# "w2l_arrays": [], +# "return_is_size": False +# }, +# {#maybe? +# "parent_name": "GetResourceFullPath", +# "l2w_names":[pchPathBuffer], +# "l2w_lens":[unBufferLen], +# "w2l_names": [pchResourceTypeDirectory], +# "w2l_arrays": [False], +# "return_is_size": False +# }, + #IVRInput::GetInputSourceHandle + #IVRIOBuffer::Open + + #TODO: LaunchInternalProcess, need steam cooperation ] aliases = { @@ -314,16 +390,16 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e if path_conv: for i in range(len(path_conv["w2l_names"])): if path_conv["w2l_arrays"][i]: - cfile.write(" const char **lin_%s = steamclient_dos_to_unix_stringlist(%s);\n" % (path_conv["w2l_names"][i], path_conv["w2l_names"][i])) + cfile.write(" const char **lin_%s = vrclient_dos_to_unix_stringlist(%s);\n" % (path_conv["w2l_names"][i], path_conv["w2l_names"][i])) # TODO pass else: cfile.write(" char lin_%s[PATH_MAX];\n" % path_conv["w2l_names"][i]) - cfile.write(" steamclient_dos_path_to_unix_path(%s, lin_%s);\n" % (path_conv["w2l_names"][i], path_conv["w2l_names"][i])) + cfile.write(" vrclient_dos_path_to_unix_path(%s, lin_%s);\n" % (path_conv["w2l_names"][i], path_conv["w2l_names"][i])) if None in path_conv["l2w_names"]: cfile.write(" const char *path_result;\n") elif path_conv["return_is_size"]: - cfile.write(" uint32 path_result;\n") + cfile.write(" uint32_t path_result;\n") elif len(path_conv["l2w_names"]) > 0: cfile.write(" %s path_result;\n" % method.result_type.spelling) @@ -430,12 +506,12 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e cfile.write(" ") if path_conv["return_is_size"]: cfile.write("path_result = ") - cfile.write("steamclient_unix_path_to_dos_path(path_result, %s, %s, %s);\n" % (path_conv["l2w_names"][i], path_conv["l2w_names"][i], path_conv["l2w_lens"][i])) + cfile.write("vrclient_unix_path_to_dos_path(path_result, %s, %s, %s);\n" % (path_conv["l2w_names"][i], path_conv["l2w_names"][i], path_conv["l2w_lens"][i])) cfile.write(" return path_result;\n") if path_conv: for i in range(len(path_conv["w2l_names"])): if path_conv["w2l_arrays"][i]: - cfile.write(" steamclient_free_stringlist(lin_%s);\n" % path_conv["w2l_names"][i]) + cfile.write(" vrclient_free_stringlist(lin_%s);\n" % path_conv["w2l_names"][i]) if do_lin_to_win: cpp.write(" struct_%s_%s_lin_to_win(&lin, %s);\n" % (strip_ns(do_lin_to_win[0]), display_sdkver(sdkver), do_lin_to_win[1])) cpp.write(" return _ret;\n") diff --git a/vrclient_x64/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_x64/vrclient_main.c index f5ce0ae7..bec2537f 100644 --- a/vrclient_x64/vrclient_x64/vrclient_main.c +++ b/vrclient_x64/vrclient_x64/vrclient_main.c @@ -52,10 +52,40 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) return TRUE; } +/* returns the number of bytes written to dst, not including the NUL terminator */ +unsigned int vrclient_unix_path_to_dos_path(bool api_result, const char *src, char *dst, uint32_t dst_bytes) +{ + WCHAR *dosW; + uint32_t r; + + if(!dst || !dst_bytes) + return 0; + + if(!src || !api_result){ + *dst = 0; + return 0; + } + + dosW = wine_get_dos_file_name(src); + *dst = 0; + + if(!dosW){ + WARN("Unable to convert unix filename to DOS: %s\n", src); + return 0; + } + + r = WideCharToMultiByte(CP_ACP, 0, dosW, -1, dst, dst_bytes, + NULL, NULL); + + HeapFree(GetProcessHeap(), 0, dosW); + + return r == 0 ? 0 : r - 1; +} + #define IS_ABSOLUTE(x) (*x == '/' || *x == '\\' || (*x && *(x + 1) == ':')) /* returns non-zero on success, zero on failure */ -bool steamclient_dos_path_to_unix_path(const char *src, char *dst) +bool vrclient_dos_path_to_unix_path(const char *src, char *dst) { *dst = 0; diff --git a/vrclient_x64/vrclient_x64/vrclient_private.h b/vrclient_x64/vrclient_x64/vrclient_private.h index 9ef5c689..93b3ac06 100644 --- a/vrclient_x64/vrclient_x64/vrclient_private.h +++ b/vrclient_x64/vrclient_x64/vrclient_private.h @@ -37,8 +37,8 @@ typedef struct __winX winX; typedef struct __winX winX; void *create_win_interface(const char *name, void *linux_side); -unsigned int steamclient_unix_path_to_dos_path(unsigned int api_result, char *inout, unsigned int inout_bytes); -bool steamclient_dos_path_to_unix_path(const char *src, char *dst); +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/winIVRApplications.c b/vrclient_x64/vrclient_x64/winIVRApplications.c index 8496eb31..e2ed03ca 100644 --- a/vrclient_x64/vrclient_x64/winIVRApplications.c +++ b/vrclient_x64/vrclient_x64/winIVRApplications.c @@ -28,15 +28,19 @@ typedef struct __winIVRApplications_IVRApplications_006 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_006_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_006_AddApplicationManifest(winIVRApplications_IVRApplications_006 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_006_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_006_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_006_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_006_RemoveApplicationManifest(winIVRApplications_IVRApplications_006 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_006_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_006_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_006_IsApplicationInstalled, 12) @@ -364,15 +368,19 @@ typedef struct __winIVRApplications_IVRApplications_005 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_005_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_005_AddApplicationManifest(winIVRApplications_IVRApplications_005 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_005_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_005_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_005_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_005_RemoveApplicationManifest(winIVRApplications_IVRApplications_005 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_005_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_005_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_005_IsApplicationInstalled, 12) @@ -637,15 +645,19 @@ typedef struct __winIVRApplications_IVRApplications_004 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_004_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_004_AddApplicationManifest(winIVRApplications_IVRApplications_004 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_004_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_004_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_004_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_004_RemoveApplicationManifest(winIVRApplications_IVRApplications_004 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_004_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_004_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_004_IsApplicationInstalled, 12) @@ -901,15 +913,19 @@ typedef struct __winIVRApplications_IVRApplications_003 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_003_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_003_AddApplicationManifest(winIVRApplications_IVRApplications_003 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_003_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_003_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_003_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_003_RemoveApplicationManifest(winIVRApplications_IVRApplications_003 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_003_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_003_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_003_IsApplicationInstalled, 12) @@ -1147,15 +1163,19 @@ typedef struct __winIVRApplications_IVRApplications_002 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_002_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_002_AddApplicationManifest(winIVRApplications_IVRApplications_002 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_002_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_002_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_002_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_002_RemoveApplicationManifest(winIVRApplications_IVRApplications_002 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_002_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_002_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_002_IsApplicationInstalled, 12) @@ -1384,15 +1404,19 @@ typedef struct __winIVRApplications_IVRApplications_001 { DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_001_AddApplicationManifest, 13) EVRApplicationError __thiscall winIVRApplications_IVRApplications_001_AddApplicationManifest(winIVRApplications_IVRApplications_001 *_this, const char * pchApplicationManifestFullPath, bool bTemporary) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_001_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath, bTemporary); + return cppIVRApplications_IVRApplications_001_AddApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL, bTemporary); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_001_RemoveApplicationManifest, 12) EVRApplicationError __thiscall winIVRApplications_IVRApplications_001_RemoveApplicationManifest(winIVRApplications_IVRApplications_001 *_this, const char * pchApplicationManifestFullPath) { + char lin_pchApplicationManifestFullPath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchApplicationManifestFullPath, lin_pchApplicationManifestFullPath); TRACE("%p\n", _this); - return cppIVRApplications_IVRApplications_001_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath); + return cppIVRApplications_IVRApplications_001_RemoveApplicationManifest(_this->linux_side, pchApplicationManifestFullPath ? lin_pchApplicationManifestFullPath : NULL); } DEFINE_THISCALL_WRAPPER(winIVRApplications_IVRApplications_001_IsApplicationInstalled, 12) diff --git a/vrclient_x64/vrclient_x64/winIVRCompositor.c b/vrclient_x64/vrclient_x64/winIVRCompositor.c index 9712473d..290ee8bb 100644 --- a/vrclient_x64/vrclient_x64/winIVRCompositor.c +++ b/vrclient_x64/vrclient_x64/winIVRCompositor.c @@ -5952,8 +5952,10 @@ void __thiscall winIVRCompositor_IVRCompositor_005_SetOverlayRaw(winIVRComposito DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_005_SetOverlayFromFile, 20) void __thiscall winIVRCompositor_IVRCompositor_005_SetOverlayFromFile(winIVRCompositor_IVRCompositor_005 *_this, const char * pchFilePath, Compositor_OverlaySettings * pSettings) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - cppIVRCompositor_IVRCompositor_005_SetOverlayFromFile(_this->linux_side, pchFilePath, pSettings); + cppIVRCompositor_IVRCompositor_005_SetOverlayFromFile(_this->linux_side, pchFilePath ? lin_pchFilePath : NULL, pSettings); } DEFINE_THISCALL_WRAPPER(winIVRCompositor_IVRCompositor_005_ClearOverlay, 4) diff --git a/vrclient_x64/vrclient_x64/winIVRInput.c b/vrclient_x64/vrclient_x64/winIVRInput.c index 276667f0..a1b5da9d 100644 --- a/vrclient_x64/vrclient_x64/winIVRInput.c +++ b/vrclient_x64/vrclient_x64/winIVRInput.c @@ -29,7 +29,7 @@ DEFINE_THISCALL_WRAPPER(winIVRInput_IVRInput_005_SetActionManifestPath, 12) EVRInputError __thiscall winIVRInput_IVRInput_005_SetActionManifestPath(winIVRInput_IVRInput_005 *_this, const char * pchActionManifestPath) { char lin_pchActionManifestPath[PATH_MAX]; - steamclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); + vrclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); TRACE("%p\n", _this); return cppIVRInput_IVRInput_005_SetActionManifestPath(_this->linux_side, pchActionManifestPath ? lin_pchActionManifestPath : NULL); } @@ -304,7 +304,7 @@ DEFINE_THISCALL_WRAPPER(winIVRInput_IVRInput_004_SetActionManifestPath, 12) EVRInputError __thiscall winIVRInput_IVRInput_004_SetActionManifestPath(winIVRInput_IVRInput_004 *_this, const char * pchActionManifestPath) { char lin_pchActionManifestPath[PATH_MAX]; - steamclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); + vrclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); TRACE("%p\n", _this); return cppIVRInput_IVRInput_004_SetActionManifestPath(_this->linux_side, pchActionManifestPath ? lin_pchActionManifestPath : NULL); } @@ -525,7 +525,7 @@ DEFINE_THISCALL_WRAPPER(winIVRInput_IVRInput_003_SetActionManifestPath, 12) EVRInputError __thiscall winIVRInput_IVRInput_003_SetActionManifestPath(winIVRInput_IVRInput_003 *_this, const char * pchActionManifestPath) { char lin_pchActionManifestPath[PATH_MAX]; - steamclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); + vrclient_dos_path_to_unix_path(pchActionManifestPath, lin_pchActionManifestPath); TRACE("%p\n", _this); return cppIVRInput_IVRInput_003_SetActionManifestPath(_this->linux_side, pchActionManifestPath ? lin_pchActionManifestPath : NULL); } diff --git a/vrclient_x64/vrclient_x64/winIVROverlay.c b/vrclient_x64/vrclient_x64/winIVROverlay.c index a1f956c2..9d1d4bdf 100644 --- a/vrclient_x64/vrclient_x64/winIVROverlay.c +++ b/vrclient_x64/vrclient_x64/winIVROverlay.c @@ -455,8 +455,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_019_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_019_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_019_SetOverlayFromFile(winIVROverlay_IVROverlay_019 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_019_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_019_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_019_GetOverlayTexture, 76) @@ -1250,8 +1252,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_018_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_018_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_018_SetOverlayFromFile(winIVROverlay_IVROverlay_018 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_018_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_018_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_018_GetOverlayTexture, 76) @@ -2052,8 +2056,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_017_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_017_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_017_SetOverlayFromFile(winIVROverlay_IVROverlay_017 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_017_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_017_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_017_GetOverlayTexture, 76) @@ -2842,8 +2848,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_016_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_016_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_016_SetOverlayFromFile(winIVROverlay_IVROverlay_016 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_016_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_016_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_016_GetOverlayTexture, 76) @@ -3593,8 +3601,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_014_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_014_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_014_SetOverlayFromFile(winIVROverlay_IVROverlay_014 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_014_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_014_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_014_GetOverlayTexture, 76) @@ -4325,8 +4335,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_013_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_013_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_013_SetOverlayFromFile(winIVROverlay_IVROverlay_013 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_013_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_013_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_013_GetOverlayTexture, 68) @@ -5011,8 +5023,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_012_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_012_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_012_SetOverlayFromFile(winIVROverlay_IVROverlay_012 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_012_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_012_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_012_GetOverlayTexture, 68) @@ -5680,8 +5694,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_011_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_011_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_011_SetOverlayFromFile(winIVROverlay_IVROverlay_011 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_011_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_011_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_011_GetOverlayTexture, 68) @@ -6326,8 +6342,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_010_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_010_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_010_SetOverlayFromFile(winIVROverlay_IVROverlay_010 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_010_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_010_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_010_CreateDashboardOverlay, 36) @@ -6936,8 +6954,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_008_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_008_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_008_SetOverlayFromFile(winIVROverlay_IVROverlay_008 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_008_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_008_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_008_CreateDashboardOverlay, 36) @@ -7526,8 +7546,10 @@ EVROverlayError __thiscall winIVROverlay_IVROverlay_007_SetOverlayRaw(winIVROver DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_007_SetOverlayFromFile, 20) EVROverlayError __thiscall winIVROverlay_IVROverlay_007_SetOverlayFromFile(winIVROverlay_IVROverlay_007 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_007_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_007_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_007_CreateDashboardOverlay, 36) @@ -8068,8 +8090,10 @@ VROverlayError __thiscall winIVROverlay_IVROverlay_005_SetOverlayRaw(winIVROverl DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_005_SetOverlayFromFile, 20) VROverlayError __thiscall winIVROverlay_IVROverlay_005_SetOverlayFromFile(winIVROverlay_IVROverlay_005 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_005_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_005_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_005_CreateDashboardOverlay, 36) @@ -8586,8 +8610,10 @@ VROverlayError __thiscall winIVROverlay_IVROverlay_004_SetOverlayRaw(winIVROverl DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_004_SetOverlayFromFile, 20) VROverlayError __thiscall winIVROverlay_IVROverlay_004_SetOverlayFromFile(winIVROverlay_IVROverlay_004 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_004_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_004_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_004_CreateDashboardOverlay, 36) @@ -9061,8 +9087,10 @@ VROverlayError __thiscall winIVROverlay_IVROverlay_003_SetOverlayRaw(winIVROverl DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_003_SetOverlayFromFile, 20) VROverlayError __thiscall winIVROverlay_IVROverlay_003_SetOverlayFromFile(winIVROverlay_IVROverlay_003 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_003_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_003_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_003_CreateDashboardOverlay, 36) @@ -9511,8 +9539,10 @@ VROverlayError __thiscall winIVROverlay_IVROverlay_002_SetOverlayRaw(winIVROverl DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_002_SetOverlayFromFile, 20) VROverlayError __thiscall winIVROverlay_IVROverlay_002_SetOverlayFromFile(winIVROverlay_IVROverlay_002 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_002_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_002_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_002_CreateDashboardOverlay, 36) @@ -9939,8 +9969,10 @@ VROverlayError __thiscall winIVROverlay_IVROverlay_001_SetOverlayRaw(winIVROverl DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_001_SetOverlayFromFile, 20) VROverlayError __thiscall winIVROverlay_IVROverlay_001_SetOverlayFromFile(winIVROverlay_IVROverlay_001 *_this, VROverlayHandle_t ulOverlayHandle, const char * pchFilePath) { + char lin_pchFilePath[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchFilePath, lin_pchFilePath); TRACE("%p\n", _this); - return cppIVROverlay_IVROverlay_001_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath); + return cppIVROverlay_IVROverlay_001_SetOverlayFromFile(_this->linux_side, ulOverlayHandle, pchFilePath ? lin_pchFilePath : NULL); } DEFINE_THISCALL_WRAPPER(winIVROverlay_IVROverlay_001_IsSystemOverlayVisible, 4) diff --git a/vrclient_x64/vrclient_x64/winIVRScreenshots.c b/vrclient_x64/vrclient_x64/winIVRScreenshots.c index bdcdd5bc..f41cb08f 100644 --- a/vrclient_x64/vrclient_x64/winIVRScreenshots.c +++ b/vrclient_x64/vrclient_x64/winIVRScreenshots.c @@ -28,8 +28,12 @@ typedef struct __winIVRScreenshots_IVRScreenshots_001 { DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_RequestScreenshot, 32) EVRScreenshotError __thiscall winIVRScreenshots_IVRScreenshots_001_RequestScreenshot(winIVRScreenshots_IVRScreenshots_001 *_this, ScreenshotHandle_t * pOutScreenshotHandle, EVRScreenshotType type, const char * pchPreviewFilename, const char * pchVRFilename) { + char lin_pchPreviewFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchPreviewFilename, lin_pchPreviewFilename); + char lin_pchVRFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchVRFilename, lin_pchVRFilename); TRACE("%p\n", _this); - return cppIVRScreenshots_IVRScreenshots_001_RequestScreenshot(_this->linux_side, pOutScreenshotHandle, type, pchPreviewFilename, pchVRFilename); + return cppIVRScreenshots_IVRScreenshots_001_RequestScreenshot(_this->linux_side, pOutScreenshotHandle, type, pchPreviewFilename ? lin_pchPreviewFilename : NULL, pchVRFilename ? lin_pchVRFilename : NULL); } DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_HookScreenshot, 16) @@ -49,8 +53,11 @@ EVRScreenshotType __thiscall winIVRScreenshots_IVRScreenshots_001_GetScreenshotP DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_GetScreenshotPropertyFilename, 32) uint32_t __thiscall winIVRScreenshots_IVRScreenshots_001_GetScreenshotPropertyFilename(winIVRScreenshots_IVRScreenshots_001 *_this, ScreenshotHandle_t screenshotHandle, EVRScreenshotPropertyFilenames filenameType, char * pchFilename, uint32_t cchFilename, EVRScreenshotError * pError) { + uint32_t path_result; TRACE("%p\n", _this); - return cppIVRScreenshots_IVRScreenshots_001_GetScreenshotPropertyFilename(_this->linux_side, screenshotHandle, filenameType, pchFilename, cchFilename, pError); + path_result = cppIVRScreenshots_IVRScreenshots_001_GetScreenshotPropertyFilename(_this->linux_side, screenshotHandle, filenameType, pchFilename, cchFilename, pError); + path_result = vrclient_unix_path_to_dos_path(path_result, pchFilename, pchFilename, cchFilename); + return path_result; } DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_UpdateScreenshotProgress, 12) @@ -63,15 +70,23 @@ EVRScreenshotError __thiscall winIVRScreenshots_IVRScreenshots_001_UpdateScreens DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_TakeStereoScreenshot, 28) EVRScreenshotError __thiscall winIVRScreenshots_IVRScreenshots_001_TakeStereoScreenshot(winIVRScreenshots_IVRScreenshots_001 *_this, ScreenshotHandle_t * pOutScreenshotHandle, const char * pchPreviewFilename, const char * pchVRFilename) { + char lin_pchPreviewFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchPreviewFilename, lin_pchPreviewFilename); + char lin_pchVRFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchVRFilename, lin_pchVRFilename); TRACE("%p\n", _this); - return cppIVRScreenshots_IVRScreenshots_001_TakeStereoScreenshot(_this->linux_side, pOutScreenshotHandle, pchPreviewFilename, pchVRFilename); + return cppIVRScreenshots_IVRScreenshots_001_TakeStereoScreenshot(_this->linux_side, pOutScreenshotHandle, pchPreviewFilename ? lin_pchPreviewFilename : NULL, pchVRFilename ? lin_pchVRFilename : NULL); } DEFINE_THISCALL_WRAPPER(winIVRScreenshots_IVRScreenshots_001_SubmitScreenshot, 28) EVRScreenshotError __thiscall winIVRScreenshots_IVRScreenshots_001_SubmitScreenshot(winIVRScreenshots_IVRScreenshots_001 *_this, ScreenshotHandle_t screenshotHandle, EVRScreenshotType type, const char * pchSourcePreviewFilename, const char * pchSourceVRFilename) { + char lin_pchSourcePreviewFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchSourcePreviewFilename, lin_pchSourcePreviewFilename); + char lin_pchSourceVRFilename[PATH_MAX]; + vrclient_dos_path_to_unix_path(pchSourceVRFilename, lin_pchSourceVRFilename); TRACE("%p\n", _this); - return cppIVRScreenshots_IVRScreenshots_001_SubmitScreenshot(_this->linux_side, screenshotHandle, type, pchSourcePreviewFilename, pchSourceVRFilename); + return cppIVRScreenshots_IVRScreenshots_001_SubmitScreenshot(_this->linux_side, screenshotHandle, type, pchSourcePreviewFilename ? lin_pchSourcePreviewFilename : NULL, pchSourceVRFilename ? lin_pchSourceVRFilename : NULL); } extern vtable_ptr winIVRScreenshots_IVRScreenshots_001_vtable;