You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(windows): use wide Win32 APIs for runtime library paths (non-ASCII path support) (#68)
* fix(windows): use wide Win32 APIs for runtime library paths
The launchers convert paths to UTF-8 (GetModuleFileNameW / CommandLineToArgvW -> WideCharToMultiByte(CP_UTF8)) but then passed them to ANSI APIs (GetFileAttributesA / LoadLibraryA / GetEnvironmentVariableA), which reinterpret the bytes in the active codepage. Any non-ASCII character in the bundle path (e.g. a Japanese user profile) broke colocated runtime detection, --runtime, and LAUFEY_RUNTIME_PATH. Convert back to UTF-16 and use the wide APIs instead. Fixes the launch failure reported in denoland/deno#36591.
* fix(windows): finish the wide-API sweep and share one UTF-8/UTF-16 helper
Review follow-ups for the runtime-path Unicode fix:
- Export Utf8ToWide/WideToUtf8 from backend-common (new strings_win.cc)
and delete the seven local copies in cef/webview runtime loaders,
webview_windows.cc, and the backend-common *_win.cc files.
- cef: build the CEF cache path with GetTempPathW (checked) instead of
unchecked GetTempPathA, whose ANSI bytes garble non-ASCII profile
names once CefString decodes them as UTF-8.
- cef: read LAUFEY_REMOTE_DEBUGGING_PORT wide with an upper bound on
the returned length; the old '> 0' check passed on the required-size
return and atoi() then parsed uninitialized stack.
- cef/webview: re-query LAUFEY_RUNTIME_PATH with a grown buffer when
the value is MAX_PATH or longer instead of silently dropping it.
- cef: accept --runtime=<path> on Windows too (Linux/macOS already do,
and the Rust launcher emits that form).
- cef: show a MessageBoxW with the attempted path when the runtime
fails to load; the WIN32-subsystem binary's stderr is detached.
- webview: probe the fallback DLL candidates with GetFileAttributesW
and use MessageBoxW consistently for the error dialogs.
* ci: clang-format
---------
Co-authored-by: mogwai-dev <mogwai-dev@users.noreply.github.com>
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
0 commit comments