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
b78f7290
Commit
b78f7290
authored
Mar 29, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Apr 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Add both ifaces to the DirectPlay object and stop cloning the object.
parent
3fa95f33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
54 deletions
+24
-54
dplay.c
dlls/dplayx/dplay.c
+22
-52
dplay_global.h
dlls/dplayx/dplay_global.h
+2
-2
No files found.
dlls/dplayx/dplay.c
View file @
b78f7290
...
...
@@ -219,12 +219,12 @@ static LONG kludgePlayerGroupId = 1000;
static
inline
IDirectPlayImpl
*
impl_from_IDirectPlay4A
(
IDirectPlay4A
*
iface
)
{
return
(
IDirectPlayImpl
*
)
iface
;
/* What are you gonna do? */
return
CONTAINING_RECORD
(
iface
,
IDirectPlayImpl
,
IDirectPlay4A_iface
);
}
static
inline
IDirectPlayImpl
*
impl_from_IDirectPlay4
(
IDirectPlay4
*
iface
)
{
return
(
IDirectPlayImpl
*
)
iface
;
/* What are you gonna do? */
return
CONTAINING_RECORD
(
iface
,
IDirectPlayImpl
,
IDirectPlay4_iface
);
}
static
BOOL
DP_CreateIUnknown
(
LPVOID
lpDP
)
...
...
@@ -399,12 +399,15 @@ HRESULT DP_CreateInterface
if
(
!
This
)
return
DPERR_OUTOFMEMORY
;
This
->
IDirectPlay4_iface
.
lpVtbl
=
&
directPlay4WVT
;
This
->
IDirectPlay4A_iface
.
lpVtbl
=
&
directPlay4AVT
;
if
(
IsEqualGUID
(
&
IID_IDirectPlay2
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay3
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay4
,
riid
)
)
This
->
lpVtbl
=
&
directPlay4WVT
;
*
ppvObj
=
&
This
->
IDirectPlay4_iface
;
else
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay2A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay3A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay4A
,
riid
)
)
This
->
lpVtbl
=
&
directPlay4AVT
;
*
ppvObj
=
&
This
->
IDirectPlay4A_iface
;
else
{
/* Unsupported interface */
...
...
@@ -415,8 +418,7 @@ HRESULT DP_CreateInterface
}
/* Initialize it */
*
ppvObj
=
This
;
if
(
DP_CreateIUnknown
(
*
ppvObj
)
&&
DP_CreateDirectPlay2
(
*
ppvObj
)
)
if
(
DP_CreateIUnknown
(
This
)
&&
DP_CreateDirectPlay2
(
This
)
)
{
IDirectPlayX_AddRef
(
(
LPDIRECTPLAY2A
)
*
ppvObj
);
...
...
@@ -424,10 +426,10 @@ HRESULT DP_CreateInterface
}
/* Initialize failed, destroy it */
DP_DestroyDirectPlay2
(
*
ppvObj
);
DP_DestroyIUnknown
(
*
ppvObj
);
DP_DestroyDirectPlay2
(
This
);
DP_DestroyIUnknown
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
*
ppvObj
=
NULL
;
return
DPERR_NOMEMORY
;
...
...
@@ -441,35 +443,16 @@ static HRESULT WINAPI DP_QueryInterface( IDirectPlayImpl *This, REFIID riid, voi
{
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObj
);
*
ppvObj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
This
)
);
if
(
*
ppvObj
==
NULL
)
{
return
DPERR_OUTOFMEMORY
;
}
CopyMemory
(
*
ppvObj
,
This
,
sizeof
(
*
This
)
);
(
*
(
IDirectPlay2Impl
**
)
ppvObj
)
->
ulInterfaceRef
=
0
;
if
(
IsEqualGUID
(
&
IID_IDirectPlay2
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay3
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay4
,
riid
)
)
{
IDirectPlay4Impl
*
This
=
*
ppvObj
;
This
->
lpVtbl
=
&
directPlay4WVT
;
}
*
ppvObj
=
&
This
->
IDirectPlay4_iface
;
else
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay2A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay3A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectPlay4A
,
riid
)
)
{
IDirectPlay4AImpl
*
This
=
*
ppvObj
;
This
->
lpVtbl
=
&
directPlay4AVT
;
}
*
ppvObj
=
&
This
->
IDirectPlay4A_iface
;
else
{
/* Unsupported interface */
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
*
ppvObj
=
NULL
;
return
E_NOINTERFACE
;
}
...
...
@@ -481,43 +464,30 @@ static HRESULT WINAPI DP_QueryInterface( IDirectPlayImpl *This, REFIID riid, voi
/* Shared between all dplay types */
static
ULONG
WINAPI
DP_AddRef
(
IDirectPlayImpl
*
This
)
{
ULONG
ulInterfaceRefCount
,
ulObjRefCount
;
ULONG
ulInterfaceRefCount
=
InterlockedIncrement
(
&
This
->
ulInterfaceRef
)
;
ulObjRefCount
=
InterlockedIncrement
(
&
This
->
unk
->
ulObjRef
);
ulInterfaceRefCount
=
InterlockedIncrement
(
&
This
->
ulInterfaceRef
);
TRACE
(
"ref count incremented to %u for %p
\n
"
,
ulInterfaceRefCount
,
This
);
TRACE
(
"ref count incremented to %u:%u for %p
\n
"
,
ulInterfaceRefCount
,
ulObjRefCount
,
This
);
return
ulObjRefCount
;
return
ulInterfaceRefCount
;
}
static
ULONG
WINAPI
DP_Release
(
IDirectPlayImpl
*
This
)
{
ULONG
ulInterfaceRefCount
,
ulObjRefCount
;
ulObjRefCount
=
InterlockedDecrement
(
&
This
->
unk
->
ulObjRef
);
ulInterfaceRefCount
=
InterlockedDecrement
(
&
This
->
ulInterfaceRef
);
ULONG
ulInterfaceRefCount
=
InterlockedDecrement
(
&
This
->
ulInterfaceRef
);
TRACE
(
"ref count decremented to %u:%u for %p
\n
"
,
ulInterfaceRefCount
,
ulObjRefCount
,
This
);
TRACE
(
"ref count decremented to %u for %p
\n
"
,
ulInterfaceRefCount
,
This
);
/* Deallocate if this is the last reference to the object */
if
(
ul
Obj
RefCount
==
0
)
if
(
ul
Interface
RefCount
==
0
)
{
/* If we're destroying the object, this must be the last ref
of the last interface */
DP_DestroyDirectPlay2
(
This
);
DP_DestroyIUnknown
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
/* Deallocate the interface */
if
(
ulInterfaceRefCount
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ulObjRefCount
;
return
ulInterfaceRefCount
;
}
static
inline
DPID
DP_NextObjectId
(
void
)
...
...
@@ -1766,7 +1736,7 @@ static HRESULT DP_IF_DestroyPlayer
/* Find each group and call DeletePlayerFromGroup if the player is a
member of the group */
IDirectPlayX_EnumGroups
(
(
IDirectPlay4
*
)
This
,
NULL
,
cbDeletePlayerFromAllGroups
,
&
cbContext
,
IDirectPlayX_EnumGroups
(
&
This
->
IDirectPlay4_iface
,
NULL
,
cbDeletePlayerFromAllGroups
,
&
cbContext
,
DPENUMGROUPS_ALL
);
/* Now delete player and player list from the sys group */
...
...
dlls/dplayx/dplay_global.h
View file @
b78f7290
...
...
@@ -33,7 +33,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback,
typedef
struct
tagDirectPlayIUnknownData
{
LONG
ulObjRef
;
CRITICAL_SECTION
DP_lock
;
}
DirectPlayIUnknownData
;
...
...
@@ -188,7 +187,8 @@ typedef struct tagDirectPlay2Data
typedef
struct
IDirectPlayImpl
{
const
void
*
lpVtbl
;
IDirectPlay4A
IDirectPlay4A_iface
;
IDirectPlay4
IDirectPlay4_iface
;
LONG
ulInterfaceRef
;
DirectPlayIUnknownData
*
unk
;
DirectPlay2Data
*
dp2
;
...
...
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