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
21da080d
Commit
21da080d
authored
Apr 02, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add support for the KEY_WOW64_32KEY flag in RegOpenKey on 64-bit.
parent
68a5c347
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
2 deletions
+51
-2
registry.c
dlls/advapi32/registry.c
+51
-2
No files found.
dlls/advapi32/registry.c
View file @
21da080d
...
...
@@ -174,6 +174,55 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
return
status
;
}
/* wrapper for NtOpenKey to handle Wow6432 nodes */
static
NTSTATUS
open_key
(
HKEY
*
retkey
,
ACCESS_MASK
access
,
OBJECT_ATTRIBUTES
*
attr
)
{
NTSTATUS
status
;
BOOL
force_wow32
=
is_win64
&&
(
access
&
KEY_WOW64_32KEY
);
HANDLE
subkey
,
root
=
attr
->
RootDirectory
;
WCHAR
*
buffer
=
attr
->
ObjectName
->
Buffer
;
DWORD
attrs
,
pos
=
0
,
i
=
0
,
len
=
attr
->
ObjectName
->
Length
/
sizeof
(
WCHAR
);
UNICODE_STRING
str
;
if
(
!
force_wow32
)
return
NtOpenKey
(
(
HANDLE
*
)
retkey
,
access
,
attr
);
if
(
len
&&
buffer
[
0
]
==
'\\'
)
return
STATUS_OBJECT_PATH_INVALID
;
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
attrs
=
attr
->
Attributes
;
attr
->
Attributes
&=
~
OBJ_OPENLINK
;
attr
->
ObjectName
=
&
str
;
while
(
i
<
len
)
{
str
.
Buffer
=
buffer
+
pos
;
str
.
Length
=
(
i
-
pos
)
*
sizeof
(
WCHAR
);
if
(
force_wow32
&&
pos
)
{
if
(
is_wow6432node
(
&
str
))
force_wow32
=
FALSE
;
else
if
((
subkey
=
open_wow6432node
(
attr
->
RootDirectory
,
&
str
)))
{
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
attr
->
RootDirectory
=
subkey
;
force_wow32
=
FALSE
;
}
}
status
=
NtOpenKey
(
&
subkey
,
access
,
attr
);
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
if
(
status
)
return
status
;
attr
->
RootDirectory
=
subkey
;
while
(
i
<
len
&&
buffer
[
i
]
==
'\\'
)
i
++
;
pos
=
i
;
while
(
i
<
len
&&
buffer
[
i
]
!=
'\\'
)
i
++
;
}
str
.
Buffer
=
buffer
+
pos
;
str
.
Length
=
(
i
-
pos
)
*
sizeof
(
WCHAR
);
attr
->
Attributes
=
attrs
;
status
=
NtOpenKey
(
(
PHANDLE
)
retkey
,
access
,
attr
);
if
(
attr
->
RootDirectory
!=
root
)
NtClose
(
attr
->
RootDirectory
);
return
status
;
}
/* create one of the HKEY_* special root keys */
static
HKEY
create_special_root_hkey
(
HKEY
hkey
,
DWORD
access
)
{
...
...
@@ -404,7 +453,7 @@ LSTATUS WINAPI RegOpenKeyExW( HKEY hkey, LPCWSTR name, DWORD options, REGSAM acc
attr
.
SecurityQualityOfService
=
NULL
;
if
(
options
&
REG_OPTION_OPEN_LINK
)
attr
.
Attributes
|=
OBJ_OPENLINK
;
RtlInitUnicodeString
(
&
nameW
,
name
);
return
RtlNtStatusToDosError
(
NtOpenKey
(
(
PHANDLE
)
retkey
,
access
,
&
attr
)
);
return
RtlNtStatusToDosError
(
open_key
(
retkey
,
access
,
&
attr
)
);
}
...
...
@@ -455,7 +504,7 @@ LSTATUS WINAPI RegOpenKeyExA( HKEY hkey, LPCSTR name, DWORD options, REGSAM acce
if
(
!
(
status
=
RtlAnsiStringToUnicodeString
(
&
NtCurrentTeb
()
->
StaticUnicodeString
,
&
nameA
,
FALSE
)))
{
status
=
NtOpenKey
(
(
PHANDLE
)
retkey
,
access
,
&
attr
);
status
=
open_key
(
retkey
,
access
,
&
attr
);
}
return
RtlNtStatusToDosError
(
status
);
}
...
...
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