Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
b872d831
Commit
b872d831
authored
18 years ago
by
Paul Vriens
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ntdll/tests: Added some NULL testing.
parent
dd77d1a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ntdll/tests/reg.c
+58
-0
58 additions, 0 deletions
dlls/ntdll/tests/reg.c
with
58 additions
and
0 deletions
dlls/ntdll/tests/reg.c
+
58
−
0
View file @
b872d831
...
...
@@ -88,6 +88,7 @@ static NTSTATUS (WINAPI * pRtlOpenCurrentUser)(IN ACCESS_MASK, OUT PHKEY);
static
NTSTATUS
(
WINAPI
*
pNtOpenKey
)(
PHANDLE
,
IN
ACCESS_MASK
,
IN
POBJECT_ATTRIBUTES
);
static
NTSTATUS
(
WINAPI
*
pNtClose
)(
IN
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtDeleteValueKey
)(
IN
HANDLE
,
IN
PUNICODE_STRING
);
static
NTSTATUS
(
WINAPI
*
pNtFlushKey
)(
HKEY
);
static
NTSTATUS
(
WINAPI
*
pNtDeleteKey
)(
HKEY
);
static
NTSTATUS
(
WINAPI
*
pNtCreateKey
)(
PHKEY
retkey
,
ACCESS_MASK
access
,
const
OBJECT_ATTRIBUTES
*
attr
,
ULONG
TitleIndex
,
const
UNICODE_STRING
*
class
,
ULONG
options
,
...
...
@@ -134,6 +135,7 @@ static BOOL InitFunctionPtrs(void)
NTDLL_GET_PROC
(
NtClose
)
NTDLL_GET_PROC
(
NtDeleteValueKey
)
NTDLL_GET_PROC
(
NtCreateKey
)
NTDLL_GET_PROC
(
NtFlushKey
)
NTDLL_GET_PROC
(
NtDeleteKey
)
NTDLL_GET_PROC
(
NtSetValueKey
)
NTDLL_GET_PROC
(
NtOpenKey
)
...
...
@@ -290,6 +292,38 @@ static void test_RtlQueryRegistryValues(void)
pRtlFreeHeap
(
GetProcessHeap
(),
0
,
QueryTable
);
}
static
void
test_NtOpenKey
(
void
)
{
HANDLE
key
;
NTSTATUS
status
;
OBJECT_ATTRIBUTES
attr
;
ACCESS_MASK
am
=
KEY_READ
;
#if 0 /* Crashes Wine */
/* All NULL */
status = pNtOpenKey(NULL, 0, NULL);
ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx\n", status);
/* NULL attributes */
status = pNtOpenKey(&key, 0, NULL);
ok(status == STATUS_ACCESS_VIOLATION /* W2K3/XP/W2K */ || status == STATUS_INVALID_PARAMETER /* NT4 */,
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08lx\n", status);
#endif
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
/* NULL key */
status
=
pNtOpenKey
(
NULL
,
0
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got: 0x%08lx
\n
"
,
status
);
/* Length > sizeof(OBJECT_ATTRIBUTES) */
attr
.
Length
*=
2
;
status
=
pNtOpenKey
(
&
key
,
am
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got: 0x%08lx
\n
"
,
status
);
}
static
void
test_NtCreateKey
(
void
)
{
/*Create WineTest*/
...
...
@@ -375,6 +409,25 @@ static void test_RtlCheckRegistryKey(void)
ok
(
status
==
STATUS_SUCCESS
,
"RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and RTL_REGISTRY_OPTIONAL: 0x%08lx
\n
"
,
status
);
}
static
void
test_NtFlushKey
(
void
)
{
NTSTATUS
status
;
HANDLE
hkey
;
OBJECT_ATTRIBUTES
attr
;
ACCESS_MASK
am
=
KEY_ALL_ACCESS
;
status
=
pNtFlushKey
(
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got: 0x%08lx
\n
"
,
status
);
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
pNtOpenKey
(
&
hkey
,
am
,
&
attr
);
status
=
pNtFlushKey
(
hkey
);
ok
(
status
==
STATUS_SUCCESS
,
"NtDeleteKey Failed: 0x%08lx
\n
"
,
status
);
pNtClose
(
hkey
);
}
static
void
test_NtDeleteKey
(
void
)
{
NTSTATUS
status
;
...
...
@@ -382,6 +435,9 @@ static void test_NtDeleteKey(void)
OBJECT_ATTRIBUTES
attr
;
ACCESS_MASK
am
=
KEY_ALL_ACCESS
;
status
=
pNtDeleteKey
(
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got: 0x%08lx
\n
"
,
status
);
InitializeObjectAttributes
(
&
attr
,
&
winetestpath
,
0
,
0
,
0
);
status
=
pNtOpenKey
(
&
hkey
,
am
,
&
attr
);
...
...
@@ -401,11 +457,13 @@ START_TEST(reg)
pRtlAppendUnicodeToString
(
&
winetestpath
,
winetest
);
test_NtOpenKey
();
test_NtCreateKey
();
test_NtSetValueKey
();
test_RtlCheckRegistryKey
();
test_RtlOpenCurrentUser
();
test_RtlQueryRegistryValues
();
test_NtFlushKey
();
test_NtDeleteKey
();
pRtlFreeUnicodeString
(
&
winetestpath
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment