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
10765f29
Commit
10765f29
authored
Dec 25, 2022
by
Etaash Mathamsetty
Committed by
Alexandre Julliard
Mar 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add Driver Object Extension Tests.
parent
2f3c7e87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+33
-0
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
10765f29
...
...
@@ -2294,6 +2294,38 @@ static void test_permanence(void)
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#lx
\n
"
,
status
);
}
static
void
test_driver_object_extension
(
void
)
{
NTSTATUS
(
WINAPI
*
pIoAllocateDriverObjectExtension
)(
PDRIVER_OBJECT
,
PVOID
,
ULONG
,
PVOID
*
);
PVOID
(
WINAPI
*
pIoGetDriverObjectExtension
)(
PDRIVER_OBJECT
,
PVOID
);
NTSTATUS
status
;
void
*
driver_obj_ext
=
NULL
;
void
*
get_obj_ext
=
NULL
;
pIoAllocateDriverObjectExtension
=
get_proc_address
(
"IoAllocateDriverObjectExtension"
);
pIoGetDriverObjectExtension
=
get_proc_address
(
"IoGetDriverObjectExtension"
);
if
(
!
pIoAllocateDriverObjectExtension
)
{
win_skip
(
"IoAllocateDriverObjectExtension is not available.
\n
"
);
return
;
}
status
=
pIoAllocateDriverObjectExtension
(
driver_obj
,
NULL
,
100
,
&
driver_obj_ext
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"got %#lx
\n
"
,
status
);
todo_wine
ok
(
driver_obj_ext
!=
NULL
,
"got NULL
\n
"
);
get_obj_ext
=
pIoGetDriverObjectExtension
(
driver_obj
,
NULL
);
todo_wine
ok
(
get_obj_ext
==
driver_obj_ext
&&
get_obj_ext
!=
NULL
,
"got %p != %p
\n
"
,
get_obj_ext
,
driver_obj_ext
);
status
=
pIoAllocateDriverObjectExtension
(
driver_obj
,
NULL
,
100
,
&
driver_obj_ext
);
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_COLLISION
,
"got %#lx
\n
"
,
status
);
ok
(
driver_obj_ext
==
NULL
,
"got %p
\n
"
,
driver_obj_ext
);
get_obj_ext
=
pIoGetDriverObjectExtension
(
driver_obj
,
(
void
*
)
0xdead
);
ok
(
get_obj_ext
==
NULL
,
"got %p
\n
"
,
get_obj_ext
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
{
void
*
buffer
=
irp
->
AssociatedIrp
.
SystemBuffer
;
...
...
@@ -2337,6 +2369,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
test_dpc
();
test_process_memory
(
test_input
);
test_permanence
();
test_driver_object_extension
();
IoMarkIrpPending
(
irp
);
IoQueueWorkItem
(
work_item
,
main_test_task
,
DelayedWorkQueue
,
irp
);
...
...
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