Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
40491ecc
Commit
40491ecc
authored
23 years ago
by
Daniel Walker
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented WSAAccept().
parent
404b9a5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/winsock/socket.c
+60
-0
60 additions, 0 deletions
dlls/winsock/socket.c
dlls/winsock/ws2_32.spec
+1
-1
1 addition, 1 deletion
dlls/winsock/ws2_32.spec
include/winsock2.h
+27
-2
27 additions, 2 deletions
include/winsock2.h
with
88 additions
and
3 deletions
dlls/winsock/socket.c
+
60
−
0
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
;
}
This diff is collapsed.
Click to expand it.
dlls/winsock/ws2_32.spec
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
include/winsock2.h
+
27
−
2
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment