Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b872d831
Commit
b872d831
authored
Jul 07, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Jul 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Added some NULL testing.
parent
dd77d1a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
reg.c
dlls/ntdll/tests/reg.c
+58
-0
No files found.
dlls/ntdll/tests/reg.c
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
);
...
...
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