You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against 1b9d48a7b01e2b715af46bc1f8d5fe6f1529782c.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
From f29eb0b6a2b555beea0c29e9202c218ef31311b6 Mon Sep 17 00:00:00 2001
|
||||
From 519a979a6d7c304c65f198b64495f4fd36482fbc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 26 Feb 2015 06:41:26 +0100
|
||||
Subject: [PATCH] kernelbase: Add support for progress callback in CopyFileEx.
|
||||
@ -9,38 +9,38 @@ Subject: [PATCH] kernelbase: Add support for progress callback in CopyFileEx.
|
||||
2 files changed, 71 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
|
||||
index f8e49491a7d..74c13ff11d0 100644
|
||||
index 77174d43d5b..4bd9f790cc0 100644
|
||||
--- a/dlls/kernel32/tests/file.c
|
||||
+++ b/dlls/kernel32/tests/file.c
|
||||
@@ -1169,23 +1169,17 @@ static void test_CopyFileEx(void)
|
||||
ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError());
|
||||
@@ -1170,23 +1170,17 @@ static void test_CopyFileEx(void)
|
||||
ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
retok = CopyFileExA(source, dest, copy_progress_cb, hfile, NULL, 0);
|
||||
- todo_wine
|
||||
ok(!retok, "CopyFileExA unexpectedly succeeded\n");
|
||||
- todo_wine
|
||||
ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %d\n", GetLastError());
|
||||
ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %ld\n", GetLastError());
|
||||
ok(GetFileAttributesA(dest) != INVALID_FILE_ATTRIBUTES, "file was deleted\n");
|
||||
|
||||
hfile = CreateFileA(dest, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
NULL, OPEN_EXISTING, 0, 0);
|
||||
- todo_wine
|
||||
ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError());
|
||||
ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %ld\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
retok = CopyFileExA(source, dest, copy_progress_cb, hfile, NULL, 0);
|
||||
- todo_wine
|
||||
ok(!retok, "CopyFileExA unexpectedly succeeded\n");
|
||||
- todo_wine
|
||||
ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %d\n", GetLastError());
|
||||
ok(GetLastError() == ERROR_REQUEST_ABORTED, "expected ERROR_REQUEST_ABORTED, got %ld\n", GetLastError());
|
||||
- todo_wine
|
||||
ok(GetFileAttributesA(dest) == INVALID_FILE_ATTRIBUTES, "file was not deleted\n");
|
||||
|
||||
retok = CopyFileExA(source, NULL, copy_progress_cb, hfile, NULL, 0);
|
||||
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
|
||||
index c6dc904044a..b9ba1bd7c26 100644
|
||||
index 02c2e841f85..cabbe2d17c1 100644
|
||||
--- a/dlls/kernelbase/file.c
|
||||
+++ b/dlls/kernelbase/file.c
|
||||
@@ -499,11 +499,16 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -500,11 +500,16 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
{
|
||||
static const int buffer_size = 65536;
|
||||
HANDLE h1, h2;
|
||||
@ -58,7 +58,7 @@ index c6dc904044a..b9ba1bd7c26 100644
|
||||
|
||||
if (!source || !dest)
|
||||
{
|
||||
@@ -518,7 +523,15 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -519,7 +524,15 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
|
||||
TRACE("%s -> %s, %lx\n", debugstr_w(source), debugstr_w(dest), flags);
|
||||
|
||||
@ -75,7 +75,7 @@ index c6dc904044a..b9ba1bd7c26 100644
|
||||
NULL, OPEN_EXISTING, 0, 0 )) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
WARN("Unable to open source %s\n", debugstr_w(source));
|
||||
@@ -526,7 +539,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -527,7 +540,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ index c6dc904044a..b9ba1bd7c26 100644
|
||||
{
|
||||
WARN("GetFileInformationByHandle returned error for %s\n", debugstr_w(source));
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
@@ -552,7 +565,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -553,7 +566,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ index c6dc904044a..b9ba1bd7c26 100644
|
||||
(flags & COPY_FILE_FAIL_IF_EXISTS) ? CREATE_NEW : CREATE_ALWAYS,
|
||||
info.FileAttributes, h1 )) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
@@ -562,6 +579,29 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -563,6 +580,29 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ index c6dc904044a..b9ba1bd7c26 100644
|
||||
while (ReadFile( h1, buffer, buffer_size, &count, NULL ) && count)
|
||||
{
|
||||
char *p = buffer;
|
||||
@@ -571,13 +611,38 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
@@ -572,13 +612,38 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
|
||||
if (!WriteFile( h2, p, count, &res, NULL ) || !res) goto done;
|
||||
p += res;
|
||||
count -= res;
|
||||
|
Reference in New Issue
Block a user