diff options
author | Rob Mensching <rob@firegiant.com> | 2021-04-14 09:45:51 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-04-14 09:45:51 -0700 |
commit | 10a2a1740616715f367536b9515bad5ff6c645e1 (patch) | |
tree | 36ce0de6253ffef1afae490f3f4449ce7a58af86 | |
parent | 10ea1d3e52217ccd93dfa6830776a6be308ca1f6 (diff) | |
download | wix-10a2a1740616715f367536b9515bad5ff6c645e1.tar.gz wix-10a2a1740616715f367536b9515bad5ff6c645e1.tar.bz2 wix-10a2a1740616715f367536b9515bad5ff6c645e1.zip |
Make FileCopyUsingHandlesWithProgress more like MoveFileWithProgress
-rw-r--r-- | src/dutil/fileutil.cpp | 17 | ||||
-rw-r--r-- | src/dutil/inc/fileutil.h | 4 |
2 files changed, 2 insertions, 19 deletions
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( | |||
1114 | __in HANDLE hTarget, | 1114 | __in HANDLE hTarget, |
1115 | __in DWORD64 cbCopy, | 1115 | __in DWORD64 cbCopy, |
1116 | __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, | 1116 | __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, |
1117 | __in_opt LPVOID lpData, | 1117 | __in_opt LPVOID lpData |
1118 | __in_opt LPBOOL pbCancel, | ||
1119 | __out_opt DWORD64* pcbCopied | ||
1120 | ) | 1118 | ) |
1121 | { | 1119 | { |
1122 | HRESULT hr = S_OK; | 1120 | HRESULT hr = S_OK; |
1123 | BOOL fCanceled = FALSE; | ||
1124 | DWORD64 cbTotalCopied = 0; | 1121 | DWORD64 cbTotalCopied = 0; |
1125 | BYTE rgbData[64 * 1024]; | 1122 | BYTE rgbData[64 * 1024]; |
1126 | DWORD cbRead = 0; | 1123 | DWORD cbRead = 0; |
@@ -1145,7 +1142,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( | |||
1145 | break; | 1142 | break; |
1146 | 1143 | ||
1147 | case PROGRESS_CANCEL: | 1144 | case PROGRESS_CANCEL: |
1148 | fCanceled = TRUE; | ||
1149 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); | 1145 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); |
1150 | 1146 | ||
1151 | case PROGRESS_STOP: | 1147 | case PROGRESS_STOP: |
@@ -1195,7 +1191,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( | |||
1195 | break; | 1191 | break; |
1196 | 1192 | ||
1197 | case PROGRESS_CANCEL: | 1193 | case PROGRESS_CANCEL: |
1198 | fCanceled = TRUE; | ||
1199 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); | 1194 | ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); |
1200 | 1195 | ||
1201 | case PROGRESS_STOP: | 1196 | case PROGRESS_STOP: |
@@ -1214,16 +1209,6 @@ extern "C" HRESULT DAPI FileCopyUsingHandlesWithProgress( | |||
1214 | } | 1209 | } |
1215 | 1210 | ||
1216 | LExit: | 1211 | LExit: |
1217 | if (pbCancel) | ||
1218 | { | ||
1219 | *pbCancel = fCanceled; | ||
1220 | } | ||
1221 | |||
1222 | if (pcbCopied) | ||
1223 | { | ||
1224 | *pcbCopied = cbTotalCopied; | ||
1225 | } | ||
1226 | |||
1227 | return hr; | 1212 | return hr; |
1228 | } | 1213 | } |
1229 | 1214 | ||
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( | |||
153 | __in HANDLE hTarget, | 153 | __in HANDLE hTarget, |
154 | __in DWORD64 cbCopy, | 154 | __in DWORD64 cbCopy, |
155 | __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, | 155 | __in_opt LPPROGRESS_ROUTINE lpProgressRoutine, |
156 | __in_opt LPVOID lpData, | 156 | __in_opt LPVOID lpData |
157 | __in_opt LPBOOL pbCancel, | ||
158 | __out_opt DWORD64* pcbCopied | ||
159 | ); | 157 | ); |
160 | HRESULT DAPI FileEnsureCopy( | 158 | HRESULT DAPI FileEnsureCopy( |
161 | __in_z LPCWSTR wzSource, | 159 | __in_z LPCWSTR wzSource, |