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
cf1f8c67
Commit
cf1f8c67
authored
Apr 04, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl/tests: Open the test output file using a hardcoded path.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa928d16
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+4
-3
driver.h
dlls/ntoskrnl.exe/tests/driver.h
+0
-1
driver4.c
dlls/ntoskrnl.exe/tests/driver4.c
+4
-3
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+8
-16
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
cf1f8c67
...
...
@@ -2126,13 +2126,14 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
return
STATUS_BUFFER_TOO_SMALL
;
attr
.
Length
=
sizeof
(
attr
);
RtlInitUnicodeString
(
&
pathU
,
test_input
->
path
);
RtlInitUnicodeString
(
&
pathU
,
L"
\\
??
\\
C:
\\
windows
\\
winetest_ntoskrnl_okfile"
);
running_under_wine
=
test_input
->
running_under_wine
;
winetest_debug
=
test_input
->
winetest_debug
;
winetest_report_success
=
test_input
->
winetest_report_success
;
attr
.
ObjectName
=
&
pathU
;
attr
.
Attributes
=
OBJ_KERNEL_HANDLE
;
/* needed to be accessible from system threads */
ZwOpenFile
(
&
okfile
,
FILE_APPEND_DATA
|
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_KERNEL_HANDLE
;
/* needed to be accessible from system threads */
ZwOpenFile
(
&
okfile
,
FILE_APPEND_DATA
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
);
pExEventObjectType
=
get_proc_address
(
"ExEventObjectType"
);
ok
(
!!
pExEventObjectType
,
"ExEventObjectType not found
\n
"
);
...
...
dlls/ntoskrnl.exe/tests/driver.h
View file @
cf1f8c67
...
...
@@ -46,7 +46,6 @@ struct test_input
DWORD
process_id
;
SIZE_T
teststr_offset
;
ULONG64
*
modified_value
;
WCHAR
path
[
1
];
};
static
inline
char
*
drv_strrchr
(
const
char
*
str
,
char
ch
)
...
...
dlls/ntoskrnl.exe/tests/driver4.c
View file @
cf1f8c67
...
...
@@ -487,13 +487,14 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
return
STATUS_BUFFER_TOO_SMALL
;
attr
.
Length
=
sizeof
(
attr
);
RtlInitUnicodeString
(
&
pathU
,
test_input
->
path
);
RtlInitUnicodeString
(
&
pathU
,
L"
\\
??
\\
C:
\\
winetest_ntoskrnl_okfile"
);
running_under_wine
=
test_input
->
running_under_wine
;
winetest_debug
=
test_input
->
winetest_debug
;
winetest_report_success
=
test_input
->
winetest_report_success
;
attr
.
ObjectName
=
&
pathU
;
attr
.
Attributes
=
OBJ_KERNEL_HANDLE
;
/* needed to be accessible from system threads */
ZwOpenFile
(
&
okfile
,
FILE_APPEND_DATA
|
SYNCHRONIZE
,
&
attr
,
&
io
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
);
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
OBJ_KERNEL_HANDLE
;
/* needed to be accessible from system threads */
ZwOpenFile
(
&
okfile
,
FILE_APPEND_DATA
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_SYNCHRONOUS_IO_NONALERT
);
netio_init
();
test_wsk_get_address_info
();
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
cf1f8c67
...
...
@@ -367,22 +367,20 @@ static ULONG64 modified_value;
static
void
main_test
(
void
)
{
WCHAR
temppathW
[
MAX_PATH
],
pathW
[
MAX_PATH
];
struct
test_input
*
test_input
;
DWORD
len
,
written
,
read
;
UNICODE_STRING
pathU
;
DWORD
written
,
read
;
LONG
new_failures
;
char
buffer
[
512
];
HANDLE
okfile
;
BOOL
res
;
/* Create a temporary file that the driver will write ok/trace output to. */
GetTempPathW
(
MAX_PATH
,
temppathW
);
GetTempFileNameW
(
temppathW
,
L"dok"
,
0
,
pathW
);
pRtlDosPathNameToNtPathName_U
(
pathW
,
&
pathU
,
NULL
,
NULL
);
len
=
pathU
.
Length
+
sizeof
(
WCHAR
);
test_input
=
heap_alloc
(
offsetof
(
struct
test_input
,
path
[
len
/
sizeof
(
WCHAR
)])
);
okfile
=
CreateFileA
(
"C:
\\
windows
\\
winetest_ntoskrnl_okfile"
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
okfile
!=
INVALID_HANDLE_VALUE
,
"failed to create file, error %u
\n
"
,
GetLastError
());
test_input
=
heap_alloc
(
sizeof
(
*
test_input
)
);
test_input
->
running_under_wine
=
!
strcmp
(
winetest_platform
,
"wine"
);
test_input
->
winetest_report_success
=
winetest_report_success
;
test_input
->
winetest_debug
=
winetest_debug
;
...
...
@@ -391,16 +389,11 @@ static void main_test(void)
test_input
->
modified_value
=
&
modified_value
;
modified_value
=
0
;
memcpy
(
test_input
->
path
,
pathU
.
Buffer
,
len
);
res
=
DeviceIoControl
(
device
,
IOCTL_WINETEST_MAIN_TEST
,
test_input
,
offsetof
(
struct
test_input
,
path
[
len
/
sizeof
(
WCHAR
)]),
res
=
DeviceIoControl
(
device
,
IOCTL_WINETEST_MAIN_TEST
,
test_input
,
sizeof
(
*
test_input
),
&
new_failures
,
sizeof
(
new_failures
),
&
written
,
NULL
);
ok
(
res
,
"DeviceIoControl failed: %u
\n
"
,
GetLastError
());
ok
(
written
==
sizeof
(
new_failures
),
"got size %x
\n
"
,
written
);
okfile
=
CreateFileW
(
pathW
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
okfile
!=
INVALID_HANDLE_VALUE
,
"failed to create %s: %u
\n
"
,
wine_dbgstr_w
(
pathW
),
GetLastError
());
/* Print the ok/trace output and then add to our failure count. */
do
{
ReadFile
(
okfile
,
buffer
,
sizeof
(
buffer
),
&
read
,
NULL
);
...
...
@@ -408,10 +401,9 @@ static void main_test(void)
}
while
(
read
==
sizeof
(
buffer
));
winetest_add_failures
(
new_failures
);
pRtlFreeUnicodeString
(
&
pathU
);
heap_free
(
test_input
);
CloseHandle
(
okfile
);
DeleteFile
W
(
pathW
);
DeleteFile
A
(
"C:
\\
windows
\\
winetest_ntoskrnl_okfile"
);
}
static
void
test_basic_ioctl
(
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