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
58e719ce
Commit
58e719ce
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 IOCTL for serial: SET_WAIT_MASK, GET_WAIT_MASK.
parent
b83c5ead
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
31 deletions
+61
-31
comm.c
dlls/kernel/comm.c
+16
-31
serial.c
dlls/ntdll/serial.c
+45
-0
No files found.
dlls/kernel/comm.c
View file @
58e719ce
...
...
@@ -952,28 +952,20 @@ BOOL WINAPI SetupComm(
* Obtain the events associated with a communication device that will cause
* a call WaitCommEvent to return.
*
* PARAMS
*
* handle [in] The communications device
* evtmask [out] The events which cause WaitCommEvent to return
*
* RETURNS
*
* True on success, fail on bad device handle etc.
*/
BOOL
WINAPI
GetCommMask
(
HANDLE
handle
,
/* [in] The communications device. */
LPDWORD
evtmask
)
/* [out] The events which cause WaitCommEvent to return. */
BOOL
WINAPI
GetCommMask
(
HANDLE
handle
,
LPDWORD
evtmask
)
{
BOOL
ret
;
TRACE
(
"handle %p, mask %p
\n
"
,
handle
,
evtmask
);
SERVER_START_REQ
(
get_serial_info
)
{
req
->
handle
=
handle
;
if
((
ret
=
!
wine_server_call_err
(
req
)))
{
if
(
evtmask
)
*
evtmask
=
reply
->
eventmask
;
}
}
SERVER_END_REQ
;
return
ret
;
return
DeviceIoControl
(
handle
,
IOCTL_SERIAL_GET_WAIT_MASK
,
NULL
,
0
,
evtmask
,
sizeof
(
*
evtmask
),
NULL
,
NULL
);
}
/*****************************************************************************
...
...
@@ -983,27 +975,20 @@ BOOL WINAPI GetCommMask(
* (Set which events associated with a communication device should cause
* a call WaitCommEvent to return.)
*
* PARAMS
*
* handle [in] The communications device
* evtmask [in] The events that are to be monitored
*
* RETURNS
*
* True on success, false on bad handle etc.
*/
BOOL
WINAPI
SetCommMask
(
HANDLE
handle
,
/* [in] The communications device. */
DWORD
evtmask
)
/* [in] The events that are to be monitored. */
BOOL
WINAPI
SetCommMask
(
HANDLE
handle
,
DWORD
evtmask
)
{
BOOL
ret
;
TRACE
(
"handle %p, mask %lx
\n
"
,
handle
,
evtmask
);
SERVER_START_REQ
(
set_serial_info
)
{
req
->
handle
=
handle
;
req
->
flags
=
SERIALINFO_SET_MASK
;
req
->
eventmask
=
evtmask
;
ret
=
!
wine_server_call_err
(
req
);
}
SERVER_END_REQ
;
return
ret
;
return
DeviceIoControl
(
handle
,
IOCTL_SERIAL_SET_WAIT_MASK
,
&
evtmask
,
sizeof
(
evtmask
),
NULL
,
0
,
NULL
,
NULL
);
}
/*****************************************************************************
...
...
dlls/ntdll/serial.c
View file @
58e719ce
...
...
@@ -129,6 +129,20 @@ static const char* iocode2str(DWORD ioc)
}
}
static
NTSTATUS
get_wait_mask
(
HANDLE
hDevice
,
DWORD
*
mask
)
{
NTSTATUS
status
;
SERVER_START_REQ
(
get_serial_info
)
{
req
->
handle
=
hDevice
;
if
(
!
(
status
=
wine_server_call
(
req
)))
*
mask
=
reply
->
eventmask
;
}
SERVER_END_REQ
;
return
status
;
}
static
NTSTATUS
purge
(
int
fd
,
DWORD
flags
)
{
/*
...
...
@@ -143,6 +157,21 @@ static NTSTATUS purge(int fd, DWORD flags)
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_wait_mask
(
HANDLE
hDevice
,
DWORD
mask
)
{
NTSTATUS
status
;
SERVER_START_REQ
(
set_serial_info
)
{
req
->
handle
=
hDevice
;
req
->
flags
=
SERIALINFO_SET_MASK
;
req
->
eventmask
=
mask
;
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
return
status
;
}
/******************************************************************
* COMM_DeviceIoControl
*
...
...
@@ -170,6 +199,15 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
switch
(
dwIoControlCode
)
{
case
IOCTL_SERIAL_GET_WAIT_MASK
:
if
(
lpOutBuffer
&&
nOutBufferSize
==
sizeof
(
DWORD
))
{
if
(
!
(
status
=
get_wait_mask
(
hDevice
,
(
DWORD
*
)
lpOutBuffer
)))
sz
=
sizeof
(
DWORD
);
}
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
case
IOCTL_SERIAL_PURGE
:
if
(
lpInBuffer
&&
nInBufferSize
==
sizeof
(
DWORD
))
status
=
purge
(
fd
,
*
(
DWORD
*
)
lpInBuffer
);
...
...
@@ -200,6 +238,13 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
status
=
STATUS_NOT_SUPPORTED
;
#endif
break
;
case
IOCTL_SERIAL_SET_WAIT_MASK
:
if
(
lpInBuffer
&&
nInBufferSize
==
sizeof
(
DWORD
))
{
status
=
set_wait_mask
(
hDevice
,
*
(
DWORD
*
)
lpInBuffer
);
}
else
status
=
STATUS_INVALID_PARAMETER
;
break
;
default:
FIXME
(
"Unsupported IOCTL %lx (type=%lx access=%lx func=%lx meth=%lx)
\n
"
,
dwIoControlCode
,
dwIoControlCode
>>
16
,
(
dwIoControlCode
>>
14
)
&
3
,
...
...
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