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
55c76154
Commit
55c76154
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 setsockopt(IPX_PTYPE) implementation to ntdll.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ce1c5ffc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
39 deletions
+14
-39
socket.c
dlls/ntdll/unix/socket.c
+12
-0
socket.c
dlls/ws2_32/socket.c
+1
-39
afd.h
include/wine/afd.h
+1
-0
No files found.
dlls/ntdll/unix/socket.c
View file @
55c76154
...
...
@@ -1925,6 +1925,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
#ifdef SOL_IPX
case
IOCTL_AFD_WINE_GET_IPX_PTYPE
:
return
do_getsockopt
(
handle
,
io
,
SOL_IPX
,
IPX_TYPE
,
out_buffer
,
out_size
);
case
IOCTL_AFD_WINE_SET_IPX_PTYPE
:
return
do_setsockopt
(
handle
,
io
,
SOL_IPX
,
IPX_TYPE
,
in_buffer
,
in_size
);
#elif defined(SO_DEFAULT_HEADERS)
case
IOCTL_AFD_WINE_GET_IPX_PTYPE
:
{
...
...
@@ -1942,6 +1945,15 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc
*
(
DWORD
*
)
out_buffer
=
value
.
ipx_pt
;
return
STATUS_SUCCESS
;
}
case
IOCTL_AFD_WINE_SET_IPX_PTYPE
:
{
struct
ipx
value
=
{
0
};
/* FIXME: should we retrieve SO_DEFAULT_HEADERS first and modify it? */
value
.
ipx_pt
=
*
(
DWORD
*
)
in_buffer
;
return
do_setsockopt
(
handle
,
io
,
0
,
SO_DEFAULT_HEADERS
,
&
value
,
sizeof
(
value
)
);
}
#endif
default:
...
...
dlls/ws2_32/socket.c
View file @
55c76154
...
...
@@ -825,42 +825,6 @@ convert_socktype_u2w(int unixsocktype) {
return
-
1
;
}
static
int
set_ipx_packettype
(
int
sock
,
int
ptype
)
{
#ifdef HAS_IPX
int
fd
=
get_sock_fd
(
sock
,
0
,
NULL
),
ret
=
0
;
TRACE
(
"trying to set IPX_PTYPE: %d (fd: %d)
\n
"
,
ptype
,
fd
);
if
(
fd
==
-
1
)
return
SOCKET_ERROR
;
/* We try to set the ipx type on ipx socket level. */
#ifdef SOL_IPX
if
(
setsockopt
(
fd
,
SOL_IPX
,
IPX_TYPE
,
&
ptype
,
sizeof
(
ptype
))
==
-
1
)
{
ERR
(
"IPX: could not set ipx option type; expect weird behaviour
\n
"
);
ret
=
SOCKET_ERROR
;
}
#else
{
struct
ipx
val
;
/* Should we retrieve val using a getsockopt call and then
* set the modified one? */
val
.
ipx_pt
=
ptype
;
setsockopt
(
fd
,
0
,
SO_DEFAULT_HEADERS
,
&
val
,
sizeof
(
struct
ipx
));
}
#endif
release_sock_fd
(
sock
,
fd
);
return
ret
;
#else
WARN
(
"IPX support is not enabled, can't set packet type
\n
"
);
return
SOCKET_ERROR
;
#endif
}
/* ----------------------------------- API -----
*
* Init / cleanup / error checking.
*/
/***********************************************************************
* WSAStartup (WS2_32.115)
...
...
@@ -3453,12 +3417,11 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
}
break
;
/* case WS_SOL_SOCKET */
#ifdef HAS_IPX
case
WS_NSPROTO_IPX
:
switch
(
optname
)
{
case
WS_IPX_PTYPE
:
return
se
t_ipx_packettype
(
s
,
*
(
int
*
)
optval
);
return
se
rver_setsockopt
(
s
,
IOCTL_AFD_WINE_SET_IPX_PTYPE
,
optval
,
optlen
);
case
WS_IPX_FILTERPTYPE
:
/* Sets the receive filter packet type, at the moment we don't support it */
...
...
@@ -3471,7 +3434,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
return
SOCKET_ERROR
;
}
break
;
/* case WS_NSPROTO_IPX */
#endif
/* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
case
WS_IPPROTO_TCP
:
...
...
include/wine/afd.h
View file @
55c76154
...
...
@@ -224,6 +224,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_GET_IPV6_V6ONLY WINE_AFD_IOC(279)
#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)
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