Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
a6d339c6
Commit
a6d339c6
authored
19 years ago
by
Eric Pouech
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Implemented serial IOCTL for status: GET_COMM_STATUS.
parent
8f08fe6c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ntdll/serial.c
+38
-0
38 additions, 0 deletions
dlls/ntdll/serial.c
with
38 additions
and
0 deletions
dlls/ntdll/serial.c
+
38
−
0
View file @
a6d339c6
...
...
@@ -168,6 +168,36 @@ static NTSTATUS get_modem_status(int fd, DWORD* lpModemStat)
return
status
;
}
static
NTSTATUS
get_status
(
int
fd
,
SERIAL_STATUS
*
ss
)
{
NTSTATUS
status
=
STATUS_SUCCESS
;
ss
->
Errors
=
0
;
ss
->
HoldReasons
=
0
;
ss
->
EofReceived
=
FALSE
;
ss
->
WaitForImmediate
=
FALSE
;
#ifdef TIOCOUTQ
if
(
ioctl
(
fd
,
TIOCOUTQ
,
&
ss
->
AmountInOutQueue
)
==
-
1
)
{
WARN
(
"ioctl returned error
\n
"
);
status
=
FILE_GetNtStatus
();
}
#else
ss
->
AmountInOutQueue
=
0
;
/* FIXME: find a different way to find out */
#endif
#ifdef TIOCINQ
if
(
ioctl
(
fd
,
TIOCINQ
,
&
ss
->
AmountInInQueue
))
{
WARN
(
"ioctl returned error
\n
"
);
status
=
FILE_GetNtStatus
();
}
#else
ss
->
AmountInInQueue
=
0
;
/* FIXME: find a different way to find out */
#endif
return
status
;
}
static
NTSTATUS
get_wait_mask
(
HANDLE
hDevice
,
DWORD
*
mask
)
{
NTSTATUS
status
;
...
...
@@ -247,6 +277,14 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
switch
(
dwIoControlCode
)
{
case
IOCTL_SERIAL_GET_COMMSTATUS
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
SERIAL_STATUS
))
{
if
(
!
(
status
=
get_status
(
fd
,
(
SERIAL_STATUS
*
)
lpOutBuffer
)))
sz
=
sizeof
(
SERIAL_STATUS
);
}
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
case
IOCTL_SERIAL_GET_MODEMSTATUS
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment