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
7f383a88
Commit
7f383a88
authored
Mar 30, 2000
by
Rein Klazes
Committed by
Alexandre Julliard
Mar 30, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CTS, DSR and RingIndicator states to Window's semi-documented
modem line status register.
parent
280aeb96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
comm.c
misc/comm.c
+23
-9
No files found.
misc/comm.c
View file @
7f383a88
...
...
@@ -78,7 +78,15 @@ DEFAULT_DEBUG_CHANNEL(comm);
#ifndef TIOCINQ
#define TIOCINQ FIONREAD
#endif
#define COMM_MSR_OFFSET 35
/* see knowledge base Q101417 */
/* window's semi documented modem status register */
#define COMM_MSR_OFFSET 35
#define MSR_CTS 0x10
#define MSR_DSR 0x20
#define MSR_RI 0x40
#define MSR_RLSD 0x80
#define MSR_MASK (MSR_CTS|MSR_DSR|MSR_RI|MSR_RLSD)
#define FLAG_LPT 0x80
struct
DosDeviceStruct
COM
[
MAX_PORTS
];
...
...
@@ -88,6 +96,18 @@ LPCVOID *unknown[MAX_PORTS];
/* save terminal states */
static
struct
termios
m_stat
[
MAX_PORTS
];
/* update window's semi documented modem status register */
/* see knowledge base Q101417 */
static
void
COMM_MSRUpdate
(
UCHAR
*
pMsr
,
unsigned
int
mstat
)
{
UCHAR
tmpmsr
=
0
;
if
(
mstat
&
TIOCM_CTS
)
tmpmsr
|=
MSR_CTS
;
if
(
mstat
&
TIOCM_DSR
)
tmpmsr
|=
MSR_DSR
;
if
(
mstat
&
TIOCM_RI
)
tmpmsr
|=
MSR_RI
;
if
(
mstat
&
TIOCM_CAR
)
tmpmsr
|=
MSR_RLSD
;
*
pMsr
=
(
*
pMsr
&
~
MSR_MASK
)
|
tmpmsr
;
}
void
COMM_Init
(
void
)
{
int
x
;
...
...
@@ -745,10 +765,7 @@ INT16 WINAPI GetCommError16(INT16 cid,LPCOMSTAT16 lpStat)
}
stol
=
(
unsigned
char
*
)
unknown
[
cid
]
+
COMM_MSR_OFFSET
;
ioctl
(
ptr
->
fd
,
TIOCMGET
,
&
mstat
);
if
(
mstat
&
TIOCM_CAR
)
*
stol
|=
0x80
;
else
*
stol
&=
0x7f
;
COMM_MSRUpdate
(
stol
,
mstat
);
if
(
lpStat
)
{
lpStat
->
status
=
0
;
...
...
@@ -796,10 +813,7 @@ SEGPTR WINAPI SetCommEventMask16(INT16 cid,UINT16 fuEvtMask)
stol
=
(
unsigned
char
*
)
unknown
[
cid
]
+
COMM_MSR_OFFSET
;
repid
=
ioctl
(
ptr
->
fd
,
TIOCMGET
,
&
mstat
);
TRACE
(
" ioctl %d, msr %x at %p %p
\n
"
,
repid
,
mstat
,
stol
,
unknown
[
cid
]);
if
((
mstat
&
TIOCM_CAR
))
*
stol
|=
0x80
;
else
*
stol
&=
0x7f
;
COMM_MSRUpdate
(
stol
,
mstat
);
TRACE
(
" modem dcd construct %x
\n
"
,
*
stol
);
return
SEGPTR_GET
(
unknown
[
cid
]);
...
...
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