@zfigura @iamahuman This is my first wine patch, I am not familiar with wine review process, and I am not sure who should review this (bot didn't assign anybody), but I would appreciate a review.
Code should be obvious, but question for the last commit: should I open with `O_CLOEXEC` ? I do not think so, but would be good to confirm.