Alfred Agrell (@Alcaro) commented about dlls/kernelbase/file.c:
+/***********************************************************************
- CopyFileExW (kernelbase.@)
- */
+BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUTINE progress,
void *param, BOOL *cancel_ptr, DWORD flags )
+{
- HRESULT ret;
- COPYFILE2_EXTENDED_PARAMETERS params;
- params.dwSize = sizeof(params);
- params.dwCopyFlags = flags;
- ret = CopyFile2( source, dest, ¶ms );
- if (ret != S_OK) {
SetLastError( ret );
SetLastError doesn't take a HRESULT. HRESULT to SetLastError feels like a function that should exist, but I can't find it; closest I can find is HRESULT_CODE, which will do something weird if CopyFile2 returns something other than S_OK or HRESULT_FROM_WIN32(something).
Maybe another reviewer can enlighten us?