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
200eba3b
Commit
200eba3b
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 user managed context in MsiQueryFeatureState.
parent
aefd63dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
39 deletions
+54
-39
msi.c
dlls/msi/msi.c
+4
-3
msipriv.h
dlls/msi/msipriv.h
+1
-0
registry.c
dlls/msi/registry.c
+40
-0
msi.c
dlls/msi/tests/msi.c
+9
-36
No files found.
dlls/msi/msi.c
View file @
200eba3b
...
...
@@ -1821,10 +1821,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
!
squash_guid
(
szProduct
,
squishProduct
))
return
INSTALLSTATE_INVALIDARG
;
/* check that it's installed at all */
rc
=
MSIREG_OpenUserFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
MSIREG_OpenManagedFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenUserFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
{
return
INSTALLSTATE_UNKNOWN
;
}
parent_feature
=
msi_reg_get_val_str
(
hkey
,
szFeature
);
RegCloseKey
(
hkey
);
...
...
dlls/msi/msipriv.h
View file @
200eba3b
...
...
@@ -788,6 +788,7 @@ extern UINT MSIREG_OpenLocalSystemComponentKey(LPCWSTR szComponent, HKEY *key, B
extern
UINT
MSIREG_OpenLocalClassesProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalClassesFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalManagedProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenManagedFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_DeleteUserFeaturesKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
);
...
...
dlls/msi/registry.c
View file @
200eba3b
...
...
@@ -220,6 +220,16 @@ static const WCHAR szInstaller_LocalManagedProd_fmt[] = {
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szInstaller_LocalManagedFeat_fmt
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'd'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'F'
,
'e'
,
'a'
,
't'
,
'u'
,
'r'
,
'e'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szInstaller_ClassesUpgrade_fmt
[]
=
{
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
's'
,
'\\'
,
...
...
@@ -1128,6 +1138,36 @@ UINT MSIREG_OpenLocalManagedProductKey(LPCWSTR szProductCode, HKEY *key, BOOL cr
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_OpenManagedFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
LPWSTR
usersid
;
UINT
r
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProductCode
));
if
(
!
squash_guid
(
szProductCode
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
r
=
get_user_sid
(
&
usersid
);
if
(
r
!=
ERROR_SUCCESS
||
!
usersid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
r
);
return
r
;
}
sprintfW
(
keypath
,
szInstaller_LocalManagedFeat_fmt
,
usersid
,
squished_pc
);
LocalFree
(
usersid
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_OpenClassesUpgradeCodesKey
(
LPCWSTR
szUpgradeCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
dlls/msi/tests/msi.c
View file @
200eba3b
...
...
@@ -842,10 +842,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
,
usersid
);
...
...
@@ -858,46 +855,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
,
usersid
);
...
...
@@ -908,28 +890,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