@joebigelow / wix / commits / 10a2a174

Make FileCopyUsingHandlesWithProgress more like MoveFileWithProgress

Rob Mensching committed Apr 14, 2021 at 09:45 UTC 10a2a1740616715f367536b9515bad5ff6c645e1
2 files changed +2 -19
src/dutil/fileutil.cpp
+1 -16
@@ -1114,13 +1114,10 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress(
1114 __in HANDLE hTarget,
1115 __in DWORD64 cbCopy,
1116 __in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
1117 - __in_opt LPVOID lpData,
1118 - __in_opt LPBOOL pbCancel,
1119 - __out_opt DWORD64* pcbCopied
1117 + __in_opt LPVOID lpData
1118 )
1119 {
1120 HRESULT hr = S_OK;
1123 - BOOL fCanceled = FALSE;
1121 DWORD64 cbTotalCopied = 0;
1122 BYTE rgbData[64 * 1024];
1123 DWORD cbRead = 0;
@@ -1145,7 +1142,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress(
1142 break;
1143
1144 case PROGRESS_CANCEL:
1148 - fCanceled = TRUE;
1145 ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED));
1146
1147 case PROGRESS_STOP:
@@ -1195,7 +1191,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress(
1191 break;
1192
1193 case PROGRESS_CANCEL:
1198 - fCanceled = TRUE;
1194 ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED));
1195
1196 case PROGRESS_STOP:
@@ -1214,16 +1209,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress(
1209 }
1210
1211 LExit:
1217 - if (pbCancel)
1218 - {
1219 - *pbCancel = fCanceled;
1220 - }
1221 -
1222 - if (pcbCopied)
1223 - {
1224 - *pcbCopied = cbTotalCopied;
1225 - }
1226 -
1212 return hr;
1213 }
1214
src/dutil/inc/fileutil.h
+1 -3
@@ -153,9 +153,7 @@ HRESULT DAPI FileCopyUsingHandlesWithProgress(
153 __in HANDLE hTarget,
154 __in DWORD64 cbCopy,
155 __in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
156 - __in_opt LPVOID lpData,
157 - __in_opt LPBOOL pbCancel,
158 - __out_opt DWORD64* pcbCopied
156 + __in_opt LPVOID lpData
157 );
158 HRESULT DAPI FileEnsureCopy(
159 __in_z LPCWSTR wzSource,