Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f07e8ca8
Commit
f07e8ca8
authored
Mar 12, 2018
by
Stefan Leichter
Committed by
Alexandre Julliard
Mar 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix RtlCheckRegistryKey when called with empty path.
Signed-off-by:
Stefan Leichter
<
sle85276@gmx.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4d4fc7ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
reg.c
dlls/ntdll/reg.c
+3
-1
reg.c
dlls/ntdll/tests/reg.c
+13
-0
No files found.
dlls/ntdll/reg.c
View file @
f07e8ca8
...
...
@@ -1401,10 +1401,12 @@ NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG RelativeTo, IN PWSTR Path)
TRACE
(
"(%d, %s)
\n
"
,
RelativeTo
,
debugstr_w
(
Path
));
if
(
(
!
RelativeTo
)
&&
Path
==
NULL
)
if
(
!
RelativeTo
&&
(
Path
==
NULL
||
Path
[
0
]
==
0
)
)
return
STATUS_OBJECT_PATH_SYNTAX_BAD
;
if
(
RelativeTo
&
RTL_REGISTRY_HANDLE
)
return
STATUS_SUCCESS
;
if
((
RelativeTo
<=
RTL_REGISTRY_USER
)
&&
(
Path
==
NULL
||
Path
[
0
]
==
0
))
return
STATUS_SUCCESS
;
status
=
RTL_GetKeyHandle
(
RelativeTo
,
Path
,
&
handle
);
if
(
handle
)
NtClose
(
handle
);
...
...
dlls/ntdll/tests/reg.c
View file @
f07e8ca8
...
...
@@ -671,6 +671,7 @@ static void test_RtlOpenCurrentUser(void)
static
void
test_RtlCheckRegistryKey
(
void
)
{
static
WCHAR
empty
[]
=
{
0
};
NTSTATUS
status
;
status
=
pRtlCheckRegistryKey
(
RTL_REGISTRY_ABSOLUTE
,
winetestpath
.
Buffer
);
...
...
@@ -678,6 +679,18 @@ static void test_RtlCheckRegistryKey(void)
status
=
pRtlCheckRegistryKey
((
RTL_REGISTRY_ABSOLUTE
|
RTL_REGISTRY_OPTIONAL
),
winetestpath
.
Buffer
);
ok
(
status
==
STATUS_SUCCESS
,
"RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and RTL_REGISTRY_OPTIONAL: 0x%08x
\n
"
,
status
);
status
=
pRtlCheckRegistryKey
(
RTL_REGISTRY_ABSOLUTE
,
NULL
);
ok
(
status
==
STATUS_OBJECT_PATH_SYNTAX_BAD
,
"RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and Path being NULL: 0x%08x
\n
"
,
status
);
status
=
pRtlCheckRegistryKey
(
RTL_REGISTRY_ABSOLUTE
,
empty
);
ok
(
status
==
STATUS_OBJECT_PATH_SYNTAX_BAD
,
"RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and Path being empty: 0x%08x
\n
"
,
status
);
status
=
pRtlCheckRegistryKey
(
RTL_REGISTRY_USER
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"RtlCheckRegistryKey with RTL_REGISTRY_USER and Path being NULL: 0x%08x
\n
"
,
status
);
status
=
pRtlCheckRegistryKey
(
RTL_REGISTRY_USER
,
empty
);
ok
(
status
==
STATUS_SUCCESS
,
"RtlCheckRegistryKey with RTL_REGISTRY_USER and Path being empty: 0x%08x
\n
"
,
status
);
}
static
void
test_NtFlushKey
(
void
)
...
...
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