I don't write tests.
Then it's going to hard to convince the reviewer that this is correct.
Regarding `SetLastError()` it was changed not long ago with [1dfedae](/wine/wine/-/commit/1dfedae9030b18d6648d48fe613a1ade2af382e5)
That's on the unixlib side of win32u. This code is in user32, which is PE.