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
63064f7a
Commit
63064f7a
authored
Aug 25, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Aug 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle features installed as source in MsiQueryFeatureState.
parent
ad156168
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
30 deletions
+39
-30
msi.c
dlls/msi/msi.c
+10
-0
msi.c
dlls/msi/tests/msi.c
+29
-0
package.c
dlls/msi/tests/package.c
+0
-30
No files found.
dlls/msi/msi.c
View file @
63064f7a
...
@@ -1905,6 +1905,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -1905,6 +1905,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
INSTALLSTATE
r
;
INSTALLSTATE
r
;
BOOL
missing
=
FALSE
;
BOOL
missing
=
FALSE
;
BOOL
machine
=
FALSE
;
BOOL
machine
=
FALSE
;
BOOL
source
=
FALSE
;
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
));
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
));
...
@@ -1978,6 +1979,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -1978,6 +1979,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
path
=
msi_reg_get_val_str
(
hkey
,
squishProduct
);
path
=
msi_reg_get_val_str
(
hkey
,
squishProduct
);
if
(
!
path
)
if
(
!
path
)
missing
=
TRUE
;
missing
=
TRUE
;
else
if
(
lstrlenW
(
path
)
>
2
&&
path
[
0
]
>=
'0'
&&
path
[
0
]
<=
'9'
&&
path
[
1
]
>=
'0'
&&
path
[
1
]
<=
'9'
)
{
source
=
TRUE
;
}
msi_free
(
path
);
msi_free
(
path
);
}
}
...
@@ -1988,6 +1995,9 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -1988,6 +1995,9 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
missing
)
if
(
missing
)
return
INSTALLSTATE_ADVERTISED
;
return
INSTALLSTATE_ADVERTISED
;
if
(
source
)
return
INSTALLSTATE_SOURCE
;
return
INSTALLSTATE_LOCAL
;
return
INSTALLSTATE_LOCAL
;
}
}
...
...
dlls/msi/tests/msi.c
View file @
63064f7a
...
@@ -920,6 +920,35 @@ static void test_MsiQueryFeatureState(void)
...
@@ -920,6 +920,35 @@ static void test_MsiQueryFeatureState(void)
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_LOCAL */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01
\\
"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_SOURCE */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* bad INSTALLSTATE_SOURCE */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01a"
,
4
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* INSTALLSTATE_SOURCE */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"01"
,
3
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* bad INSTALLSTATE_SOURCE */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
...
...
dlls/msi/tests/package.c
View file @
63064f7a
...
@@ -3730,20 +3730,14 @@ static void test_states(void)
...
@@ -3730,20 +3730,14 @@ static void test_states(void)
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
...
@@ -4477,20 +4471,14 @@ static void test_states(void)
...
@@ -4477,20 +4471,14 @@ static void test_states(void)
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
...
@@ -4521,20 +4509,14 @@ static void test_states(void)
...
@@ -4521,20 +4509,14 @@ static void test_states(void)
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"six"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"six"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"seven"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"seven"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
ok
(
action
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
action
);
state
=
0xdeadbee
;
state
=
0xdeadbee
;
...
@@ -5221,21 +5203,15 @@ static void test_states(void)
...
@@ -5221,21 +5203,15 @@ static void test_states(void)
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"one"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"two"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
...
@@ -5265,21 +5241,15 @@ static void test_states(void)
...
@@ -5265,21 +5241,15 @@ static void test_states(void)
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"six"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"six"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
r
=
MsiGetFeatureState
(
hpkg
,
"seven"
,
&
state
,
&
action
);
r
=
MsiGetFeatureState
(
hpkg
,
"seven"
,
&
state
,
&
action
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_SOURCE
,
"Expected INSTALLSTATE_SOURCE, got %d
\n
"
,
state
);
}
state
=
0xdeadbee
;
state
=
0xdeadbee
;
action
=
0xdeadbee
;
action
=
0xdeadbee
;
...
...
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