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
71c2c2da
Commit
71c2c2da
authored
Feb 10, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Use the global memory allocation helpers.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
405e25d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
+17
-13
ddraw.c
dlls/ddrawex/ddraw.c
+7
-5
ddrawex_private.h
dlls/ddrawex/ddrawex_private.h
+2
-0
main.c
dlls/ddrawex/main.c
+6
-6
surface.c
dlls/ddrawex/surface.c
+2
-2
No files found.
dlls/ddrawex/ddraw.c
View file @
71c2c2da
...
@@ -166,7 +166,7 @@ static ULONG WINAPI ddrawex4_Release(IDirectDraw4 *iface)
...
@@ -166,7 +166,7 @@ static ULONG WINAPI ddrawex4_Release(IDirectDraw4 *iface)
if
(
!
refcount
)
if
(
!
refcount
)
{
{
IDirectDraw4_Release
(
ddrawex
->
parent
);
IDirectDraw4_Release
(
ddrawex
->
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
ddrawex
);
heap_free
(
ddrawex
);
}
}
return
refcount
;
return
refcount
;
...
@@ -1426,7 +1426,7 @@ HRESULT WINAPI ddrawex_factory_CreateDirectDraw(IDirectDrawFactory *iface, GUID
...
@@ -1426,7 +1426,7 @@ HRESULT WINAPI ddrawex_factory_CreateDirectDraw(IDirectDrawFactory *iface, GUID
if
(
outer_unknown
)
if
(
outer_unknown
)
FIXME
(
"Implement aggregation in ddrawex's IDirectDraw interface.
\n
"
);
FIXME
(
"Implement aggregation in ddrawex's IDirectDraw interface.
\n
"
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
object
->
ref
=
1
;
object
->
ref
=
1
;
...
@@ -1447,9 +1447,11 @@ HRESULT WINAPI ddrawex_factory_CreateDirectDraw(IDirectDrawFactory *iface, GUID
...
@@ -1447,9 +1447,11 @@ HRESULT WINAPI ddrawex_factory_CreateDirectDraw(IDirectDrawFactory *iface, GUID
return
DD_OK
;
return
DD_OK
;
err:
err:
if
(
object
&&
object
->
parent
)
IDirectDraw4_Release
(
object
->
parent
);
if
(
object
&&
object
->
parent
)
if
(
parent
)
IDirectDraw_Release
(
parent
);
IDirectDraw4_Release
(
object
->
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
parent
)
IDirectDraw_Release
(
parent
);
heap_free
(
object
);
*
ddraw
=
NULL
;
*
ddraw
=
NULL
;
return
hr
;
return
hr
;
}
}
...
...
dlls/ddrawex/ddrawex_private.h
View file @
71c2c2da
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
#ifndef __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H
#ifndef __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H
#define __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H
#define __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H
#include "wine/heap.h"
DEFINE_GUID
(
CLSID_DirectDrawFactory
,
0x4fd2a832
,
0x86c8
,
0x11d0
,
0x8f
,
0xca
,
0x0
,
0xc0
,
0x4f
,
0xd9
,
0x18
,
0x9d
);
DEFINE_GUID
(
CLSID_DirectDrawFactory
,
0x4fd2a832
,
0x86c8
,
0x11d0
,
0x8f
,
0xca
,
0x0
,
0xc0
,
0x4f
,
0xd9
,
0x18
,
0x9d
);
DEFINE_GUID
(
IID_IDirectDrawFactory
,
0x4fd2a833
,
0x86c8
,
0x11d0
,
0x8f
,
0xca
,
0x0
,
0xc0
,
0x4f
,
0xd9
,
0x18
,
0x9d
);
DEFINE_GUID
(
IID_IDirectDrawFactory
,
0x4fd2a833
,
0x86c8
,
0x11d0
,
0x8f
,
0xca
,
0x0
,
0xc0
,
0x4f
,
0xd9
,
0x18
,
0x9d
);
...
...
dlls/ddrawex/main.c
View file @
71c2c2da
...
@@ -84,7 +84,7 @@ static ULONG WINAPI ddrawex_class_factory_Release(IClassFactory *iface)
...
@@ -84,7 +84,7 @@ static ULONG WINAPI ddrawex_class_factory_Release(IClassFactory *iface)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
heap_free
(
factory
);
return
refcount
;
return
refcount
;
}
}
...
@@ -163,7 +163,7 @@ static ULONG WINAPI ddrawex_factory_Release(IDirectDrawFactory *iface)
...
@@ -163,7 +163,7 @@ static ULONG WINAPI ddrawex_factory_Release(IDirectDrawFactory *iface)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
if
(
!
refcount
)
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
heap_free
(
factory
);
return
refcount
;
return
refcount
;
}
}
...
@@ -195,13 +195,13 @@ static HRESULT ddrawex_factory_create(IUnknown *outer_unknown, REFIID riid, void
...
@@ -195,13 +195,13 @@ static HRESULT ddrawex_factory_create(IUnknown *outer_unknown, REFIID riid, void
if
(
outer_unknown
)
if
(
outer_unknown
)
return
CLASS_E_NOAGGREGATION
;
return
CLASS_E_NOAGGREGATION
;
if
(
!
(
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
))))
if
(
!
(
factory
=
heap_alloc_zero
(
sizeof
(
*
factory
))))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
factory
->
IDirectDrawFactory_iface
.
lpVtbl
=
&
ddrawex_factory_vtbl
;
factory
->
IDirectDrawFactory_iface
.
lpVtbl
=
&
ddrawex_factory_vtbl
;
if
(
FAILED
(
hr
=
ddrawex_factory_QueryInterface
(
&
factory
->
IDirectDrawFactory_iface
,
riid
,
out
)))
if
(
FAILED
(
hr
=
ddrawex_factory_QueryInterface
(
&
factory
->
IDirectDrawFactory_iface
,
riid
,
out
)))
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
heap_free
(
factory
);
return
hr
;
return
hr
;
}
}
...
@@ -234,8 +234,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
...
@@ -234,8 +234,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out)
return
CLASS_E_CLASSNOTAVAILABLE
;
return
CLASS_E_CLASSNOTAVAILABLE
;
}
}
factory
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
factory
));
if
(
!
(
factory
=
heap_alloc_zero
(
sizeof
(
*
factory
))))
if
(
factory
==
NULL
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_vtbl
;
factory
->
IClassFactory_iface
.
lpVtbl
=
&
ddrawex_class_factory_vtbl
;
factory
->
ref
=
1
;
factory
->
ref
=
1
;
...
...
dlls/ddrawex/surface.c
View file @
71c2c2da
...
@@ -124,7 +124,7 @@ static ULONG WINAPI ddrawex_surface4_Release(IDirectDrawSurface4 *iface)
...
@@ -124,7 +124,7 @@ static ULONG WINAPI ddrawex_surface4_Release(IDirectDrawSurface4 *iface)
{
{
IDirectDrawSurface4_FreePrivateData
(
surface
->
parent
,
&
IID_DDrawexPriv
);
IDirectDrawSurface4_FreePrivateData
(
surface
->
parent
,
&
IID_DDrawexPriv
);
IDirectDrawSurface4_Release
(
surface
->
parent
);
IDirectDrawSurface4_Release
(
surface
->
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
heap_free
(
surface
);
}
}
return
refcount
;
return
refcount
;
...
@@ -1208,7 +1208,7 @@ IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner)
...
@@ -1208,7 +1208,7 @@ IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner)
struct
ddrawex_surface
*
impl
;
struct
ddrawex_surface
*
impl
;
TRACE
(
"Creating new ddrawex surface wrapper for surface %p
\n
"
,
inner
);
TRACE
(
"Creating new ddrawex surface wrapper for surface %p
\n
"
,
inner
);
impl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
impl
));
impl
=
heap_alloc_zero
(
sizeof
(
*
impl
));
impl
->
ref
=
1
;
impl
->
ref
=
1
;
impl
->
IDirectDrawSurface3_iface
.
lpVtbl
=
&
ddrawex_surface3_vtbl
;
impl
->
IDirectDrawSurface3_iface
.
lpVtbl
=
&
ddrawex_surface3_vtbl
;
impl
->
IDirectDrawSurface4_iface
.
lpVtbl
=
&
ddrawex_surface4_vtbl
;
impl
->
IDirectDrawSurface4_iface
.
lpVtbl
=
&
ddrawex_surface4_vtbl
;
...
...
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