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
d5f6d641
Commit
d5f6d641
authored
May 17, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Retrieve the default destination path in SetupInstallFile().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ddc60c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
queue.c
dlls/setupapi/queue.c
+14
-2
install.c
dlls/setupapi/tests/install.c
+3
-3
No files found.
dlls/setupapi/queue.c
View file @
d5f6d641
...
...
@@ -1216,7 +1216,7 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour
static
const
WCHAR
CopyFiles
[]
=
{
'C'
,
'o'
,
'p'
,
'y'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
BOOL
ret
,
absolute
=
(
root
&&
*
root
&&
!
(
style
&
SP_COPY_SOURCE_ABSOLUTE
));
WCHAR
*
buffer
,
*
p
,
*
inf_source
=
NULL
;
WCHAR
*
buffer
,
*
p
,
*
inf_source
=
NULL
,
dest_path
[
MAX_PATH
]
;
unsigned
int
len
;
TRACE
(
"%p %p %s %s %s %x %p %p %p
\n
"
,
hinf
,
inf_context
,
debugstr_w
(
source
),
debugstr_w
(
root
),
...
...
@@ -1224,8 +1224,11 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour
if
(
in_use
)
FIXME
(
"no file in use support
\n
"
);
dest_path
[
0
]
=
0
;
if
(
hinf
)
{
WCHAR
*
dest_dir
;
INFCONTEXT
ctx
;
if
(
!
inf_context
)
...
...
@@ -1245,6 +1248,13 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour
return
FALSE
;
}
source
=
inf_source
;
if
((
dest_dir
=
get_destination_dir
(
hinf
,
NULL
)))
{
strcpyW
(
dest_path
,
dest_dir
);
strcatW
(
dest_path
,
backslashW
);
heap_free
(
dest_dir
);
}
}
else
if
(
!
source
)
{
...
...
@@ -1271,7 +1281,9 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour
while
(
*
source
==
'\\'
)
source
++
;
strcpyW
(
p
,
source
);
ret
=
do_file_copyW
(
buffer
,
dest
,
style
,
handler
,
context
);
strcatW
(
dest_path
,
dest
);
ret
=
do_file_copyW
(
buffer
,
dest_path
,
style
,
handler
,
context
);
HeapFree
(
GetProcessHeap
(),
0
,
inf_source
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
...
...
dlls/setupapi/tests/install.c
View file @
d5f6d641
...
...
@@ -1364,11 +1364,11 @@ static void test_install_file(void)
ret
=
SetupInstallFileA
(
hinf
,
&
infctx
,
"one.txt"
,
"src"
,
"one.txt"
,
0
,
NULL
,
NULL
);
ok
(
ret
,
"Expected success.
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
todo_wine
ok
(
delete_file
(
"dst/one.txt"
),
"Destination file should exist.
\n
"
);
ok
(
delete_file
(
"dst/one.txt"
),
"Destination file should exist.
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
SetupInstallFileA
(
hinf
,
&
infctx
,
"one.txt"
,
"src"
,
"one.txt"
,
SP_COPY_REPLACEONLY
,
NULL
,
NULL
);
todo_wine
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
ok
(
!
file_exists
(
"dst/one.txt"
),
"Destination file should not exist.
\n
"
);
...
...
@@ -1394,7 +1394,7 @@ static void test_install_file(void)
ret
=
SetupInstallFileA
(
hinf
,
&
infctx
,
"three.txt"
,
"src/alpha"
,
"three.txt"
,
0
,
NULL
,
NULL
);
ok
(
ret
,
"Expected success.
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
todo_wine
ok
(
delete_file
(
"dst/three.txt"
),
"Destination file should exist.
\n
"
);
ok
(
delete_file
(
"dst/three.txt"
),
"Destination file should exist.
\n
"
);
SetupCloseInfFile
(
hinf
);
delete_file
(
"src/one.txt"
);
...
...
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