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
b11dddf7
Commit
b11dddf7
authored
Sep 03, 2013
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dplayx: Simplify ref-counting for IDPLobbySP.
parent
5da060be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
49 deletions
+16
-49
lobbysp.c
dlls/dplayx/lobbysp.c
+16
-49
No files found.
dlls/dplayx/lobbysp.c
View file @
b11dddf7
...
@@ -38,7 +38,6 @@ typedef struct IDPLobbySPImpl IDPLobbySPImpl;
...
@@ -38,7 +38,6 @@ typedef struct IDPLobbySPImpl IDPLobbySPImpl;
typedef
struct
tagDPLobbySPIUnknownData
typedef
struct
tagDPLobbySPIUnknownData
{
{
LONG
ulObjRef
;
CRITICAL_SECTION
DPLSP_lock
;
CRITICAL_SECTION
DPLSP_lock
;
}
DPLobbySPIUnknownData
;
}
DPLobbySPIUnknownData
;
...
@@ -48,13 +47,13 @@ typedef struct tagDPLobbySPData
...
@@ -48,13 +47,13 @@ typedef struct tagDPLobbySPData
}
DPLobbySPData
;
}
DPLobbySPData
;
#define DPLSP_IMPL_FIELDS \
#define DPLSP_IMPL_FIELDS \
LONG ulInterfaceRef; \
DPLobbySPIUnknownData* unk; \
DPLobbySPIUnknownData* unk; \
DPLobbySPData* sp;
DPLobbySPData* sp;
struct
IDPLobbySPImpl
struct
IDPLobbySPImpl
{
{
const
IDPLobbySPVtbl
*
lpVtbl
;
const
IDPLobbySPVtbl
*
lpVtbl
;
LONG
ref
;
DPLSP_IMPL_FIELDS
DPLSP_IMPL_FIELDS
};
};
...
@@ -165,79 +164,47 @@ static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP )
...
@@ -165,79 +164,47 @@ static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP )
}
}
static
HRESULT
WINAPI
IDPLobbySPImpl_QueryInterface
(
IDPLobbySP
*
iface
,
REFIID
riid
,
static
HRESULT
WINAPI
IDPLobbySPImpl_QueryInterface
(
IDPLobbySP
*
iface
,
REFIID
riid
,
void
**
ppv
Obj
)
void
**
ppv
)
{
{
IDPLobbySPImpl
*
This
=
(
IDPLobbySPImpl
*
)
iface
;
TRACE
(
"(%p)->(%s,%p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObj
);
*
ppvObj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IDPLobbySP
,
riid
)
)
sizeof
(
*
This
)
);
if
(
*
ppvObj
==
NULL
)
{
{
return
DPERR_OUTOFMEMORY
;
*
ppv
=
iface
;
IDPLobbySP_AddRef
(
iface
);
return
S_OK
;
}
}
CopyMemory
(
*
ppvObj
,
This
,
sizeof
(
*
This
)
);
FIXME
(
"Unsupported interface %s
\n
"
,
debugstr_guid
(
riid
));
(
*
(
IDPLobbySPImpl
**
)
ppvObj
)
->
ulInterfaceRef
=
0
;
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IDPLobbySP
,
riid
)
)
{
IDPLobbySPImpl
*
This
=
*
ppvObj
;
This
->
lpVtbl
=
&
dpLobbySPVT
;
}
else
{
/* Unsupported interface */
HeapFree
(
GetProcessHeap
(),
0
,
*
ppvObj
);
*
ppvObj
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
IDPLobbySP_AddRef
(
(
LPDPLOBBYSP
)
*
ppvObj
);
return
S_OK
;
}
}
static
ULONG
WINAPI
IDPLobbySPImpl_AddRef
(
IDPLobbySP
*
iface
)
static
ULONG
WINAPI
IDPLobbySPImpl_AddRef
(
IDPLobbySP
*
iface
)
{
{
IDPLobbySPImpl
*
This
=
impl_from_IDPLobbySP
(
iface
);
IDPLobbySPImpl
*
This
=
impl_from_IDPLobbySP
(
iface
);
ULONG
ulInterfaceRefCount
,
ulObjRefCount
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ulObjRefCount
=
InterlockedIncrement
(
&
This
->
unk
->
ulObjRef
);
ulInterfaceRefCount
=
InterlockedIncrement
(
&
This
->
ulInterfaceRef
);
TRACE
(
"ref count incremented to %u:%u for %p
\n
"
,
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
ulInterfaceRefCount
,
ulObjRefCount
,
This
);
return
ulObjRefCount
;
return
ref
;
}
}
static
ULONG
WINAPI
IDPLobbySPImpl_Release
(
IDPLobbySP
*
iface
)
static
ULONG
WINAPI
IDPLobbySPImpl_Release
(
IDPLobbySP
*
iface
)
{
{
IDPLobbySPImpl
*
This
=
impl_from_IDPLobbySP
(
iface
);
IDPLobbySPImpl
*
This
=
impl_from_IDPLobbySP
(
iface
);
ULONG
ulInterfaceRefCount
,
ulObjRefCount
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ulObjRefCount
=
InterlockedDecrement
(
&
This
->
unk
->
ulObjRef
);
ulInterfaceRefCount
=
InterlockedDecrement
(
&
This
->
ulInterfaceRef
);
TRACE
(
"ref count decremented to %u:%u for %p
\n
"
,
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
ulInterfaceRefCount
,
ulObjRefCount
,
This
);
/* Deallocate if this is the last reference to the object */
if
(
!
ref
)
if
(
ulObjRefCount
==
0
)
{
{
DPLSP_DestroyDPLobbySP
(
This
);
DPLSP_DestroyDPLobbySP
(
This
);
DPLSP_DestroyIUnknown
(
This
);
DPLSP_DestroyIUnknown
(
This
);
}
if
(
ulInterfaceRefCount
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
return
ulInterfaceRefCount
;
return
ref
;
}
}
static
HRESULT
WINAPI
IDPLobbySPImpl_AddGroupToGroup
(
IDPLobbySP
*
iface
,
static
HRESULT
WINAPI
IDPLobbySPImpl_AddGroupToGroup
(
IDPLobbySP
*
iface
,
...
...
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