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
dfe8563d
Commit
dfe8563d
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_DeletePlayerFromGroup helper.
parent
878a6a5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
74 deletions
+45
-74
dplay.c
dlls/dplayx/dplay.c
+45
-74
No files found.
dlls/dplayx/dplay.c
View file @
dfe8563d
...
...
@@ -78,9 +78,6 @@ static BOOL CALLBACK cbRemoveGroupOrPlayer( DPID dpId, DWORD dwPlayerType,
static
void
DP_DeleteGroup
(
IDirectPlay2Impl
*
This
,
DPID
dpid
);
/* Helper methods for player/group interfaces */
static
HRESULT
DP_IF_DeletePlayerFromGroup
(
IDirectPlay2Impl
*
This
,
LPVOID
lpMsgHdr
,
DPID
idGroup
,
DPID
idPlayer
,
BOOL
bAnsi
);
static
HRESULT
DP_IF_CreatePlayer
(
IDirectPlay2Impl
*
This
,
LPVOID
lpMsgHdr
,
LPDPID
lpidPlayer
,
LPDPNAME
lpPlayerName
,
HANDLE
hEvent
,
LPVOID
lpData
,
...
...
@@ -1448,76 +1445,60 @@ static DPID DP_GetRemoteNextObjectId(void)
return
DP_NextObjectId
();
}
static
HRESULT
DP_IF_DeletePlayerFromGroup
(
IDirectPlay2Impl
*
This
,
LPVOID
lpMsgHdr
,
DPID
idGroup
,
DPID
idPlayer
,
BOOL
bAnsi
)
static
HRESULT
WINAPI
IDirectPlay4AImpl_DeletePlayerFromGroup
(
IDirectPlay4A
*
iface
,
DPID
group
,
DPID
player
)
{
HRESULT
hr
=
DP_OK
;
lpGroupData
lpGData
;
lpPlayerList
lpPList
;
TRACE
(
"(%p)->(%p,0x%08x,0x%08x,%u)
\n
"
,
This
,
lpMsgHdr
,
idGroup
,
idPlayer
,
bAnsi
);
/* Find the group */
if
(
(
lpGData
=
DP_FindAnyGroup
(
This
,
idGroup
)
)
==
NULL
)
{
return
DPERR_INVALIDGROUP
;
}
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
return
IDirectPlayX_DeletePlayerFromGroup
(
&
This
->
IDirectPlay4_iface
,
group
,
player
);
}
/* Find the player */
if
(
(
lpPList
=
DP_FindPlayer
(
This
,
idPlayer
)
)
==
NULL
)
{
return
DPERR_INVALIDPLAYER
;
}
static
HRESULT
WINAPI
IDirectPlay4Impl_DeletePlayerFromGroup
(
IDirectPlay4
*
iface
,
DPID
group
,
DPID
player
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4
(
iface
)
;
HRESULT
hr
=
DP_OK
;
/* Remove the player shortcut from the group */
DPQ_REMOVE_ENTRY
(
lpGData
->
players
,
players
,
lpPData
->
dpid
,
==
,
idPlayer
,
lpPList
)
;
lpGroupData
gdata
;
lpPlayerList
plist
;
if
(
lpPList
==
NULL
)
{
return
DPERR_INVALIDPLAYER
;
}
TRACE
(
"(%p)->(0x%08x,0x%08x)
\n
"
,
This
,
group
,
player
);
/* One less reference */
lpPList
->
lpPData
->
uRef
--
;
/* Find the group */
if
(
(
gdata
=
DP_FindAnyGroup
(
This
,
group
)
)
==
NULL
)
return
DPERR_INVALIDGROUP
;
/* Delete the Player List element */
HeapFree
(
GetProcessHeap
(),
0
,
lpPList
);
/* Find the player */
if
(
(
plist
=
DP_FindPlayer
(
This
,
player
)
)
==
NULL
)
return
DPERR_INVALIDPLAYER
;
/* Inform the SP if they care */
if
(
This
->
dp2
->
spData
.
lpCB
->
RemovePlayerFromGroup
)
{
DPSP_REMOVEPLAYERFROMGROUPDATA
data
;
/* Remove the player shortcut from the group */
DPQ_REMOVE_ENTRY
(
gdata
->
players
,
players
,
lpPData
->
dpid
,
==
,
player
,
plist
);
TRACE
(
"Calling SP RemovePlayerFromGroup
\n
"
);
if
(
!
plist
)
return
DPERR_INVALIDPLAYER
;
data
.
idPlayer
=
idPlayer
;
data
.
idGroup
=
idGroup
;
data
.
lpISP
=
This
->
dp2
->
spData
.
lpISP
;
/* One less reference */
plist
->
lpPData
->
uRef
--
;
hr
=
(
*
This
->
dp2
->
spData
.
lpCB
->
RemovePlayerFromGroup
)(
&
data
);
}
/* Delete the Player List element */
HeapFree
(
GetProcessHeap
(),
0
,
plist
);
/* Need to send a DELETEPLAYERFROMGROUP message */
FIXME
(
"Need to send a message
\n
"
);
/* Inform the SP if they care */
if
(
This
->
dp2
->
spData
.
lpCB
->
RemovePlayerFromGroup
)
{
DPSP_REMOVEPLAYERFROMGROUPDATA
data
;
return
hr
;
}
TRACE
(
"Calling SP RemovePlayerFromGroup
\n
"
);
data
.
idPlayer
=
player
;
data
.
idGroup
=
group
;
data
.
lpISP
=
This
->
dp2
->
spData
.
lpISP
;
hr
=
(
*
This
->
dp2
->
spData
.
lpCB
->
RemovePlayerFromGroup
)(
&
data
);
}
static
HRESULT
WINAPI
IDirectPlay4AImpl_DeletePlayerFromGroup
(
IDirectPlay4A
*
iface
,
DPID
idGroup
,
DPID
idPlayer
)
{
IDirectPlayImpl
*
This
=
impl_from_IDirectPlay4A
(
iface
);
return
DP_IF_DeletePlayerFromGroup
(
This
,
NULL
,
idGroup
,
idPlayer
,
TRUE
);
}
/* Need to send a DELETEPLAYERFROMGROUP message */
FIXME
(
"Need to send a message
\n
"
);
static
HRESULT
WINAPI
DirectPlay2WImpl_DeletePlayerFromGroup
(
LPDIRECTPLAY2
iface
,
DPID
idGroup
,
DPID
idPlayer
)
{
IDirectPlay2Impl
*
This
=
(
IDirectPlay2Impl
*
)
iface
;
return
DP_IF_DeletePlayerFromGroup
(
This
,
NULL
,
idGroup
,
idPlayer
,
FALSE
);
return
hr
;
}
typedef
struct
_DPRGOPContext
...
...
@@ -1551,18 +1532,9 @@ cbRemoveGroupOrPlayer(
dpId
,
lpCtxt
->
idGroup
);
}
}
else
{
if
(
FAILED
(
DP_IF_DeletePlayerFromGroup
(
(
IDirectPlay2Impl
*
)
lpCtxt
->
This
,
NULL
,
lpCtxt
->
idGroup
,
dpId
,
lpCtxt
->
bAnsi
)
)
)
{
ERR
(
"Unable to delete player 0x%08x from grp 0x%08x
\n
"
,
dpId
,
lpCtxt
->
idGroup
);
}
}
else
if
(
FAILED
(
IDirectPlayX_DeletePlayerFromGroup
(
&
lpCtxt
->
This
->
IDirectPlay4_iface
,
lpCtxt
->
idGroup
,
dpId
)
)
)
ERR
(
"Unable to delete player 0x%08x from grp 0x%08x
\n
"
,
dpId
,
lpCtxt
->
idGroup
);
return
TRUE
;
/* Continue enumeration */
}
...
...
@@ -1708,8 +1680,7 @@ cbDeletePlayerFromAllGroups(
if
(
dwPlayerType
==
DPPLAYERTYPE_GROUP
)
{
DP_IF_DeletePlayerFromGroup
(
lpCtxt
->
This
,
NULL
,
dpId
,
lpCtxt
->
idPlayer
,
lpCtxt
->
bAnsi
);
IDirectPlayX_DeletePlayerFromGroup
(
&
lpCtxt
->
This
->
IDirectPlay4_iface
,
dpId
,
lpCtxt
->
idPlayer
);
/* Enumerate all groups in this group since this will normally only
* be called for top level groups
...
...
@@ -4588,7 +4559,7 @@ static const IDirectPlay4Vtbl dp4_vt =
IDirectPlay4Impl_Close
,
XCAST
(
CreateGroup
)
DirectPlay2WImpl_CreateGroup
,
XCAST
(
CreatePlayer
)
DirectPlay2WImpl_CreatePlayer
,
XCAST
(
DeletePlayerFromGroup
)
DirectPlay2W
Impl_DeletePlayerFromGroup
,
IDirectPlay4
Impl_DeletePlayerFromGroup
,
XCAST
(
DestroyGroup
)
DirectPlay2WImpl_DestroyGroup
,
XCAST
(
DestroyPlayer
)
DirectPlay2WImpl_DestroyPlayer
,
XCAST
(
EnumGroupPlayers
)
DirectPlay2WImpl_EnumGroupPlayers
,
...
...
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