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
b960b967
Commit
b960b967
authored
Nov 08, 2009
by
Rob Shearman
Committed by
Alexandre Julliard
Nov 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Improve stub for MsiGetFeatureCost{A, W} and hook the stub into the…
msi: Improve stub for MsiGetFeatureCost{A, W} and hook the stub into the VolumeCostList dialog control.
parent
3a9ea794
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
5 deletions
+120
-5
dialog.c
dlls/msi/dialog.c
+41
-0
install.c
dlls/msi/install.c
+68
-5
msipriv.h
dlls/msi/msipriv.h
+1
-0
msiserver.idl
dlls/msi/msiserver.idl
+1
-0
package.c
dlls/msi/package.c
+9
-0
No files found.
dlls/msi/dialog.c
View file @
b960b967
...
...
@@ -2614,15 +2614,44 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
}
}
static
LONGLONG
msi_vcl_get_cost
(
msi_dialog
*
dialog
)
{
MSIFEATURE
*
feature
;
INT
each_cost
;
LONGLONG
total_cost
=
0
;
LIST_FOR_EACH_ENTRY
(
feature
,
&
dialog
->
package
->
features
,
MSIFEATURE
,
entry
)
{
if
(
ERROR_SUCCESS
==
(
MSI_GetFeatureCost
(
dialog
->
package
,
feature
,
MSICOSTTREE_SELFONLY
,
INSTALLSTATE_LOCAL
,
&
each_cost
)))
{
/* each_cost is in 512-byte units */
total_cost
+=
each_cost
*
512
;
}
if
(
ERROR_SUCCESS
==
(
MSI_GetFeatureCost
(
dialog
->
package
,
feature
,
MSICOSTTREE_SELFONLY
,
INSTALLSTATE_ABSENT
,
&
each_cost
)))
{
/* each_cost is in 512-byte units */
total_cost
-=
each_cost
*
512
;
}
}
return
total_cost
;
}
static
void
msi_dialog_vcl_add_drives
(
msi_dialog
*
dialog
,
msi_control
*
control
)
{
ULARGE_INTEGER
total
,
free
;
LONGLONG
difference
,
cost
;
WCHAR
size_text
[
MAX_PATH
];
WCHAR
cost_text
[
MAX_PATH
];
LPWSTR
drives
,
ptr
;
LVITEMW
lvitem
;
DWORD
size
;
int
i
=
0
;
cost
=
msi_vcl_get_cost
(
dialog
);
StrFormatByteSizeW
(
cost
,
cost_text
,
MAX_PATH
);
size
=
GetLogicalDriveStringsW
(
0
,
NULL
);
if
(
!
size
)
return
;
...
...
@@ -2642,6 +2671,7 @@ static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control
SendMessageW
(
control
->
hwnd
,
LVM_INSERTITEMW
,
0
,
(
LPARAM
)
&
lvitem
);
GetDiskFreeSpaceExW
(
ptr
,
&
free
,
&
total
,
NULL
);
difference
=
free
.
QuadPart
-
cost
;
StrFormatByteSizeW
(
total
.
QuadPart
,
size_text
,
MAX_PATH
);
lvitem
.
iSubItem
=
1
;
...
...
@@ -2655,6 +2685,17 @@ static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control
lvitem
.
cchTextMax
=
lstrlenW
(
size_text
)
+
1
;
SendMessageW
(
control
->
hwnd
,
LVM_SETITEMW
,
0
,
(
LPARAM
)
&
lvitem
);
lvitem
.
iSubItem
=
3
;
lvitem
.
pszText
=
cost_text
;
lvitem
.
cchTextMax
=
lstrlenW
(
cost_text
)
+
1
;
SendMessageW
(
control
->
hwnd
,
LVM_SETITEMW
,
0
,
(
LPARAM
)
&
lvitem
);
StrFormatByteSizeW
(
difference
,
size_text
,
MAX_PATH
);
lvitem
.
iSubItem
=
4
;
lvitem
.
pszText
=
size_text
;
lvitem
.
cchTextMax
=
lstrlenW
(
size_text
)
+
1
;
SendMessageW
(
control
->
hwnd
,
LVM_SETITEMW
,
0
,
(
LPARAM
)
&
lvitem
);
ptr
+=
lstrlenW
(
ptr
)
+
1
;
i
++
;
}
...
...
dlls/msi/install.c
View file @
b960b967
...
...
@@ -934,8 +934,24 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
UINT
WINAPI
MsiGetFeatureCostA
(
MSIHANDLE
hInstall
,
LPCSTR
szFeature
,
MSICOSTTREE
iCostTree
,
INSTALLSTATE
iState
,
LPINT
piCost
)
{
FIXME
(
"(%d %s %i %i %p): stub
\n
"
,
hInstall
,
debugstr_a
(
szFeature
),
iCostTree
,
iState
,
piCost
);
LPWSTR
szwFeature
=
NULL
;
UINT
rc
;
szwFeature
=
strdupAtoW
(
szFeature
);
rc
=
MsiGetFeatureCostW
(
hInstall
,
szwFeature
,
iCostTree
,
iState
,
piCost
);
msi_free
(
szwFeature
);
return
rc
;
}
UINT
MSI_GetFeatureCost
(
MSIPACKAGE
*
package
,
MSIFEATURE
*
feature
,
MSICOSTTREE
iCostTree
,
INSTALLSTATE
iState
,
LPINT
piCost
)
{
FIXME
(
"(%s %i %i %p): not implemented yet
\n
"
,
debugstr_w
(
feature
->
Feature
),
iCostTree
,
iState
,
piCost
);
if
(
piCost
)
*
piCost
=
0
;
return
ERROR_SUCCESS
;
}
...
...
@@ -946,10 +962,57 @@ UINT WINAPI MsiGetFeatureCostA(MSIHANDLE hInstall, LPCSTR szFeature,
UINT
WINAPI
MsiGetFeatureCostW
(
MSIHANDLE
hInstall
,
LPCWSTR
szFeature
,
MSICOSTTREE
iCostTree
,
INSTALLSTATE
iState
,
LPINT
piCost
)
{
FIXME
(
"(%d %s %i %i %p): stub
\n
"
,
hInstall
,
debugstr_w
(
szFeature
),
MSIPACKAGE
*
package
;
MSIFEATURE
*
feature
;
UINT
ret
;
TRACE
(
"(%d %s %i %i %p)
\n
"
,
hInstall
,
debugstr_w
(
szFeature
),
iCostTree
,
iState
,
piCost
);
if
(
piCost
)
*
piCost
=
0
;
return
ERROR_SUCCESS
;
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
!
package
)
{
HRESULT
hr
;
BSTR
feature
;
IWineMsiRemotePackage
*
remote_package
;
remote_package
=
(
IWineMsiRemotePackage
*
)
msi_get_remote
(
hInstall
);
if
(
!
remote_package
)
return
ERROR_INVALID_HANDLE
;
feature
=
SysAllocString
(
szFeature
);
if
(
!
feature
)
{
IWineMsiRemotePackage_Release
(
remote_package
);
return
ERROR_OUTOFMEMORY
;
}
hr
=
IWineMsiRemotePackage_GetFeatureCost
(
remote_package
,
feature
,
iCostTree
,
iState
,
piCost
);
SysFreeString
(
feature
);
IWineMsiRemotePackage_Release
(
remote_package
);
if
(
FAILED
(
hr
))
{
if
(
HRESULT_FACILITY
(
hr
)
==
FACILITY_WIN32
)
return
HRESULT_CODE
(
hr
);
return
ERROR_FUNCTION_FAILED
;
}
return
ERROR_SUCCESS
;
}
feature
=
get_loaded_feature
(
package
,
szFeature
);
if
(
feature
)
ret
=
MSI_GetFeatureCost
(
package
,
feature
,
iCostTree
,
iState
,
piCost
);
else
ret
=
ERROR_UNKNOWN_FEATURE
;
msiobj_release
(
&
package
->
hdr
);
return
ret
;
}
/***********************************************************************
...
...
dlls/msi/msipriv.h
View file @
b960b967
...
...
@@ -759,6 +759,7 @@ extern LPCWSTR msi_download_file( LPCWSTR szUrl, LPWSTR filename );
extern
UINT
msi_package_add_info
(
MSIPACKAGE
*
,
DWORD
,
DWORD
,
LPCWSTR
,
LPWSTR
);
extern
UINT
msi_package_add_media_disk
(
MSIPACKAGE
*
,
DWORD
,
DWORD
,
DWORD
,
LPWSTR
,
LPWSTR
);
extern
UINT
msi_clone_properties
(
MSIPACKAGE
*
);
extern
UINT
MSI_GetFeatureCost
(
MSIPACKAGE
*
,
MSIFEATURE
*
,
MSICOSTTREE
,
INSTALLSTATE
,
LPINT
);
/* for deformating */
extern
UINT
MSI_FormatRecordW
(
MSIPACKAGE
*
,
MSIRECORD
*
,
LPWSTR
,
LPDWORD
);
...
...
dlls/msi/msiserver.idl
View file @
b960b967
...
...
@@ -71,6 +71,7 @@ interface IWineMsiRemotePackage : IUnknown
HRESULT
SetInstallLevel
(
[
in
]
int
level
)
;
HRESULT
FormatRecord
(
[
in
]
MSIHANDLE
record
,
[
out
]
BSTR
*
value
)
;
HRESULT
EvaluateCondition
(
[
in
]
BSTR
condition
)
;
HRESULT
GetFeatureCost
(
[
in
]
BSTR
feature
,
[
in
]
INT
cost_tree
,
[
in
]
INSTALLSTATE
state
,
[
out
]
INT
*
cost
)
;
}
[
...
...
dlls/msi/package.c
View file @
b960b967
...
...
@@ -1898,6 +1898,14 @@ static HRESULT WINAPI mrp_EvaluateCondition( IWineMsiRemotePackage *iface, BSTR
return
HRESULT_FROM_WIN32
(
r
);
}
static
HRESULT
WINAPI
mrp_GetFeatureCost
(
IWineMsiRemotePackage
*
iface
,
BSTR
feature
,
INT
cost_tree
,
INSTALLSTATE
state
,
INT
*
cost
)
{
msi_remote_package_impl
*
This
=
mrp_from_IWineMsiRemotePackage
(
iface
);
UINT
r
=
MsiGetFeatureCostW
(
This
->
package
,
feature
,
cost_tree
,
state
,
cost
);
return
HRESULT_FROM_WIN32
(
r
);
}
static
const
IWineMsiRemotePackageVtbl
msi_remote_package_vtbl
=
{
mrp_QueryInterface
,
...
...
@@ -1922,6 +1930,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_SetInstallLevel
,
mrp_FormatRecord
,
mrp_EvaluateCondition
,
mrp_GetFeatureCost
,
};
HRESULT
create_msi_remote_package
(
IUnknown
*
pOuter
,
LPVOID
*
ppObj
)
...
...
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