http://bugs.winehq.org/show_bug.cgi?id=12838
--- Comment #10 from dimaki dimaki@rocketmail.com 2009-03-24 14:00:29 --- This problem is still present in today's GIT.
The bug here comes down to the way Wine's ini handling functions handle NULL (0x00) bytes within data that comes before the first section in files being read in as ini files. Windows reads in this data incuding the NULL bytes and writes it back out the same way while Wine treats them as the end of a string resulting in the output file being corrupted.
I noticed James Hawkins started working on profile.c which is where the ini processing functions reside. I added him as a CC to this bug. Perhaps he will be able to help out with addressing it.