https://bugs.winehq.org/show_bug.cgi?id=53569
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com --- (In reply to Robert Wilhelm from comment #1)
Created attachment 72941 [details] patch
Looks good, needs a small test though. We should also fix a leak on RtlGenRandom() failure path, but that's a minor issue.