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
5973955e
Commit
5973955e
authored
Feb 06, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implemented COMM IOCTL for modem status: GET_MODEMSTATUS.
parent
58e719ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
43 deletions
+55
-43
comm.c
dlls/kernel/comm.c
+8
-43
serial.c
dlls/ntdll/serial.c
+47
-0
No files found.
dlls/kernel/comm.c
View file @
5973955e
...
...
@@ -1801,55 +1801,20 @@ BOOL WINAPI SetCommTimeouts(
*
* Obtains the four control register bits if supported by the hardware.
*
* PARAMS
*
* hFile [in] The communications device
* lpModemStat [out] The control register bits
*
* RETURNS
*
* True if the communications handle was good and for hardware that
* control register access, false otherwise.
*/
BOOL
WINAPI
GetCommModemStatus
(
HANDLE
hFile
,
/* [in] The communications device. */
LPDWORD
lpModemStat
)
/* [out] The control register bits. */
BOOL
WINAPI
GetCommModemStatus
(
HANDLE
hFile
,
LPDWORD
lpModemStat
)
{
int
fd
,
mstat
,
result
=
FALSE
;
*
lpModemStat
=
0
;
#ifdef TIOCMGET
fd
=
get_comm_fd
(
hFile
,
FILE_READ_DATA
);
if
(
fd
<
0
)
return
FALSE
;
result
=
ioctl
(
fd
,
TIOCMGET
,
&
mstat
);
release_comm_fd
(
hFile
,
fd
);
if
(
result
==
-
1
)
{
WARN
(
"ioctl failed
\n
"
);
return
FALSE
;
}
#ifdef TIOCM_CTS
if
(
mstat
&
TIOCM_CTS
)
*
lpModemStat
|=
MS_CTS_ON
;
#endif
#ifdef TIOCM_DSR
if
(
mstat
&
TIOCM_DSR
)
*
lpModemStat
|=
MS_DSR_ON
;
#endif
#ifdef TIOCM_RNG
if
(
mstat
&
TIOCM_RNG
)
*
lpModemStat
|=
MS_RING_ON
;
#endif
#ifdef TIOCM_CAR
/*FIXME: Not really sure about RLSD UB 990810*/
if
(
mstat
&
TIOCM_CAR
)
*
lpModemStat
|=
MS_RLSD_ON
;
#endif
TRACE
(
"%04x -> %s%s%s%s
\n
"
,
mstat
,
(
*
lpModemStat
&
MS_RLSD_ON
)
?
"MS_RLSD_ON "
:
""
,
(
*
lpModemStat
&
MS_RING_ON
)
?
"MS_RING_ON "
:
""
,
(
*
lpModemStat
&
MS_DSR_ON
)
?
"MS_DSR_ON "
:
""
,
(
*
lpModemStat
&
MS_CTS_ON
)
?
"MS_CTS_ON "
:
""
);
return
TRUE
;
#else
return
FALSE
;
#endif
return
DeviceIoControl
(
hFile
,
IOCTL_SERIAL_GET_MODEMSTATUS
,
NULL
,
0
,
lpModemStat
,
sizeof
(
DWORD
),
NULL
,
NULL
);
}
static
DWORD
WINAPI
Comm_CheckEvents
(
int
fd
,
DWORD
mask
,
serial_irq_info
*
new
,
serial_irq_info
*
old
,
DWORD
new_mstat
,
DWORD
old_mstat
)
...
...
dlls/ntdll/serial.c
View file @
5973955e
...
...
@@ -129,6 +129,45 @@ static const char* iocode2str(DWORD ioc)
}
}
static
NTSTATUS
get_modem_status
(
int
fd
,
DWORD
*
lpModemStat
)
{
NTSTATUS
status
=
STATUS_SUCCESS
;
int
mstat
;
#ifdef TIOCMGET
if
(
ioctl
(
fd
,
TIOCMGET
,
&
mstat
)
==
-
1
)
{
WARN
(
"ioctl failed
\n
"
);
status
=
FILE_GetNtStatus
();
}
else
{
*
lpModemStat
=
0
;
#ifdef TIOCM_CTS
if
(
mstat
&
TIOCM_CTS
)
*
lpModemStat
|=
MS_CTS_ON
;
#endif
#ifdef TIOCM_DSR
if
(
mstat
&
TIOCM_DSR
)
*
lpModemStat
|=
MS_DSR_ON
;
#endif
#ifdef TIOCM_RNG
if
(
mstat
&
TIOCM_RNG
)
*
lpModemStat
|=
MS_RING_ON
;
#endif
#ifdef TIOCM_CAR
/* FIXME: Not really sure about RLSD UB 990810 */
if
(
mstat
&
TIOCM_CAR
)
*
lpModemStat
|=
MS_RLSD_ON
;
#endif
TRACE
(
"%04x -> %s%s%s%s
\n
"
,
mstat
,
(
*
lpModemStat
&
MS_RLSD_ON
)
?
"MS_RLSD_ON "
:
""
,
(
*
lpModemStat
&
MS_RING_ON
)
?
"MS_RING_ON "
:
""
,
(
*
lpModemStat
&
MS_DSR_ON
)
?
"MS_DSR_ON "
:
""
,
(
*
lpModemStat
&
MS_CTS_ON
)
?
"MS_CTS_ON "
:
""
);
}
#else
status
=
STATUS_NOT_SUPPORTED
;
#endif
return
status
;
}
static
NTSTATUS
get_wait_mask
(
HANDLE
hDevice
,
DWORD
*
mask
)
{
NTSTATUS
status
;
...
...
@@ -199,6 +238,14 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
switch
(
dwIoControlCode
)
{
case
IOCTL_SERIAL_GET_MODEMSTATUS
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
if
(
!
(
status
=
get_modem_status
(
fd
,
(
DWORD
*
)
lpOutBuffer
)))
sz
=
sizeof
(
DWORD
);
}
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
case
IOCTL_SERIAL_GET_WAIT_MASK
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
...
...
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