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
2f93be4b
Commit
2f93be4b
authored
Feb 12, 2021
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add another key unloading test with NtUnloadKey.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
70c77cdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
registry.c
dlls/advapi32/tests/registry.c
+21
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
2f93be4b
...
...
@@ -22,6 +22,8 @@
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
...
...
@@ -48,8 +50,10 @@ static LONG (WINAPI *pRegDeleteTreeA)(HKEY,const char *);
static
DWORD
(
WINAPI
*
pRegDeleteKeyExA
)(
HKEY
,
LPCSTR
,
REGSAM
,
DWORD
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
NTSTATUS
(
WINAPI
*
pNtDeleteKey
)(
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtUnloadKey
)(
POBJECT_ATTRIBUTES
);
static
NTSTATUS
(
WINAPI
*
pRtlFormatCurrentUserKeyPath
)(
UNICODE_STRING
*
);
static
NTSTATUS
(
WINAPI
*
pRtlFreeUnicodeString
)(
PUNICODE_STRING
);
static
NTSTATUS
(
WINAPI
*
pRtlInitUnicodeString
)(
PUNICODE_STRING
,
PCWSTR
);
static
LONG
(
WINAPI
*
pRegDeleteKeyValueA
)(
HKEY
,
LPCSTR
,
LPCSTR
);
static
LONG
(
WINAPI
*
pRegSetKeyValueW
)(
HKEY
,
LPCWSTR
,
LPCWSTR
,
DWORD
,
const
void
*
,
DWORD
);
static
LONG
(
WINAPI
*
pRegLoadMUIStringA
)(
HKEY
,
LPCSTR
,
LPSTR
,
DWORD
,
LPDWORD
,
DWORD
,
LPCSTR
);
...
...
@@ -90,7 +94,9 @@ static void InitFunctionPtrs(void)
pIsWow64Process
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"IsWow64Process"
);
pRtlFormatCurrentUserKeyPath
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlFormatCurrentUserKeyPath"
);
pRtlFreeUnicodeString
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlFreeUnicodeString"
);
pRtlInitUnicodeString
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlInitUnicodeString"
);
pNtDeleteKey
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtDeleteKey"
);
pNtUnloadKey
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtUnloadKey"
);
}
/* delete key and all its subkeys */
...
...
@@ -1561,7 +1567,11 @@ static void test_reg_load_key(void)
static
void
test_reg_unload_key
(
void
)
{
UNICODE_STRING
key_name
;
OBJECT_ATTRIBUTES
attr
;
NTSTATUS
status
;
DWORD
ret
;
HKEY
key
;
if
(
!
set_privileges
(
SE_RESTORE_NAME
,
TRUE
)
||
!
set_privileges
(
SE_BACKUP_NAME
,
FALSE
))
...
...
@@ -1570,6 +1580,17 @@ static void test_reg_unload_key(void)
return
;
}
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Test"
,
0
,
KEY_READ
,
&
key
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
/* try to unload though the key handle is live */
pRtlInitUnicodeString
(
&
key_name
,
L"
\\
REGISTRY
\\
Machine
\\
Test"
);
InitializeObjectAttributes
(
&
attr
,
&
key_name
,
OBJ_CASE_INSENSITIVE
,
NULL
,
NULL
);
status
=
pNtUnloadKey
(
&
attr
);
ok
(
status
==
STATUS_CANNOT_DELETE
,
"expected STATUS_CANNOT_DELETE, got %08x
\n
"
,
status
);
RegCloseKey
(
key
);
ret
=
RegUnLoadKeyA
(
HKEY_LOCAL_MACHINE
,
"Test"
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
...
...
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