I hate win32.
Apparently, I forgot to run my Java program in privilege mode, so it gives a error 5 (Access is denied), which you have to ask it by invoking GetLastError().
And then, there is encoding issues. I give it plain ASCII chars, and windows think it's some Chinese characters.
My heart is physically pain at the moment.