From 10a2a1740616715f367536b9515bad5ff6c645e1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 14 Apr 2021 09:45:51 -0700 Subject: Make FileCopyUsingHandlesWithProgress more like MoveFileWithProgress --- src/dutil/fileutil.cpp | 17 +---------------- src/dutil/inc/fileutil.h | 4 +--- 2 files changed, 2 insertions(+), 19 deletions(-) (limited to 'src/dutil') diff --git a/src/dutil/fileutil.cpp b/src/dutil/fileutil.cpp index cb67813d..6cc2a80e 100644 --- a/src/dutil/fileutil.cpp +++ b/src/dutil/fileutil.cpp @@ -1114,13 +1114,10 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( __in HANDLE hTarget, __in DWORD64 cbCopy, __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, - __in_opt LPVOID lpData, - __in_opt LPBOOL pbCancel, - __out_opt DWORD64* pcbCopied + __in_opt LPVOID lpData ) { HRESULT hr = S_OK; - BOOL fCanceled = FALSE; DWORD64 cbTotalCopied = 0; BYTE rgbData[64 * 1024]; DWORD cbRead = 0; @@ -1145,7 +1142,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( break; case PROGRESS_CANCEL: - fCanceled = TRUE; ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); case PROGRESS_STOP: @@ -1195,7 +1191,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( break; case PROGRESS_CANCEL: - fCanceled = TRUE; ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); case PROGRESS_STOP: @@ -1214,16 +1209,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( } LExit: - if (pbCancel) - { - *pbCancel = fCanceled; - } - - if (pcbCopied) - { - *pcbCopied = cbTotalCopied; - } - return hr; } diff --git a/src/dutil/inc/fileutil.h b/src/dutil/inc/fileutil.h index 48830043..319c5508 100644 --- a/src/dutil/inc/fileutil.h +++ b/src/dutil/inc/fileutil.h @@ -153,9 +153,7 @@ HRESULT DAPI FileCopyUsingHandlesWithProgress( __in HANDLE hTarget, __in DWORD64 cbCopy, __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, - __in_opt LPVOID lpData, - __in_opt LPBOOL pbCancel, - __out_opt DWORD64* pcbCopied + __in_opt LPVOID lpData ); HRESULT DAPI FileEnsureCopy( __in_z LPCWSTR wzSource, -- cgit v1.2.3-55-g6feb