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
4be97b66
Commit
4be97b66
authored
Jul 10, 2001
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 10, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite EscapeCommFunction16 to use EscapeCommFunction.
parent
e3454c78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
79 deletions
+24
-79
comm.c
dlls/kernel/comm.c
+24
-79
No files found.
dlls/kernel/comm.c
View file @
4be97b66
...
...
@@ -702,29 +702,25 @@ INT16 WINAPI ClearCommBreak16(INT16 cid)
*/
LONG
WINAPI
EscapeCommFunction16
(
UINT16
cid
,
UINT16
nFunction
)
{
int
r
,
fd
;
struct
DosDeviceStruct
*
ptr
;
struct
termios
port
;
struct
DosDeviceStruct
*
ptr
;
int
max
;
TRACE
(
"cid=%d, function=%d
\n
"
,
cid
,
nFunction
);
if
(
nFunction
==
GETMAXCOM
)
{
int
max
;
switch
(
nFunction
)
{
case
GETMAXCOM
:
TRACE
(
"GETMAXCOM
\n
"
);
for
(
max
=
MAX_PORTS
;
!
COM
[
max
].
devicename
;
max
--
)
;
return
max
;
}
if
(
nFunction
==
GETMAXLPT
)
{
int
max
;
case
GETMAXLPT
:
TRACE
(
"GETMAXLPT
\n
"
);
for
(
max
=
MAX_PORTS
;
!
LPT
[
max
].
devicename
;
max
--
)
;
return
FLAG_LPT
+
max
;
}
if
(
nFunction
==
GETBASEIRQ
)
{
case
GETBASEIRQ
:
TRACE
(
"GETBASEIRQ
\n
"
);
/* FIXME: use tables */
/* just fake something for now */
...
...
@@ -743,79 +739,28 @@ LONG WINAPI EscapeCommFunction16(UINT16 cid,UINT16 nFunction)
return
-
1
;
}
/* FIXME: replace with a call to EscapeCommFunction */
if
(
(
fd
=
FILE_GetUnixHandle
(
ptr
->
handle
,
GENERIC_READ
))
==
0
)
return
-
1
;
if
(
tcgetattr
(
fd
,
&
port
)
==
-
1
)
{
TRACE
(
"tcgetattr failed
\n
"
);
close
(
fd
);
ptr
->
commerror
=
WinError
();
return
-
1
;
}
switch
(
nFunction
)
{
case
RESETDEV
:
TRACE
(
"RESETDEV
\n
"
);
break
;
case
CLRDTR
:
TRACE
(
"CLRDTR
\n
"
);
#ifdef TIOCM_DTR
r
=
COMM_WhackModem
(
fd
,
~
TIOCM_DTR
,
0
);
close
(
fd
);
return
r
;
#endif
case
CLRRTS
:
TRACE
(
"CLRRTS
\n
"
);
#ifdef TIOCM_RTS
r
=
COMM_WhackModem
(
fd
,
~
TIOCM_RTS
,
0
);
close
(
fd
);
return
r
;
#endif
case
SETDTR
:
TRACE
(
"SETDTR
\n
"
);
#ifdef TIOCM_DTR
r
=
COMM_WhackModem
(
fd
,
0
,
TIOCM_DTR
);
close
(
fd
);
return
r
;
#endif
case
SETRTS
:
TRACE
(
"SETRTS
\n
"
);
#ifdef TIOCM_RTS
r
=
COMM_WhackModem
(
fd
,
0
,
TIOCM_RTS
);
close
(
fd
);
return
r
;
#endif
case
SETXOFF
:
TRACE
(
"SETXOFF
\n
"
);
port
.
c_iflag
|=
IXOFF
;
break
;
case
SETXON
:
TRACE
(
"SETXON
\n
"
);
port
.
c_iflag
|=
IXON
;
break
;
case
RESETDEV
:
case
CLRDTR
:
case
CLRRTS
:
case
SETDTR
:
case
SETRTS
:
case
SETXOFF
:
case
SETXON
:
if
(
EscapeCommFunction
(
ptr
->
handle
,
nFunction
))
return
0
;
else
{
ptr
->
commerror
=
WinError
();
return
-
1
;
}
default:
WARN
(
"(cid=%d,nFunction=%d): Unknown function
\n
"
,
case
CLRBREAK
:
case
SETBREAK
:
default:
WARN
(
"(cid=%d,nFunction=%d): Unknown function
\n
"
,
cid
,
nFunction
);
break
;
}
r
=
tcsetattr
(
fd
,
TCSADRAIN
,
&
port
);
close
(
fd
);
if
(
r
<
0
)
{
ptr
->
commerror
=
WinError
();
return
-
1
;
}
else
{
ptr
->
commerror
=
0
;
return
0
;
}
return
-
1
;
}
/*****************************************************************************
...
...
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