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
cfb10615
Commit
cfb10615
authored
Oct 25, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Accept descriptors without component.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8aed9e90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
12 deletions
+44
-12
registry.c
dlls/msi/registry.c
+21
-12
db.c
dlls/msi/tests/db.c
+23
-0
No files found.
dlls/msi/registry.c
View file @
cfb10615
...
...
@@ -1024,7 +1024,8 @@ UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
*
* Decomposes an MSI descriptor into product, feature and component parts.
* An MSI descriptor is a string of the form:
* [base 85 guid] [feature code] '>' [base 85 guid]
* [base 85 guid] [feature code] '>' [base 85 guid] or
* [base 85 guid] [feature code] '<'
*
* PARAMS
* szDescriptor [I] the descriptor to decompose
...
...
@@ -1041,21 +1042,21 @@ UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
UINT
WINAPI
MsiDecomposeDescriptorW
(
LPCWSTR
szDescriptor
,
LPWSTR
szProduct
,
LPWSTR
szFeature
,
LPWSTR
szComponent
,
LPDWORD
pUsed
)
{
UINT
r
,
len
;
LPWSTR
p
;
UINT
len
;
const
WCHAR
*
p
;
GUID
product
,
component
;
TRACE
(
"%s %p %p %p %p
\n
"
,
debugstr_w
(
szDescriptor
),
szProduct
,
szFeature
,
szComponent
,
pUsed
);
r
=
decode_base85_guid
(
szDescriptor
,
&
product
);
if
(
!
r
)
if
(
!
decode_base85_guid
(
szDescriptor
,
&
product
))
return
ERROR_INVALID_PARAMETER
;
TRACE
(
"product %s
\n
"
,
debugstr_guid
(
&
product
));
p
=
strchrW
(
&
szDescriptor
[
20
],
'>'
);
if
(
!
p
)
if
(
!
(
p
=
strchrW
(
&
szDescriptor
[
20
],
'>'
)))
p
=
strchrW
(
&
szDescriptor
[
20
],
'<'
);
if
(
!
p
)
return
ERROR_INVALID_PARAMETER
;
len
=
(
p
-
&
szDescriptor
[
20
]);
...
...
@@ -1064,22 +1065,30 @@ UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR szDescriptor, LPWSTR szProduct,
TRACE
(
"feature %s
\n
"
,
debugstr_wn
(
&
szDescriptor
[
20
],
len
));
r
=
decode_base85_guid
(
p
+
1
,
&
component
);
if
(
!
r
)
if
(
*
p
==
'>'
)
{
if
(
!
decode_base85_guid
(
p
+
1
,
&
component
))
return
ERROR_INVALID_PARAMETER
;
TRACE
(
"component %s
\n
"
,
debugstr_guid
(
&
component
));
TRACE
(
"component %s
\n
"
,
debugstr_guid
(
&
component
)
);
}
if
(
szProduct
)
StringFromGUID2
(
&
product
,
szProduct
,
MAX_FEATURE_CHARS
+
1
);
if
(
szComponent
)
{
if
(
*
p
==
'>'
)
StringFromGUID2
(
&
component
,
szComponent
,
MAX_FEATURE_CHARS
+
1
);
else
szComponent
[
0
]
=
0
;
}
if
(
szFeature
)
{
memcpy
(
szFeature
,
&
szDescriptor
[
20
],
len
*
sizeof
(
WCHAR
)
);
szFeature
[
len
]
=
0
;
}
len
=
(
&
p
[
21
]
-
szDescriptor
);
len
=
p
-
szDescriptor
+
1
;
if
(
*
p
==
'>'
)
len
+=
20
;
TRACE
(
"length = %d
\n
"
,
len
);
if
(
pUsed
)
*
pUsed
=
len
;
...
...
dlls/msi/tests/db.c
View file @
cfb10615
...
...
@@ -470,6 +470,7 @@ static void test_msidecomposedesc(void)
/* test a valid feature descriptor */
desc
=
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit>3w2x^IGfe?CxI5heAvk."
;
len
=
0
;
prod
[
0
]
=
feature
[
0
]
=
comp
[
0
]
=
0
;
r
=
pMsiDecomposeDescriptorA
(
desc
,
prod
,
feature
,
comp
,
&
len
);
ok
(
r
==
ERROR_SUCCESS
,
"returned an error
\n
"
);
ok
(
len
==
strlen
(
desc
),
"length was wrong
\n
"
);
...
...
@@ -485,6 +486,28 @@ static void test_msidecomposedesc(void)
r
=
pMsiDecomposeDescriptorA
(
desc
,
prod
,
feature
,
comp
,
&
len
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"returned wrong error
\n
"
);
/* test a feature descriptor with < instead of > */
desc
=
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit<3w2x^IGfe?CxI5heAvk."
;
len
=
0
;
prod
[
0
]
=
feature
[
0
]
=
0
;
comp
[
0
]
=
0x55
;
r
=
pMsiDecomposeDescriptorA
(
desc
,
prod
,
feature
,
comp
,
&
len
);
ok
(
r
==
ERROR_SUCCESS
,
"returned an error
\n
"
);
ok
(
len
==
41
,
"got %u
\n
"
,
len
);
ok
(
!
strcmp
(
prod
,
"{90110409-6000-11D3-8CFE-0150048383C9}"
),
"got '%s'
\n
"
,
prod
);
ok
(
!
strcmp
(
feature
,
"FollowTheWhiteRabbit"
),
"got '%s'
\n
"
,
feature
);
ok
(
!
comp
[
0
],
"got '%s'
\n
"
,
comp
);
len
=
0
;
prod
[
0
]
=
feature
[
0
]
=
0
;
comp
[
0
]
=
0x55
;
r
=
pMsiDecomposeDescriptorA
(
"yh1BVN)8A$!!!!!MKKSkAlwaysInstalledIntl_1033<"
,
prod
,
feature
,
comp
,
&
len
);
ok
(
r
==
ERROR_SUCCESS
,
"got %u
\n
"
,
r
);
ok
(
len
==
45
,
"got %u
\n
"
,
len
);
ok
(
!
strcmp
(
prod
,
"{90150000-006E-0409-0000-0000000FF1CE}"
),
"got '%s'
\n
"
,
prod
);
ok
(
!
strcmp
(
feature
,
"AlwaysInstalledIntl_1033"
),
"got '%s'
\n
"
,
feature
);
ok
(
!
comp
[
0
],
"got '%s'
\n
"
,
comp
);
/*
* Test a valid feature descriptor with the
* maximum number of characters and some trailing characters.
...
...
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