Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c8c00d6f
Commit
c8c00d6f
authored
Jan 27, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Add MoveFile implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4e9dae37
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
4 deletions
+65
-4
filesystem.c
dlls/scrrun/filesystem.c
+3
-4
filesystem.c
dlls/scrrun/tests/filesystem.c
+62
-0
No files found.
dlls/scrrun/filesystem.c
View file @
c8c00d6f
...
...
@@ -3638,12 +3638,11 @@ static HRESULT WINAPI filesys_DeleteFolder(IFileSystem3 *iface, BSTR FolderSpec,
return
delete_folder
(
FolderSpec
,
SysStringLen
(
FolderSpec
),
Force
);
}
static
HRESULT
WINAPI
filesys_MoveFile
(
IFileSystem3
*
iface
,
BSTR
Source
,
BSTR
Destination
)
static
HRESULT
WINAPI
filesys_MoveFile
(
IFileSystem3
*
iface
,
BSTR
source
,
BSTR
destination
)
{
FIXME
(
"%p %s %s
\n
"
,
iface
,
debugstr_w
(
Source
),
debugstr_w
(
D
estination
));
TRACE
(
"%p %s %s
\n
"
,
iface
,
debugstr_w
(
source
),
debugstr_w
(
d
estination
));
return
E_NOTIMPL
;
return
MoveFileW
(
source
,
destination
)
?
S_OK
:
create_error
(
GetLastError
())
;
}
static
HRESULT
WINAPI
filesys_MoveFolder
(
IFileSystem3
*
iface
,
BSTR
Source
,
...
...
dlls/scrrun/tests/filesystem.c
View file @
c8c00d6f
...
...
@@ -2467,6 +2467,67 @@ static void test_GetSpecialFolder(void)
IFolder_Release
(
folder
);
}
static
void
test_MoveFile
(
void
)
{
ITextStream
*
stream
;
BSTR
str
,
src
,
dst
;
HRESULT
hr
;
str
=
SysAllocString
(
L"test.txt"
);
hr
=
IFileSystem3_CreateTextFile
(
fs3
,
str
,
VARIANT_FALSE
,
VARIANT_FALSE
,
&
stream
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
SysAllocString
(
L"test"
);
hr
=
ITextStream_Write
(
stream
,
str
);
ok
(
hr
==
S_OK
,
"Write failed: %08x
\n
"
,
hr
);
SysFreeString
(
str
);
ITextStream_Release
(
stream
);
str
=
SysAllocString
(
L"test2.txt"
);
hr
=
IFileSystem3_CreateTextFile
(
fs3
,
str
,
VARIANT_FALSE
,
VARIANT_FALSE
,
&
stream
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
ITextStream_Release
(
stream
);
src
=
SysAllocString
(
L"test.txt"
);
dst
=
SysAllocString
(
L"test3.txt"
);
hr
=
IFileSystem3_MoveFile
(
fs3
,
src
,
dst
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
src
);
SysFreeString
(
dst
);
str
=
SysAllocString
(
L"test.txt"
);
hr
=
IFileSystem3_DeleteFile
(
fs3
,
str
,
VARIANT_TRUE
);
ok
(
hr
==
CTL_E_FILENOTFOUND
,
"DeleteFile returned %x, expected CTL_E_FILENOTFOUND
\n
"
,
hr
);
SysFreeString
(
str
);
src
=
SysAllocString
(
L"test3.txt"
);
dst
=
SysAllocString
(
L"test2.txt"
);
/* already exists */
hr
=
IFileSystem3_MoveFile
(
fs3
,
src
,
dst
);
ok
(
hr
==
CTL_E_FILEALREADYEXISTS
,
"got 0x%08x, expected CTL_E_FILEALREADYEXISTS
\n
"
,
hr
);
SysFreeString
(
src
);
SysFreeString
(
dst
);
src
=
SysAllocString
(
L"nonexistent.txt"
);
dst
=
SysAllocString
(
L"test4.txt"
);
hr
=
IFileSystem3_MoveFile
(
fs3
,
src
,
dst
);
ok
(
hr
==
CTL_E_FILENOTFOUND
,
"got 0x%08x, expected CTL_E_FILENOTFOUND
\n
"
,
hr
);
SysFreeString
(
src
);
SysFreeString
(
dst
);
str
=
SysAllocString
(
L"test3.txt"
);
hr
=
IFileSystem3_DeleteFile
(
fs3
,
str
,
VARIANT_TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
SysAllocString
(
L"test2.txt"
);
hr
=
IFileSystem3_DeleteFile
(
fs3
,
str
,
VARIANT_TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
}
START_TEST
(
filesystem
)
{
HRESULT
hr
;
...
...
@@ -2506,6 +2567,7 @@ START_TEST(filesystem)
test_SerialNumber
();
test_GetExtensionName
();
test_GetSpecialFolder
();
test_MoveFile
();
IFileSystem3_Release
(
fs3
);
...
...
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