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
b198f4f2
Commit
b198f4f2
authored
Dec 09, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Dec 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add the ability to open multiple users' component keys.
parent
930b429d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
37 deletions
+27
-37
action.c
dlls/msi/action.c
+4
-2
msi.c
dlls/msi/msi.c
+6
-6
msipriv.h
dlls/msi/msipriv.h
+2
-2
registry.c
dlls/msi/registry.c
+15
-27
No files found.
dlls/msi/action.c
View file @
b198f4f2
...
...
@@ -2859,9 +2859,11 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
continue
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
MSIREG_OpenLocalUserDataComponentKey
(
comp
->
ComponentId
,
&
hkey
,
TRUE
);
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
->
ComponentId
,
szLocalSid
,
&
hkey
,
TRUE
);
else
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
->
ComponentId
,
&
hkey
,
TRUE
);
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
->
ComponentId
,
NULL
,
&
hkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
continue
;
...
...
dlls/msi/msi.c
View file @
b198f4f2
...
...
@@ -618,7 +618,7 @@ UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer)
if
(
!
squash_guid
(
szComponent
,
squished_comp
))
return
ERROR_INVALID_PARAMETER
;
if
(
MSIREG_OpenUserDataComponentKey
(
szComponent
,
&
compkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
if
(
MSIREG_OpenUserDataComponentKey
(
szComponent
,
NULL
,
&
compkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenLocalSystemComponentKey
(
szComponent
,
&
compkey
,
FALSE
)
!=
ERROR_SUCCESS
)
{
return
ERROR_UNKNOWN_COMPONENT
;
...
...
@@ -1326,7 +1326,7 @@ static BOOL msi_comp_find_prodcode(LPWSTR squished_pc,
if
(
context
==
MSIINSTALLCONTEXT_MACHINE
)
r
=
MSIREG_OpenLocalSystemComponentKey
(
comp
,
&
hkey
,
FALSE
);
else
r
=
MSIREG_OpenUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
r
=
MSIREG_OpenUserDataComponentKey
(
comp
,
NULL
,
&
hkey
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
FALSE
;
...
...
@@ -1777,7 +1777,7 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
state
=
INSTALLSTATE_UNKNOWN
;
if
(
MSIREG_OpenLocalSystemComponentKey
(
szComponent
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
||
MSIREG_OpenUserDataComponentKey
(
szComponent
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
MSIREG_OpenUserDataComponentKey
(
szComponent
,
NULL
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
{
path
=
msi_reg_get_val_str
(
hkey
,
squished_pc
);
RegCloseKey
(
hkey
);
...
...
@@ -1803,7 +1803,7 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
RegCloseKey
(
hkey
);
if
(
MSIREG_OpenLocalSystemComponentKey
(
szComponent
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
||
MSIREG_OpenUserDataComponentKey
(
szComponent
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
MSIREG_OpenUserDataComponentKey
(
szComponent
,
NULL
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
{
msi_free
(
path
);
path
=
msi_reg_get_val_str
(
hkey
,
squished_pc
);
...
...
@@ -1991,9 +1991,9 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
StringFromGUID2
(
&
guid
,
comp
,
GUID_SIZE
);
if
(
machine
)
rc
=
MSIREG_Open
LocalUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
rc
=
MSIREG_Open
UserDataComponentKey
(
comp
,
szLocalSid
,
&
hkey
,
FALSE
);
else
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
,
NULL
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
{
...
...
dlls/msi/msipriv.h
View file @
b198f4f2
...
...
@@ -773,8 +773,8 @@ extern UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL c
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_Open
LocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_Open
UserDataComponentKey
(
LPCWSTR
szComponent
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
);
...
...
dlls/msi/registry.c
View file @
b198f4f2
...
...
@@ -753,24 +753,6 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenLocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
comp
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szComponent
));
if
(
!
squash_guid
(
szComponent
,
comp
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
sprintfW
(
keypath
,
szUserDataComp_fmt
,
szLocalSid
,
comp
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
)
{
WCHAR
comp
[
GUID_SIZE
];
...
...
@@ -785,7 +767,8 @@ UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent)
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
WCHAR
comp
[
GUID_SIZE
];
...
...
@@ -797,21 +780,26 @@ UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
if
(
!
szUserSid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
rc
);
return
rc
;
}
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
rc
);
return
rc
;
}
sprintfW
(
keypath
,
szUserDataComp_fmt
,
usersid
,
comp
);
sprintfW
(
keypath
,
szUserDataComp_fmt
,
usersid
,
comp
);
LocalFree
(
usersid
);
}
else
sprintfW
(
keypath
,
szUserDataComp_fmt
,
szUserSid
,
comp
);
if
(
create
)
rc
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
else
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
LocalFree
(
usersid
);
return
rc
;
}
...
...
@@ -1433,7 +1421,7 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct)
if
(
!
szComponent
||
!*
szComponent
||
!
szProduct
)
return
ERROR_INVALID_PARAMETER
;
if
(
MSIREG_OpenUserDataComponentKey
(
szComponent
,
&
hkeyComp
,
FALSE
)
!=
ERROR_SUCCESS
&&
if
(
MSIREG_OpenUserDataComponentKey
(
szComponent
,
NULL
,
&
hkeyComp
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenLocalSystemComponentKey
(
szComponent
,
&
hkeyComp
,
FALSE
)
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_COMPONENT
;
...
...
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