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
4bd160da
Commit
4bd160da
authored
Jun 09, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add some tests for NtRenameKey().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
8e12b359
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
reg.c
dlls/ntdll/tests/reg.c
+69
-0
No files found.
dlls/ntdll/tests/reg.c
View file @
4bd160da
...
@@ -2115,6 +2115,74 @@ static void test_RtlCreateRegistryKey(void)
...
@@ -2115,6 +2115,74 @@ static void test_RtlCreateRegistryKey(void)
pRtlFreeUnicodeString
(
&
str
);
pRtlFreeUnicodeString
(
&
str
);
}
}
static
void
test_NtRenameKey
(
void
)
{
KEY_NAME_INFORMATION
*
info
=
NULL
;
UNICODE_STRING
str
,
str2
;
OBJECT_ATTRIBUTES
attr
;
HANDLE
key
,
subkey
;
char
buffer
[
200
];
NTSTATUS
status
;
DWORD
size
;
status
=
NtRenameKey
(
NULL
,
NULL
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Unexpected status %#lx.
\n
"
,
status
);
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
status
=
pNtCreateKey
(
&
key
,
KEY_READ
|
DELETE
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
!
status
,
"Unexpected status %#lx.
\n
"
,
status
);
attr
.
RootDirectory
=
key
;
attr
.
ObjectName
=
&
str
;
pRtlCreateUnicodeStringFromAsciiz
(
&
str
,
"rename_subkey"
);
status
=
pNtCreateKey
(
&
subkey
,
KEY_READ
|
DELETE
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
!
status
,
"Unexpected status %#lx.
\n
"
,
status
);
pRtlCreateUnicodeStringFromAsciiz
(
&
str2
,
"renamed_subkey"
);
status
=
NtRenameKey
(
subkey
,
NULL
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Unexpected status %#lx.
\n
"
,
status
);
status
=
NtRenameKey
(
NULL
,
&
str
);
todo_wine
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Unexpected status %#lx.
\n
"
,
status
);
status
=
NtRenameKey
(
subkey
,
&
str2
);
todo_wine
ok
(
status
==
STATUS_ACCESS_DENIED
,
"Unexpected status %#lx.
\n
"
,
status
);
pNtClose
(
subkey
);
status
=
pNtCreateKey
(
&
subkey
,
KEY_WRITE
|
DELETE
,
&
attr
,
0
,
0
,
0
,
0
);
ok
(
!
status
,
"Unexpected status %#lx.
\n
"
,
status
);
/* Rename to itself. */
status
=
NtRenameKey
(
subkey
,
&
str
);
todo_wine
ok
(
status
==
STATUS_CANNOT_DELETE
,
"Unexpected status %#lx.
\n
"
,
status
);
status
=
NtRenameKey
(
subkey
,
&
str2
);
todo_wine
ok
(
!
status
,
"Unexpected status %#lx.
\n
"
,
status
);
pRtlFreeUnicodeString
(
&
str2
);
pRtlFreeUnicodeString
(
&
str
);
info
=
(
KEY_NAME_INFORMATION
*
)
buffer
;
status
=
pNtQueryKey
(
subkey
,
KeyNameInformation
,
info
,
sizeof
(
buffer
),
&
size
);
todo_wine
ok
(
!
status
,
"Unexpected status %#lx.
\n
"
,
status
);
if
(
status
==
STATUS_SUCCESS
)
{
info
->
Name
[
info
->
NameLength
/
sizeof
(
WCHAR
)]
=
0
;
ok
(
!!
wcsstr
(
info
->
Name
,
L"renamed_subkey"
),
"Unexpected subkey name %s.
\n
"
,
wine_dbgstr_w
(
info
->
Name
));
}
pNtDeleteKey
(
subkey
);
pNtDeleteKey
(
key
);
pNtClose
(
subkey
);
pNtClose
(
key
);
}
START_TEST
(
reg
)
START_TEST
(
reg
)
{
{
static
const
WCHAR
winetest
[]
=
{
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'T'
,
'e'
,
's'
,
't'
,
0
};
static
const
WCHAR
winetest
[]
=
{
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'T'
,
'e'
,
's'
,
't'
,
0
};
...
@@ -2144,6 +2212,7 @@ START_TEST(reg)
...
@@ -2144,6 +2212,7 @@ START_TEST(reg)
test_NtDeleteKey
();
test_NtDeleteKey
();
test_symlinks
();
test_symlinks
();
test_redirection
();
test_redirection
();
test_NtRenameKey
();
pRtlFreeUnicodeString
(
&
winetestpath
);
pRtlFreeUnicodeString
(
&
winetestpath
);
...
...
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