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
db003d4a
Commit
db003d4a
authored
Nov 02, 2016
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Nov 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Initialize winsock.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eef69511
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
7 deletions
+50
-7
Makefile.in
dlls/dpnet/Makefile.in
+1
-1
client.c
dlls/dpnet/client.c
+4
-0
dpnet_main.c
dlls/dpnet/dpnet_main.c
+37
-6
dpnet_private.h
dlls/dpnet/dpnet_private.h
+2
-0
lobbiedapp.c
dlls/dpnet/lobbiedapp.c
+2
-0
peer.c
dlls/dpnet/peer.c
+2
-0
server.c
dlls/dpnet/server.c
+2
-0
No files found.
dlls/dpnet/Makefile.in
View file @
db003d4a
MODULE
=
dpnet.dll
IMPORTLIB
=
dpnet
IMPORTS
=
dxguid uuid ole32 advapi32
IMPORTS
=
dxguid uuid ole32 advapi32
ws2_32
C_SRCS
=
\
address.c
\
...
...
dlls/dpnet/client.c
View file @
db003d4a
...
...
@@ -115,6 +115,8 @@ static HRESULT WINAPI IDirectPlay8ClientImpl_Initialize(IDirectPlay8Client *ifac
This
->
msghandler
=
pfn
;
This
->
flags
=
dwFlags
;
init_winsock
();
return
DPN_OK
;
}
...
...
@@ -443,6 +445,8 @@ static HRESULT WINAPI lobbyclient_Initialize(IDirectPlay8LobbyClient *iface, voi
This
->
msghandler
=
msghandler
;
This
->
flags
=
flags
;
init_winsock
();
return
DPN_OK
;
}
...
...
dlls/dpnet/dpnet_main.c
View file @
db003d4a
...
...
@@ -40,15 +40,46 @@ WINE_DEFAULT_DEBUG_CHANNEL(dpnet);
static
HINSTANCE
instance
;
static
BOOL
winsock_loaded
=
FALSE
;
static
BOOL
WINAPI
winsock_startup
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
WSADATA
wsa_data
;
DWORD
res
;
res
=
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
wsa_data
);
if
(
res
==
ERROR_SUCCESS
)
winsock_loaded
=
TRUE
;
else
ERR
(
"WSAStartup failed: %u
\n
"
,
res
);
return
TRUE
;
}
void
init_winsock
(
void
)
{
static
INIT_ONCE
init_once
=
INIT_ONCE_STATIC_INIT
;
InitOnceExecuteOnce
(
&
init_once
,
winsock_startup
,
NULL
,
NULL
);
}
/* At process attach */
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
TRACE
(
"%p,%x,%p
\n
"
,
hInstDLL
,
fdwReason
,
lpvReserved
);
if
(
fdwReason
==
DLL_PROCESS_ATTACH
)
{
instance
=
hInstDLL
;
DisableThreadLibraryCalls
(
hInstDLL
);
}
return
TRUE
;
TRACE
(
"%p,%x,%p
\n
"
,
hInstDLL
,
fdwReason
,
lpvReserved
);
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
instance
=
hInstDLL
;
DisableThreadLibraryCalls
(
hInstDLL
);
break
;
case
DLL_PROCESS_DETACH
:
if
(
lpvReserved
)
break
;
if
(
winsock_loaded
)
WSACleanup
();
break
;
}
return
TRUE
;
}
/***********************************************************************
...
...
dlls/dpnet/dpnet_private.h
View file @
db003d4a
...
...
@@ -26,6 +26,7 @@
#endif
#include <wine/list.h>
#include "winsock2.h"
#include "wine/unicode.h"
#include "dplay8.h"
...
...
@@ -135,6 +136,7 @@ extern HRESULT DPNET_CreateDirectPlay8ThreadPool(LPCLASSFACTORY iface, LPUNKNOWN
extern
HRESULT
DPNET_CreateDirectPlay8LobbyClient
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppobj
)
DECLSPEC_HIDDEN
;
extern
void
init_dpn_sp_caps
(
DPN_SP_CAPS
*
dpnspcaps
)
DECLSPEC_HIDDEN
;
extern
void
init_winsock
(
void
)
DECLSPEC_HIDDEN
;
/* used for generic dumping (copied from ddraw) */
typedef
struct
{
...
...
dlls/dpnet/lobbiedapp.c
View file @
db003d4a
...
...
@@ -101,6 +101,8 @@ static HRESULT WINAPI IDirectPlay8LobbiedApplicationImpl_Initialize(IDirectPlay8
This
->
usercontext
=
pvUserContext
;
This
->
connection
=
pdpnhConnection
;
init_winsock
();
return
DPN_OK
;
}
...
...
dlls/dpnet/peer.c
View file @
db003d4a
...
...
@@ -122,6 +122,8 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_Initialize(IDirectPlay8Peer *iface,
This
->
msghandler
=
pfn
;
This
->
flags
=
dwFlags
;
init_winsock
();
return
DPN_OK
;
}
...
...
dlls/dpnet/server.c
View file @
db003d4a
...
...
@@ -118,6 +118,8 @@ static HRESULT WINAPI IDirectPlay8ServerImpl_Initialize(IDirectPlay8Server *ifac
This
->
msghandler
=
pfn
;
This
->
flags
=
dwFlags
;
init_winsock
();
return
DPN_OK
;
}
...
...
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