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
151370c4
Commit
151370c4
authored
Jun 30, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add more tests for deleted keys.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
089b2528
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
3 deletions
+50
-3
reg.c
dlls/ntdll/tests/reg.c
+50
-3
No files found.
dlls/ntdll/tests/reg.c
View file @
151370c4
...
...
@@ -125,6 +125,8 @@ static NTSTATUS (WINAPI * pRtlOpenCurrentUser)(IN ACCESS_MASK, PHANDLE);
static
NTSTATUS
(
WINAPI
*
pNtOpenKey
)(
PHANDLE
,
IN
ACCESS_MASK
,
IN
POBJECT_ATTRIBUTES
);
static
NTSTATUS
(
WINAPI
*
pNtOpenKeyEx
)(
PHANDLE
,
ACCESS_MASK
,
POBJECT_ATTRIBUTES
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtClose
)(
IN
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtEnumerateKey
)(
HANDLE
,
ULONG
,
KEY_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
static
NTSTATUS
(
WINAPI
*
pNtEnumerateValueKey
)(
HANDLE
,
ULONG
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
static
NTSTATUS
(
WINAPI
*
pNtFlushKey
)(
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtDeleteKey
)(
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtCreateKey
)(
PHANDLE
retkey
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
...
...
@@ -132,6 +134,7 @@ static NTSTATUS (WINAPI * pNtCreateKey)( PHANDLE retkey, ACCESS_MASK access, con
PULONG
dispos
);
static
NTSTATUS
(
WINAPI
*
pNtQueryKey
)(
HANDLE
,
KEY_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryLicenseValue
)(
const
UNICODE_STRING
*
,
ULONG
*
,
PVOID
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQueryObject
)(
HANDLE
,
OBJECT_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQueryValueKey
)(
HANDLE
,
const
UNICODE_STRING
*
,
KEY_VALUE_INFORMATION_CLASS
,
void
*
,
DWORD
,
DWORD
*
);
static
NTSTATUS
(
WINAPI
*
pNtSetValueKey
)(
HANDLE
,
const
PUNICODE_STRING
,
ULONG
,
ULONG
,
const
void
*
,
ULONG
);
...
...
@@ -181,9 +184,12 @@ static BOOL InitFunctionPtrs(void)
NTDLL_GET_PROC
(
NtClose
)
NTDLL_GET_PROC
(
NtDeleteValueKey
)
NTDLL_GET_PROC
(
NtCreateKey
)
NTDLL_GET_PROC
(
NtEnumerateKey
)
NTDLL_GET_PROC
(
NtEnumerateValueKey
)
NTDLL_GET_PROC
(
NtFlushKey
)
NTDLL_GET_PROC
(
NtDeleteKey
)
NTDLL_GET_PROC
(
NtQueryKey
)
NTDLL_GET_PROC
(
NtQueryObject
)
NTDLL_GET_PROC
(
NtQueryValueKey
)
NTDLL_GET_PROC
(
NtQueryInformationProcess
)
NTDLL_GET_PROC
(
NtSetValueKey
)
...
...
@@ -844,20 +850,61 @@ static void test_NtQueryValueKey(void)
static
void
test_NtDeleteKey
(
void
)
{
UNICODE_STRING
string
;
char
buffer
[
200
];
NTSTATUS
status
;
HANDLE
hkey
;
HANDLE
hkey
,
hkey2
;
OBJECT_ATTRIBUTES
attr
;
ACCESS_MASK
am
=
KEY_ALL_ACCESS
;
DWORD
size
;
status
=
pNtDeleteKey
(
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got: 0x%08x
\n
"
,
status
);
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
status
=
pNtOpenKey
(
&
hkey
,
am
,
&
attr
);
status
=
pNtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
);
ok
(
status
==
STATUS_SUCCESS
,
"NtOpenKey Failed: 0x%08x
\n
"
,
status
);
status
=
pNtDeleteKey
(
hkey
);
ok
(
status
==
STATUS_SUCCESS
,
"NtDeleteKey Failed: 0x%08x
\n
"
,
status
);
status
=
pNtQueryKey
(
hkey
,
KeyNameInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtEnumerateKey
(
hkey
,
0
,
KeyFullInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
pRtlInitUnicodeString
(
&
string
,
L"value"
);
status
=
pNtQueryValueKey
(
hkey
,
&
string
,
KeyValueBasicInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtEnumerateValueKey
(
hkey
,
0
,
KeyValuePartialInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtSetValueKey
(
hkey
,
&
string
,
0
,
REG_SZ
,
"test"
,
5
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtDeleteValueKey
(
hkey
,
&
string
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtDeleteKey
(
hkey
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
RtlInitUnicodeString
(
&
string
,
L"subkey"
);
InitializeObjectAttributes
(
&
attr
,
&
string
,
OBJ_CASE_INSENSITIVE
,
hkey
,
NULL
);
status
=
pNtOpenKey
(
&
hkey2
,
KEY_READ
,
&
attr
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtCreateKey
(
&
hkey2
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtQueryObject
(
hkey
,
ObjectNameInformation
,
buffer
,
sizeof
(
buffer
),
&
size
);
ok
(
status
==
STATUS_KEY_DELETED
,
"got %#x
\n
"
,
status
);
status
=
pNtQueryObject
(
hkey
,
ObjectBasicInformation
,
buffer
,
sizeof
(
OBJECT_BASIC_INFORMATION
),
&
size
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
pNtClose
(
hkey
);
ok
(
status
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
status
);
}
static
void
test_NtQueryLicenseKey
(
void
)
...
...
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