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
40491ecc
Commit
40491ecc
authored
Jan 14, 2002
by
Daniel Walker
Committed by
Alexandre Julliard
Jan 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented WSAAccept().
parent
404b9a5f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
3 deletions
+88
-3
socket.c
dlls/winsock/socket.c
+60
-0
ws2_32.spec
dlls/winsock/ws2_32.spec
+1
-1
winsock2.h
include/winsock2.h
+27
-2
No files found.
dlls/winsock/socket.c
View file @
40491ecc
...
...
@@ -3470,3 +3470,63 @@ INT WINAPI WSCDeinstallProvider(LPGUID lpProviderId, LPINT lpErrno)
*
lpErrno
=
0
;
return
0
;
}
SOCKET
WINAPI
WSAAccept
(
SOCKET
s
,
struct
WS_sockaddr
*
addr
,
LPINT
addrlen
,
LPCONDITIONPROC
lpfnCondition
,
DWORD
dwCallbackData
)
{
int
ret
=
0
,
size
=
0
;
WSABUF
CallerId
,
CallerData
,
CalleeId
,
CalleeData
;
/* QOS SQOS, GQOS; */
GROUP
g
;
SOCKET
cs
;
SOCKADDR
s_addr
,
d_addr
;
TRACE
(
"Socket %ui, sockaddr %p, addrlen %p, fnCondition %p, dwCallbackD ata %ld
\n
"
,
s
,
addr
,
addrlen
,
lpfnCondition
,
dwCallbackData
);
size
=
sizeof
(
s_addr
);
cs
=
WS_accept
(
s
,
&
s_addr
,
&
size
);
if
(
cs
==
SOCKET_ERROR
)
return
SOCKET_ERROR
;
CallerId
.
buf
=
(
char
*
)
&
s_addr
;
CallerId
.
len
=
sizeof
(
s_addr
);
CallerData
.
buf
=
NULL
;
CallerData
.
len
=
(
ULONG
)
NULL
;
WS_getsockname
(
cs
,
&
d_addr
,
&
size
);
CalleeId
.
buf
=
(
char
*
)
&
d_addr
;
CalleeId
.
len
=
sizeof
(
d_addr
);
ret
=
(
*
lpfnCondition
)(
&
CallerId
,
&
CallerData
,
NULL
,
NULL
,
&
CalleeId
,
&
CalleeData
,
&
g
,
dwCallbackData
);
switch
(
ret
)
{
case
CF_ACCEPT
:
if
(
addr
&&
addrlen
)
addr
=
memcpy
(
addr
,
&
s_addr
,
(
*
addrlen
>
size
)
?
size
:
*
addrlen
);
return
cs
;
case
CF_DEFER
:
SetLastError
(
WSATRY_AGAIN
);
return
SOCKET_ERROR
;
case
CF_REJECT
:
WS_closesocket
(
cs
);
SetLastError
(
WSAECONNREFUSED
);
return
SOCKET_ERROR
;
default:
FIXME
(
"Unknown return type from Condition function
\n
"
);
SetLastError
(
WSAENOTSOCK
);
return
SOCKET_ERROR
;
}
SetLastError
(
WSAENOTSOCK
);
return
SOCKET_ERROR
;
}
dlls/winsock/ws2_32.spec
View file @
40491ecc
...
...
@@ -38,7 +38,7 @@ debug_channels (winsock)
23 stdcall socket(long long long) WS_socket
24 stdcall WSApSetPostRoutine(ptr) WSApSetPostRoutine
25 stub WPUCompleteOverlappedRequest
26 st
ub
WSAAccept
26 st
dcall WSAAccept(long ptr ptr ptr long)
WSAAccept
27 stub WSAAddressToStringA
28 stub WSAAddressToStringW
29 stdcall WSACloseEvent(long) WSACloseEvent
...
...
include/winsock2.h
View file @
40491ecc
...
...
@@ -226,8 +226,28 @@ typedef unsigned int GROUP;
#define SG_UNCONSTRAINED_GROUP 0x01
#define SG_CONSTRAINED_GROUP 0x02
/* FIXME: We don't yet have qos.h */
typedef
DWORD
QOS
,
*
LPQOS
;
/*
* FLOWSPEC and SERVICETYPE should eventually move to qos.h
*/
typedef
ULONG
SERVICETYPE
;
typedef
struct
_FLOWSPEC
{
unsigned
int
TokenRate
;
unsigned
int
TokenBucketSize
;
unsigned
int
PeakBandwidth
;
unsigned
int
Latency
;
unsigned
int
DelayVariation
;
SERVICETYPE
ServiceType
;
unsigned
int
MaxSduSize
;
unsigned
int
MinimumPolicedSize
;
}
FLOWSPEC
,
*
PFLOWSPEC
,
*
LPFLOWSPEC
;
typedef
struct
_QUALITYOFSERVICE
{
FLOWSPEC
SendingFlowspec
;
FLOWSPEC
ReceivingFlowspec
;
WSABUF
ProviderSpecific
;
}
QOS
,
*
LPQOS
;
typedef
int
CALLBACK
(
*
LPCONDITIONPROC
)
(
...
...
@@ -440,6 +460,11 @@ typedef DWORD (WINAPI *LPFN_WSAWAITFORMULTIPLEEVENTS)(DWORD,const WSAEVENT*,BOOL
#endif
/* WS_API_TYPEDEFS */
/* Condition function return values */
#define CF_ACCEPT 0x0000
#define CF_REJECT 0x0001
#define CF_DEFER 0x0002
#include "poppack.h"
#ifdef __cplusplus
...
...
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