Both handling is compliant. The Unicode specs allow signaling an error, removing the invalid code, or replacing it with a replacement character (usually the U+FFFD REPLACEMENT CHARACTER).
If you need identical behaviour you can try to use the
MB_ERR_INVALID_CHARS
flag. Then the function calls should fail.
The MS code is not public and won't help you. Having a look at the Wine sources shows that the function
wine_utf8_mbstowcs
(see
http://source.winehq.org/source/libs/wine/utf8.c[
^]) called by
WideCharToMultiByte
simply skips invalid codes.