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
cf518bcd
Commit
cf518bcd
authored
Apr 27, 2002
by
Martin Wilck
Committed by
Alexandre Julliard
Apr 27, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SO_OPENTYPE has to be a per-thread setting.
parent
c1494edc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
socket.c
dlls/winsock/socket.c
+11
-15
No files found.
dlls/winsock/socket.c
View file @
cf518bcd
...
...
@@ -263,13 +263,7 @@ static int _px_tcp_ops[] = {
0
};
/* Holds value of SO_OPENTYPE socket option. This is essentially a global
* variable that Windows uses to affect how new sockets are created. See
* <http://support.microsoft.com/default.aspx?scid=kb;EN-US;q181611>. Right
* now, Wine does not do anything with this value other than get and set it on
* request.
*/
static
int
opentype
=
0
;
static
DWORD
opentype_tls_index
=
-
1
;
/* TLS index for SO_OPENTYPE flag */
inline
static
DWORD
NtStatusToWSAError
(
const
DWORD
status
)
{
...
...
@@ -430,7 +424,11 @@ BOOL WINAPI WS_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
TRACE
(
"0x%x 0x%lx %p
\n
"
,
hInstDLL
,
fdwReason
,
fImpLoad
);
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
opentype_tls_index
=
TlsAlloc
();
break
;
case
DLL_PROCESS_DETACH
:
TlsFree
(
opentype_tls_index
);
WINSOCK_DeleteIData
();
break
;
}
...
...
@@ -1763,9 +1761,9 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
*
(
int
*
)
optval
=
opentype
;
*
(
int
*
)
optval
=
(
int
)
TlsGetValue
(
opentype_tls_index
)
;
*
optlen
=
sizeof
(
int
);
TRACE
(
"getting global SO_OPENTYPE = 0x%x
\n
"
,
opentype
);
TRACE
(
"getting global SO_OPENTYPE = 0x%x
\n
"
,
*
((
int
*
)
optval
)
);
return
0
;
}
...
...
@@ -2621,8 +2619,8 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
opentype
=
*
(
int
*
)
optval
;
TRACE
(
"setting global SO_OPENTYPE to 0x%x
\n
"
,
opentype
);
TlsSetValue
(
opentype_tls_index
,
(
LPVOID
)
*
(
int
*
)
optval
)
;
TRACE
(
"setting global SO_OPENTYPE to 0x%x
\n
"
,
*
(
int
*
)
optval
);
return
0
;
}
...
...
@@ -2796,10 +2794,8 @@ SOCKET WINAPI WS_socket(int af, int type, int protocol)
{
TRACE
(
"af=%d type=%d protocol=%d
\n
"
,
af
,
type
,
protocol
);
/* The Winsock2 specification states that socket() always opens sockets
in overlapped mode.
FIXME: is the SO_OPENTYPE behaviour correct? */
return
WSASocketA
(
af
,
type
,
protocol
,
NULL
,
0
,
(
opentype
?
0
:
WSA_FLAG_OVERLAPPED
)
);
return
WSASocketA
(
af
,
type
,
protocol
,
NULL
,
0
,
(
TlsGetValue
(
opentype_tls_index
)
?
0
:
WSA_FLAG_OVERLAPPED
)
);
}
/***********************************************************************
...
...
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