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
34cffce6
Commit
34cffce6
authored
Sep 24, 2004
by
Joris Huizer
Committed by
Alexandre Julliard
Sep 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref count increment/decrement cleanup.
parent
0c3f2868
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
163 additions
and
247 deletions
+163
-247
antimoniker.c
dlls/ole32/antimoniker.c
+5
-8
bindctx.c
dlls/ole32/bindctx.c
+5
-7
clipboard.c
dlls/ole32/clipboard.c
+10
-10
compositemoniker.c
dlls/ole32/compositemoniker.c
+11
-14
datacache.c
dlls/ole32/datacache.c
+11
-18
defaulthandler.c
dlls/ole32/defaulthandler.c
+9
-16
filemoniker.c
dlls/ole32/filemoniker.c
+5
-8
hglobalstream.c
dlls/ole32/hglobalstream.c
+2
-8
itemmoniker.c
dlls/ole32/itemmoniker.c
+5
-8
marshal.c
dlls/ole32/marshal.c
+4
-7
memlockbytes.c
dlls/ole32/memlockbytes.c
+5
-11
memlockbytes16.c
dlls/ole32/memlockbytes16.c
+5
-9
moniker.c
dlls/ole32/moniker.c
+5
-6
oleobj.c
dlls/ole32/oleobj.c
+9
-19
oleproxy.c
dlls/ole32/oleproxy.c
+15
-19
rpc.c
dlls/ole32/rpc.c
+5
-5
stg_stream.c
dlls/ole32/stg_stream.c
+5
-10
storage.c
dlls/ole32/storage.c
+19
-17
storage32.c
dlls/ole32/storage32.c
+6
-13
connpt.c
dlls/oleaut32/connpt.c
+12
-21
dispatch.c
dlls/oleaut32/dispatch.c
+5
-5
umon.c
dlls/urlmon/umon.c
+5
-8
No files found.
dlls/ole32/antimoniker.c
View file @
34cffce6
...
...
@@ -186,7 +186,7 @@ ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -195,19 +195,16 @@ ULONG WINAPI AntiMonikerImpl_AddRef(IMoniker* iface)
ULONG
WINAPI
AntiMonikerImpl_Release
(
IMoniker
*
iface
)
{
AntiMonikerImpl
*
This
=
(
AntiMonikerImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
){
if
(
ref
==
0
)
AntiMonikerImpl_Destroy
(
This
);
AntiMonikerImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
dlls/ole32/bindctx.c
View file @
34cffce6
...
...
@@ -142,7 +142,7 @@ ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -151,21 +151,19 @@ ULONG WINAPI BindCtxImpl_AddRef(IBindCtx* iface)
ULONG
WINAPI
BindCtxImpl_Release
(
IBindCtx
*
iface
)
{
BindCtxImpl
*
This
=
(
BindCtxImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
if
(
This
->
ref
==
0
){
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
){
/* release all registered objects */
BindCtxImpl_ReleaseBoundObjects
((
IBindCtx
*
)
This
);
BindCtxImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
...
...
dlls/ole32/clipboard.c
View file @
34cffce6
...
...
@@ -1162,9 +1162,8 @@ static ULONG WINAPI OLEClipbrd_IDataObject_AddRef(
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
This
->
ref
++
;
return
InterlockedIncrement
(
&
This
->
ref
)
;
return
This
->
ref
;
}
/************************************************************************
...
...
@@ -1179,23 +1178,24 @@ static ULONG WINAPI OLEClipbrd_IDataObject_Release(
* Declare "This" pointer
*/
OLEClipbrd
*
This
=
(
OLEClipbrd
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
if
(
ref
==
0
)
{
OLEClipbrd_Destroy
(
This
);
}
return
This
->
ref
;
return
ref
;
}
...
...
@@ -1651,7 +1651,7 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_AddRef(LPENUMFORMATETC iface)
if
(
This
->
pUnkDataObj
)
IUnknown_AddRef
(
This
->
pUnkDataObj
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -1663,13 +1663,15 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface)
{
IEnumFORMATETCImpl
*
This
=
(
IEnumFORMATETCImpl
*
)
iface
;
LPMALLOC
pIMalloc
;
ULONG
ref
;
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
if
(
This
->
pUnkDataObj
)
IUnknown_Release
(
This
->
pUnkDataObj
);
/* Release parent data object */
if
(
!--
(
This
->
ref
))
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
{
TRACE
(
"() - destroying IEnumFORMATETC(%p)
\n
"
,
This
);
if
(
SUCCEEDED
(
CoGetMalloc
(
MEMCTX_TASK
,
&
pIMalloc
)))
...
...
@@ -1679,10 +1681,8 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface)
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
dlls/ole32/compositemoniker.c
View file @
34cffce6
...
...
@@ -243,7 +243,7 @@ ULONG WINAPI CompositeMonikerImpl_AddRef(IMoniker* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -253,23 +253,22 @@ ULONG WINAPI CompositeMonikerImpl_Release(IMoniker* iface)
{
CompositeMonikerImpl
*
This
=
(
CompositeMonikerImpl
*
)
iface
;
ULONG
i
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
){
if
(
ref
==
0
){
/* release all the components before destroying this object */
for
(
i
=
0
;
i
<
This
->
tabLastIndex
;
i
++
)
IMoniker_Release
(
This
->
tabMoniker
[
i
]);
CompositeMonikerImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
@@ -1527,7 +1526,7 @@ ULONG WINAPI EnumMonikerImpl_AddRef(IEnumMoniker* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
...
...
@@ -1537,24 +1536,22 @@ ULONG WINAPI EnumMonikerImpl_AddRef(IEnumMoniker* iface)
ULONG
WINAPI
EnumMonikerImpl_Release
(
IEnumMoniker
*
iface
)
{
EnumMonikerImpl
*
This
=
(
EnumMonikerImpl
*
)
iface
;
ULONG
i
;
ULONG
i
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
)
{
if
(
ref
==
0
)
{
for
(
i
=
0
;
i
<
This
->
tabSize
;
i
++
)
IMoniker_Release
(
This
->
tabMoniker
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tabMoniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
dlls/ole32/datacache.c
View file @
34cffce6
...
...
@@ -134,12 +134,12 @@ typedef struct DataCache DataCache;
* There is a version to accomodate all of the VTables implemented
* by this object.
*/
#define _ICOM_THIS_From_IDataObject(class,name) class* this = (class*)name
;
#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
;
#define _ICOM_THIS_From_IPersistStorage(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
;
#define _ICOM_THIS_From_IViewObject2(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
;
#define _ICOM_THIS_From_IOleCache2(class, name) class* this = (class*)(((char*)name)-4*sizeof(void*))
;
#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*))
;
#define _ICOM_THIS_From_IDataObject(class,name) class* this = (class*)name
#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
#define _ICOM_THIS_From_IPersistStorage(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
#define _ICOM_THIS_From_IViewObject2(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
#define _ICOM_THIS_From_IOleCache2(class, name) class* this = (class*)(((char*)name)-4*sizeof(void*))
#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*))
/*
* Prototypes for the methods of the DataCache class.
...
...
@@ -968,10 +968,7 @@ static ULONG WINAPI DataCache_NDIUnknown_AddRef(
IUnknown
*
iface
)
{
_ICOM_THIS_From_NDIUnknown
(
DataCache
,
iface
);
this
->
ref
++
;
return
this
->
ref
;
return
InterlockedIncrement
(
&
this
->
ref
);
}
/************************************************************************
...
...
@@ -986,23 +983,19 @@ static ULONG WINAPI DataCache_NDIUnknown_Release(
IUnknown
*
iface
)
{
_ICOM_THIS_From_NDIUnknown
(
DataCache
,
iface
);
ULONG
ref
;
/*
* Decrease the reference count on this object.
*/
this
->
ref
--
;
ref
=
InterlockedDecrement
(
&
this
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
this
->
ref
==
0
)
{
DataCache_Destroy
(
this
);
return
0
;
}
if
(
ref
==
0
)
DataCache_Destroy
(
this
);
return
this
->
ref
;
return
ref
;
}
/*********************************************************
...
...
dlls/ole32/defaulthandler.c
View file @
34cffce6
...
...
@@ -126,10 +126,10 @@ typedef struct DefaultHandler DefaultHandler;
* There is a version to accomodate all of the VTables implemented
* by this object.
*/
#define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name
;
#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
;
#define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
;
#define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
;
#define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name
#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
#define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
#define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
/*
* Prototypes for the methods of the DefaultHandler class.
...
...
@@ -656,10 +656,7 @@ static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef(
IUnknown
*
iface
)
{
_ICOM_THIS_From_NDIUnknown
(
DefaultHandler
,
iface
);
this
->
ref
++
;
return
this
->
ref
;
return
InterlockedIncrement
(
&
this
->
ref
);
}
/************************************************************************
...
...
@@ -674,23 +671,19 @@ static ULONG WINAPI DefaultHandler_NDIUnknown_Release(
IUnknown
*
iface
)
{
_ICOM_THIS_From_NDIUnknown
(
DefaultHandler
,
iface
);
ULONG
ref
;
/*
* Decrease the reference count on this object.
*/
this
->
ref
--
;
ref
=
InterlockedDecrement
(
&
this
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
this
->
ref
==
0
)
{
DefaultHandler_Destroy
(
this
);
return
0
;
}
if
(
ref
==
0
)
DefaultHandler_Destroy
(
this
);
return
this
->
ref
;
return
ref
;
}
/*********************************************************
...
...
dlls/ole32/filemoniker.c
View file @
34cffce6
...
...
@@ -194,7 +194,7 @@ ULONG WINAPI FileMonikerImpl_AddRef(IMoniker* iface)
TRACE
(
"(%p)
\n
"
,
iface
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -203,19 +203,16 @@ ULONG WINAPI FileMonikerImpl_AddRef(IMoniker* iface)
ULONG
WINAPI
FileMonikerImpl_Release
(
IMoniker
*
iface
)
{
FileMonikerImpl
*
This
=
(
FileMonikerImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
iface
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
){
if
(
ref
==
0
)
FileMonikerImpl_Destroy
(
This
);
FileMonikerImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
dlls/ole32/hglobalstream.c
View file @
34cffce6
...
...
@@ -378,10 +378,7 @@ ULONG WINAPI HGLOBALStreamImpl_AddRef(
IStream
*
iface
)
{
HGLOBALStreamImpl
*
const
This
=
(
HGLOBALStreamImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/***
...
...
@@ -392,12 +389,9 @@ ULONG WINAPI HGLOBALStreamImpl_Release(
IStream
*
iface
)
{
HGLOBALStreamImpl
*
const
This
=
(
HGLOBALStreamImpl
*
)
iface
;
ULONG
newRef
;
This
->
ref
--
;
newRef
=
This
->
ref
;
newRef
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* If the reference count goes down to 0, perform suicide.
...
...
dlls/ole32/itemmoniker.c
View file @
34cffce6
...
...
@@ -193,7 +193,7 @@ ULONG WINAPI ItemMonikerImpl_AddRef(IMoniker* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -202,19 +202,16 @@ ULONG WINAPI ItemMonikerImpl_AddRef(IMoniker* iface)
ULONG
WINAPI
ItemMonikerImpl_Release
(
IMoniker
*
iface
)
{
ItemMonikerImpl
*
This
=
(
ItemMonikerImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
){
if
(
ref
==
0
)
ItemMonikerImpl_Destroy
(
This
);
ItemMonikerImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
dlls/ole32/marshal.c
View file @
34cffce6
...
...
@@ -217,19 +217,16 @@ StdMarshalImpl_QueryInterface(LPMARSHAL iface,REFIID riid,LPVOID *ppv) {
static
ULONG
WINAPI
StdMarshalImpl_AddRef
(
LPMARSHAL
iface
)
{
StdMarshalImpl
*
This
=
(
StdMarshalImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
StdMarshalImpl_Release
(
LPMARSHAL
iface
)
{
StdMarshalImpl
*
This
=
(
StdMarshalImpl
*
)
iface
;
This
->
ref
--
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
This
->
ref
)
return
This
->
ref
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
static
HRESULT
WINAPI
...
...
dlls/ole32/memlockbytes.c
View file @
34cffce6
...
...
@@ -351,10 +351,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface(
ULONG
WINAPI
HGLOBALLockBytesImpl_AddRef
(
ILockBytes
*
iface
)
{
HGLOBALLockBytesImpl
*
const
This
=
(
HGLOBALLockBytesImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -364,22 +361,19 @@ ULONG WINAPI HGLOBALLockBytesImpl_AddRef(ILockBytes* iface)
ULONG
WINAPI
HGLOBALLockBytesImpl_Release
(
ILockBytes
*
iface
)
{
HGLOBALLockBytesImpl
*
const
This
=
(
HGLOBALLockBytesImpl
*
)
iface
;
ULONG
ref
;
ULONG
newRef
;
This
->
ref
--
;
newRef
=
This
->
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
newR
ef
==
0
)
if
(
r
ef
==
0
)
{
HGLOBALLockBytesImpl_Destroy
(
This
);
}
return
newR
ef
;
return
r
ef
;
}
/******************************************************************************
...
...
dlls/ole32/memlockbytes16.c
View file @
34cffce6
...
...
@@ -280,9 +280,7 @@ ULONG WINAPI HGLOBALLockBytesImpl16_AddRef(ILockBytes16* iface)
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -292,20 +290,18 @@ ULONG WINAPI HGLOBALLockBytesImpl16_AddRef(ILockBytes16* iface)
ULONG
WINAPI
HGLOBALLockBytesImpl16_Release
(
ILockBytes16
*
iface
)
{
HGLOBALLockBytesImpl16
*
const
This
=
(
HGLOBALLockBytesImpl16
*
)
iface
;
ULONG
ref
;
ULONG
newRef
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
newRef
=
This
->
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
newR
ef
==
0
)
if
(
r
ef
==
0
)
HGLOBALLockBytesImpl16_Destroy
(
This
);
return
newR
ef
;
return
r
ef
;
}
/******************************************************************************
...
...
dlls/ole32/moniker.c
View file @
34cffce6
...
...
@@ -145,7 +145,7 @@ ULONG WINAPI RunningObjectTableImpl_AddRef(IRunningObjectTable* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/***********************************************************************
...
...
@@ -174,13 +174,14 @@ ULONG WINAPI RunningObjectTableImpl_Release(IRunningObjectTable* iface)
{
DWORD
i
;
RunningObjectTableImpl
*
This
=
(
RunningObjectTableImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* unitialize ROT structure if there's no more reference to it*/
if
(
This
->
ref
==
0
)
{
if
(
ref
==
0
)
{
/* release all registered objects */
for
(
i
=
0
;
i
<
This
->
runObjTabLastIndx
;
i
++
)
...
...
@@ -197,11 +198,9 @@ ULONG WINAPI RunningObjectTableImpl_Release(IRunningObjectTable* iface)
/* there's no more elements in the table */
This
->
runObjTabRegister
=
0
;
This
->
runObjTabLastIndx
=
0
;
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/***********************************************************************
...
...
dlls/ole32/oleobj.c
View file @
34cffce6
...
...
@@ -189,17 +189,13 @@ static ULONG WINAPI OleAdviseHolderImpl_Release(
LPOLEADVISEHOLDER
iface
)
{
OleAdviseHolderImpl
*
This
=
(
OleAdviseHolderImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
This
->
ref
==
0
)
{
OleAdviseHolderImpl_Destructor
(
This
);
return
0
;
}
if
(
ref
==
0
)
OleAdviseHolderImpl_Destructor
(
This
);
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
@@ -524,9 +520,7 @@ static ULONG WINAPI DataAdviseHolder_AddRef(
{
DataAdviseHolder
*
This
=
(
DataAdviseHolder
*
)
iface
;
TRACE
(
"(%p) (ref=%ld)
\n
"
,
This
,
This
->
ref
);
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -538,24 +532,20 @@ static ULONG WINAPI DataAdviseHolder_Release(
IDataAdviseHolder
*
iface
)
{
DataAdviseHolder
*
This
=
(
DataAdviseHolder
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p) (ref=%ld)
\n
"
,
This
,
This
->
ref
);
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
{
DataAdviseHolder_Destructor
(
This
);
return
0
;
}
if
(
ref
==
0
)
DataAdviseHolder_Destructor
(
This
);
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
dlls/ole32/oleproxy.c
View file @
34cffce6
...
...
@@ -103,20 +103,17 @@ CFStub_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *ppv) {
static
ULONG
WINAPI
CFStub_AddRef
(
LPRPCSTUBBUFFER
iface
)
{
CFStub
*
This
=
(
CFStub
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
CFStub_Release
(
LPRPCSTUBBUFFER
iface
)
{
CFStub
*
This
=
(
CFStub
*
)
iface
;
ULONG
ref
;
This
->
ref
--
;
if
(
This
->
ref
)
return
This
->
ref
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
static
HRESULT
WINAPI
...
...
@@ -286,18 +283,18 @@ static HRESULT WINAPI IRpcProxyBufferImpl_QueryInterface(LPRPCPROXYBUFFER iface,
static
ULONG
WINAPI
IRpcProxyBufferImpl_AddRef
(
LPRPCPROXYBUFFER
iface
)
{
ICOM_THIS_MULTI
(
CFProxy
,
lpvtbl_proxy
,
iface
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IRpcProxyBufferImpl_Release
(
LPRPCPROXYBUFFER
iface
)
{
ICOM_THIS_MULTI
(
CFProxy
,
lpvtbl_proxy
,
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
--
(
This
->
ref
)
)
{
if
(
!
ref
)
{
IRpcChannelBuffer_Release
(
This
->
chanbuf
);
This
->
chanbuf
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
IRpcProxyBufferImpl_Connect
(
LPRPCPROXYBUFFER
iface
,
IRpcChannelBuffer
*
pRpcChannelBuffer
)
{
...
...
@@ -331,17 +328,16 @@ CFProxy_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppv) {
static
ULONG
WINAPI
CFProxy_AddRef
(
LPCLASSFACTORY
iface
)
{
ICOM_THIS_MULTI
(
CFProxy
,
lpvtbl_cf
,
iface
);
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
CFProxy_Release
(
LPCLASSFACTORY
iface
)
{
ULONG
ref
;
ICOM_THIS_MULTI
(
CFProxy
,
lpvtbl_cf
,
iface
);
This
->
ref
--
;
if
(
This
->
ref
)
return
This
->
ref
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
static
HRESULT
WINAPI
CFProxy_CreateInstance
(
...
...
dlls/ole32/rpc.c
View file @
34cffce6
...
...
@@ -286,20 +286,20 @@ PipeBuf_QueryInterface(
static
ULONG
WINAPI
PipeBuf_AddRef
(
LPRPCCHANNELBUFFER
iface
)
{
PipeBuf
*
This
=
(
PipeBuf
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
PipeBuf_Release
(
LPRPCCHANNELBUFFER
iface
)
{
PipeBuf
*
This
=
(
PipeBuf
*
)
iface
;
ULONG
ref
;
wine_rpc_disconnect_header
header
;
HANDLE
pipe
;
DWORD
reqtype
=
REQTYPE_DISCONNECT
;
This
->
ref
--
;
if
(
This
->
ref
)
return
This
->
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
)
return
ref
;
FIXME
(
"Free all stuff
\n
"
);
...
...
dlls/ole32/stg_stream.c
View file @
34cffce6
...
...
@@ -221,10 +221,7 @@ ULONG WINAPI StgStreamImpl_AddRef(
IStream
*
iface
)
{
StgStreamImpl
*
const
This
=
(
StgStreamImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/***
...
...
@@ -236,21 +233,19 @@ ULONG WINAPI StgStreamImpl_Release(
{
StgStreamImpl
*
const
This
=
(
StgStreamImpl
*
)
iface
;
ULONG
newRef
;
This
->
ref
--
;
ULONG
ref
;
newRef
=
This
->
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
newR
ef
==
0
)
if
(
r
ef
==
0
)
{
StgStreamImpl_Destroy
(
This
);
}
return
newR
ef
;
return
r
ef
;
}
/***
...
...
dlls/ole32/storage.c
View file @
34cffce6
...
...
@@ -986,7 +986,7 @@ HRESULT WINAPI IStream16_fnQueryInterface(
*/
ULONG
WINAPI
IStream16_fnAddRef
(
IStream16
*
iface
)
{
IStream16Impl
*
This
=
(
IStream16Impl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -994,15 +994,15 @@ ULONG WINAPI IStream16_fnAddRef(IStream16* iface) {
*/
ULONG
WINAPI
IStream16_fnRelease
(
IStream16
*
iface
)
{
IStream16Impl
*
This
=
(
IStream16Impl
*
)
iface
;
ULONG
ref
;
FlushFileBuffers
(
This
->
hf
);
This
->
ref
--
;
if
(
!
This
->
ref
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
!
ref
)
{
CloseHandle
(
This
->
hf
);
UnMapLS
(
This
->
thisptr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
@@ -1480,7 +1480,7 @@ HRESULT WINAPI IStream_fnQueryInterface(
*/
ULONG
WINAPI
IStream_fnAddRef
(
IStream
*
iface
)
{
IStream32Impl
*
This
=
(
IStream32Impl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -1488,14 +1488,14 @@ ULONG WINAPI IStream_fnAddRef(IStream* iface) {
*/
ULONG
WINAPI
IStream_fnRelease
(
IStream
*
iface
)
{
IStream32Impl
*
This
=
(
IStream32Impl
*
)
iface
;
ULONG
ref
;
FlushFileBuffers
(
This
->
hf
);
This
->
ref
--
;
if
(
!
This
->
ref
)
{
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
!
ref
)
{
CloseHandle
(
This
->
hf
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/* --- IStorage16 implementation */
...
...
@@ -1534,7 +1534,7 @@ HRESULT WINAPI IStorage16_fnQueryInterface(
*/
ULONG
WINAPI
IStorage16_fnAddRef
(
IStorage16
*
iface
)
{
IStorage16Impl
*
This
=
(
IStorage16Impl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -1542,12 +1542,14 @@ ULONG WINAPI IStorage16_fnAddRef(IStorage16* iface) {
*/
ULONG
WINAPI
IStorage16_fnRelease
(
IStorage16
*
iface
)
{
IStorage16Impl
*
This
=
(
IStorage16Impl
*
)
iface
;
This
->
ref
--
;
if
(
This
->
ref
)
return
This
->
ref
;
UnMapLS
(
This
->
thisptr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
{
UnMapLS
(
This
->
thisptr
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
/******************************************************************************
...
...
dlls/ole32/storage32.c
View file @
34cffce6
...
...
@@ -291,9 +291,7 @@ ULONG WINAPI StorageBaseImpl_AddRef(
IStorage
*
iface
)
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -311,12 +309,12 @@ ULONG WINAPI StorageBaseImpl_Release(
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
if
(
ref
==
0
)
{
/*
* Since we are using a system of base-classes, we want to call the
...
...
@@ -324,11 +322,9 @@ ULONG WINAPI StorageBaseImpl_Release(
* using virtual functions to implement the destructor.
*/
This
->
v_destructor
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
@@ -3637,9 +3633,7 @@ ULONG WINAPI IEnumSTATSTGImpl_AddRef(
IEnumSTATSTG
*
iface
)
{
IEnumSTATSTGImpl
*
const
This
=
(
IEnumSTATSTGImpl
*
)
iface
;
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
ULONG
WINAPI
IEnumSTATSTGImpl_Release
(
...
...
@@ -3649,8 +3643,7 @@ ULONG WINAPI IEnumSTATSTGImpl_Release(
ULONG
newRef
;
This
->
ref
--
;
newRef
=
This
->
ref
;
newRef
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* If the reference count goes down to 0, perform suicide.
...
...
dlls/oleaut32/connpt.c
View file @
34cffce6
...
...
@@ -194,9 +194,7 @@ static ULONG WINAPI ConnectionPointImpl_AddRef(IConnectionPoint* iface)
{
ConnectionPointImpl
*
This
=
(
ConnectionPointImpl
*
)
iface
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -208,24 +206,20 @@ static ULONG WINAPI ConnectionPointImpl_Release(
IConnectionPoint
*
iface
)
{
ConnectionPointImpl
*
This
=
(
ConnectionPointImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
{
ConnectionPointImpl_Destroy
(
This
);
return
0
;
}
if
(
ref
==
0
)
ConnectionPointImpl_Destroy
(
This
);
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
@@ -473,10 +467,11 @@ static HRESULT WINAPI EnumConnectionsImpl_QueryInterface(
static
ULONG
WINAPI
EnumConnectionsImpl_AddRef
(
IEnumConnections
*
iface
)
{
EnumConnectionsImpl
*
This
=
(
EnumConnectionsImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
This
->
ref
++
;
ref
=
InterlockedIncrement
(
&
This
->
ref
)
;
IUnknown_AddRef
(
This
->
pUnk
);
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
@@ -487,6 +482,7 @@ static ULONG WINAPI EnumConnectionsImpl_AddRef(IEnumConnections* iface)
static
ULONG
WINAPI
EnumConnectionsImpl_Release
(
IEnumConnections
*
iface
)
{
EnumConnectionsImpl
*
This
=
(
EnumConnectionsImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
IUnknown_Release
(
This
->
pUnk
);
...
...
@@ -494,19 +490,14 @@ static ULONG WINAPI EnumConnectionsImpl_Release(IEnumConnections* iface)
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
{
EnumConnectionsImpl_Destroy
(
This
);
return
0
;
}
if
(
ref
==
0
)
EnumConnectionsImpl_Destroy
(
This
);
return
This
->
ref
;
return
ref
;
}
/************************************************************************
...
...
dlls/oleaut32/dispatch.c
View file @
34cffce6
...
...
@@ -278,7 +278,7 @@ static ULONG WINAPI StdDispatch_AddRef(LPDISPATCH iface)
StdDispatch
*
This
=
(
StdDispatch
*
)
iface
;
TRACE
(
"()
\n
"
);
return
++
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
)
;
}
/******************************************************************************
...
...
@@ -289,18 +289,18 @@ static ULONG WINAPI StdDispatch_AddRef(LPDISPATCH iface)
static
ULONG
WINAPI
StdDispatch_Release
(
LPDISPATCH
iface
)
{
StdDispatch
*
This
=
(
StdDispatch
*
)
iface
;
ULONG
re
t
;
ULONG
re
f
;
TRACE
(
"(%p)->()
\n
"
,
This
);
re
t
=
This
->
ref
--
;
re
f
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
This
->
ref
==
0
)
if
(
ref
==
0
)
{
ITypeInfo_Release
(
This
->
pTypeInfo
);
CoTaskMemFree
(
This
);
}
return
re
t
;
return
re
f
;
}
/******************************************************************************
...
...
dlls/urlmon/umon.c
View file @
34cffce6
...
...
@@ -197,7 +197,7 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
TRACE
(
"(%p)
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
/******************************************************************************
...
...
@@ -206,19 +206,16 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
static
ULONG
WINAPI
URLMonikerImpl_Release
(
IMoniker
*
iface
)
{
URLMonikerImpl
*
This
=
(
URLMonikerImpl
*
)
iface
;
ULONG
ref
;
TRACE
(
"(%p)
\n
"
,
This
);
This
->
ref
--
;
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
/* destroy the object if there's no more reference on it */
if
(
This
->
ref
==
0
){
if
(
ref
==
0
)
URLMonikerImpl_Destroy
(
This
);
URLMonikerImpl_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/******************************************************************************
...
...
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