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
0dd3f041
Commit
0dd3f041
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_GetPlayerData helper.
parent
a784e239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
57 deletions
+36
-57
dplay.c
dlls/dplayx/dplay.c
+36
-57
No files found.
dlls/dplayx/dplay.c
View file @
0dd3f041
...
...
@@ -89,9 +89,6 @@ static HRESULT DP_IF_DestroyPlayer
static
HRESULT
DP_IF_GetGroupName
(
IDirectPlay2Impl
*
This
,
DPID
idGroup
,
LPVOID
lpData
,
LPDWORD
lpdwDataSize
,
BOOL
bAnsi
);
static
HRESULT
DP_IF_GetPlayerData
(
IDirectPlay2Impl
*
This
,
DPID
idPlayer
,
LPVOID
lpData
,
LPDWORD
lpdwDataSize
,
DWORD
dwFlags
,
BOOL
bAnsi
);
static
HRESULT
DP_IF_GetPlayerName
(
IDirectPlay2Impl
*
This
,
DPID
idPlayer
,
LPVOID
lpData
,
LPDWORD
lpdwDataSize
,
BOOL
bAnsi
);
...
...
@@ -2249,68 +2246,50 @@ static HRESULT WINAPI IDirectPlay4Impl_GetPlayerCaps( IDirectPlay4 *iface, DPID
return
(
*
This
->
dp2
->
spData
.
lpCB
->
GetCaps
)(
&
data
);
}
static
HRESULT
DP_IF_GetPlayerData
(
IDirectPlay2Impl
*
This
,
DPID
idPlayer
,
LPVOID
lpData
,
LPDWORD
lpdwDataSize
,
DWORD
dwFlags
,
BOOL
bAnsi
)
static
HRESULT
WINAPI
IDirectPlay4AImpl_GetPlayerData
(
IDirectPlay4A
*
iface
,
DPID
player
,
void
*
data
,
DWORD
*
size
,
DWORD
flags
)
{
lpPlayerList
lpPList
;
DWORD
dwRequiredBufferSize
;
LPVOID
lpCopyDataFrom
;
TRACE
(
"(%p)->(0x%08x,%p,%p,0x%08x,%u)
\n
"
,
This
,
idPlayer
,
lpData
,
lpdwDataSize
,
dwFlags
,
bAnsi
);
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
return
IDirectPlayX_GetPlayerData
(
&
This
->
IDirectPlay4_iface
,
player
,
data
,
size
,
flags
);
}
if
(
This
->
dp2
->
connectionInitialized
==
NO_PROVIDER
)
{
return
DPERR_UNINITIALIZED
;
}
static
HRESULT
WINAPI
IDirectPlay4Impl_GetPlayerData
(
IDirectPlay4
*
iface
,
DPID
player
,
void
*
data
,
DWORD
*
size
,
DWORD
flags
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4
(
iface
);
lpPlayerList
plist
;
DWORD
bufsize
;
void
*
src
;
if
(
(
lpPList
=
DP_FindPlayer
(
This
,
idPlayer
)
)
==
NULL
)
{
return
DPERR_INVALIDPLAYER
;
}
TRACE
(
"(%p)->(0x%08x,%p,%p,0x%08x)
\n
"
,
This
,
player
,
data
,
size
,
flags
);
/* How much buffer is required? */
if
(
dwFlags
&
DPSET_LOCAL
)
{
dwRequiredBufferSize
=
lpPList
->
lpPData
->
dwLocalDataSize
;
lpCopyDataFrom
=
lpPList
->
lpPData
->
lpLocalData
;
}
else
{
dwRequiredBufferSize
=
lpPList
->
lpPData
->
dwRemoteDataSize
;
lpCopyDataFrom
=
lpPList
->
lpPData
->
lpRemoteData
;
}
if
(
This
->
dp2
->
connectionInitialized
==
NO_PROVIDER
)
return
DPERR_UNINITIALIZED
;
/* Is the user requesting to know how big a buffer is required? */
if
(
(
lpData
==
NULL
)
||
(
*
lpdwDataSize
<
dwRequiredBufferSize
)
)
{
*
lpdwDataSize
=
dwRequiredBufferSize
;
return
DPERR_BUFFERTOOSMALL
;
}
if
(
(
plist
=
DP_FindPlayer
(
This
,
player
)
)
==
NULL
)
return
DPERR_INVALIDPLAYER
;
CopyMemory
(
lpData
,
lpCopyDataFrom
,
dwRequiredBufferSize
);
if
(
flags
&
DPSET_LOCAL
)
{
bufsize
=
plist
->
lpPData
->
dwLocalDataSize
;
src
=
plist
->
lpPData
->
lpLocalData
;
}
else
{
bufsize
=
plist
->
lpPData
->
dwRemoteDataSize
;
src
=
plist
->
lpPData
->
lpRemoteData
;
}
return
DP_OK
;
}
/* Is the user requesting to know how big a buffer is required? */
if
(
!
data
||
*
size
<
bufsize
)
{
*
size
=
bufsize
;
return
DPERR_BUFFERTOOSMALL
;
}
static
HRESULT
WINAPI
IDirectPlay4AImpl_GetPlayerData
(
IDirectPlay4A
*
iface
,
DPID
idPlayer
,
void
*
lpData
,
DWORD
*
lpdwDataSize
,
DWORD
dwFlags
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
return
DP_IF_GetPlayerData
(
This
,
idPlayer
,
lpData
,
lpdwDataSize
,
dwFlags
,
TRUE
);
}
CopyMemory
(
data
,
src
,
bufsize
);
static
HRESULT
WINAPI
DirectPlay2WImpl_GetPlayerData
(
LPDIRECTPLAY2
iface
,
DPID
idPlayer
,
LPVOID
lpData
,
LPDWORD
lpdwDataSize
,
DWORD
dwFlags
)
{
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
return
DP_IF_GetPlayerData
(
This
,
idPlayer
,
lpData
,
lpdwDataSize
,
dwFlags
,
FALSE
);
return
DP_OK
;
}
static
HRESULT
DP_IF_GetPlayerName
...
...
@@ -4489,7 +4468,7 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_GetMessageCount
,
IDirectPlay4Impl_GetPlayerAddress
,
IDirectPlay4Impl_GetPlayerCaps
,
XCAST
(
GetPlayerData
)
DirectPlay2W
Impl_GetPlayerData
,
IDirectPlay4
Impl_GetPlayerData
,
XCAST
(
GetPlayerName
)
DirectPlay2WImpl_GetPlayerName
,
XCAST
(
GetSessionDesc
)
DirectPlay2WImpl_GetSessionDesc
,
IDirectPlay4Impl_Initialize
,
...
...
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