https://bugs.winehq.org/show_bug.cgi?id=5137
--- Comment #16 from Angus Lees gus@inodes.org --- I'm not in a position to retry my original code without a lot of work. For what it's worth however, your patch looks good to me from a simple visual inspection.