From 926f2ef2a07c2f74ce3b08a0fc9199a299f73e8b Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Sat, 16 Aug 2025 19:18:15 -0700 Subject: [PATCH] ddr: enclose file path in quotes & use wchar when registering codecs (#354) ## Link to GitHub Issue, if one exists #345 ## Description of change Account for the path to codec DLL having spaces in it and use wide chars. ## Testing Testing 32 and 64 bits. --- src/spice2x/games/ddr/ddr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/spice2x/games/ddr/ddr.cpp b/src/spice2x/games/ddr/ddr.cpp index efb1a6c..2d5f17c 100644 --- a/src/spice2x/games/ddr/ddr.cpp +++ b/src/spice2x/games/ddr/ddr.cpp @@ -84,11 +84,12 @@ namespace games::ddr { log_info("ddr", "found DLL: {}", filename.string()); if (filename == "k-clvsd.dll" || filename.string().find("xactengine") == 0) { - const std::string cmd = "regsvr32.exe /s " + file.path().string(); - + const std::wstring wcmd = L"regsvr32.exe /s \"" + file.path().wstring() + L"\""; + const std::string cmd = "regsvr32.exe /s \"" + file.path().string() + "\""; + int result = 0; - std::thread t([cmd, &result]() { - result = system(cmd.c_str()); + std::thread t([wcmd, &result]() { + result = _wsystem(wcmd.c_str()); }); t.join(); log_info("ddr", "`{}` returned {}", cmd, result);