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
72175acd
Commit
72175acd
authored
Jul 12, 2016
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Use atomic operations to manipulate the refcount.
Signed-off-by:
Michael Stefaniuc
<
mstefani@redhat.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
919a3389
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
factory.c
dlls/avifil32/factory.c
+15
-17
No files found.
dlls/avifil32/factory.c
View file @
72175acd
...
@@ -57,11 +57,9 @@ static const IClassFactoryVtbl iclassfact = {
...
@@ -57,11 +57,9 @@ static const IClassFactoryVtbl iclassfact = {
typedef
struct
typedef
struct
{
{
/* IUnknown fields */
IClassFactory
IClassFactory_iface
;
IClassFactory
IClassFactory_iface
;
DWORD
dwRef
;
LONG
ref
;
CLSID
clsid
;
CLSID
clsid
;
}
IClassFactoryImpl
;
}
IClassFactoryImpl
;
static
inline
IClassFactoryImpl
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
static
inline
IClassFactoryImpl
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
...
@@ -82,7 +80,7 @@ static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid,
...
@@ -82,7 +80,7 @@ static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid,
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
pClassFactory
->
IClassFactory_iface
.
lpVtbl
=
&
iclassfact
;
pClassFactory
->
IClassFactory_iface
.
lpVtbl
=
&
iclassfact
;
pClassFactory
->
dwRef
=
0
;
pClassFactory
->
ref
=
0
;
pClassFactory
->
clsid
=
*
pclsid
;
pClassFactory
->
clsid
=
*
pclsid
;
hr
=
IClassFactory_QueryInterface
(
&
pClassFactory
->
IClassFactory_iface
,
riid
,
ppv
);
hr
=
IClassFactory_QueryInterface
(
&
pClassFactory
->
IClassFactory_iface
,
riid
,
ppv
);
...
@@ -109,26 +107,26 @@ static HRESULT WINAPI IClassFactory_fnQueryInterface(LPCLASSFACTORY iface,
...
@@ -109,26 +107,26 @@ static HRESULT WINAPI IClassFactory_fnQueryInterface(LPCLASSFACTORY iface,
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
IClassFactory_fnAddRef
(
LPCLASSFACTORY
iface
)
static
ULONG
WINAPI
IClassFactory_fnAddRef
(
IClassFactory
*
iface
)
{
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
iface
);
TRACE
(
"(%p) ref = %u
\n
"
,
This
,
ref
);
return
ref
;
return
++
(
This
->
dwRef
);
}
}
static
ULONG
WINAPI
IClassFactory_fnRelease
(
LPCLASSFACTORY
iface
)
static
ULONG
WINAPI
IClassFactory_fnRelease
(
IClassFactory
*
iface
)
{
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
iface
);
TRACE
(
"(%p) ref = %u
\n
"
,
This
,
ref
);
if
((
--
(
This
->
dwRef
))
>
0
)
return
This
->
dwRef
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
ref
;
}
}
static
HRESULT
WINAPI
IClassFactory_fnCreateInstance
(
LPCLASSFACTORY
iface
,
static
HRESULT
WINAPI
IClassFactory_fnCreateInstance
(
LPCLASSFACTORY
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