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
424a379f
Commit
424a379f
authored
Nov 20, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Return a WSA error code in create_socket.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4383a9d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
14 deletions
+50
-14
socket.c
dlls/ws2_32/socket.c
+1
-10
sock.c
dlls/ws2_32/tests/sock.c
+0
-1
sock.c
server/sock.c
+2
-3
trace.c
server/trace.c
+43
-0
make_requests
tools/make_requests
+4
-0
No files found.
dlls/ws2_32/socket.c
View file @
424a379f
...
...
@@ -7619,7 +7619,7 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
req
->
access
=
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
;
req
->
attributes
=
(
dwFlags
&
WSA_FLAG_NO_HANDLE_INHERIT
)
?
0
:
OBJ_INHERIT
;
req
->
flags
=
dwFlags
&
~
WSA_FLAG_NO_HANDLE_INHERIT
;
set_e
rror
(
wine_server_call
(
req
)
);
err
=
NtStatusToWSAE
rror
(
wine_server_call
(
req
)
);
ret
=
HANDLE2SOCKET
(
wine_server_ptr_handle
(
reply
->
handle
));
}
SERVER_END_REQ
;
...
...
@@ -7655,7 +7655,6 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
return
ret
;
}
err
=
GetLastError
();
if
(
err
==
WSAEACCES
)
/* raw socket denied */
{
if
(
type
==
SOCK_RAW
)
...
...
@@ -7663,14 +7662,6 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
else
ERR_
(
winediag
)(
"Failed to create socket, this requires special permissions.
\n
"
);
}
else
{
/* invalid combination of valid parameters, like SOCK_STREAM + IPPROTO_UDP */
if
(
err
==
WSAEINVAL
)
err
=
WSAESOCKTNOSUPPORT
;
else
if
(
err
==
WSAEOPNOTSUPP
)
err
=
WSAEPROTONOSUPPORT
;
}
done:
WARN
(
"
\t\t
failed, error %d!
\n
"
,
err
);
...
...
dlls/ws2_32/tests/sock.c
View file @
424a379f
...
...
@@ -2773,7 +2773,6 @@ static void test_WSASocket(void)
if
(
sock
==
INVALID_SOCKET
)
{
err
=
WSAGetLastError
();
todo_wine
ok
(
err
==
WSAEAFNOSUPPORT
||
broken
(
err
==
WSAEPROTONOSUPPORT
),
"Expected 10047, received %d
\n
"
,
err
);
skip
(
"IPX is not supported
\n
"
);
}
...
...
server/sock.c
View file @
424a379f
...
...
@@ -661,11 +661,10 @@ static struct object *create_socket( int family, int type, int protocol, unsigne
int
sockfd
;
sockfd
=
socket
(
family
,
type
,
protocol
);
if
(
debug_level
)
fprintf
(
stderr
,
"socket(%d,%d,%d)=%d
\n
"
,
family
,
type
,
protocol
,
sockfd
);
if
(
sockfd
==
-
1
)
{
sock_set_error
();
if
(
errno
==
EINVAL
)
set_win32_error
(
WSAESOCKTNOSUPPORT
);
else
set_win32_error
(
sock_get_error
(
errno
));
return
NULL
;
}
fcntl
(
sockfd
,
F_SETFL
,
O_NONBLOCK
);
/* make socket nonblocking */
...
...
server/trace.c
View file @
424a379f
...
...
@@ -5549,6 +5549,49 @@ static const struct
{
"USER_MAPPED_FILE"
,
STATUS_USER_MAPPED_FILE
},
{
"VOLUME_DISMOUNTED"
,
STATUS_VOLUME_DISMOUNTED
},
{
"WAS_LOCKED"
,
STATUS_WAS_LOCKED
},
{
"WSAEACCES"
,
0xc0010000
|
WSAEACCES
},
{
"WSAEADDRINUSE"
,
0xc0010000
|
WSAEADDRINUSE
},
{
"WSAEADDRNOTAVAIL"
,
0xc0010000
|
WSAEADDRNOTAVAIL
},
{
"WSAEAFNOSUPPORT"
,
0xc0010000
|
WSAEAFNOSUPPORT
},
{
"WSAEALREADY"
,
0xc0010000
|
WSAEALREADY
},
{
"WSAEBADF"
,
0xc0010000
|
WSAEBADF
},
{
"WSAECONNABORTED"
,
0xc0010000
|
WSAECONNABORTED
},
{
"WSAECONNREFUSED"
,
0xc0010000
|
WSAECONNREFUSED
},
{
"WSAECONNRESET"
,
0xc0010000
|
WSAECONNRESET
},
{
"WSAEDESTADDRREQ"
,
0xc0010000
|
WSAEDESTADDRREQ
},
{
"WSAEDQUOT"
,
0xc0010000
|
WSAEDQUOT
},
{
"WSAEFAULT"
,
0xc0010000
|
WSAEFAULT
},
{
"WSAEHOSTDOWN"
,
0xc0010000
|
WSAEHOSTDOWN
},
{
"WSAEHOSTUNREACH"
,
0xc0010000
|
WSAEHOSTUNREACH
},
{
"WSAEINPROGRESS"
,
0xc0010000
|
WSAEINPROGRESS
},
{
"WSAEINTR"
,
0xc0010000
|
WSAEINTR
},
{
"WSAEINVAL"
,
0xc0010000
|
WSAEINVAL
},
{
"WSAEISCONN"
,
0xc0010000
|
WSAEISCONN
},
{
"WSAELOOP"
,
0xc0010000
|
WSAELOOP
},
{
"WSAEMFILE"
,
0xc0010000
|
WSAEMFILE
},
{
"WSAEMSGSIZE"
,
0xc0010000
|
WSAEMSGSIZE
},
{
"WSAENAMETOOLONG"
,
0xc0010000
|
WSAENAMETOOLONG
},
{
"WSAENETDOWN"
,
0xc0010000
|
WSAENETDOWN
},
{
"WSAENETRESET"
,
0xc0010000
|
WSAENETRESET
},
{
"WSAENETUNREACH"
,
0xc0010000
|
WSAENETUNREACH
},
{
"WSAENOBUFS"
,
0xc0010000
|
WSAENOBUFS
},
{
"WSAENOPROTOOPT"
,
0xc0010000
|
WSAENOPROTOOPT
},
{
"WSAENOTCONN"
,
0xc0010000
|
WSAENOTCONN
},
{
"WSAENOTEMPTY"
,
0xc0010000
|
WSAENOTEMPTY
},
{
"WSAENOTSOCK"
,
0xc0010000
|
WSAENOTSOCK
},
{
"WSAEOPNOTSUPP"
,
0xc0010000
|
WSAEOPNOTSUPP
},
{
"WSAEPFNOSUPPORT"
,
0xc0010000
|
WSAEPFNOSUPPORT
},
{
"WSAEPROCLIM"
,
0xc0010000
|
WSAEPROCLIM
},
{
"WSAEPROTONOSUPPORT"
,
0xc0010000
|
WSAEPROTONOSUPPORT
},
{
"WSAEPROTOTYPE"
,
0xc0010000
|
WSAEPROTOTYPE
},
{
"WSAEREMOTE"
,
0xc0010000
|
WSAEREMOTE
},
{
"WSAESHUTDOWN"
,
0xc0010000
|
WSAESHUTDOWN
},
{
"WSAESOCKTNOSUPPORT"
,
0xc0010000
|
WSAESOCKTNOSUPPORT
},
{
"WSAESTALE"
,
0xc0010000
|
WSAESTALE
},
{
"WSAETIMEDOUT"
,
0xc0010000
|
WSAETIMEDOUT
},
{
"WSAETOOMANYREFS"
,
0xc0010000
|
WSAETOOMANYREFS
},
{
"WSAEUSERS"
,
0xc0010000
|
WSAEUSERS
},
{
"WSAEWOULDBLOCK"
,
0xc0010000
|
WSAEWOULDBLOCK
},
{
NULL
,
0
}
};
...
...
tools/make_requests
View file @
424a379f
...
...
@@ -298,6 +298,10 @@ sub GET_ERROR_NAMES()
{
$errors
{
$1
}
=
"0xc0010000 | $1"
;
}
while
(
/\breturn\s+(WSA\w+)/g
)
{
$errors
{
$1
}
=
"0xc0010000 | $1"
;
}
}
close
FILE
;
}
...
...
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