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
03f6a6e9
Commit
03f6a6e9
authored
Jan 18, 2015
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jan 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix HKLM\Software handling when opening with KEY_WOW64_32KEY.
parent
cf92569c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
registry.c
dlls/advapi32/registry.c
+18
-5
registry.c
dlls/advapi32/tests/registry.c
+3
-5
No files found.
dlls/advapi32/registry.c
View file @
03f6a6e9
...
@@ -127,12 +127,12 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
...
@@ -127,12 +127,12 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
{
{
BOOL
force_wow32
=
is_win64
&&
(
access
&
KEY_WOW64_32KEY
);
BOOL
force_wow32
=
is_win64
&&
(
access
&
KEY_WOW64_32KEY
);
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
HANDLE
subkey
,
root
=
attr
->
RootDirectory
;
if
(
!
force_wow32
)
status
=
NtCreateKey
(
(
HANDLE
*
)
ret
key
,
access
,
attr
,
0
,
class
,
options
,
dispos
);
if
(
!
force_wow32
)
status
=
NtCreateKey
(
&
sub
key
,
access
,
attr
,
0
,
class
,
options
,
dispos
);
if
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
)
if
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
)
{
{
HANDLE
subkey
,
root
=
attr
->
RootDirectory
;
WCHAR
*
buffer
=
attr
->
ObjectName
->
Buffer
;
WCHAR
*
buffer
=
attr
->
ObjectName
->
Buffer
;
DWORD
attrs
,
pos
=
0
,
i
=
0
,
len
=
attr
->
ObjectName
->
Length
/
sizeof
(
WCHAR
);
DWORD
attrs
,
pos
=
0
,
i
=
0
,
len
=
attr
->
ObjectName
->
Length
/
sizeof
(
WCHAR
);
UNICODE_STRING
str
;
UNICODE_STRING
str
;
...
@@ -160,7 +160,7 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
...
@@ -160,7 +160,7 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
if
(
i
==
len
)
if
(
i
==
len
)
{
{
attr
->
Attributes
=
attrs
;
attr
->
Attributes
=
attrs
;
status
=
NtCreateKey
(
(
PHANDLE
)
ret
key
,
access
,
attr
,
0
,
class
,
options
,
dispos
);
status
=
NtCreateKey
(
&
sub
key
,
access
,
attr
,
0
,
class
,
options
,
dispos
);
}
}
else
else
{
{
...
@@ -177,6 +177,13 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
...
@@ -177,6 +177,13 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
}
}
}
}
attr
->
RootDirectory
=
subkey
;
if
(
force_wow32
&&
(
subkey
=
open_wow6432node
(
attr
->
RootDirectory
)))
{
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
attr
->
RootDirectory
=
subkey
;
}
*
retkey
=
attr
->
RootDirectory
;
return
status
;
return
status
;
}
}
...
@@ -214,7 +221,7 @@ static NTSTATUS open_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *a
...
@@ -214,7 +221,7 @@ static NTSTATUS open_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *a
if
(
i
==
len
)
if
(
i
==
len
)
{
{
attr
->
Attributes
=
attrs
;
attr
->
Attributes
=
attrs
;
status
=
NtOpenKey
(
(
PHANDLE
)
ret
key
,
access
,
attr
);
status
=
NtOpenKey
(
&
sub
key
,
access
,
attr
);
}
}
else
else
{
{
...
@@ -223,12 +230,18 @@ static NTSTATUS open_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *a
...
@@ -223,12 +230,18 @@ static NTSTATUS open_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *a
}
}
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
if
(
status
)
return
status
;
if
(
status
)
return
status
;
if
(
i
==
len
)
break
;
attr
->
RootDirectory
=
subkey
;
attr
->
RootDirectory
=
subkey
;
if
(
i
==
len
)
break
;
while
(
i
<
len
&&
buffer
[
i
]
==
'\\'
)
i
++
;
while
(
i
<
len
&&
buffer
[
i
]
==
'\\'
)
i
++
;
pos
=
i
;
pos
=
i
;
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
}
}
if
(
force_wow32
&&
(
subkey
=
open_wow6432node
(
attr
->
RootDirectory
)))
{
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
attr
->
RootDirectory
=
subkey
;
}
*
retkey
=
attr
->
RootDirectory
;
return
status
;
return
status
;
}
}
...
...
dlls/advapi32/tests/registry.c
View file @
03f6a6e9
...
@@ -2142,12 +2142,10 @@ static void test_redirection(void)
...
@@ -2142,12 +2142,10 @@ static void test_redirection(void)
err
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
NULL
,
0
,
err
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
NULL
,
0
,
KEY_WOW64_32KEY
|
KEY_ALL_ACCESS
,
NULL
,
&
key
,
NULL
);
KEY_WOW64_32KEY
|
KEY_ALL_ACCESS
,
NULL
,
&
key
,
NULL
);
ok
(
err
==
ERROR_SUCCESS
,
"RegCreateKeyExA failed: %u
\n
"
,
err
);
ok
(
err
==
ERROR_SUCCESS
,
"RegCreateKeyExA failed: %u
\n
"
,
err
);
dw
=
get_key_value
(
key
,
"Wine
\\
Winetest"
,
0
);
check_key_value
(
key
,
"Wine
\\
Winetest"
,
0
,
32
);
todo_wine
ok
(
dw
==
32
,
"wrong value %u
\n
"
,
dw
);
dw
=
get_key_value
(
key
,
"Wine
\\
Winetest"
,
KEY_WOW64_64KEY
);
dw
=
get_key_value
(
key
,
"Wine
\\
Winetest"
,
KEY_WOW64_64KEY
);
todo_wine
ok
(
dw
==
32
||
broken
(
dw
==
64
)
/* vista */
,
"wrong value %u
\n
"
,
dw
);
ok
(
dw
==
32
||
broken
(
dw
==
64
)
/* vista */
,
"wrong value %u
\n
"
,
dw
);
dw
=
get_key_value
(
key
,
"Wine
\\
Winetest"
,
KEY_WOW64_32KEY
);
check_key_value
(
key
,
"Wine
\\
Winetest"
,
KEY_WOW64_32KEY
,
32
);
todo_wine
ok
(
dw
==
32
,
"wrong value %u
\n
"
,
dw
);
RegCloseKey
(
key
);
RegCloseKey
(
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