Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b4a7a30b
Commit
b4a7a30b
authored
May 02, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
May 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix handling of components without a key path in MsiEnumComponentCostsW.
parent
ee683f71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
msi.c
dlls/msi/msi.c
+12
-3
package.c
dlls/msi/tests/package.c
+11
-4
No files found.
dlls/msi/msi.c
View file @
b4a7a30b
...
...
@@ -1864,12 +1864,22 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
drive
[
0
]
=
0
;
*
cost
=
*
temp
=
0
;
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
if
(
component
&&
component
[
0
])
{
*
cost
=
max
(
8
,
comp
->
Cost
/
512
);
if
(
comp
->
assembly
&&
!
comp
->
assembly
->
application
)
*
temp
=
comp
->
Cost
;
if
(
(
file
=
get_loaded_file
(
package
,
comp
->
KeyPath
))
)
if
(
!
comp
->
Enabled
||
!
comp
->
KeyPath
)
{
*
cost
=
0
;
drive
[
0
]
=
path
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
r
=
ERROR_SUCCESS
;
}
else
if
((
file
=
get_loaded_file
(
package
,
comp
->
KeyPath
)))
{
*
cost
=
max
(
8
,
comp
->
Cost
/
512
);
drive
[
0
]
=
file
->
TargetPath
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
...
...
@@ -1880,7 +1890,6 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
else
if
(
IStorage_Stat
(
package
->
db
->
storage
,
&
stat
,
STATFLAG_NONAME
)
==
S_OK
)
{
*
temp
=
max
(
8
,
stat
.
cbSize
.
QuadPart
/
512
);
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
drive
[
0
]
=
path
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
...
...
dlls/msi/tests/package.c
View file @
b4a7a30b
...
...
@@ -12942,16 +12942,13 @@ static void test_MsiEnumComponentCosts(void)
r
=
add_file_entry
(
hdb
,
"'one.txt', 'one', 'one.txt', 4096, '', '', 8192, 1"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add file %u
\n
"
,
r
);
r
=
add_file_entry
(
hdb
,
"'two.txt', 'two', 'two.txt', 8192, '', '', 8192, 2"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add file %u
\n
"
,
r
);
r
=
create_component_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create Component table %u
\n
"
,
r
);
r
=
add_component_entry
(
hdb
,
"'one', '{B2F86B9D-8447-4BC5-8883-750C45AA31CA}', 'TARGETDIR', 0, '', 'one.txt'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add component %u
\n
"
,
r
);
r
=
add_component_entry
(
hdb
,
"'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', '
two.txt
'"
);
r
=
add_component_entry
(
hdb
,
"'two', '{62A09F6E-0B74-4829-BDB7-CAB66F42CCE8}', 'TARGETDIR', 0, '', ''"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add component %u
\n
"
,
r
);
r
=
create_feature_table
(
hdb
);
...
...
@@ -13103,6 +13100,16 @@ static void test_MsiEnumComponentCosts(void)
len
=
sizeof
(
drive
);
drive
[
0
]
=
0
;
cost
=
temp
=
0xdead
;
r
=
MsiEnumComponentCostsA
(
hpkg
,
"two"
,
0
,
INSTALLSTATE_LOCAL
,
drive
,
&
len
,
&
cost
,
&
temp
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
len
==
2
,
"expected len == 2, got %u
\n
"
,
len
);
ok
(
drive
[
0
],
"expected a drive
\n
"
);
ok
(
!
cost
,
"expected cost == 0, got %d
\n
"
,
cost
);
ok
(
!
temp
,
"expected temp == 0, got %d
\n
"
,
temp
);
len
=
sizeof
(
drive
);
drive
[
0
]
=
0
;
cost
=
temp
=
0xdead
;
r
=
MsiEnumComponentCostsA
(
hpkg
,
""
,
0
,
INSTALLSTATE_UNKNOWN
,
drive
,
&
len
,
&
cost
,
&
temp
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
len
==
2
,
"expected len == 2, got %u
\n
"
,
len
);
...
...
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