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
545cdfa2
Commit
545cdfa2
authored
Jan 10, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use Interlocked* functions in AddRef and Release.
- store the result of the Interlocked functions and use only this.
parent
b3f064cc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
33 deletions
+57
-33
amstream.c
dlls/amstream/amstream.c
+7
-8
factory.c
dlls/comcat/factory.c
+10
-4
information.c
dlls/comcat/information.c
+19
-9
manager.c
dlls/comcat/manager.c
+10
-4
filedlgbrowser.c
dlls/commdlg/filedlgbrowser.c
+7
-5
mediacatenum.c
dlls/devenum/mediacatenum.c
+4
-3
No files found.
dlls/amstream/amstream.c
View file @
545cdfa2
...
...
@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream);
typedef
struct
{
IAMMultiMediaStream
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IAMMultiMediaStreamImpl
;
static
struct
IAMMultiMediaStreamVtbl
AM_Vtbl
;
...
...
@@ -83,22 +83,21 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_AddRef(IAMMultiMediaStream* iface)
{
IAMMultiMediaStreamImpl
*
This
=
(
IAMMultiMediaStreamImpl
*
)
iface
;
FIXME
(
"(%p/%p)
\n
"
,
iface
,
This
);
This
->
ref
++
;
return
S_OK
;
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IAMMultiMediaStreamImpl_Release
(
IAMMultiMediaStream
*
iface
)
{
IAMMultiMediaStreamImpl
*
This
=
(
IAMMultiMediaStreamImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
FIXME
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IMultiMediaStream methods ***/
...
...
dlls/comcat/factory.c
View file @
545cdfa2
...
...
@@ -56,14 +56,17 @@ static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface(
static
ULONG
WINAPI
COMCAT_IClassFactory_AddRef
(
LPCLASSFACTORY
iface
)
{
ClassFactoryImpl
*
This
=
(
ClassFactoryImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
InterlockedIncrement
(
&
This
->
ref
)
==
1
)
{
ref
=
InterlockedIncrement
(
&
This
->
ref
);
if
(
ref
==
1
)
{
InterlockedIncrement
(
&
dll_ref
);
}
return
This
->
ref
;
return
ref
;
}
/**********************************************************************
...
...
@@ -72,14 +75,17 @@ static ULONG WINAPI COMCAT_IClassFactory_AddRef(LPCLASSFACTORY iface)
static
ULONG
WINAPI
COMCAT_IClassFactory_Release
(
LPCLASSFACTORY
iface
)
{
ClassFactoryImpl
*
This
=
(
ClassFactoryImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
InterlockedDecrement
(
&
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
InterlockedDecrement
(
&
dll_ref
);
}
return
This
->
ref
;
return
ref
;
}
/**********************************************************************
...
...
dlls/comcat/information.c
View file @
545cdfa2
...
...
@@ -307,11 +307,12 @@ typedef struct
static
ULONG
WINAPI
COMCAT_IEnumCATEGORYINFO_AddRef
(
LPENUMCATEGORYINFO
iface
)
{
IEnumCATEGORYINFOImpl
*
This
=
(
IEnumCATEGORYINFOImpl
*
)
iface
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
COMCAT_IEnumCATEGORYINFO_QueryInterface
(
...
...
@@ -338,16 +339,19 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_QueryInterface(
static
ULONG
WINAPI
COMCAT_IEnumCATEGORYINFO_Release
(
LPENUMCATEGORYINFO
iface
)
{
IEnumCATEGORYINFOImpl
*
This
=
(
IEnumCATEGORYINFOImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
--
(
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
key
)
RegCloseKey
(
This
->
key
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
COMCAT_IEnumCATEGORYINFO_Next
(
...
...
@@ -613,7 +617,7 @@ static ULONG WINAPI COMCAT_CLSID_IEnumGUID_AddRef(LPENUMGUID iface)
if
(
This
==
NULL
)
return
E_POINTER
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
COMCAT_CLSID_IEnumGUID_QueryInterface
(
...
...
@@ -640,17 +644,20 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_QueryInterface(
static
ULONG
WINAPI
COMCAT_CLSID_IEnumGUID_Release
(
LPENUMGUID
iface
)
{
CLSID_IEnumGUIDImpl
*
This
=
(
CLSID_IEnumGUIDImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
--
(
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
key
)
RegCloseKey
(
This
->
key
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
This
->
categories
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
COMCAT_CLSID_IEnumGUID_Next
(
...
...
@@ -805,7 +812,7 @@ static ULONG WINAPI COMCAT_CATID_IEnumGUID_AddRef(LPENUMGUID iface)
if
(
This
==
NULL
)
return
E_POINTER
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
COMCAT_CATID_IEnumGUID_QueryInterface
(
...
...
@@ -832,16 +839,19 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_QueryInterface(
static
ULONG
WINAPI
COMCAT_CATID_IEnumGUID_Release
(
LPENUMGUID
iface
)
{
CATID_IEnumGUIDImpl
*
This
=
(
CATID_IEnumGUIDImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
--
(
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
key
)
RegCloseKey
(
This
->
key
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
COMCAT_CATID_IEnumGUID_Next
(
...
...
dlls/comcat/manager.c
View file @
545cdfa2
...
...
@@ -66,14 +66,17 @@ static HRESULT WINAPI COMCAT_IUnknown_QueryInterface(
static
ULONG
WINAPI
COMCAT_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
ComCatMgrImpl
,
unkVtbl
,
iface
);
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
InterlockedIncrement
(
&
This
->
ref
)
==
1
)
{
ref
=
InterlockedIncrement
(
&
This
->
ref
);
if
(
ref
==
1
)
{
InterlockedIncrement
(
&
dll_ref
);
}
return
This
->
ref
;
return
ref
;
}
/**********************************************************************
...
...
@@ -82,14 +85,17 @@ static ULONG WINAPI COMCAT_IUnknown_AddRef(LPUNKNOWN iface)
static
ULONG
WINAPI
COMCAT_IUnknown_Release
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
ComCatMgrImpl
,
unkVtbl
,
iface
);
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
This
==
NULL
)
return
E_POINTER
;
if
(
InterlockedDecrement
(
&
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
InterlockedDecrement
(
&
dll_ref
);
}
return
This
->
ref
;
return
ref
;
}
/**********************************************************************
...
...
dlls/commdlg/filedlgbrowser.c
View file @
545cdfa2
...
...
@@ -216,10 +216,11 @@ HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
ULONG
WINAPI
IShellBrowserImpl_AddRef
(
IShellBrowser
*
iface
)
{
IShellBrowserImpl
*
This
=
(
IShellBrowserImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p,%lu)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p,%lu)
\n
"
,
This
,
ref
-
1
);
return
++
(
This
->
ref
)
;
return
ref
;
}
/**************************************************************************
...
...
@@ -228,16 +229,17 @@ ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
ULONG
WINAPI
IShellBrowserImpl_Release
(
IShellBrowser
*
iface
)
{
IShellBrowserImpl
*
This
=
(
IShellBrowserImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p,%lu)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p,%lu)
\n
"
,
This
,
ref
+
1
);
if
(
!
--
(
This
->
ref
)
)
if
(
!
ref
)
{
COMDLG32_SHFree
(
This
);
TRACE
(
"-- destroyed
\n
"
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/*
...
...
dlls/devenum/mediacatenum.c
View file @
545cdfa2
...
...
@@ -84,16 +84,17 @@ static ULONG WINAPI DEVENUM_IPropertyBag_AddRef(LPPROPERTYBAG iface)
static
ULONG
WINAPI
DEVENUM_IPropertyBag_Release
(
LPPROPERTYBAG
iface
)
{
RegPropBagImpl
*
This
=
(
RegPropBagImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"
\n
"
);
if
(
InterlockedDecrement
(
&
This
->
ref
)
==
0
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
RegCloseKey
(
This
->
hkey
);
CoTaskMemFree
(
This
);
DEVENUM_UnlockModule
();
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
DEVENUM_IPropertyBag_Read
(
...
...
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