http://bugs.winehq.org/show_bug.cgi?id=18243
--- Comment #9 from Hans Leidekker hans@meelstraat.net 2009-04-28 02:38:03 --- The truncation bug happens with any protocol. What happens is that the last WriteFile call fails with an invalid handle error. If I disable the fd cache in ntdll it succeeds and the file is fully written.
A significant thing happening in between is that wininet gets unloaded, but that doesn't close the file handle (it shouldn't, since it's owned by the app).
Another interesting fact is that the CloseHandle call following the failed WriteFile call succeeds.