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
3e09e250
Commit
3e09e250
authored
Jul 30, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Move the getsockopt(IRLMP_ENUMDEVICES) implementation to ntdll.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
55c76154
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
59 deletions
+45
-59
socket.c
dlls/ntdll/unix/socket.c
+43
-0
socket.c
dlls/ws2_32/socket.c
+1
-59
afd.h
include/wine/afd.h
+1
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
3e09e250
...
...
@@ -1956,6 +1956,49 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
}
#endif
#ifdef HAS_IRDA
#define MAX_IRDA_DEVICES 10
case
IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES
:
{
char
buffer
[
offsetof
(
struct
irda_device_list
,
dev
[
MAX_IRDA_DEVICES
]
)];
struct
irda_device_list
*
unix_list
=
(
struct
irda_device_list
*
)
buffer
;
socklen_t
len
=
sizeof
(
buffer
);
DEVICELIST
*
ws_list
=
out_buffer
;
int
fd
,
needs_close
=
FALSE
;
NTSTATUS
status
;
unsigned
int
i
;
int
ret
;
if
((
status
=
server_get_unix_fd
(
handle
,
0
,
&
fd
,
&
needs_close
,
NULL
,
NULL
)))
return
status
;
ret
=
getsockopt
(
fd
,
SOL_IRLMP
,
IRLMP_ENUMDEVICES
,
buffer
,
&
len
);
if
(
needs_close
)
close
(
fd
);
if
(
ret
)
return
sock_errno_to_status
(
errno
);
io
->
Information
=
offsetof
(
DEVICELIST
,
unix_list
->
len
);
if
(
out_size
<
io
->
Information
)
return
STATUS_BUFFER_TOO_SMALL
;
TRACE
(
"IRLMP_ENUMDEVICES: got %u devices:
\n
"
,
unix_list
->
len
);
ws_list
->
numDevice
=
unix_list
->
len
;
for
(
i
=
0
;
i
<
unix_list
->
len
;
++
i
)
{
const
struct
irda_device_info
*
unix_dev
=
&
unix_list
->
dev
[
i
];
IRDA_DEVICE_INFO
*
ws_dev
=
&
ws_list
->
Device
[
i
];
TRACE
(
"saddr %#08x, daddr %#08x, info %s, hints 0x%02x%02x
\n
"
,
unix_dev
->
saddr
,
unix_dev
->
daddr
,
unix_dev
->
info
,
unix_dev
->
hints
[
0
],
unix_dev
->
hints
[
1
]
);
memcpy
(
ws_dev
->
irdaDeviceID
,
&
unix_dev
->
daddr
,
sizeof
(
unix_dev
->
daddr
)
);
memcpy
(
ws_dev
->
irdaDeviceName
,
unix_dev
->
info
,
sizeof
(
unix_dev
->
info
)
);
ws_dev
->
irdaDeviceHints1
=
unix_dev
->
hints
[
0
];
ws_dev
->
irdaDeviceHints2
=
unix_dev
->
hints
[
1
];
ws_dev
->
irdaCharSet
=
unix_dev
->
charset
;
}
return
STATUS_SUCCESS
;
}
#endif
default:
{
if
((
code
>>
16
)
==
FILE_DEVICE_NETWORK
)
...
...
dlls/ws2_32/socket.c
View file @
3e09e250
...
...
@@ -2169,75 +2169,17 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
}
/* end switch(optname) */
}
/* end case WS_NSPROTO_IPX */
#ifdef HAS_IRDA
#define MAX_IRDA_DEVICES 10
case
WS_SOL_IRLMP
:
switch
(
optname
)
{
case
WS_IRLMP_ENUMDEVICES
:
{
char
buf
[
sizeof
(
struct
irda_device_list
)
+
(
MAX_IRDA_DEVICES
-
1
)
*
sizeof
(
struct
irda_device_info
)];
int
res
;
socklen_t
len
=
sizeof
(
buf
);
return
server_getsockopt
(
s
,
IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES
,
optval
,
optlen
);
if
(
(
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
res
=
getsockopt
(
fd
,
SOL_IRLMP
,
IRLMP_ENUMDEVICES
,
buf
,
&
len
);
release_sock_fd
(
s
,
fd
);
if
(
res
<
0
)
{
SetLastError
(
wsaErrno
());
return
SOCKET_ERROR
;
}
else
{
struct
irda_device_list
*
src
=
(
struct
irda_device_list
*
)
buf
;
DEVICELIST
*
dst
=
(
DEVICELIST
*
)
optval
;
INT
needed
=
sizeof
(
DEVICELIST
);
unsigned
int
i
;
if
(
src
->
len
>
0
)
needed
+=
(
src
->
len
-
1
)
*
sizeof
(
IRDA_DEVICE_INFO
);
if
(
*
optlen
<
needed
)
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
*
optlen
=
needed
;
TRACE
(
"IRLMP_ENUMDEVICES: %d devices found:
\n
"
,
src
->
len
);
dst
->
numDevice
=
src
->
len
;
for
(
i
=
0
;
i
<
src
->
len
;
i
++
)
{
TRACE
(
"saddr = %08x, daddr = %08x, info = %s, hints = %02x%02x
\n
"
,
src
->
dev
[
i
].
saddr
,
src
->
dev
[
i
].
daddr
,
src
->
dev
[
i
].
info
,
src
->
dev
[
i
].
hints
[
0
],
src
->
dev
[
i
].
hints
[
1
]);
memcpy
(
dst
->
Device
[
i
].
irdaDeviceID
,
&
src
->
dev
[
i
].
daddr
,
sizeof
(
dst
->
Device
[
i
].
irdaDeviceID
)
)
;
memcpy
(
dst
->
Device
[
i
].
irdaDeviceName
,
src
->
dev
[
i
].
info
,
sizeof
(
dst
->
Device
[
i
].
irdaDeviceName
)
)
;
memcpy
(
&
dst
->
Device
[
i
].
irdaDeviceHints1
,
&
src
->
dev
[
i
].
hints
[
0
],
sizeof
(
dst
->
Device
[
i
].
irdaDeviceHints1
)
)
;
memcpy
(
&
dst
->
Device
[
i
].
irdaDeviceHints2
,
&
src
->
dev
[
i
].
hints
[
1
],
sizeof
(
dst
->
Device
[
i
].
irdaDeviceHints2
)
)
;
dst
->
Device
[
i
].
irdaCharSet
=
src
->
dev
[
i
].
charset
;
}
return
0
;
}
}
default:
FIXME
(
"IrDA optname:0x%x
\n
"
,
optname
);
return
SOCKET_ERROR
;
}
break
;
/* case WS_SOL_IRLMP */
#undef MAX_IRDA_DEVICES
#endif
/* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
case
WS_IPPROTO_TCP
:
...
...
include/wine/afd.h
View file @
3e09e250
...
...
@@ -225,6 +225,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_IPV6_V6ONLY WINE_AFD_IOC(280)
#define IOCTL_AFD_WINE_GET_IPX_PTYPE WINE_AFD_IOC(281)
#define IOCTL_AFD_WINE_SET_IPX_PTYPE WINE_AFD_IOC(282)
#define IOCTL_AFD_WINE_GET_IRLMP_ENUMDEVICES WINE_AFD_IOC(283)
struct
afd_create_params
{
...
...
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