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
72fedf7d
Commit
72fedf7d
authored
Jun 23, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle the machine context in MsiQueryFeatureState.
parent
200eba3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
40 deletions
+26
-40
msi.c
dlls/msi/msi.c
+17
-4
msi.c
dlls/msi/tests/msi.c
+9
-36
No files found.
dlls/msi/msi.c
View file @
72fedf7d
...
...
@@ -1812,6 +1812,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
HKEY
hkey
;
INSTALLSTATE
r
;
BOOL
missing
=
FALSE
;
BOOL
machine
=
FALSE
;
TRACE
(
"%s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
));
...
...
@@ -1824,7 +1825,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
MSIREG_OpenManagedFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenUserFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
{
return
INSTALLSTATE_UNKNOWN
;
rc
=
MSIREG_OpenLocalClassesFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_UNKNOWN
;
machine
=
TRUE
;
}
parent_feature
=
msi_reg_get_val_str
(
hkey
,
szFeature
);
...
...
@@ -1838,8 +1843,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
r
==
INSTALLSTATE_ABSENT
)
return
r
;
/* now check if it's complete or advertised */
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
machine
)
rc
=
MSIREG_OpenLocalUserDataFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
else
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_ADVERTISED
;
...
...
@@ -1863,7 +1871,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
}
StringFromGUID2
(
&
guid
,
comp
,
GUID_SIZE
);
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
if
(
machine
)
rc
=
MSIREG_OpenLocalUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
else
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
{
msi_free
(
components
);
...
...
dlls/msi/tests/msi.c
View file @
72fedf7d
...
...
@@ -930,10 +930,7 @@ static void test_MsiQueryFeatureState(void)
/* feature value exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
"S-1-5-18
\\
Products
\\
"
);
...
...
@@ -945,46 +942,31 @@ static void test_MsiQueryFeatureState(void)
/* userdata features key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaa"
,
20
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_BADCONFIG
,
"Expected INSTALLSTATE_BADCONFIG, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_BADCONFIG
,
"Expected INSTALLSTATE_BADCONFIG, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaa"
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaaa"
,
22
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
comp_base85
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
"S-1-5-18
\\
Components
\\
"
);
...
...
@@ -994,28 +976,19 @@ static void test_MsiQueryFeatureState(void)
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteKeyA
(
compkey
,
""
);
...
...
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