Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1e348427
Commit
1e348427
authored
Feb 16, 2024
by
Kartavya Vashishtha
Committed by
Alexandre Julliard
Feb 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement CopyFile2().
parent
1b0d8428
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
7 deletions
+46
-7
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
file.c
dlls/kernelbase/file.c
+44
-6
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
No files found.
dlls/kernel32/kernel32.spec
View file @
1e348427
...
@@ -257,6 +257,7 @@
...
@@ -257,6 +257,7 @@
@ stdcall -import ConvertThreadToFiberEx(ptr long)
@ stdcall -import ConvertThreadToFiberEx(ptr long)
@ stdcall ConvertToGlobalHandle(long)
@ stdcall ConvertToGlobalHandle(long)
@ stdcall -import CopyContext(ptr long ptr)
@ stdcall -import CopyContext(ptr long ptr)
@ stdcall -import CopyFile2(wstr wstr ptr)
@ stdcall CopyFileA(str str long)
@ stdcall CopyFileA(str str long)
@ stdcall CopyFileExA (str str ptr ptr ptr long)
@ stdcall CopyFileExA (str str ptr ptr ptr long)
@ stdcall -import CopyFileExW(wstr wstr ptr ptr ptr long)
@ stdcall -import CopyFileExW(wstr wstr ptr ptr ptr long)
...
...
dlls/kernelbase/file.c
View file @
1e348427
...
@@ -487,13 +487,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH AreFileApisANSI(void)
...
@@ -487,13 +487,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH AreFileApisANSI(void)
return
!
oem_file_apis
;
return
!
oem_file_apis
;
}
}
/******************************************************************************
/***********************************************************************
* copy_file
* CopyFileExW (kernelbase.@)
*/
*/
BOOL
WINAPI
CopyFileExW
(
const
WCHAR
*
source
,
const
WCHAR
*
dest
,
LPPROGRESS_ROUTINE
progress
,
static
BOOL
copy_file
(
const
WCHAR
*
source
,
const
WCHAR
*
dest
,
COPYFILE2_EXTENDED_PARAMETERS
*
params
)
void
*
param
,
BOOL
*
cancel_ptr
,
DWORD
flags
)
{
{
DWORD
flags
=
params
?
params
->
dwCopyFlags
:
0
;
BOOL
*
cancel_ptr
=
params
?
params
->
pfCancel
:
NULL
;
PCOPYFILE2_PROGRESS_ROUTINE
progress
=
params
?
params
->
pProgressRoutine
:
NULL
;
static
const
int
buffer_size
=
65536
;
static
const
int
buffer_size
=
65536
;
HANDLE
h1
,
h2
;
HANDLE
h1
,
h2
;
FILE_BASIC_INFORMATION
info
;
FILE_BASIC_INFORMATION
info
;
...
@@ -502,6 +504,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
...
@@ -502,6 +504,11 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
char
*
buffer
;
char
*
buffer
;
if
(
cancel_ptr
)
FIXME
(
"pfCancel is not supported
\n
"
);
if
(
progress
)
FIXME
(
"PCOPYFILE2_PROGRESS_ROUTINE is not supported
\n
"
);
if
(
!
source
||
!
dest
)
if
(
!
source
||
!
dest
)
{
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
@@ -577,7 +584,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
...
@@ -577,7 +584,7 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
count
-=
res
;
count
-=
res
;
}
}
}
}
ret
=
TRUE
;
ret
=
TRUE
;
done:
done:
/* Maintain the timestamp of source file to destination file and read-only attribute */
/* Maintain the timestamp of source file to destination file and read-only attribute */
info
.
FileAttributes
&=
FILE_ATTRIBUTE_READONLY
;
info
.
FileAttributes
&=
FILE_ATTRIBUTE_READONLY
;
...
@@ -589,6 +596,37 @@ done:
...
@@ -589,6 +596,37 @@ done:
return
ret
;
return
ret
;
}
}
/***********************************************************************
* CopyFile2 (kernelbase.@)
*/
HRESULT
WINAPI
CopyFile2
(
const
WCHAR
*
source
,
const
WCHAR
*
dest
,
COPYFILE2_EXTENDED_PARAMETERS
*
params
)
{
return
copy_file
(
source
,
dest
,
params
)
?
S_OK
:
HRESULT_FROM_WIN32
(
GetLastError
());
}
/***********************************************************************
* CopyFileExW (kernelbase.@)
*/
BOOL
WINAPI
CopyFileExW
(
const
WCHAR
*
source
,
const
WCHAR
*
dest
,
LPPROGRESS_ROUTINE
progress
,
void
*
param
,
BOOL
*
cancel_ptr
,
DWORD
flags
)
{
COPYFILE2_EXTENDED_PARAMETERS
params
;
if
(
progress
)
FIXME
(
"LPPROGRESS_ROUTINE is not supported
\n
"
);
if
(
cancel_ptr
)
FIXME
(
"cancel_ptr is not supported
\n
"
);
params
.
dwSize
=
sizeof
(
params
);
params
.
dwCopyFlags
=
flags
;
params
.
pProgressRoutine
=
NULL
;
params
.
pvCallbackContext
=
NULL
;
params
.
pfCancel
=
NULL
;
return
copy_file
(
source
,
dest
,
&
params
);
}
/**************************************************************************
/**************************************************************************
* CopyFileW (kernelbase.@)
* CopyFileW (kernelbase.@)
...
...
dlls/kernelbase/kernelbase.spec
View file @
1e348427
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
@ stdcall ConvertThreadToFiberEx(ptr long)
@ stdcall ConvertThreadToFiberEx(ptr long)
@ stdcall ConvertToAutoInheritPrivateObjectSecurity(ptr ptr ptr ptr long ptr)
@ stdcall ConvertToAutoInheritPrivateObjectSecurity(ptr ptr ptr ptr long ptr)
@ stdcall CopyContext(ptr long ptr)
@ stdcall CopyContext(ptr long ptr)
# @ stub CopyFile2
@ stdcall CopyFile2(wstr wstr ptr)
@ stdcall CopyFileExW(wstr wstr ptr ptr ptr long)
@ stdcall CopyFileExW(wstr wstr ptr ptr ptr long)
@ stdcall CopyFileW(wstr wstr long)
@ stdcall CopyFileW(wstr wstr long)
@ stdcall -arch=x86_64 CopyMemoryNonTemporal(ptr ptr long) ntdll.RtlCopyMemoryNonTemporal
@ stdcall -arch=x86_64 CopyMemoryNonTemporal(ptr ptr long) ntdll.RtlCopyMemoryNonTemporal
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment