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
440d3717
Commit
440d3717
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/tests: Add some tests for RegRenameKey().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
4bd160da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
registry.c
dlls/advapi32/tests/registry.c
+73
-0
winreg.h
include/winreg.h
+1
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
440d3717
...
...
@@ -4475,6 +4475,78 @@ static void test_EnumDynamicTimeZoneInformation(void)
RegCloseKey
(
key
);
}
static
void
test_RegRenameKey
(
void
)
{
HKEY
key
,
key2
;
LSTATUS
ret
;
ret
=
RegRenameKey
(
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
NULL
,
L"newname"
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
NULL
,
L"oldname"
,
L"newname"
);
todo_wine
ok
(
ret
==
ERROR_INVALID_HANDLE
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_READ
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
todo_wine
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key
);
/* Rename itself. */
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
NULL
,
L"TestNewRenameKey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestNewRenameKey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
hkey_main
,
"TestRenameKey"
);
todo_wine
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
/* Subkey does not exist. */
ret
=
RegCreateKeyExA
(
hkey_main
,
"TestRenameKey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegRenameKey
(
key
,
L"unknown_subkey"
,
L"known_subkey"
);
todo_wine
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Unexpected return value %ld.
\n
"
,
ret
);
/* Rename existing subkey. */
ret
=
RegCreateKeyExA
(
key
,
"known_subkey"
,
0
,
NULL
,
0
,
KEY_WRITE
,
NULL
,
&
key2
,
NULL
);
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key2
);
ret
=
RegRenameKey
(
key
,
L"known_subkey"
,
L"renamed_subkey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
key
,
"renamed_subkey"
);
todo_wine
ok
(
!
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
ret
=
RegDeleteKeyA
(
key
,
"known_subkey"
);
todo_wine
ok
(
ret
,
"Unexpected return value %ld.
\n
"
,
ret
);
RegCloseKey
(
key
);
}
START_TEST
(
registry
)
{
/* Load pointers for functions that are not available in all Windows versions */
...
...
@@ -4514,6 +4586,7 @@ START_TEST(registry)
test_RegLoadMUIString
();
test_EnumDynamicTimeZoneInformation
();
test_perflib_key
();
test_RegRenameKey
();
/* cleanup */
delete_key
(
hkey_main
);
...
...
include/winreg.h
View file @
440d3717
...
...
@@ -178,6 +178,7 @@ WINADVAPI LSTATUS WINAPI RegQueryValueW(HKEY,LPCWSTR,LPWSTR,LPLONG);
WINADVAPI
LSTATUS
WINAPI
RegQueryValueExA
(
HKEY
,
LPCSTR
,
LPDWORD
,
LPDWORD
,
LPBYTE
,
LPDWORD
);
WINADVAPI
LSTATUS
WINAPI
RegQueryValueExW
(
HKEY
,
LPCWSTR
,
LPDWORD
,
LPDWORD
,
LPBYTE
,
LPDWORD
);
#define RegQueryValueEx WINELIB_NAME_AW(RegQueryValueEx)
WINADVAPI
LSTATUS
WINAPI
RegRenameKey
(
HKEY
,
LPCWSTR
,
LPCWSTR
);
WINADVAPI
LSTATUS
WINAPI
RegReplaceKeyA
(
HKEY
,
LPCSTR
,
LPCSTR
,
LPCSTR
);
WINADVAPI
LSTATUS
WINAPI
RegReplaceKeyW
(
HKEY
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
);
#define RegReplaceKey WINELIB_NAME_AW(RegReplaceKey)
...
...
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