As my previous attempt in PR#600 got botched, and I can't figure how to see the wine test results, I would like to ask if someone could check this patch doesn't ruin the user32:win wine test.
The code is based on a similar code path on wine's equivalent function.