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
6488a6a5
Commit
6488a6a5
authored
Jan 09, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Extend registry helpers to support opening the features key for a specific user.
parent
f279d09f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
25 deletions
+33
-25
action.c
dlls/msi/action.c
+4
-4
msi.c
dlls/msi/msi.c
+5
-5
msipriv.h
dlls/msi/msipriv.h
+2
-2
registry.c
dlls/msi/registry.c
+22
-14
No files found.
dlls/msi/action.c
View file @
6488a6a5
...
@@ -4852,12 +4852,12 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
...
@@ -4852,12 +4852,12 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
if
(
!
msi_check_publish
(
package
))
if
(
!
msi_check_publish
(
package
))
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
rc
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
rc
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
NULL
,
package
->
Context
,
&
hkey
,
TRUE
);
&
hkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
goto
end
;
rc
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
rc
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
NULL
,
package
->
Context
,
&
userdata
,
TRUE
);
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
goto
end
;
...
@@ -4957,7 +4957,7 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
...
@@ -4957,7 +4957,7 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
TRACE
(
"unpublishing feature %s
\n
"
,
debugstr_w
(
feature
->
Feature
));
TRACE
(
"unpublishing feature %s
\n
"
,
debugstr_w
(
feature
->
Feature
));
r
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
r
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
NULL
,
package
->
Context
,
&
hkey
,
FALSE
);
&
hkey
,
FALSE
);
if
(
r
==
ERROR_SUCCESS
)
if
(
r
==
ERROR_SUCCESS
)
{
{
...
@@ -4965,7 +4965,7 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
...
@@ -4965,7 +4965,7 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
}
}
r
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
r
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
NULL
,
package
->
Context
,
&
hkey
,
FALSE
);
&
hkey
,
FALSE
);
if
(
r
==
ERROR_SUCCESS
)
if
(
r
==
ERROR_SUCCESS
)
{
{
...
...
dlls/msi/msi.c
View file @
6488a6a5
...
@@ -2982,12 +2982,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -2982,12 +2982,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
SetLastError
(
ERROR_SUCCESS
);
SetLastError
(
ERROR_SUCCESS
);
if
(
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_USERMANAGED
,
if
(
MSIREG_OpenFeaturesKey
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_USERMANAGED
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSIREG_OpenFeaturesKey
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
{
{
rc
=
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_MACHINE
,
rc
=
MSIREG_OpenFeaturesKey
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
&
hkey
,
FALSE
);
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_UNKNOWN
;
return
INSTALLSTATE_UNKNOWN
;
...
@@ -3007,11 +3007,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
...
@@ -3007,11 +3007,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
return
r
;
return
r
;
if
(
machine
)
if
(
machine
)
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
MSIINSTALLCONTEXT_MACHINE
,
&
hkey
,
FALSE
);
&
hkey
,
FALSE
);
else
else
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
&
hkey
,
FALSE
);
&
hkey
,
FALSE
);
...
...
dlls/msi/msipriv.h
View file @
6488a6a5
...
@@ -885,10 +885,10 @@ extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)
...
@@ -885,10 +885,10 @@ extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)
extern
UINT
MSIREG_DeleteUninstallKey
(
const
WCHAR
*
,
enum
platform
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_DeleteUninstallKey
(
const
WCHAR
*
,
enum
platform
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
extern
UINT
MSIREG_OpenProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
extern
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenUserPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenUserPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
DECLSPEC_HIDDEN
;
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
LPCWSTR
szUserSid
,
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
LPCWSTR
szUserSid
,
...
...
dlls/msi/registry.c
View file @
6488a6a5
...
@@ -562,12 +562,12 @@ UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create)
...
@@ -562,12 +562,12 @@ UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY *key, BOOL create)
return
RegOpenKeyW
(
HKEY_CURRENT_USER
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_CURRENT_USER
,
keypath
,
key
);
}
}
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
{
{
LPWSTR
usersid
;
HKEY
root
=
HKEY_LOCAL_MACHINE
;
HKEY
root
=
HKEY_LOCAL_MACHINE
;
REGSAM
access
=
KEY_WOW64_64KEY
|
KEY_ALL_ACCESS
;
REGSAM
access
=
KEY_WOW64_64KEY
|
KEY_ALL_ACCESS
;
WCHAR
squished_pc
[
GUID_SIZE
],
keypath
[
MAX_PATH
];
WCHAR
squished_pc
[
GUID_SIZE
],
keypath
[
MAX_PATH
]
,
*
usersid
=
NULL
;
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"%s squished %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
squished_pc
));
TRACE
(
"%s squished %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
squished_pc
));
...
@@ -585,12 +585,16 @@ UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY *
...
@@ -585,12 +585,16 @@ UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY *
}
}
else
else
{
{
if
(
!
(
usersid
=
get_user_sid
())
)
if
(
!
szUserSid
)
{
{
ERR
(
"Failed to retrieve user SID
\n
"
);
if
(
!
(
usersid
=
get_user_sid
()))
return
ERROR_FUNCTION_FAILED
;
{
ERR
(
"Failed to retrieve user SID
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
szUserSid
=
usersid
;
}
}
sprintfW
(
keypath
,
szInstaller_LocalManagedFeat_fmt
,
users
id
,
squished_pc
);
sprintfW
(
keypath
,
szInstaller_LocalManagedFeat_fmt
,
szUserS
id
,
squished_pc
);
LocalFree
(
usersid
);
LocalFree
(
usersid
);
}
}
if
(
create
)
return
RegCreateKeyExW
(
root
,
keypath
,
0
,
NULL
,
0
,
access
,
NULL
,
key
,
NULL
);
if
(
create
)
return
RegCreateKeyExW
(
root
,
keypath
,
0
,
NULL
,
0
,
access
,
NULL
,
key
,
NULL
);
...
@@ -624,11 +628,11 @@ static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL c
...
@@ -624,11 +628,11 @@ static UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL c
return
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
keypath
,
0
,
access
,
key
);
return
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
keypath
,
0
,
access
,
key
);
}
}
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
{
{
LPWSTR
usersid
;
REGSAM
access
=
KEY_WOW64_64KEY
|
KEY_ALL_ACCESS
;
REGSAM
access
=
KEY_WOW64_64KEY
|
KEY_ALL_ACCESS
;
WCHAR
squished_pc
[
GUID_SIZE
],
keypath
[
0x200
];
WCHAR
squished_pc
[
GUID_SIZE
],
keypath
[
0x200
]
,
*
usersid
=
NULL
;
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"%s squished %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
squished_pc
));
TRACE
(
"%s squished %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
squished_pc
));
...
@@ -639,12 +643,16 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context
...
@@ -639,12 +643,16 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context
}
}
else
else
{
{
if
(
!
(
usersid
=
get_user_sid
())
)
if
(
!
szUserSid
)
{
{
ERR
(
"Failed to retrieve user SID
\n
"
);
if
(
!
(
usersid
=
get_user_sid
()))
return
ERROR_FUNCTION_FAILED
;
{
ERR
(
"Failed to retrieve user SID
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
szUserSid
=
usersid
;
}
}
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
users
id
,
squished_pc
);
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
szUserS
id
,
squished_pc
);
LocalFree
(
usersid
);
LocalFree
(
usersid
);
}
}
if
(
create
)
return
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
keypath
,
0
,
NULL
,
0
,
access
,
NULL
,
key
,
NULL
);
if
(
create
)
return
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
keypath
,
0
,
NULL
,
0
,
access
,
NULL
,
key
,
NULL
);
...
...
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