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
7f07b006
Commit
7f07b006
authored
Jan 20, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 20, 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
e1ff586d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
49 deletions
+56
-49
d3dxof.c
dlls/d3dxof/d3dxof.c
+49
-42
d3dxof_private.h
dlls/d3dxof/d3dxof_private.h
+7
-7
No files found.
dlls/d3dxof/d3dxof.c
View file @
7f07b006
...
...
@@ -80,23 +80,24 @@ static HRESULT WINAPI IDirectXFileImpl_QueryInterface(IDirectXFile* iface, REFII
static
ULONG
WINAPI
IDirectXFileImpl_AddRef
(
IDirectXFile
*
iface
)
{
IDirectXFileImpl
*
This
=
(
IDirectXFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileImpl_Release
(
IDirectXFile
*
iface
)
{
IDirectXFileImpl
*
This
=
(
IDirectXFileImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFile methods ***/
...
...
@@ -190,23 +191,24 @@ static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary*
static
ULONG
WINAPI
IDirectXFileBinaryImpl_AddRef
(
IDirectXFileBinary
*
iface
)
{
IDirectXFileBinaryImpl
*
This
=
(
IDirectXFileBinaryImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileBinaryImpl_Release
(
IDirectXFileBinary
*
iface
)
{
IDirectXFileBinaryImpl
*
This
=
(
IDirectXFileBinaryImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFileObject methods ***/
...
...
@@ -308,23 +310,24 @@ static HRESULT WINAPI IDirectXFileDataImpl_QueryInterface(IDirectXFileData* ifac
static
ULONG
WINAPI
IDirectXFileDataImpl_AddRef
(
IDirectXFileData
*
iface
)
{
IDirectXFileDataImpl
*
This
=
(
IDirectXFileDataImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileDataImpl_Release
(
IDirectXFileData
*
iface
)
{
IDirectXFileDataImpl
*
This
=
(
IDirectXFileDataImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFileObject methods ***/
...
...
@@ -456,23 +459,24 @@ static HRESULT WINAPI IDirectXFileDataReferenceImpl_QueryInterface(IDirectXFileD
static
ULONG
WINAPI
IDirectXFileDataReferenceImpl_AddRef
(
IDirectXFileDataReference
*
iface
)
{
IDirectXFileDataReferenceImpl
*
This
=
(
IDirectXFileDataReferenceImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileDataReferenceImpl_Release
(
IDirectXFileDataReference
*
iface
)
{
IDirectXFileDataReferenceImpl
*
This
=
(
IDirectXFileDataReferenceImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFileObject methods ***/
...
...
@@ -552,23 +556,24 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_QueryInterface(IDirectXFileEnum
static
ULONG
WINAPI
IDirectXFileEnumObjectImpl_AddRef
(
IDirectXFileEnumObject
*
iface
)
{
IDirectXFileEnumObjectImpl
*
This
=
(
IDirectXFileEnumObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileEnumObjectImpl_Release
(
IDirectXFileEnumObject
*
iface
)
{
IDirectXFileEnumObjectImpl
*
This
=
(
IDirectXFileEnumObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFileEnumObject methods ***/
...
...
@@ -655,23 +660,24 @@ static HRESULT WINAPI IDirectXFileObjectImpl_QueryInterface(IDirectXFileObject*
static
ULONG
WINAPI
IDirectXFileObjectImpl_AddRef
(
IDirectXFileObject
*
iface
)
{
IDirectXFileObjectImpl
*
This
=
(
IDirectXFileObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileObjectImpl_Release
(
IDirectXFileObject
*
iface
)
{
IDirectXFileObjectImpl
*
This
=
(
IDirectXFileObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
/*** IDirectXFileObject methods ***/
...
...
@@ -740,23 +746,24 @@ static HRESULT WINAPI IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSave
static
ULONG
WINAPI
IDirectXFileSaveObjectImpl_AddRef
(
IDirectXFileSaveObject
*
iface
)
{
IDirectXFileSaveObjectImpl
*
This
=
(
IDirectXFileSaveObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: AddRef from %ld
\n
"
,
iface
,
This
,
ref
-
1
);
This
->
ref
++
;
return
S_OK
;
return
ref
;
}
static
ULONG
WINAPI
IDirectXFileSaveObjectImpl_Release
(
IDirectXFileSaveObject
*
iface
)
{
IDirectXFileSaveObjectImpl
*
This
=
(
IDirectXFileSaveObjectImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
TRACE
(
"(%p/%p)
: ReleaseRef to %ld
\n
"
,
iface
,
This
,
ref
);
if
(
!
--
This
->
ref
)
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
S_OK
;
return
ref
;
}
static
HRESULT
WINAPI
IDirectXFileSaveObjectImpl_SaveTemplates
(
IDirectXFileSaveObject
*
iface
,
DWORD
cTemplates
,
const
GUID
**
ppguidTemplates
)
...
...
dlls/d3dxof/d3dxof_private.h
View file @
7f07b006
...
...
@@ -35,37 +35,37 @@
typedef
struct
{
IDirectXFile
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileImpl
;
typedef
struct
{
IDirectXFileBinary
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileBinaryImpl
;
typedef
struct
{
IDirectXFileData
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileDataImpl
;
typedef
struct
{
IDirectXFileDataReference
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileDataReferenceImpl
;
typedef
struct
{
IDirectXFileObject
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileObjectImpl
;
typedef
struct
{
IDirectXFileEnumObject
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileEnumObjectImpl
;
typedef
struct
{
IDirectXFileSaveObject
lpVtbl
;
int
ref
;
ULONG
ref
;
}
IDirectXFileSaveObjectImpl
;
HRESULT
IDirectXFileImpl_Create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
);
...
...
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