Hacker News new | ask | show | jobs
by brokenparser 4967 days ago
What appears to be missing is the automatic mapping of the A (ansi) and W (wide) suffixed function names to conventional unsuffixed function names. In C, this is done using macros. If UNICODE is not defined, the macro MessageBoxEx would expand to MessageBoxExA. With UNICODE, the macro expands to MessageBoxExW. Similarly, TEXT is used to wrap strings to ensure they're unprefixed or prefixed with an L respectively. You could do this by hand, it's just a bit more tedious to write.
1 comments

One would wish these distinctions could be forgotten with calling the Win32api from JS. However, that is a pipe dream and could have an impact on performance.
You can forget the distinctions without impacting performance if your JavaScript engine uses UTF-16, because that's the native encoding of Windows NT 5.0+. You'll still get overhead when working with binary data, Typed Array or not.