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
72241b5d
Commit
72241b5d
authored
Sep 10, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make sure that serial ioctl calls fail on non-serial handles.
parent
c1cb976b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
comm.c
dlls/kernel32/tests/comm.c
+10
-0
serial.c
dlls/ntdll/serial.c
+10
-1
No files found.
dlls/kernel32/tests/comm.c
View file @
72241b5d
...
...
@@ -1643,6 +1643,15 @@ static void test_WaitBreak(HANDLE hcom)
ok
(
ClearCommBreak
(
hcom
),
"ClearCommBreak failed
\n
"
);
}
static
void
test_stdio
(
void
)
{
DCB
dcb
;
/* cygwin tries this to determine the stdin handle type */
ok
(
!
GetCommState
(
GetStdHandle
(
STD_INPUT_HANDLE
),
&
dcb
),
"GetCommState succeeded on stdin
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"got error %u
\n
"
,
GetLastError
()
);
}
START_TEST
(
comm
)
{
HANDLE
hcom
;
...
...
@@ -1735,4 +1744,5 @@ START_TEST(comm)
test_WaitBreak
(
hcom
);
CloseHandle
(
hcom
);
}
test_stdio
();
}
dlls/ntdll/serial.c
View file @
72241b5d
...
...
@@ -1110,8 +1110,17 @@ static inline NTSTATUS io_control(HANDLE hDevice,
if
(
dwIoControlCode
!=
IOCTL_SERIAL_GET_TIMEOUTS
&&
dwIoControlCode
!=
IOCTL_SERIAL_SET_TIMEOUTS
)
if
((
status
=
server_get_unix_fd
(
hDevice
,
access
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
{
enum
server_fd_type
type
;
if
((
status
=
server_get_unix_fd
(
hDevice
,
access
,
&
fd
,
&
needs_close
,
&
type
,
NULL
)))
goto
error
;
if
(
type
!=
FD_TYPE_SERIAL
)
{
if
(
needs_close
)
close
(
fd
);
status
=
STATUS_OBJECT_TYPE_MISMATCH
;
goto
error
;
}
}
switch
(
dwIoControlCode
)
{
...
...
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