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
97645d7a
Commit
97645d7a
authored
Mar 12, 2012
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix status returned for too-long registry value names.
parent
7fd6ccd1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
reg.c
dlls/ntdll/reg.c
+3
-3
reg.c
dlls/ntdll/tests/reg.c
+36
-0
No files found.
dlls/ntdll/reg.c
View file @
97645d7a
...
...
@@ -190,7 +190,7 @@ NTSTATUS WINAPI NtDeleteValueKey( HANDLE hkey, const UNICODE_STRING *name )
NTSTATUS
ret
;
TRACE
(
"(%p,%s)
\n
"
,
hkey
,
debugstr_us
(
name
)
);
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
BUFFER_OVERFLOW
;
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
OBJECT_NAME_NOT_FOUND
;
SERVER_START_REQ
(
delete_key_value
)
{
...
...
@@ -483,7 +483,7 @@ NTSTATUS WINAPI NtQueryValueKey( HANDLE handle, const UNICODE_STRING *name,
TRACE
(
"(%p,%s,%d,%p,%d)
\n
"
,
handle
,
debugstr_us
(
name
),
info_class
,
info
,
length
);
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
BUFFER_OVERFLOW
;
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
OBJECT_NAME_NOT_FOUND
;
/* compute the length we want to retrieve */
switch
(
info_class
)
...
...
@@ -771,7 +771,7 @@ NTSTATUS WINAPI NtSetValueKey( HANDLE hkey, const UNICODE_STRING *name, ULONG Ti
TRACE
(
"(%p,%s,%d,%p,%d)
\n
"
,
hkey
,
debugstr_us
(
name
),
type
,
data
,
count
);
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
BUFFER_OVERFLOW
;
if
(
name
->
Length
>
MAX_VALUE_LENGTH
)
return
STATUS_
INVALID_PARAMETER
;
SERVER_START_REQ
(
set_key_value
)
{
...
...
dlls/ntdll/tests/reg.c
View file @
97645d7a
...
...
@@ -1244,6 +1244,41 @@ static void test_redirection(void)
pNtClose
(
key64
);
}
static
void
test_long_value_name
(
void
)
{
HANDLE
key
;
NTSTATUS
status
,
expected
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
ValName
;
DWORD
i
;
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
status
=
pNtOpenKey
(
&
key
,
KEY_WRITE
|
KEY_READ
,
&
attr
);
ok
(
status
==
STATUS_SUCCESS
,
"NtOpenKey Failed: 0x%08x
\n
"
,
status
);
ValName
.
MaximumLength
=
0xfffc
;
ValName
.
Length
=
ValName
.
MaximumLength
-
sizeof
(
WCHAR
);
ValName
.
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ValName
.
MaximumLength
);
for
(
i
=
0
;
i
<
ValName
.
Length
/
sizeof
(
WCHAR
);
i
++
)
ValName
.
Buffer
[
i
]
=
'a'
;
ValName
.
Buffer
[
i
]
=
0
;
status
=
pNtDeleteValueKey
(
key
,
&
ValName
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"NtDeleteValueKey with nonexistent long value name returned 0x%08x
\n
"
,
status
);
status
=
pNtSetValueKey
(
key
,
&
ValName
,
0
,
REG_DWORD
,
&
i
,
sizeof
(
i
));
ok
(
status
==
STATUS_INVALID_PARAMETER
||
broken
(
status
==
STATUS_SUCCESS
)
/* nt4 */
,
"NtSetValueKey with long value name returned 0x%08x
\n
"
,
status
);
expected
=
(
status
==
STATUS_SUCCESS
)
?
STATUS_SUCCESS
:
STATUS_OBJECT_NAME_NOT_FOUND
;
status
=
pNtDeleteValueKey
(
key
,
&
ValName
);
ok
(
status
==
expected
,
"NtDeleteValueKey with long value name returned 0x%08x
\n
"
,
status
);
status
=
pNtQueryValueKey
(
key
,
&
ValName
,
KeyValueBasicInformation
,
NULL
,
0
,
&
i
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"NtQueryValueKey with nonexistent long value name returned 0x%08x
\n
"
,
status
);
pRtlFreeUnicodeString
(
&
ValName
);
pNtClose
(
key
);
}
START_TEST
(
reg
)
{
static
const
WCHAR
winetest
[]
=
{
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'T'
,
'e'
,
's'
,
't'
,
0
};
...
...
@@ -1265,6 +1300,7 @@ START_TEST(reg)
test_RtlpNtQueryValueKey
();
test_NtFlushKey
();
test_NtQueryValueKey
();
test_long_value_name
();
test_NtDeleteKey
();
test_symlinks
();
test_redirection
();
...
...
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