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
ebbee24c
Commit
ebbee24c
authored
Jun 09, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement RegRenameKey().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
1fb6f271
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
+19
-17
registry.c
dlls/advapi32/registry.c
+19
-3
registry.c
dlls/advapi32/tests/registry.c
+0
-14
No files found.
dlls/advapi32/registry.c
View file @
ebbee24c
...
@@ -510,10 +510,26 @@ LSTATUS WINAPI RegReplaceKeyW( HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpNewFile,
...
@@ -510,10 +510,26 @@ LSTATUS WINAPI RegReplaceKeyW( HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpNewFile,
* RegRenameKey [ADVAPI32.@]
* RegRenameKey [ADVAPI32.@]
*
*
*/
*/
LSTATUS
WINAPI
RegRenameKey
(
HKEY
hkey
,
LPCWSTR
lpSubKey
,
LPCWSTR
lpNewN
ame
)
LSTATUS
WINAPI
RegRenameKey
(
HKEY
hkey
,
LPCWSTR
subkey_name
,
LPCWSTR
new_n
ame
)
{
{
FIXME
(
"(%p,%s,%s): stub
\n
"
,
hkey
,
debugstr_w
(
lpSubKey
),
debugstr_w
(
lpNewName
));
UNICODE_STRING
str
;
return
ERROR_CALL_NOT_IMPLEMENTED
;
LSTATUS
ret
;
HKEY
subkey
;
TRACE
(
"%p, %s, %s.
\n
"
,
hkey
,
debugstr_w
(
subkey_name
),
debugstr_w
(
new_name
));
RtlInitUnicodeString
(
&
str
,
new_name
);
if
(
!
subkey_name
)
return
RtlNtStatusToDosError
(
NtRenameKey
(
hkey
,
&
str
));
if
((
ret
=
RegOpenKeyExW
(
hkey
,
subkey_name
,
0
,
KEY_WRITE
,
&
subkey
)))
return
ret
;
ret
=
RtlNtStatusToDosError
(
NtRenameKey
(
subkey
,
&
str
));
RegCloseKey
(
subkey
);
return
ret
;
}
}
...
...
dlls/advapi32/tests/registry.c
View file @
ebbee24c
...
@@ -4481,22 +4481,17 @@ static void test_RegRenameKey(void)
...
@@ -4481,22 +4481,17 @@ static void test_RegRenameKey(void)
LSTATUS
ret
;
LSTATUS
ret
;
ret
=
RegRenameKey
(
NULL
,
NULL
,
NULL
);
ret
=
RegRenameKey
(
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
NULL
,
L"newname"
);
ret
=
RegRenameKey
(
NULL
,
NULL
,
L"newname"
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
NULL
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
L"newname"
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
L"newname"
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_READ
,
NULL
,
&
key
,
NULL
);
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_READ
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
todo_wine
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key
);
RegCloseKey
(
key
);
...
@@ -4504,28 +4499,22 @@ static void test_RegRenameKey(void)
...
@@ -4504,28 +4499,22 @@ static void test_RegRenameKey(void)
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
NULL
);
ret
=
RegRenameKey
(
key
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key
);
RegCloseKey
(
key
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestNewRenameKey"
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestNewRenameKey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestRenameKey"
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestRenameKey"
);
todo_wine
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
/* Subkey does not exist. */
/* Subkey does not exist. */
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
NULL
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
L"known_subkey"
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
L"known_subkey"
);
todo_wine
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
/* Rename existing subkey. */
/* Rename existing subkey. */
...
@@ -4534,14 +4523,11 @@ static void test_RegRenameKey(void)
...
@@ -4534,14 +4523,11 @@ static void test_RegRenameKey(void)
RegCloseKey
(
key2
);
RegCloseKey
(
key2
);
ret
=
RegRenameKey
(
key
,
L"known_subkey"
,
L"renamed_subkey"
);
ret
=
RegRenameKey
(
key
,
L"known_subkey"
,
L"renamed_subkey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
key
,
"renamed_subkey"
);
ret
=
RegDeleteKeyA
(
key
,
"renamed_subkey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
key
,
"known_subkey"
);
ret
=
RegDeleteKeyA
(
key
,
"known_subkey"
);
todo_wine
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
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