Alfred Agrell (@Alcaro) commented about dlls/kernelbase/file.c:
return ret;
}
+/***********************************************************************
- CopyFile2 (kernelbase.@)
- */
+HRESULT WINAPI CopyFile2( PCWSTR source, PCWSTR dest, COPYFILE2_EXTENDED_PARAMETERS *params ) {
- DWORD prev_err = GetLastError();
- HRESULT res;
- res = CopyFile2_impl(source, dest, params) ? S_OK : HRESULT_FROM_WIN32(GetLastError());
- SetLastError(prev_err);
There is a function to restore the last error, as opposed to setting a new instance of the same error. It's called, surprisingly, RestoreLastError. https://devblogs.microsoft.com/oldnewthing/20110429-00/?p=10803
But Wine currently uses RestoreLastError exactly nowhere else, so for now, better stay consistent and keep it as is.
For now. I've filed !5035 to split it apart, let's see what happens. (If this one merges before 5035, updating this line belongs in 5035.)