Skip to content
Discussion options

You must be logged in to vote

@small18 Thanks, this is a pretty good reason why. I'll go through the code and point out the problems.

	wchar_t plugin_path[MAX_PATH] = {};
	GetModuleFileNameW(g_plugin_module, plugin_path, MAX_PATH);

Two problems here. First, do not assume windows APIs are wide-character. (AI models absolutely love doing this, but MS's own advice states that you should NOT do this, nor should you mix them.) Always always always use the macros (in this case, GetModuleFileName, LoadLibrary, etc.), which will resolve to the correct functions that you should call. Second, GetModuleFileNameA/GetModuleFileNameW return an error code, so check that! Literally all of your wide-character code which follows from t…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by small18
Comment options

You must be logged in to vote
1 reply
@small18
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #81 on July 20, 2026 16:06.