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
4a1c243e
Commit
4a1c243e
authored
May 20, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
May 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Factor out common code from MsiEnumComponentCostsW.
parent
0858dee3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
msi.c
dlls/msi/msi.c
+11
-12
No files found.
dlls/msi/msi.c
View file @
4a1c243e
...
...
@@ -1825,6 +1825,14 @@ UINT WINAPI MsiEnumComponentCostsA( MSIHANDLE handle, LPCSTR component, DWORD in
return
r
;
}
static
UINT
set_drive
(
WCHAR
*
buffer
,
WCHAR
letter
)
{
buffer
[
0
]
=
letter
;
buffer
[
1
]
=
':'
;
buffer
[
2
]
=
0
;
return
2
;
}
UINT
WINAPI
MsiEnumComponentCostsW
(
MSIHANDLE
handle
,
LPCWSTR
component
,
DWORD
index
,
INSTALLSTATE
state
,
LPWSTR
drive
,
DWORD
*
buflen
,
int
*
cost
,
int
*
temp
)
...
...
@@ -1896,29 +1904,20 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
if
(
!
comp
->
Enabled
||
!
comp
->
KeyPath
)
{
*
cost
=
0
;
drive
[
0
]
=
path
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
*
buflen
=
set_drive
(
drive
,
path
[
0
]
);
r
=
ERROR_SUCCESS
;
}
else
if
((
file
=
msi_get_loaded_file
(
package
,
comp
->
KeyPath
)))
{
*
cost
=
max
(
8
,
comp
->
Cost
/
512
);
drive
[
0
]
=
file
->
TargetPath
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
*
buflen
=
set_drive
(
drive
,
file
->
TargetPath
[
0
]
);
r
=
ERROR_SUCCESS
;
}
}
else
if
(
IStorage_Stat
(
package
->
db
->
storage
,
&
stat
,
STATFLAG_NONAME
)
==
S_OK
)
{
*
temp
=
max
(
8
,
stat
.
cbSize
.
QuadPart
/
512
);
drive
[
0
]
=
path
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
*
buflen
=
set_drive
(
drive
,
path
[
0
]
);
r
=
ERROR_SUCCESS
;
}
msiobj_release
(
&
package
->
hdr
);
...
...
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