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
329c70d9
Commit
329c70d9
authored
Feb 14, 2014
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
May 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpnet: Store DPN_SP_CAPS as part of the object.
parent
3cd86c9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
10 deletions
+33
-10
dpnet_private.h
dlls/dpnet/dpnet_private.h
+2
-0
peer.c
dlls/dpnet/peer.c
+24
-10
peer.c
dlls/dpnet/tests/peer.c
+7
-0
No files found.
dlls/dpnet/dpnet_private.h
View file @
329c70d9
...
...
@@ -99,6 +99,8 @@ extern HRESULT DPNET_CreateDirectPlay8Address(LPCLASSFACTORY iface, LPUNKNOWN pu
extern
HRESULT
DPNET_CreateDirectPlay8LobbiedApp
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
DECLSPEC_HIDDEN
;
extern
HRESULT
DPNET_CreateDirectPlay8ThreadPool
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
DECLSPEC_HIDDEN
;
extern
void
init_dpn_sp_caps
(
DPN_SP_CAPS
*
dpnspcaps
)
DECLSPEC_HIDDEN
;
/* used for generic dumping (copied from ddraw) */
typedef
struct
{
DWORD
val
;
...
...
dlls/dpnet/peer.c
View file @
329c70d9
...
...
@@ -47,6 +47,8 @@ typedef struct IDirectPlay8PeerImpl
PFNDPNMESSAGEHANDLER
msghandler
;
DWORD
flags
;
void
*
usercontext
;
DPN_SP_CAPS
spcaps
;
}
IDirectPlay8PeerImpl
;
static
inline
IDirectPlay8PeerImpl
*
impl_from_IDirectPlay8Peer
(
IDirectPlay8Peer
*
iface
)
...
...
@@ -416,22 +418,19 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetSPCaps(IDirectPlay8Peer *iface, co
static
HRESULT
WINAPI
IDirectPlay8PeerImpl_GetSPCaps
(
IDirectPlay8Peer
*
iface
,
const
GUID
*
const
pguidSP
,
DPN_SP_CAPS
*
const
pdpspCaps
,
const
DWORD
dwFlags
)
{
TRACE
(
"(%p)->(%p,%p,%x)
\n
"
,
iface
,
pguidSP
,
pdpspCaps
,
dwFlags
);
IDirectPlay8PeerImpl
*
This
=
impl_from_IDirectPlay8Peer
(
iface
);
TRACE
(
"(%p)->(%p,%p,%x)
\n
"
,
This
,
pguidSP
,
pdpspCaps
,
dwFlags
);
if
(
!
This
->
msghandler
)
return
DPNERR_UNINITIALIZED
;
if
(
pdpspCaps
->
dwSize
!=
sizeof
(
DPN_SP_CAPS
))
{
return
DPNERR_INVALIDPARAM
;
}
pdpspCaps
->
dwFlags
=
DPNSPCAPS_SUPPORTSDPNSRV
|
DPNSPCAPS_SUPPORTSBROADCAST
|
DPNSPCAPS_SUPPORTSALLADAPTERS
|
DPNSPCAPS_SUPPORTSTHREADPOOL
;
pdpspCaps
->
dwNumThreads
=
3
;
pdpspCaps
->
dwDefaultEnumCount
=
5
;
pdpspCaps
->
dwDefaultEnumRetryInterval
=
1500
;
pdpspCaps
->
dwDefaultEnumTimeout
=
1500
;
pdpspCaps
->
dwMaxEnumPayloadSize
=
983
;
pdpspCaps
->
dwBuffersPerThread
=
1
;
pdpspCaps
->
dwSystemBufferSize
=
0x10000
;
*
pdpspCaps
=
This
->
spcaps
;
return
DPN_OK
;
}
...
...
@@ -501,6 +500,19 @@ static const IDirectPlay8PeerVtbl DirectPlay8Peer_Vtbl =
IDirectPlay8PeerImpl_TerminateSession
};
void
init_dpn_sp_caps
(
DPN_SP_CAPS
*
dpnspcaps
)
{
dpnspcaps
->
dwFlags
=
DPNSPCAPS_SUPPORTSDPNSRV
|
DPNSPCAPS_SUPPORTSBROADCAST
|
DPNSPCAPS_SUPPORTSALLADAPTERS
|
DPNSPCAPS_SUPPORTSTHREADPOOL
;
dpnspcaps
->
dwNumThreads
=
3
;
dpnspcaps
->
dwDefaultEnumCount
=
5
;
dpnspcaps
->
dwDefaultEnumRetryInterval
=
1500
;
dpnspcaps
->
dwDefaultEnumTimeout
=
1500
;
dpnspcaps
->
dwMaxEnumPayloadSize
=
983
;
dpnspcaps
->
dwBuffersPerThread
=
1
;
dpnspcaps
->
dwSystemBufferSize
=
0x10000
;
};
HRESULT
DPNET_CreateDirectPlay8Peer
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirectPlay8PeerImpl
*
Client
;
...
...
@@ -522,6 +534,8 @@ HRESULT DPNET_CreateDirectPlay8Peer(IClassFactory *iface, IUnknown *pUnkOuter, R
Client
->
msghandler
=
NULL
;
Client
->
flags
=
0
;
init_dpn_sp_caps
(
&
Client
->
spcaps
);
ret
=
IDirectPlay8Peer_QueryInterface
(
&
Client
->
IDirectPlay8Peer_iface
,
riid
,
ppobj
);
IDirectPlay8Peer_Release
(
&
Client
->
IDirectPlay8Peer_iface
);
...
...
dlls/dpnet/tests/peer.c
View file @
329c70d9
...
...
@@ -34,6 +34,7 @@ static HRESULT WINAPI DirectPlayMessageHandler(PVOID context, DWORD message_id,
static
void
test_init_dp
(
void
)
{
HRESULT
hr
;
DPN_SP_CAPS
caps
;
hr
=
CoInitialize
(
0
);
ok
(
hr
==
S_OK
,
"CoInitialize failed with %x
\n
"
,
hr
);
...
...
@@ -41,6 +42,12 @@ static void test_init_dp(void)
hr
=
CoCreateInstance
(
&
CLSID_DirectPlay8Peer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDirectPlay8Peer
,
(
void
**
)
&
peer
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed with 0x%x
\n
"
,
hr
);
memset
(
&
caps
,
0
,
sizeof
(
DPN_SP_CAPS
));
caps
.
dwSize
=
sizeof
(
DPN_SP_CAPS
);
hr
=
IDirectPlay8Peer_GetSPCaps
(
peer
,
&
CLSID_DP8SP_TCPIP
,
&
caps
,
0
);
ok
(
hr
==
DPNERR_UNINITIALIZED
,
"GetSPCaps failed with %x
\n
"
,
hr
);
hr
=
IDirectPlay8Peer_Initialize
(
peer
,
NULL
,
NULL
,
0
);
ok
(
hr
==
DPNERR_INVALIDPARAM
,
"got %x
\n
"
,
hr
);
...
...
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