Porting a fix from Bitcoin: http://gavintech.blogspot.co.uk/2012/03/full-disclosure-bitcoin-qt-on-windows.html
https://github.com/bitcoin/bitcoin/commit/8864019f6d88b13d3442843d9e6ebeb8dd938831