Rebase against aa2851f167aa2089fdbb12ec58d6f6b4801edbab.

This commit is contained in:
Alistair Leslie-Hughes 2022-03-23 09:48:51 +11:00
parent 5d30a5655f
commit eb80c9d640
3 changed files with 17 additions and 22 deletions

View File

@ -1,18 +1,18 @@
From 519a979a6d7c304c65f198b64495f4fd36482fbc Mon Sep 17 00:00:00 2001
From 8b435d44bcbeb2e6fd1ef37c8a23405dea88b685 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.
---
dlls/kernel32/tests/file.c | 6 ---
dlls/kernelbase/file.c | 77 +++++++++++++++++++++++++++++++++++---
2 files changed, 71 insertions(+), 12 deletions(-)
dlls/kernel32/tests/file.c | 6 ----
dlls/kernelbase/file.c | 72 ++++++++++++++++++++++++++++++++++----
2 files changed, 66 insertions(+), 12 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 77174d43d5b..4bd9f790cc0 100644
index 1c4cdfea1b4..0d0e6a893c9 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -1170,23 +1170,17 @@ static void test_CopyFileEx(void)
@@ -1169,23 +1169,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);
@ -37,7 +37,7 @@ index 77174d43d5b..4bd9f790cc0 100644
retok = CopyFileExA(source, NULL, copy_progress_cb, hfile, NULL, 0);
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 02c2e841f85..cabbe2d17c1 100644
index 7b1858de424..a98a54ae9b1 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -500,11 +500,16 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
@ -58,16 +58,11 @@ index 02c2e841f85..cabbe2d17c1 100644
if (!source || !dest)
{
@@ -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);
@@ -526,7 +531,10 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
if (flags & COPY_FILE_OPEN_SOURCE_FOR_WRITE)
FIXME("COPY_FILE_OPEN_SOURCE_FOR_WRITE is not supported\n");
- if ((h1 = CreateFileW( source, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ if (flags & COPY_FILE_RESTARTABLE)
+ FIXME("COPY_FILE_RESTARTABLE is not supported\n");
+ if (flags & COPY_FILE_COPY_SYMLINK)
+ FIXME("COPY_FILE_COPY_SYMLINK is not supported\n");
+
+ if (flags & COPY_FILE_OPEN_SOURCE_FOR_WRITE)
+ source_access |= GENERIC_WRITE;
+
@ -75,7 +70,7 @@ index 02c2e841f85..cabbe2d17c1 100644
NULL, OPEN_EXISTING, 0, 0 )) == INVALID_HANDLE_VALUE)
{
WARN("Unable to open source %s\n", debugstr_w(source));
@@ -527,7 +540,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
@@ -534,7 +542,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
return FALSE;
}
@ -84,7 +79,7 @@ index 02c2e841f85..cabbe2d17c1 100644
{
WARN("GetFileInformationByHandle returned error for %s\n", debugstr_w(source));
HeapFree( GetProcessHeap(), 0, buffer );
@@ -553,7 +566,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
@@ -560,7 +568,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
}
}
@ -97,7 +92,7 @@ index 02c2e841f85..cabbe2d17c1 100644
(flags & COPY_FILE_FAIL_IF_EXISTS) ? CREATE_NEW : CREATE_ALWAYS,
info.FileAttributes, h1 )) == INVALID_HANDLE_VALUE)
{
@@ -563,6 +580,29 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
@@ -570,6 +582,29 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
return FALSE;
}
@ -127,7 +122,7 @@ index 02c2e841f85..cabbe2d17c1 100644
while (ReadFile( h1, buffer, buffer_size, &count, NULL ) && count)
{
char *p = buffer;
@@ -572,13 +612,38 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
@@ -579,13 +614,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;
@ -169,5 +164,5 @@ index 02c2e841f85..cabbe2d17c1 100644
CloseHandle( h1 );
CloseHandle( h2 );
--
2.34.1
2.35.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "429325b6891bbb7488b3e8d8f97e4abb92879ce7"
echo "aa2851f167aa2089fdbb12ec58d6f6b4801edbab"
}
# Show version information

View File

@ -1 +1 @@
429325b6891bbb7488b3e8d8f97e4abb92879ce7
aa2851f167aa2089fdbb12ec58d6f6b4801edbab