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
202b340a
Commit
202b340a
authored
Jan 09, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 09, 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
617dc088
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
171 additions
and
111 deletions
+171
-111
main.c
dlls/ddraw/d3ddevice/main.c
+11
-5
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+5
-3
d3dexecutebuffer.c
dlls/ddraw/d3dexecutebuffer.c
+11
-5
d3dlight.c
dlls/ddraw/d3dlight.c
+16
-8
d3dmaterial.c
dlls/ddraw/d3dmaterial.c
+11
-5
d3dvertexbuffer.c
dlls/ddraw/d3dvertexbuffer.c
+11
-5
d3dviewport.c
dlls/ddraw/d3dviewport.c
+11
-5
main.c
dlls/ddraw/dclipper/main.c
+11
-6
main.c
dlls/ddraw/ddraw/main.c
+6
-5
main.c
dlls/ddraw/dpalette/main.c
+10
-5
main.c
dlls/ddraw/dsurface/main.c
+12
-10
main.c
dlls/ddraw/main.c
+3
-2
errorinfo.c
dlls/ole32/errorinfo.c
+8
-6
ifs.c
dlls/ole32/ifs.c
+7
-5
oleobj.c
dlls/ole32/oleobj.c
+5
-2
safearray.c
dlls/oleaut32/tests/safearray.c
+2
-2
typelib.c
dlls/oleaut32/typelib.c
+17
-18
typelib2.c
dlls/oleaut32/typelib2.c
+14
-14
No files found.
dlls/ddraw/d3ddevice/main.c
View file @
202b340a
...
...
@@ -260,16 +260,22 @@ ULONG WINAPI
Main_IDirect3DDeviceImpl_7_3T_2T_1T_AddRef
(
LPDIRECT3DDEVICE7
iface
)
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DDeviceImpl_7_3T_2T_1T_Release
(
LPDIRECT3DDEVICE7
iface
)
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
int
i
;
/* Release texture associated with the device */
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
i
++
)
{
...
...
@@ -280,7 +286,7 @@ Main_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/d3ddevice/mesa.c
View file @
202b340a
...
...
@@ -381,9 +381,11 @@ GL_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
IDirect3DDeviceGLImpl
*
glThis
=
(
IDirect3DDeviceGLImpl
*
)
This
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
int
i
;
IDirectDrawSurfaceImpl
*
surface
=
This
->
surface
,
*
surf
;
...
...
@@ -442,7 +444,7 @@ GL_IDirect3DDeviceImpl_7_3T_2T_1T_Release(LPDIRECT3DDEVICE7 iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/d3dexecutebuffer.c
View file @
202b340a
...
...
@@ -519,16 +519,22 @@ ULONG WINAPI
Main_IDirect3DExecuteBufferImpl_1_AddRef
(
LPDIRECT3DEXECUTEBUFFER
iface
)
{
ICOM_THIS_FROM
(
IDirect3DExecuteBufferImpl
,
IDirect3DExecuteBuffer
,
iface
);
FIXME
(
"(%p/%p)->()incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
FIXME
(
"(%p/%p)->()incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DExecuteBufferImpl_1_Release
(
LPDIRECT3DEXECUTEBUFFER
iface
)
{
ICOM_THIS_FROM
(
IDirect3DExecuteBufferImpl
,
IDirect3DExecuteBuffer
,
iface
);
TRACE
(
"(%p/%p)->()decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->()decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
if
((
This
->
desc
.
lpData
!=
NULL
)
&&
This
->
need_free
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
desc
.
lpData
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
vertex_data
);
...
...
@@ -537,7 +543,7 @@ Main_IDirect3DExecuteBufferImpl_1_Release(LPDIRECT3DEXECUTEBUFFER iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/d3dlight.c
View file @
202b340a
...
...
@@ -53,20 +53,26 @@ ULONG WINAPI
Main_IDirect3DLightImpl_1_AddRef
(
LPDIRECT3DLIGHT
iface
)
{
ICOM_THIS_FROM
(
IDirect3DLightImpl
,
IDirect3DLight
,
iface
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DLightImpl_1_Release
(
LPDIRECT3DLIGHT
iface
)
{
ICOM_THIS_FROM
(
IDirect3DLightImpl
,
IDirect3DLight
,
iface
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
@@ -191,14 +197,16 @@ GL_IDirect3DLightImpl_1_Release(LPDIRECT3DLIGHT iface)
{
ICOM_THIS_FROM
(
IDirect3DLightImpl
,
IDirect3DLight
,
iface
);
IDirect3DLightGLImpl
*
glThis
=
(
IDirect3DLightGLImpl
*
)
This
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
((
IDirect3DGLImpl
*
)
This
->
d3d
->
d3d_private
)
->
light_released
(
This
->
d3d
,
glThis
->
light_num
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
...
...
dlls/ddraw/d3dmaterial.c
View file @
202b340a
...
...
@@ -85,20 +85,26 @@ ULONG WINAPI
Main_IDirect3DMaterialImpl_3_2T_1T_AddRef
(
LPDIRECT3DMATERIAL3
iface
)
{
ICOM_THIS_FROM
(
IDirect3DMaterialImpl
,
IDirect3DMaterial3
,
iface
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DMaterialImpl_3_2T_1T_Release
(
LPDIRECT3DMATERIAL3
iface
)
{
ICOM_THIS_FROM
(
IDirect3DMaterialImpl
,
IDirect3DMaterial3
,
iface
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/d3dvertexbuffer.c
View file @
202b340a
...
...
@@ -73,21 +73,27 @@ ULONG WINAPI
Main_IDirect3DVertexBufferImpl_7_1T_AddRef
(
LPDIRECT3DVERTEXBUFFER7
iface
)
{
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer7
,
iface
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DVertexBufferImpl_7_1T_Release
(
LPDIRECT3DVERTEXBUFFER7
iface
)
{
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer7
,
iface
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
--
(
This
->
ref
)
==
0
)
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
vertices
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/d3dviewport.c
View file @
202b340a
...
...
@@ -126,20 +126,26 @@ ULONG WINAPI
Main_IDirect3DViewportImpl_3_2_1_AddRef
(
LPDIRECT3DVIEWPORT3
iface
)
{
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() incrementing from %lu.
\n
"
,
This
,
iface
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_IDirect3DViewportImpl_3_2_1_Release
(
LPDIRECT3DVIEWPORT3
iface
)
{
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
This
->
ref
);
if
(
!--
(
This
->
ref
))
{
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)->() decrementing from %lu.
\n
"
,
This
,
iface
,
ref
+
1
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
...
...
dlls/ddraw/dclipper/main.c
View file @
202b340a
...
...
@@ -114,14 +114,16 @@ void Main_DirectDrawClipper_ForceDestroy(IDirectDrawClipperImpl* This)
ULONG
WINAPI
Main_DirectDrawClipper_Release
(
LPDIRECTDRAWCLIPPER
iface
)
{
IDirectDrawClipperImpl
*
This
=
(
IDirectDrawClipperImpl
*
)
iface
;
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
--
This
->
ref
==
0
)
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
ref
+
1
);
if
(
ref
==
0
)
{
Main_DirectDrawClipper_Destroy
(
This
);
return
0
;
}
else
return
This
->
ref
;
else
return
ref
;
}
/***********************************************************************
...
...
@@ -211,7 +213,7 @@ HRESULT WINAPI Main_DirectDrawClipper_QueryInterface(
||
IsEqualGUID
(
&
IID_IDirectDrawClipper
,
riid
))
{
*
ppvObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawClipper
);
++
This
->
ref
;
InterlockedIncrement
(
&
This
->
ref
)
;
return
S_OK
;
}
else
...
...
@@ -223,8 +225,11 @@ HRESULT WINAPI Main_DirectDrawClipper_QueryInterface(
ULONG
WINAPI
Main_DirectDrawClipper_AddRef
(
LPDIRECTDRAWCLIPPER
iface
)
{
IDirectDrawClipperImpl
*
This
=
(
IDirectDrawClipperImpl
*
)
iface
;
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
This
->
ref
);
return
++
This
->
ref
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
HRESULT
WINAPI
Main_DirectDrawClipper_GetHWnd
(
...
...
dlls/ddraw/ddraw/main.c
View file @
202b340a
...
...
@@ -149,17 +149,18 @@ void Main_DirectDraw_final_release(IDirectDrawImpl* This)
ULONG
WINAPI
Main_DirectDraw_AddRef
(
LPDIRECTDRAW7
iface
)
{
IDirectDrawImpl
*
This
=
(
IDirectDrawImpl
*
)
iface
;
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
return
++
This
->
ref
;
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
ULONG
WINAPI
Main_DirectDraw_Release
(
LPDIRECTDRAW7
iface
)
{
ULONG
ref
;
IDirectDrawImpl
*
This
=
(
IDirectDrawImpl
*
)
iface
;
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ref
=
--
This
->
ref
;
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
ref
+
1
)
;
if
(
ref
==
0
)
{
...
...
dlls/ddraw/dpalette/main.c
View file @
202b340a
...
...
@@ -208,21 +208,26 @@ ULONG WINAPI
Main_DirectDrawPalette_Release
(
LPDIRECTDRAWPALETTE
iface
)
{
IDirectDrawPaletteImpl
*
This
=
(
IDirectDrawPaletteImpl
*
)
iface
;
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!--
This
->
ref
)
TRACE
(
"(%p)->() decrementing from %lu.
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
Main_DirectDrawPalette_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
ULONG
WINAPI
Main_DirectDrawPalette_AddRef
(
LPDIRECTDRAWPALETTE
iface
)
{
IDirectDrawPaletteImpl
*
This
=
(
IDirectDrawPaletteImpl
*
)
iface
;
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
This
->
ref
);
return
++
This
->
ref
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->() incrementing from %lu.
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
HRESULT
WINAPI
...
...
dlls/ddraw/dsurface/main.c
View file @
202b340a
...
...
@@ -125,10 +125,11 @@ void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl* This)
ULONG
WINAPI
Main_DirectDrawSurface_Release
(
LPDIRECTDRAWSURFACE7
iface
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): decreasing from %ld
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(): decreasing from %ld
\n
"
,
This
,
ref
+
1
);
if
(
--
This
->
ref
==
0
)
if
(
ref
==
0
)
{
if
(
This
->
aux_release
)
This
->
aux_release
(
This
->
aux_ctx
,
This
->
aux_data
);
...
...
@@ -139,16 +140,17 @@ ULONG WINAPI Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
ULONG
WINAPI
Main_DirectDrawSurface_AddRef
(
LPDIRECTDRAWSURFACE7
iface
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): increasing from %ld
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(): increasing from %ld
\n
"
,
This
,
ref
-
1
);
return
++
This
->
ref
;
return
ref
;
}
HRESULT
WINAPI
...
...
@@ -164,7 +166,7 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
||
IsEqualGUID
(
&
IID_IDirectDrawSurface7
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectDrawSurface4
,
riid
))
{
This
->
ref
++
;
InterlockedIncrement
(
&
This
->
ref
)
;
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface7
);
return
S_OK
;
}
...
...
@@ -172,13 +174,13 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
||
IsEqualGUID
(
&
IID_IDirectDrawSurface2
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectDrawSurface3
,
riid
))
{
This
->
ref
++
;
InterlockedIncrement
(
&
This
->
ref
)
;
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawSurface3
);
return
S_OK
;
}
else
if
(
IsEqualGUID
(
&
IID_IDirectDrawGammaControl
,
riid
))
{
This
->
ref
++
;
InterlockedIncrement
(
&
This
->
ref
)
;
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirectDrawGammaControl
);
return
S_OK
;
}
...
...
@@ -199,7 +201,7 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
*
ppObj
=
ICOM_INTERFACE
(
d3ddevimpl
,
IDirect3DDevice
);
TRACE
(
" returning Direct3DDevice interface at %p.
\n
"
,
*
ppObj
);
This
->
ref
++
;
/* No idea if this is correct.. Need to check using real Windows */
InterlockedIncrement
(
&
This
->
ref
)
;
/* No idea if this is correct.. Need to check using real Windows */
return
ret_value
;
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DTexture
,
riid
)
||
...
...
@@ -230,7 +232,7 @@ Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
*
ppObj
=
ICOM_INTERFACE
(
This
,
IDirect3DTexture2
);
TRACE
(
" returning Direct3DTexture2 interface at %p.
\n
"
,
*
ppObj
);
}
This
->
ref
++
;
InterlockedIncrement
(
&
This
->
ref
)
;
return
ret_value
;
}
#endif
...
...
dlls/ddraw/main.c
View file @
202b340a
...
...
@@ -496,10 +496,11 @@ DDCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
static
ULONG
WINAPI
DDCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->() incrementing from %ld.
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->() incrementing from %ld.
\n
"
,
This
,
ref
-
1
);
return
InterlockedIncrement
(
&
This
->
ref
)
;
return
ref
;
}
static
ULONG
WINAPI
DDCF_Release
(
LPCLASSFACTORY
iface
)
...
...
dlls/ole32/errorinfo.c
View file @
202b340a
...
...
@@ -149,13 +149,13 @@ static ISupportErrorInfoVtbl ISupportErrorInfoImpl_VTable;
converts a objectpointer to This
*/
#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei)))
#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset)
;
#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset)
#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei)))
#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset)
;
#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset)
#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei)))
#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset)
;
#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset)
/*
converts This to a objectpointer
...
...
@@ -227,15 +227,17 @@ static ULONG WINAPI IErrorInfoImpl_Release(
IErrorInfo
*
iface
)
{
_ICOM_THIS_From_IErrorInfo
(
ErrorInfoImpl
,
iface
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
ref
+
1
);
if
(
!
InterlockedDecrement
(
&
This
->
ref
)
)
if
(
!
ref
)
{
TRACE
(
"-- destroying IErrorInfo(%p)
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
IErrorInfoImpl_GetGUID
(
...
...
dlls/ole32/ifs.c
View file @
202b340a
...
...
@@ -394,10 +394,11 @@ static ULONG WINAPI IMallocSpy_fnAddRef (LPMALLOCSPY iface)
{
_MallocSpy
*
This
=
(
_MallocSpy
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
ref
-
1
);
return
++
(
This
->
ref
)
;
return
ref
;
}
/******************************************************************************
...
...
@@ -410,13 +411,14 @@ static ULONG WINAPI IMallocSpy_fnRelease (LPMALLOCSPY iface)
{
_MallocSpy
*
This
=
(
_MallocSpy
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(count=%lu)
\n
"
,
This
,
ref
+
1
);
if
(
!
--
(
This
->
ref
)
)
{
if
(
!
ref
)
{
/* our allocation list MUST be empty here */
}
return
This
->
ref
;
return
ref
;
}
static
ULONG
WINAPI
IMallocSpy_fnPreAlloc
(
LPMALLOCSPY
iface
,
ULONG
cbRequest
)
...
...
dlls/ole32/oleobj.c
View file @
202b340a
...
...
@@ -181,8 +181,11 @@ static ULONG WINAPI OleAdviseHolderImpl_AddRef(
LPOLEADVISEHOLDER
iface
)
{
OleAdviseHolderImpl
*
This
=
(
OleAdviseHolderImpl
*
)
iface
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
return
++
(
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
/******************************************************************************
...
...
dlls/oleaut32/tests/safearray.c
View file @
202b340a
...
...
@@ -96,13 +96,13 @@ static IRecordInfoImpl *IRecordInfoImpl_Construct()
static
ULONG
CALLBACK
IRecordInfoImpl_AddRef
(
IRecordInfo
*
iface
)
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
return
++
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
)
;
}
static
ULONG
CALLBACK
IRecordInfoImpl_Release
(
IRecordInfo
*
iface
)
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
return
--
This
->
ref
;
return
InterlockedDecrement
(
&
This
->
ref
)
;
}
static
BOOL
fail_GetSize
;
/* Whether to fail the GetSize call */
...
...
dlls/oleaut32/typelib.c
View file @
202b340a
...
...
@@ -847,7 +847,7 @@ typedef struct tagITypeLibImpl
{
ITypeLib2Vtbl
*
lpVtbl
;
ITypeCompVtbl
*
lpVtblTypeComp
;
U
INT
ref
;
U
LONG
ref
;
TLIBATTR
LibAttr
;
/* guid,lcid,syskind,version,flags */
/* strings can be stored in tlb as multibyte strings BUT they are *always*
...
...
@@ -958,7 +958,7 @@ typedef struct tagITypeInfoImpl
{
ITypeInfo2Vtbl
*
lpVtbl
;
ITypeCompVtbl
*
lpVtblTypeComp
;
U
INT
ref
;
U
LONG
ref
;
TYPEATTR
TypeAttr
;
/* _lots_ of type information. */
ITypeLibImpl
*
pTypeLib
;
/* back pointer to typelib */
int
index
;
/* index in this typelib; */
...
...
@@ -1276,7 +1276,7 @@ static void dump_DispParms(DISPPARAMS * pdp)
static
void
dump_TypeInfo
(
ITypeInfoImpl
*
pty
)
{
TRACE
(
"%p ref=%u
\n
"
,
pty
,
pty
->
ref
);
TRACE
(
"%p ref=%
l
u
\n
"
,
pty
,
pty
->
ref
);
TRACE
(
"attr:%s
\n
"
,
debugstr_guid
(
&
(
pty
->
TypeAttr
.
guid
)));
TRACE
(
"kind:%s
\n
"
,
typekind_desc
[
pty
->
TypeAttr
.
typekind
]);
TRACE
(
"fct:%u var:%u impl:%u
\n
"
,
...
...
@@ -3434,10 +3434,11 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface(
static
ULONG
WINAPI
ITypeLib2_fnAddRef
(
ITypeLib2
*
iface
)
{
ITypeLibImpl
*
This
=
(
ITypeLibImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->ref was %
u
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->ref was %
lu
\n
"
,
This
,
ref
-
1
);
return
++
(
This
->
ref
)
;
return
ref
;
}
/* ITypeLib::Release
...
...
@@ -3445,12 +3446,11 @@ static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface)
static
ULONG
WINAPI
ITypeLib2_fnRelease
(
ITypeLib2
*
iface
)
{
ITypeLibImpl
*
This
=
(
ITypeLibImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
--
(
This
->
ref
);
TRACE
(
"(%p)->(%lu)
\n
"
,
This
,
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
This
->
ref
);
if
(
!
This
->
ref
)
if
(
!
ref
)
{
/* remove cache entry */
TRACE
(
"removing from cache list
\n
"
);
...
...
@@ -3493,7 +3493,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/* ITypeLib::GetTypeInfoCount
...
...
@@ -4110,12 +4110,12 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface(
static
ULONG
WINAPI
ITypeInfo_fnAddRef
(
ITypeInfo2
*
iface
)
{
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
++
(
This
->
ref
);
ITypeLib2_AddRef
((
ITypeLib2
*
)
This
->
pTypeLib
);
TRACE
(
"(%p)->ref is %
u
\n
"
,
This
,
This
->
ref
);
return
This
->
ref
;
TRACE
(
"(%p)->ref is %
lu
\n
"
,
This
,
ref
);
return
ref
;
}
/* ITypeInfo::Release
...
...
@@ -4123,12 +4123,11 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
static
ULONG
WINAPI
ITypeInfo_fnRelease
(
ITypeInfo2
*
iface
)
{
ITypeInfoImpl
*
This
=
(
ITypeInfoImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
--
(
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(%lu)
\n
"
,
This
,
ref
);
if
(
This
->
ref
)
{
if
(
ref
)
{
/* We don't release ITypeLib when ref=0 becouse
it means that funtion is called by ITypeLi2_Release */
ITypeLib2_Release
((
ITypeLib2
*
)
This
->
pTypeLib
);
...
...
@@ -4156,7 +4155,7 @@ static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
This
->
ref
;
return
ref
;
}
/* ITypeInfo::GetTypeAttr
...
...
dlls/oleaut32/typelib2.c
View file @
202b340a
...
...
@@ -1142,10 +1142,11 @@ static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface(
static
ULONG
WINAPI
ICreateTypeInfo2_fnAddRef
(
ICreateTypeInfo2
*
iface
)
{
ICreateTypeInfo2Impl
*
This
=
(
ICreateTypeInfo2Impl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->ref was %
u
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->ref was %
lu
\n
"
,
This
,
ref
-
1
);
return
++
(
This
->
ref
)
;
return
ref
;
}
/******************************************************************************
...
...
@@ -1156,12 +1157,11 @@ static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface)
static
ULONG
WINAPI
ICreateTypeInfo2_fnRelease
(
ICreateTypeInfo2
*
iface
)
{
ICreateTypeInfo2Impl
*
This
=
(
ICreateTypeInfo2Impl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
--
(
This
->
ref
);
TRACE
(
"(%p)->(%lu)
\n
"
,
This
,
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
This
->
ref
);
if
(
!
This
->
ref
)
{
if
(
!
ref
)
{
if
(
This
->
typelib
)
{
ICreateTypeLib2_fnRelease
((
ICreateTypeLib2
*
)
This
->
typelib
);
This
->
typelib
=
NULL
;
...
...
@@ -1172,7 +1172,7 @@ static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface)
return
0
;
}
return
This
->
ref
;
return
ref
;
}
...
...
@@ -3009,10 +3009,11 @@ static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(
static
ULONG
WINAPI
ICreateTypeLib2_fnAddRef
(
ICreateTypeLib2
*
iface
)
{
ICreateTypeLib2Impl
*
This
=
(
ICreateTypeLib2Impl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->ref was %
u
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->ref was %
lu
\n
"
,
This
,
ref
-
1
);
return
++
(
This
->
ref
)
;
return
ref
;
}
/******************************************************************************
...
...
@@ -3023,12 +3024,11 @@ static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface)
static
ULONG
WINAPI
ICreateTypeLib2_fnRelease
(
ICreateTypeLib2
*
iface
)
{
ICreateTypeLib2Impl
*
This
=
(
ICreateTypeLib2Impl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
--
(
This
->
ref
);
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
This
->
ref
);
TRACE
(
"(%p)->(%lu)
\n
"
,
This
,
ref
);
if
(
!
This
->
ref
)
{
if
(
!
ref
)
{
int
i
;
for
(
i
=
0
;
i
<
MSFT_SEG_MAX
;
i
++
)
{
...
...
@@ -3050,7 +3050,7 @@ static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface)
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