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
ca7cd1bf
Commit
ca7cd1bf
authored
Oct 06, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Validate packages based on supported version, platform and languages.
parent
8bc9a499
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
1 deletion
+50
-1
msipriv.h
dlls/msi/msipriv.h
+2
-0
package.c
dlls/msi/package.c
+36
-1
suminfo.c
dlls/msi/suminfo.c
+12
-0
No files found.
dlls/msi/msipriv.h
View file @
ca7cd1bf
...
...
@@ -315,6 +315,7 @@ typedef struct tagMSIPACKAGE
{
MSIOBJECTHDR
hdr
;
MSIDATABASE
*
db
;
INT
version
;
enum
platform
platform
;
UINT
num_langids
;
LANGID
*
langids
;
...
...
@@ -855,6 +856,7 @@ extern UINT msi_spawn_error_dialog( MSIPACKAGE*, LPWSTR, LPWSTR );
/* summary information */
extern
MSISUMMARYINFO
*
MSI_GetSummaryInformationW
(
IStorage
*
stg
,
UINT
uiUpdateCount
);
extern
LPWSTR
msi_suminfo_dup_string
(
MSISUMMARYINFO
*
si
,
UINT
uiProperty
);
extern
INT
msi_suminfo_get_int32
(
MSISUMMARYINFO
*
si
,
UINT
uiProperty
);
extern
LPWSTR
msi_get_suminfo_product
(
IStorage
*
stg
);
extern
UINT
msi_add_suminfo
(
MSIDATABASE
*
db
,
LPWSTR
**
records
,
int
num_records
,
int
num_columns
);
...
...
dlls/msi/package.c
View file @
ca7cd1bf
...
...
@@ -1292,6 +1292,9 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
WCHAR
*
template
,
*
p
,
*
q
;
DWORD
i
,
count
;
package
->
version
=
msi_suminfo_get_int32
(
si
,
PID_PAGECOUNT
);
TRACE
(
"version: %d
\n
"
,
package
->
version
);
template
=
msi_suminfo_dup_string
(
si
,
PID_TEMPLATE
);
if
(
!
template
)
return
ERROR_SUCCESS
;
/* native accepts missing template property */
...
...
@@ -1316,7 +1319,7 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
{
WARN
(
"unknown platform %s
\n
"
,
debugstr_w
(
template
));
msi_free
(
template
);
return
ERROR_
PATCH_PACKAGE_INVALI
D
;
return
ERROR_
INSTALL_PLATFORM_UNSUPPORTE
D
;
}
count
=
1
;
...
...
@@ -1345,6 +1348,32 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
return
ERROR_SUCCESS
;
}
static
UINT
validate_package
(
MSIPACKAGE
*
package
)
{
static
const
BOOL
is_64bit
=
sizeof
(
void
*
)
>
sizeof
(
int
);
BOOL
is_wow64
;
UINT
i
;
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
);
if
(
package
->
platform
==
PLATFORM_X64
)
{
if
(
!
is_64bit
&&
!
is_wow64
)
return
ERROR_INSTALL_PLATFORM_UNSUPPORTED
;
if
(
package
->
version
<
200
)
return
ERROR_INSTALL_PACKAGE_INVALID
;
}
if
(
!
package
->
num_langids
)
{
return
ERROR_SUCCESS
;
}
for
(
i
=
0
;
i
<
package
->
num_langids
;
i
++
)
{
if
(
!
package
->
langids
[
i
]
||
IsValidLocale
(
package
->
langids
[
i
],
LCID_INSTALLED
))
return
ERROR_SUCCESS
;
}
return
ERROR_INSTALL_LANGUAGE_UNSUPPORTED
;
}
UINT
MSI_OpenPackageW
(
LPCWSTR
szPackage
,
MSIPACKAGE
**
pPackage
)
{
static
const
WCHAR
Database
[]
=
{
'D'
,
'A'
,
'T'
,
'A'
,
'B'
,
'A'
,
'S'
,
'E'
,
0
};
...
...
@@ -1474,6 +1503,12 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
return
r
;
}
r
=
validate_package
(
package
);
if
(
r
!=
ERROR_SUCCESS
)
{
msiobj_release
(
&
package
->
hdr
);
return
r
;
}
msi_set_property
(
package
->
db
,
Database
,
db
->
path
);
if
(
UrlIsW
(
szPackage
,
URLIS_URL
)
)
...
...
dlls/msi/suminfo.c
View file @
ca7cd1bf
...
...
@@ -644,6 +644,18 @@ LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty )
return
strdupAtoW
(
prop
->
u
.
pszVal
);
}
INT
msi_suminfo_get_int32
(
MSISUMMARYINFO
*
si
,
UINT
uiProperty
)
{
PROPVARIANT
*
prop
;
if
(
uiProperty
>=
MSI_MAX_PROPS
)
return
-
1
;
prop
=
&
si
->
property
[
uiProperty
];
if
(
prop
->
vt
!=
VT_I4
)
return
-
1
;
return
prop
->
u
.
lVal
;
}
LPWSTR
msi_get_suminfo_product
(
IStorage
*
stg
)
{
MSISUMMARYINFO
*
si
;
...
...
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