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
5a9ecdef
Commit
5a9ecdef
authored
Sep 10, 2009
by
Ismael Barros
Committed by
Alexandre Julliard
Sep 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpwsockx: Implementation of SPInit.
parent
ec093455
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
1 deletion
+89
-1
Makefile.in
dlls/dpwsockx/Makefile.in
+1
-1
dpwsockx_dll.h
dlls/dpwsockx/dpwsockx_dll.h
+68
-0
dpwsockx_main.c
dlls/dpwsockx/dpwsockx_main.c
+20
-0
No files found.
dlls/dpwsockx/Makefile.in
View file @
5a9ecdef
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
dpwsockx.dll
IMPORTS
=
dxguid kernel32
IMPORTS
=
dxguid kernel32
ws2_32
C_SRCS
=
\
dpwsockx_main.c
...
...
dlls/dpwsockx/dpwsockx_dll.h
View file @
5a9ecdef
...
...
@@ -21,10 +21,78 @@
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "winnt.h"
#include "wine/dplaysp.h"
typedef
struct
tagDPWS_THREADDATA
{
BOOL
is_running
;
SOCKET
sock
;
SOCKADDR_IN
addr
;
HANDLE
handle
;
LPDIRECTPLAYSP
lpISP
;
}
DPWS_THREADDATA
,
*
LPDPWS_THREADDATA
;
typedef
struct
tagDPWS_DATA
{
SOCKET
sock
;
DPWS_THREADDATA
tcp_listener
,
udp_listener
,
dplaysrv
;
SOCKADDR_IN
nameserverAddr
;
LPDIRECTPLAYSP
lpISP
;
}
DPWS_DATA
,
*
LPDPWS_DATA
;
#ifdef WORDS_BIGENDIAN
static
inline
u_short
__dpws_ushort_swap
(
u_short
s
)
{
return
(
s
>>
8
)
|
(
s
<<
8
);
}
static
inline
u_long
__dpws_ulong_swap
(
u_long
l
)
{
return
((
u_long
)
__dpws_ushort_swap
((
u_short
)
l
)
<<
16
)
|
__dpws_ushort_swap
((
u_short
)(
l
>>
16
));
}
#define dpws_letohl(l) __dpws_ulong_swap(l)
#define dpws_letohs(s) __dpws_ushort_swap(s)
#define dpws_htolel(l) __dpws_ulong_swap(l)
#define dpws_htoles(s) __dpws_ushort_swap(s)
#else
/* WORDS_BIGENDIAN */
#define dpws_letohl(l) ((u_long)(l))
#define dpws_letohs(s) ((u_short)(s))
#define dpws_htolel(l) ((u_long)(l))
#define dpws_htoles(s) ((u_short)(s))
#endif
/* WORDS_BIGENDIAN */
#include "pshpack1.h"
typedef
struct
tagDPSP_MSG_HEADER
{
DWORD
mixed
;
SOCKADDR_IN
SockAddr
;
}
DPSP_MSG_HEADER
,
*
LPDPSP_MSG_HEADER
;
typedef
const
DPSP_MSG_HEADER
*
LPCDPSP_MSG_HEADER
;
#include "poppack.h"
#define DPSP_MSG_TOKEN_REMOTE 0xFAB00000
#define DPSP_MSG_TOKEN_FORWARDED 0xCAB00000
#define DPSP_MSG_TOKEN_SERVER 0xBAB00000
#define DPSP_MSG_MAKE_MIXED(s,t) dpws_htolel((s) | (t))
#define DPSP_MSG_SIZE(m) (dpws_letohl(m) & 0x000FFFFF)
#define DPSP_MSG_TOKEN(m) (dpws_letohl(m) & 0xFFF00000)
HRESULT
WINAPI
SPInit
(
LPSPINITDATA
);
#endif
/* __WINE_DPWSOCKX_DLL_H */
dlls/dpwsockx/dpwsockx_main.c
View file @
5a9ecdef
...
...
@@ -23,6 +23,7 @@
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "dpwsockx_dll.h"
#include "wine/debug.h"
#include "dplay.h"
...
...
@@ -205,6 +206,9 @@ static void setup_callbacks( LPDPSP_SPCALLBACKS lpCB )
*/
HRESULT
WINAPI
SPInit
(
LPSPINITDATA
lpspData
)
{
WSADATA
wsaData
;
DPWS_DATA
dpwsData
;
TRACE
(
"Initializing library for %s (%s)
\n
"
,
wine_dbgstr_guid
(
lpspData
->
lpGuid
),
debugstr_w
(
lpspData
->
lpszName
)
);
...
...
@@ -217,5 +221,21 @@ HRESULT WINAPI SPInit( LPSPINITDATA lpspData )
/* Assign callback functions */
setup_callbacks
(
lpspData
->
lpCB
);
/* Load Winsock 2.0 DLL */
if
(
WSAStartup
(
MAKEWORD
(
2
,
0
),
&
wsaData
)
!=
0
)
{
ERR
(
"WSAStartup() failed
\n
"
);
return
DPERR_UNAVAILABLE
;
}
/* Initialize internal data */
memset
(
&
dpwsData
,
0
,
sizeof
(
DPWS_DATA
)
);
dpwsData
.
lpISP
=
lpspData
->
lpISP
;
IDirectPlaySP_SetSPData
(
lpspData
->
lpISP
,
&
dpwsData
,
sizeof
(
DPWS_DATA
),
DPSET_LOCAL
);
/* dplay needs to know the size of the header */
lpspData
->
dwSPHeaderSize
=
sizeof
(
DPSP_MSG_HEADER
);
return
DP_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