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
c1cf1618
Commit
c1cf1618
authored
Feb 06, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Use the global memory allocation helpers.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
86baab09
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
20 deletions
+20
-20
adapter.c
dlls/dxgi/adapter.c
+2
-2
device.c
dlls/dxgi/device.c
+5
-5
dxgi_main.c
dlls/dxgi/dxgi_main.c
+5
-6
dxgi_private.h
dlls/dxgi/dxgi_private.h
+1
-0
factory.c
dlls/dxgi/factory.c
+3
-3
output.c
dlls/dxgi/output.c
+2
-2
surface.c
dlls/dxgi/surface.c
+1
-1
swapchain.c
dlls/dxgi/swapchain.c
+1
-1
No files found.
dlls/dxgi/adapter.c
View file @
c1cf1618
...
...
@@ -73,7 +73,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface)
{
wined3d_private_store_cleanup
(
&
adapter
->
private_store
);
IDXGIFactory4_Release
(
&
adapter
->
factory
->
IDXGIFactory4_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
adapter
);
heap_free
(
adapter
);
}
return
refcount
;
...
...
@@ -356,7 +356,7 @@ static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory
HRESULT
dxgi_adapter_create
(
struct
dxgi_factory
*
factory
,
UINT
ordinal
,
struct
dxgi_adapter
**
adapter
)
{
if
(
!
(
*
adapter
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
**
adapter
))))
if
(
!
(
*
adapter
=
heap_alloc
(
sizeof
(
**
adapter
))))
return
E_OUTOFMEMORY
;
dxgi_adapter_init
(
*
adapter
,
factory
,
ordinal
);
...
...
dlls/dxgi/device.c
View file @
c1cf1618
...
...
@@ -87,7 +87,7 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
wined3d_mutex_unlock
();
IWineDXGIAdapter_Release
(
device
->
adapter
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
device
);
heap_free
(
device
);
}
return
refcount
;
...
...
@@ -287,7 +287,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
TRACE
(
"iface %p, wined3d_texture %p, usage %#x, shared_resource %p, outer %p, surface %p.
\n
"
,
iface
,
wined3d_texture
,
usage
,
shared_resource
,
outer
,
surface
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate DXGI surface object memory
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -296,7 +296,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
if
(
FAILED
(
hr
=
dxgi_surface_init
(
object
,
(
IDXGIDevice
*
)
iface
,
outer
,
wined3d_texture
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -316,7 +316,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *i
TRACE
(
"iface %p, desc %p, wined3d_swapchain %p.
\n
"
,
iface
,
desc
,
wined3d_swapchain
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate DXGI swapchain object memory
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -325,7 +325,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *i
if
(
FAILED
(
hr
=
dxgi_swapchain_init
(
object
,
device
,
desc
,
implicit
)))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/dxgi/dxgi_main.c
View file @
c1cf1618
...
...
@@ -35,7 +35,7 @@ static struct dxgi_main dxgi_main;
static
void
dxgi_main_cleanup
(
void
)
{
HeapFree
(
GetProcessHeap
(),
0
,
dxgi_main
.
device_layers
);
heap_free
(
dxgi_main
.
device_layers
);
FreeLibrary
(
dxgi_main
.
d3d10core
);
}
...
...
@@ -188,8 +188,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
device_size
=
d3d10_layer
.
get_size
(
d3d10_layer
.
id
,
&
get_size_args
,
0
);
device_size
+=
sizeof
(
*
dxgi_device
);
dxgi_device
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
device_size
);
if
(
!
dxgi_device
)
if
(
!
(
dxgi_device
=
heap_alloc_zero
(
device_size
)))
{
ERR
(
"Failed to allocate device memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -199,7 +198,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize device, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
dxgi_device
);
heap_free
(
dxgi_device
);
*
device
=
NULL
;
return
hr
;
}
...
...
@@ -220,9 +219,9 @@ HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, U
wined3d_mutex_lock
();
if
(
!
dxgi_main
.
layer_count
)
new_layers
=
HeapAlloc
(
GetProcessHeap
(),
0
,
layer_count
*
sizeof
(
*
new_layers
));
new_layers
=
heap_alloc
(
layer_count
*
sizeof
(
*
new_layers
));
else
new_layers
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
dxgi_main
.
device_layers
,
new_layers
=
heap_realloc
(
dxgi_main
.
device_layers
,
(
dxgi_main
.
layer_count
+
layer_count
)
*
sizeof
(
*
new_layers
));
if
(
!
new_layers
)
...
...
dlls/dxgi/dxgi_private.h
View file @
c1cf1618
...
...
@@ -20,6 +20,7 @@
#define __WINE_DXGI_PRIVATE_H
#include "wine/debug.h"
#include "wine/heap.h"
#include <assert.h>
...
...
dlls/dxgi/factory.c
View file @
c1cf1618
...
...
@@ -81,7 +81,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory4 *iface)
wined3d_decref
(
factory
->
wined3d
);
wined3d_mutex_unlock
();
wined3d_private_store_cleanup
(
&
factory
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
heap_free
(
factory
);
}
return
refcount
;
...
...
@@ -547,13 +547,13 @@ HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended)
struct
dxgi_factory
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
dxgi_factory_init
(
object
,
extended
)))
{
WARN
(
"Failed to initialize factory, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/dxgi/output.c
View file @
c1cf1618
...
...
@@ -81,7 +81,7 @@ static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput4 *iface)
{
wined3d_private_store_cleanup
(
&
output
->
private_store
);
IWineDXGIAdapter_Release
(
&
output
->
adapter
->
IWineDXGIAdapter_iface
);
HeapFree
(
GetProcessHeap
(),
0
,
output
);
heap_free
(
output
);
}
return
refcount
;
...
...
@@ -447,7 +447,7 @@ static void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *ad
HRESULT
dxgi_output_create
(
struct
dxgi_adapter
*
adapter
,
struct
dxgi_output
**
output
)
{
if
(
!
(
*
output
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
**
output
))))
if
(
!
(
*
output
=
heap_alloc_zero
(
sizeof
(
**
output
))))
return
E_OUTOFMEMORY
;
dxgi_output_init
(
*
output
,
adapter
);
...
...
dlls/dxgi/surface.c
View file @
c1cf1618
...
...
@@ -74,7 +74,7 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
if
(
!
refcount
)
{
wined3d_private_store_cleanup
(
&
surface
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
heap_free
(
surface
);
}
return
refcount
;
...
...
dlls/dxgi/swapchain.c
View file @
c1cf1618
...
...
@@ -645,7 +645,7 @@ static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *paren
struct
dxgi_swapchain
*
swapchain
=
parent
;
wined3d_private_store_cleanup
(
&
swapchain
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
dxgi_swapchain_wined3d_parent_ops
=
...
...
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