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
e3074348
Commit
e3074348
authored
Nov 03, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Nov 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Factor out the code to open the UserData features key.
parent
0c01c586
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
48 deletions
+33
-48
action.c
dlls/msi/action.c
+6
-15
msi.c
dlls/msi/msi.c
+6
-2
msipriv.h
dlls/msi/msipriv.h
+2
-2
registry.c
dlls/msi/registry.c
+19
-29
No files found.
dlls/msi/action.c
View file @
e3074348
...
...
@@ -3846,20 +3846,10 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
rc
=
MSIREG_OpenLocalUserDataFeaturesKey
(
package
->
ProductCode
,
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
else
{
rc
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
rc
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
/* here the guids are base 85 encoded */
LIST_FOR_EACH_ENTRY
(
feature
,
&
package
->
features
,
MSIFEATURE
,
entry
)
...
...
@@ -3965,7 +3955,8 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
RegCloseKey
(
hkey
);
}
r
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
&
hkey
,
FALSE
);
r
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
&
hkey
,
FALSE
);
if
(
r
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
hkey
,
feature
->
Feature
);
...
...
dlls/msi/msi.c
View file @
e3074348
...
...
@@ -1958,9 +1958,13 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
return
r
;
if
(
machine
)
rc
=
MSIREG_OpenLocalUserDataFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_MACHINE
,
&
hkey
,
FALSE
);
else
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenUserDataFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_ADVERTISED
;
...
...
dlls/msi/msipriv.h
View file @
e3074348
...
...
@@ -770,7 +770,8 @@ extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenInstallerFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
...
...
@@ -788,7 +789,6 @@ extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct);
extern
UINT
MSIREG_DeleteUserDataProductKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_OpenLocalSystemProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalSystemComponentKey
(
LPCWSTR
szComponent
,
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
);
extern
UINT
MSIREG_DeleteUserDataComponentKey
(
LPCWSTR
szComponent
);
...
...
dlls/msi/registry.c
View file @
e3074348
...
...
@@ -684,47 +684,37 @@ UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
UINT
r
;
LPWSTR
usersid
;
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
LPWSTR
usersid
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
TRACE
(
"(%s, %d, %d)
\n
"
,
debugstr_w
(
szProduct
),
context
,
create
);
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
if
(
context
==
MSIINSTALLCONTEXT_MACHINE
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
rc
);
return
rc
;
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
localsid
,
squished_pc
);
}
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
usersid
,
squished_pc
);
if
(
create
)
rc
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
else
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
LocalFree
(
usersid
);
return
rc
;
}
UINT
MSIREG_OpenLocalUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
if
(
!
squash_guid
(
szProduct
,
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
,
szUserDataFeatures_fmt
,
localsid
,
squished_pc
);
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
usersid
,
squished_pc
);
LocalFree
(
usersid
);
}
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
...
...
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