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
Releases
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
Tayshawnna Jackson
wine
Commits
5a9ecdef
Commit
5a9ecdef
authored
15 years ago
by
Ismael Barros
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dpwsockx: Implementation of SPInit.
parent
ec093455
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/dpwsockx/Makefile.in
+1
-1
1 addition, 1 deletion
dlls/dpwsockx/Makefile.in
dlls/dpwsockx/dpwsockx_dll.h
+68
-0
68 additions, 0 deletions
dlls/dpwsockx/dpwsockx_dll.h
dlls/dpwsockx/dpwsockx_main.c
+20
-0
20 additions, 0 deletions
dlls/dpwsockx/dpwsockx_main.c
with
89 additions
and
1 deletion
dlls/dpwsockx/Makefile.in
+
1
−
1
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
...
...
This diff is collapsed.
Click to expand it.
dlls/dpwsockx/dpwsockx_dll.h
+
68
−
0
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 */
This diff is collapsed.
Click to expand it.
dlls/dpwsockx/dpwsockx_main.c
+
20
−
0
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
;
}
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