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
76605263
Commit
76605263
authored
Jan 27, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: COM cleanup for the ID3DXBuffer iface.
parent
c84b8dbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
29 deletions
+26
-29
core.c
dlls/d3dx9_36/core.c
+26
-14
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+0
-15
No files found.
dlls/d3dx9_36/core.c
View file @
76605263
...
...
@@ -30,10 +30,23 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
/* ID3DXBuffer IUnknown parts follow: */
static
HRESULT
WINAPI
ID3DXBufferImpl_QueryInterface
(
LPD3DXBUFFER
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
typedef
struct
ID3DXBufferImpl
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBuffer
ID3DXBuffer_iface
;
LONG
ref
;
DWORD
*
buffer
;
DWORD
bufferSize
;
}
ID3DXBufferImpl
;
static
inline
ID3DXBufferImpl
*
impl_from_ID3DXBuffer
(
ID3DXBuffer
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ID3DXBufferImpl
,
ID3DXBuffer_iface
);
}
static
HRESULT
WINAPI
ID3DXBufferImpl_QueryInterface
(
ID3DXBuffer
*
iface
,
REFIID
riid
,
void
**
ppobj
)
{
ID3DXBufferImpl
*
This
=
impl_from_ID3DXBuffer
(
iface
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3DXBuffer
))
...
...
@@ -47,9 +60,9 @@ static HRESULT WINAPI ID3DXBufferImpl_QueryInterface(LPD3DXBUFFER iface, REFIID
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ID3DXBufferImpl_AddRef
(
LPD3DXBUFFER
iface
)
static
ULONG
WINAPI
ID3DXBufferImpl_AddRef
(
ID3DXBuffer
*
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
impl_from_ID3DXBuffer
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) : AddRef from %d
\n
"
,
This
,
ref
-
1
);
...
...
@@ -57,9 +70,9 @@ static ULONG WINAPI ID3DXBufferImpl_AddRef(LPD3DXBUFFER iface)
return
ref
;
}
static
ULONG
WINAPI
ID3DXBufferImpl_Release
(
LPD3DXBUFFER
iface
)
static
ULONG
WINAPI
ID3DXBufferImpl_Release
(
ID3DXBuffer
*
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
impl_from_ID3DXBuffer
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
...
...
@@ -72,16 +85,15 @@ static ULONG WINAPI ID3DXBufferImpl_Release(LPD3DXBUFFER iface)
return
ref
;
}
/* ID3DXBuffer Interface follow: */
static
LPVOID
WINAPI
ID3DXBufferImpl_GetBufferPointer
(
LPD3DXBUFFER
iface
)
static
LPVOID
WINAPI
ID3DXBufferImpl_GetBufferPointer
(
ID3DXBuffer
*
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
impl_from_ID3DXBuffer
(
iface
)
;
return
This
->
buffer
;
}
static
DWORD
WINAPI
ID3DXBufferImpl_GetBufferSize
(
LPD3DXBUFFER
iface
)
static
DWORD
WINAPI
ID3DXBufferImpl_GetBufferSize
(
ID3DXBuffer
*
iface
)
{
ID3DXBufferImpl
*
This
=
(
ID3DXBufferImpl
*
)
iface
;
ID3DXBufferImpl
*
This
=
impl_from_ID3DXBuffer
(
iface
)
;
return
This
->
bufferSize
;
}
...
...
@@ -104,7 +116,7 @@ HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer)
*
ppBuffer
=
NULL
;
return
E_OUTOFMEMORY
;
}
object
->
lpVtbl
=
&
D3DXBuffer_Vtbl
;
object
->
ID3DXBuffer_iface
.
lpVtbl
=
&
D3DXBuffer_Vtbl
;
object
->
ref
=
1
;
object
->
bufferSize
=
NumBytes
;
object
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
NumBytes
);
...
...
@@ -115,6 +127,6 @@ HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer)
return
E_OUTOFMEMORY
;
}
*
ppBuffer
=
(
LPD3DXBUFFER
)
object
;
*
ppBuffer
=
&
object
->
ID3DXBuffer_iface
;
return
D3D_OK
;
}
dlls/d3dx9_36/d3dx9_36_private.h
View file @
76605263
...
...
@@ -50,21 +50,6 @@ HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer,
const
PixelFormatDesc
*
get_format_info
(
D3DFORMAT
format
);
const
PixelFormatDesc
*
get_format_info_idx
(
int
idx
);
extern
const
ID3DXBufferVtbl
D3DXBuffer_Vtbl
;
/* ID3DXBUFFER */
typedef
struct
ID3DXBufferImpl
{
/* IUnknown fields */
const
ID3DXBufferVtbl
*
lpVtbl
;
LONG
ref
;
/* ID3DXBuffer fields */
DWORD
*
buffer
;
DWORD
bufferSize
;
}
ID3DXBufferImpl
;
/* ID3DXFont */
typedef
struct
ID3DXFontImpl
{
...
...
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