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
cdf3c236
Commit
cdf3c236
authored
Jan 18, 2015
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jan 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Open 32-bit component registry keys with KEY_WOW64_32KEY flag.
parent
03f6a6e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
action.c
dlls/msi/action.c
+21
-13
install.c
dlls/msi/tests/install.c
+2
-2
No files found.
dlls/msi/action.c
View file @
cdf3c236
...
...
@@ -2612,14 +2612,24 @@ static WCHAR *get_keypath( MSICOMPONENT *comp, HKEY root, const WCHAR *path )
return
strdupW
(
path
);
}
static
HKEY
open_key
(
HKEY
root
,
const
WCHAR
*
path
,
BOOL
create
)
static
inline
REGSAM
get_registry_view
(
const
MSICOMPONENT
*
comp
)
{
REGSAM
view
=
0
;
if
(
is_wow64
||
is_64bit
)
view
|=
(
comp
->
Attributes
&
msidbComponentAttributes64bit
)
?
KEY_WOW64_64KEY
:
KEY_WOW64_32KEY
;
return
view
;
}
static
HKEY
open_key
(
const
MSICOMPONENT
*
comp
,
HKEY
root
,
const
WCHAR
*
path
,
BOOL
create
)
{
REGSAM
access
=
KEY_ALL_ACCESS
;
WCHAR
*
subkey
,
*
p
,
*
q
;
HKEY
hkey
,
ret
=
NULL
;
LONG
res
;
if
(
is_wow64
)
access
|=
KEY_WOW64_64KEY
;
if
(
comp
)
access
|=
get_registry_view
(
comp
);
else
if
(
is_wow64
)
access
|=
KEY_WOW64_64KEY
;
if
(
!
(
subkey
=
strdupW
(
path
)))
return
NULL
;
p
=
subkey
;
...
...
@@ -2636,7 +2646,7 @@ static HKEY open_key( HKEY root, const WCHAR *path, BOOL create )
}
if
(
q
&&
q
[
1
])
{
ret
=
open_key
(
hkey
,
q
+
1
,
create
);
ret
=
open_key
(
comp
,
hkey
,
q
+
1
,
create
);
RegCloseKey
(
hkey
);
}
else
ret
=
hkey
;
...
...
@@ -2817,7 +2827,7 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
BYTE
*
new_value
,
*
old_value
=
NULL
;
HKEY
root_key
,
hkey
;
DWORD
type
,
old_type
,
new_size
,
old_size
=
0
;
LPWSTR
deformated
,
uikey
,
keypath
;
LPWSTR
deformated
,
uikey
;
const
WCHAR
*
szRoot
,
*
component
,
*
name
,
*
key
,
*
str
;
MSICOMPONENT
*
comp
;
MSIRECORD
*
uirow
;
...
...
@@ -2861,15 +2871,14 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
strcpyW
(
uikey
,
szRoot
);
strcatW
(
uikey
,
deformated
);
keypath
=
get_keypath
(
comp
,
root_key
,
deformated
);
msi_free
(
deformated
);
if
(
!
(
hkey
=
open_key
(
root_key
,
keypath
,
TRUE
)))
if
(
!
(
hkey
=
open_key
(
comp
,
root_key
,
deformated
,
TRUE
)))
{
ERR
(
"Could not create key %s
\n
"
,
debugstr_w
(
keypath
));
ERR
(
"Could not create key %s
\n
"
,
debugstr_w
(
deformated
));
msi_free
(
uikey
);
msi_free
(
keypath
);
msi_free
(
deformated
);
return
ERROR_FUNCTION_FAILED
;
}
msi_free
(
deformated
);
str
=
msi_record_get_string
(
row
,
5
,
NULL
);
len
=
deformat_string
(
package
,
str
,
&
deformated
);
new_value
=
parse_value
(
package
,
deformated
,
len
,
&
type
,
&
new_size
);
...
...
@@ -2922,7 +2931,6 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
msi_free
(
old_value
);
msi_free
(
deformated
);
msi_free
(
uikey
);
msi_free
(
keypath
);
return
ERROR_SUCCESS
;
}
...
...
@@ -2957,7 +2965,7 @@ static void delete_key( HKEY root, const WCHAR *path )
for
(;;)
{
if
((
p
=
strrchrW
(
subkey
,
'\\'
)))
*
p
=
0
;
hkey
=
open_key
(
root
,
subkey
,
FALSE
);
hkey
=
open_key
(
NULL
,
root
,
subkey
,
FALSE
);
if
(
!
hkey
)
break
;
if
(
p
&&
p
[
1
])
res
=
RegDeleteKeyExW
(
hkey
,
p
+
1
,
access
,
0
);
...
...
@@ -2980,7 +2988,7 @@ static void delete_value( HKEY root, const WCHAR *path, const WCHAR *value )
HKEY
hkey
;
DWORD
num_subkeys
,
num_values
;
if
((
hkey
=
open_key
(
root
,
path
,
FALSE
)))
if
((
hkey
=
open_key
(
NULL
,
root
,
path
,
FALSE
)))
{
if
((
res
=
RegDeleteValueW
(
hkey
,
value
)))
TRACE
(
"failed to delete value %s (%d)
\n
"
,
debugstr_w
(
value
),
res
);
...
...
@@ -3001,7 +3009,7 @@ static void delete_tree( HKEY root, const WCHAR *path )
LONG
res
;
HKEY
hkey
;
if
(
!
(
hkey
=
open_key
(
root
,
path
,
FALSE
)))
return
;
if
(
!
(
hkey
=
open_key
(
NULL
,
root
,
path
,
FALSE
)))
return
;
res
=
RegDeleteTreeW
(
hkey
,
NULL
);
if
(
res
)
TRACE
(
"failed to delete subtree of %s (%d)
\n
"
,
debugstr_w
(
path
),
res
);
delete_key
(
root
,
path
);
...
...
dlls/msi/tests/install.c
View file @
cdf3c236
...
...
@@ -5669,7 +5669,7 @@ static void test_mixed_package(void)
res
=
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"CLSID
\\
{8dfef911-6885-41eb-b280-8f0304728e8b}
\\
InProcServer32"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"can't open 32-bit CLSID key, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"can't open 32-bit CLSID key, got %d
\n
"
,
res
);
if
(
res
==
ERROR_SUCCESS
)
{
size
=
sizeof
(
value
);
res
=
RegQueryValueExA
(
hkey
,
""
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
...
...
@@ -5732,7 +5732,7 @@ static void test_mixed_package(void)
res
=
RegOpenKeyExA
(
HKEY_CLASSES_ROOT
,
"CLSID
\\
{8dfef911-6885-41eb-b280-8f0304728e8b}
\\
InProcServer32"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"can't open 32-bit CLSID key, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"can't open 32-bit CLSID key, got %d
\n
"
,
res
);
if
(
res
==
ERROR_SUCCESS
)
{
size
=
sizeof
(
value
);
res
=
RegQueryValueExA
(
hkey
,
""
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
...
...
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