Skip to content

fix: Broken string cast in Windows GetModuleHandle{A,W} call#4923

Open
0x0ade wants to merge 1 commit intobytecodealliance:mainfrom
0x0ade:fix-win-unicode
Open

fix: Broken string cast in Windows GetModuleHandle{A,W} call#4923
0x0ade wants to merge 1 commit intobytecodealliance:mainfrom
0x0ade:fix-win-unicode

Conversation

@0x0ade
Copy link
Copy Markdown

@0x0ade 0x0ade commented Apr 23, 2026

GetModuleHandle can end up calling either the A (default chars / ANSI) or W (2-byte wide chars / UTF-16) variant, which requires its parameter to be the matching type. The current implementation interprets a 1-byte-per-char string as LPCTSTR, instead of using the TEXT macro, which properly passes the string as either ANSI or UTF-16 (string prefixed with L), depending on the UNICODE preprocessor definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant