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
2ffd28cf
Commit
2ffd28cf
authored
Sep 25, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Perform the offset checks in NtWriteFile also for a serial device.
parent
45448262
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
comm.c
dlls/kernel32/tests/comm.c
+0
-10
file.c
dlls/ntdll/file.c
+9
-0
No files found.
dlls/kernel32/tests/comm.c
View file @
2ffd28cf
...
...
@@ -830,9 +830,7 @@ static void test_waittxempty(void)
SetLastError
(
0xdeadbeef
);
res
=
WriteFile
(
hcom
,
tbuf
,
sizeof
(
tbuf
),
&
bytes
,
NULL
);
todo_wine
ok
(
!
res
,
"WriteFile on an overlapped handle without ovl structure should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
S
(
U
(
ovl_write
)).
Offset
=
0
;
...
...
@@ -2057,20 +2055,15 @@ static void test_read_write(void)
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
WriteFile
(
hcom
,
atz
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"WriteFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
status
=
pNtWriteFile
(
hcom
,
0
,
NULL
,
NULL
,
&
iob
,
atz
,
0
,
NULL
,
NULL
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"expected STATUS_INVALID_PARAMETER, got %#x
\n
"
,
status
);
todo_wine
ok
(
iob
.
Status
==
-
1
,
"expected -1, got %#x
\n
"
,
iob
.
Status
);
todo_wine
ok
(
iob
.
Information
==
-
1
,
"expected -1, got %ld
\n
"
,
iob
.
Information
);
for
(
i
=
-
20
;
i
<
20
;
i
++
)
...
...
@@ -2087,11 +2080,8 @@ todo_wine
}
else
{
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"%d: expected STATUS_INVALID_PARAMETER, got %#x
\n
"
,
i
,
status
);
todo_wine
ok
(
iob
.
Status
==
-
1
,
"%d: expected -1, got %#x
\n
"
,
i
,
iob
.
Status
);
todo_wine
ok
(
iob
.
Information
==
-
1
,
"%d: expected -1, got %ld
\n
"
,
i
,
iob
.
Information
);
}
}
...
...
dlls/ntdll/file.c
View file @
2ffd28cf
...
...
@@ -1016,6 +1016,15 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
goto
done
;
}
}
else
if
(
type
==
FD_TYPE_SERIAL
)
{
if
(
!
(
options
&
(
FILE_SYNCHRONOUS_IO_ALERT
|
FILE_SYNCHRONOUS_IO_NONALERT
))
&&
(
!
offset
||
(
offset
->
QuadPart
<
0
&&
offset
->
QuadPart
!=
(
LONGLONG
)
-
1
/* FILE_WRITE_TO_END_OF_FILE */
)))
{
status
=
STATUS_INVALID_PARAMETER
;
goto
done
;
}
}
for
(;;)
{
...
...
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