[Windows] Switched to wmain to accept non-ascii characters from command line by AndreaMarangoni · Pull Request #8519 · osquery/osquery

@AndreaMarangoni

Fixes #7923

From this #7923 (comment) I implemented solution 1, switching from main to wmain, as the quickest and cleanest to implement.

@AndreaMarangoni

@AndreaMarangoni

@zwass

These changes make sense to me, but when I tried testing on my Windows VM it still crashed with the ä character as in the bug report.

Did it work for you @AndreaMarangoni? If so, I will try doing it again to see if I may have made a mistake in my testing.

@AndreaMarangoni

@AndreaMarangoni

These changes make sense to me, but when I tried testing on my Windows VM it still crashed with the ä character as in the bug report.

Did it work for you @AndreaMarangoni? If so, I will try doing it again to see if I may have made a mistake in my testing.

No you were right. The linkage to wmain was actually broken and it was calling main still. My testing was right, but then realised I was linking wmain everywhere. So I reduced the scope of /ENTRY:wmain... to only osqueryd target before re-testing, without realising the linkage was actually broken. Maybe a good idea would have been to rename the main function to something else.
Thank you for testing it!
Now it should work fine.

zwass

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working for me now, thanks!