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
03464daa
Commit
03464daa
authored
Mar 29, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Merge the IDirectPlay4_InitializeConnection helper.
parent
c3df4764
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
89 deletions
+55
-89
dplay.c
dlls/dplayx/dplay.c
+55
-89
No files found.
dlls/dplayx/dplay.c
View file @
03464daa
...
...
@@ -140,8 +140,6 @@ static HRESULT DP_IF_EnumSessions
(
IDirectPlay2Impl
*
This
,
LPDPSESSIONDESC2
lpsd
,
DWORD
dwTimeout
,
LPDPENUMSESSIONSCALLBACK2
lpEnumSessionsCallback2
,
LPVOID
lpContext
,
DWORD
dwFlags
,
BOOL
bAnsi
);
static
HRESULT
DP_IF_InitializeConnection
(
IDirectPlay3Impl
*
This
,
LPVOID
lpConnection
,
DWORD
dwFlags
,
BOOL
bAnsi
);
static
BOOL
CALLBACK
cbDPCreateEnumConnections
(
LPCGUID
lpguidSP
,
LPVOID
lpConnection
,
DWORD
dwConnectionSize
,
LPCDPNAME
lpName
,
DWORD
dwFlags
,
LPVOID
lpContext
);
...
...
@@ -1896,8 +1894,7 @@ static HRESULT DP_IF_EnumSessions
return
DPERR_GENERIC
;
}
hr
=
DP_IF_InitializeConnection
(
(
IDirectPlay3Impl
*
)
This
,
lpConnection
,
0
,
bAnsi
);
hr
=
IDirectPlayX_InitializeConnection
(
&
This
->
IDirectPlay4_iface
,
lpConnection
,
0
);
if
(
FAILED
(
hr
)
)
{
return
hr
;
...
...
@@ -3735,103 +3732,72 @@ HRESULT DP_InitializeDPLSP( IDirectPlay3Impl* This, HMODULE hLobbyProvider )
return
hr
;
}
static
HRESULT
DP_IF_InitializeConnection
(
IDirectPlay3Impl
*
This
,
LPVOID
lpConnection
,
DWORD
dwFlags
,
BOOL
bAnsi
)
static
HRESULT
WINAPI
IDirectPlay4AImpl_InitializeConnection
(
IDirectPlay4A
*
iface
,
void
*
connection
,
DWORD
flags
)
{
HMODULE
hServiceProvider
;
HRESULT
hr
;
GUID
guidSP
;
const
DWORD
dwAddrSize
=
80
;
/* FIXME: Need to calculate it correctly */
BOOL
bIsDpSp
;
/* TRUE if Direct Play SP, FALSE if Direct Play Lobby SP */
TRACE
(
"(%p)->(%p,0x%08x,%u)
\n
"
,
This
,
lpConnection
,
dwFlags
,
bAnsi
);
if
(
lpConnection
==
NULL
)
{
return
DPERR_INVALIDPARAMS
;
}
if
(
dwFlags
!=
0
)
{
return
DPERR_INVALIDFLAGS
;
}
if
(
This
->
dp2
->
connectionInitialized
!=
NO_PROVIDER
)
{
return
DPERR_ALREADYINITIALIZED
;
}
/* Find out what the requested SP is and how large this buffer is */
hr
=
DPL_EnumAddress
(
DP_GetSpLpGuidFromCompoundAddress
,
lpConnection
,
dwAddrSize
,
&
guidSP
);
if
(
FAILED
(
hr
)
)
{
ERR
(
"Invalid compound address?
\n
"
);
return
DPERR_UNAVAILABLE
;
}
/* Load the service provider */
hServiceProvider
=
DP_LoadSP
(
&
guidSP
,
&
This
->
dp2
->
spData
,
&
bIsDpSp
);
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
return
IDirectPlayX_InitializeConnection
(
&
This
->
IDirectPlay4_iface
,
connection
,
flags
);
}
if
(
hServiceProvider
==
0
)
{
ERR
(
"Unable to load service provider %s
\n
"
,
debugstr_guid
(
&
guidSP
)
);
return
DPERR_UNAVAILABLE
;
}
static
HRESULT
WINAPI
IDirectPlay4Impl_InitializeConnection
(
IDirectPlay4
*
iface
,
void
*
connection
,
DWORD
flags
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4
(
iface
);
HMODULE
servprov
;
GUID
sp
;
const
DWORD
size
=
80
;
/* FIXME: Need to calculate it correctly */
BOOL
is_dp_sp
;
/* TRUE if Direct Play SP, FALSE if Direct Play Lobby SP */
HRESULT
hr
;
if
(
bIsDpSp
)
{
/* Fill in what we can of the Service Provider required information.
* The rest was be done in DP_LoadSP
*/
This
->
dp2
->
spData
.
lpAddress
=
lpConnection
;
This
->
dp2
->
spData
.
dwAddressSize
=
dwAddrSize
;
This
->
dp2
->
spData
.
lpGuid
=
&
guidSP
;
TRACE
(
"(%p)->(%p,0x%08x)
\n
"
,
This
,
connection
,
flags
);
hr
=
DP_InitializeDPSP
(
This
,
hServiceProvider
);
}
else
{
This
->
dp2
->
dplspData
.
lpAddress
=
lpConnection
;
if
(
!
connection
)
return
DPERR_INVALIDPARAMS
;
hr
=
DP_InitializeDPLSP
(
This
,
hServiceProvider
);
}
if
(
flags
)
return
DPERR_INVALIDFLAGS
;
if
(
FAILED
(
hr
)
)
{
return
hr
;
}
if
(
This
->
dp2
->
connectionInitialized
!=
NO_PROVIDER
)
return
DPERR_ALREADYINITIALIZED
;
return
DP_OK
;
}
/* Find out what the requested SP is and how large this buffer is */
hr
=
DPL_EnumAddress
(
DP_GetSpLpGuidFromCompoundAddress
,
connection
,
size
,
&
sp
);
static
HRESULT
WINAPI
IDirectPlay4AImpl_InitializeConnection
(
IDirectPlay4A
*
iface
,
void
*
lpConnection
,
DWORD
dwFlags
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
if
(
FAILED
(
hr
)
)
{
ERR
(
"Invalid compound address?
\n
"
);
return
DPERR_UNAVAILABLE
;
}
/* This may not be externally invoked once either an SP or LP is initialized */
if
(
This
->
dp2
->
connectionInitialized
!=
NO_PROVIDER
)
{
return
DPERR_ALREADYINITIALIZED
;
}
/* Load the service provider */
servprov
=
DP_LoadSP
(
&
sp
,
&
This
->
dp2
->
spData
,
&
is_dp_sp
);
return
DP_IF_InitializeConnection
(
This
,
lpConnection
,
dwFlags
,
TRUE
);
}
if
(
!
servprov
)
{
ERR
(
"Unable to load service provider %s
\n
"
,
debugstr_guid
(
&
sp
)
);
return
DPERR_UNAVAILABLE
;
}
static
HRESULT
WINAPI
DirectPlay3WImpl_InitializeConnection
(
LPDIRECTPLAY3
iface
,
LPVOID
lpConnection
,
DWORD
dwFlags
)
{
IDirectPlay3Impl
*
This
=
(
IDirectPlay3Impl
*
)
iface
;
if
(
is_dp_sp
)
{
/* Fill in what we can of the Service Provider required information.
* The rest was be done in DP_LoadSP
*/
This
->
dp2
->
spData
.
lpAddress
=
connection
;
This
->
dp2
->
spData
.
dwAddressSize
=
size
;
This
->
dp2
->
spData
.
lpGuid
=
&
sp
;
hr
=
DP_InitializeDPSP
(
This
,
servprov
);
}
else
{
This
->
dp2
->
dplspData
.
lpAddress
=
connection
;
hr
=
DP_InitializeDPLSP
(
This
,
servprov
);
}
/* This may not be externally invoked once either an SP or LP is initialized */
if
(
This
->
dp2
->
connectionInitialized
!=
NO_PROVIDER
)
{
return
DPERR_ALREADYINITIALIZED
;
}
if
(
FAILED
(
hr
)
)
return
hr
;
return
DP_IF_InitializeConnection
(
This
,
lpConnection
,
dwFlags
,
FALSE
)
;
return
DP_OK
;
}
static
HRESULT
WINAPI
IDirectPlay4AImpl_SecureOpen
(
IDirectPlay4A
*
iface
,
...
...
@@ -4365,7 +4331,7 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_EnumConnections
,
IDirectPlay4Impl_EnumGroupsInGroup
,
IDirectPlay4Impl_GetGroupConnectionSettings
,
XCAST
(
InitializeConnection
)
DirectPlay3W
Impl_InitializeConnection
,
IDirectPlay4
Impl_InitializeConnection
,
XCAST
(
SecureOpen
)
DirectPlay3WImpl_SecureOpen
,
IDirectPlay4Impl_SendChatMessage
,
IDirectPlay4Impl_SetGroupConnectionSettings
,
...
...
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