On Mon Feb 12 21:19:05 2024 +0000, Kartavya Vashishtha wrote:
While we could return a DWORD or ULONG from the helper function, the code _in_ the helper function still uses older functions that use SetLastError, so we still need to not clobber GetLastError. We need to create an HRESULT in CopyFile2 since the helper functions needs to operate in WIN32 error codes (because CopyFileEx operates in WIN32 error codes) and converting to HRESULT is easier than the other way around. So converting line 568-570:
CloseHandle( h1 ); return FALSE; }
to
CloseHandle( h1 ); return GetLastError(); }
Would this look better?
Eh, I missed that there's other last-error functions being used inside the helper. So never mind then.