Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
23696573
Commit
23696573
authored
Oct 29, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Use CRT allocation functions.
parent
1b7b948a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
34 deletions
+30
-34
adapter.c
dlls/dxgi/adapter.c
+2
-2
device.c
dlls/dxgi/device.c
+5
-5
dxgi_main.c
dlls/dxgi/dxgi_main.c
+4
-7
dxgi_private.h
dlls/dxgi/dxgi_private.h
+0
-1
factory.c
dlls/dxgi/factory.c
+3
-3
output.c
dlls/dxgi/output.c
+2
-2
resource.c
dlls/dxgi/resource.c
+1
-1
swapchain.c
dlls/dxgi/swapchain.c
+13
-13
No files found.
dlls/dxgi/adapter.c
View file @
23696573
...
...
@@ -80,7 +80,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface)
{
wined3d_private_store_cleanup
(
&
adapter
->
private_store
);
IWineDXGIFactory_Release
(
&
adapter
->
factory
->
IWineDXGIFactory_iface
);
heap_
free
(
adapter
);
free
(
adapter
);
}
return
refcount
;
...
...
@@ -447,7 +447,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
=
heap_
alloc
(
sizeof
(
**
adapter
))))
if
(
!
(
*
adapter
=
m
alloc
(
sizeof
(
**
adapter
))))
return
E_OUTOFMEMORY
;
dxgi_adapter_init
(
*
adapter
,
factory
,
ordinal
);
...
...
dlls/dxgi/device.c
View file @
23696573
...
...
@@ -100,7 +100,7 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
wined3d_mutex_unlock
();
IWineDXGIAdapter_Release
(
device
->
adapter
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
heap_
free
(
device
);
free
(
device
);
}
return
refcount
;
...
...
@@ -341,7 +341,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_resource(IWineDXGIDevice *if
"resource %p.
\n
"
,
iface
,
wined3d_resource
,
usage
,
shared_resource
,
outer
,
needs_surface
,
resource
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate DXGI resource object memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -350,7 +350,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_resource(IWineDXGIDevice *if
if
(
FAILED
(
hr
=
dxgi_resource_init
(
object
,
(
IDXGIDevice
*
)
iface
,
outer
,
needs_surface
,
wined3d_resource
)))
{
WARN
(
"Failed to initialize resource, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -455,7 +455,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate swapchain memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -464,7 +464,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_factory_create_swapchain(IWineDX
if
(
FAILED
(
hr
=
d3d11_swapchain_init
(
object
,
device
,
&
wined3d_desc
)))
{
WARN
(
"Failed to initialise swapchain, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
dlls/dxgi/dxgi_main.c
View file @
23696573
...
...
@@ -32,7 +32,7 @@ static struct dxgi_main dxgi_main;
static
void
dxgi_main_cleanup
(
void
)
{
heap_
free
(
dxgi_main
.
device_layers
);
free
(
dxgi_main
.
device_layers
);
FreeLibrary
(
dxgi_main
.
d3d10core
);
}
...
...
@@ -185,7 +185,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
);
if
(
!
(
dxgi_device
=
heap_alloc_zero
(
device_size
)))
if
(
!
(
dxgi_device
=
calloc
(
1
,
device_size
)))
{
ERR
(
"Failed to allocate device memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -195,7 +195,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize device, hr %#lx.
\n
"
,
hr
);
heap_
free
(
dxgi_device
);
free
(
dxgi_device
);
*
device
=
NULL
;
return
hr
;
}
...
...
@@ -215,10 +215,7 @@ HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, U
wined3d_mutex_lock
();
if
(
!
dxgi_main
.
layer_count
)
new_layers
=
heap_alloc
(
layer_count
*
sizeof
(
*
new_layers
));
else
new_layers
=
heap_realloc
(
dxgi_main
.
device_layers
,
new_layers
=
realloc
(
dxgi_main
.
device_layers
,
(
dxgi_main
.
layer_count
+
layer_count
)
*
sizeof
(
*
new_layers
));
if
(
!
new_layers
)
...
...
dlls/dxgi/dxgi_private.h
View file @
23696573
...
...
@@ -20,7 +20,6 @@
#define __WINE_DXGI_PRIVATE_H
#include "wine/debug.h"
#include "wine/heap.h"
#include <assert.h>
...
...
dlls/dxgi/factory.c
View file @
23696573
...
...
@@ -79,7 +79,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface)
wined3d_decref
(
factory
->
wined3d
);
wined3d_private_store_cleanup
(
&
factory
->
private_store
);
heap_
free
(
factory
);
free
(
factory
);
}
return
refcount
;
...
...
@@ -587,13 +587,13 @@ HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended)
struct
dxgi_factory
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
dxgi_factory_init
(
object
,
extended
)))
{
WARN
(
"Failed to initialize factory, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
dlls/dxgi/output.c
View file @
23696573
...
...
@@ -236,7 +236,7 @@ static ULONG STDMETHODCALLTYPE dxgi_output_Release(IDXGIOutput6 *iface)
{
wined3d_private_store_cleanup
(
&
output
->
private_store
);
IWineDXGIAdapter_Release
(
&
output
->
adapter
->
IWineDXGIAdapter_iface
);
heap_
free
(
output
);
free
(
output
);
}
return
refcount
;
...
...
@@ -725,7 +725,7 @@ static void dxgi_output_init(struct dxgi_output *output, unsigned int output_idx
HRESULT
dxgi_output_create
(
struct
dxgi_adapter
*
adapter
,
unsigned
int
output_idx
,
struct
dxgi_output
**
output
)
{
if
(
!
(
*
output
=
heap_alloc_zero
(
sizeof
(
**
output
))))
if
(
!
(
*
output
=
calloc
(
1
,
sizeof
(
**
output
))))
return
E_OUTOFMEMORY
;
dxgi_output_init
(
*
output
,
output_idx
,
adapter
);
...
...
dlls/dxgi/resource.c
View file @
23696573
...
...
@@ -77,7 +77,7 @@ static ULONG STDMETHODCALLTYPE dxgi_resource_inner_Release(IUnknown *iface)
if
(
!
refcount
)
{
wined3d_private_store_cleanup
(
&
resource
->
private_store
);
heap_
free
(
resource
);
free
(
resource
);
}
return
refcount
;
...
...
dlls/dxgi/swapchain.c
View file @
23696573
...
...
@@ -803,7 +803,7 @@ static void STDMETHODCALLTYPE d3d11_swapchain_wined3d_object_released(void *pare
struct
d3d11_swapchain
*
swapchain
=
parent
;
wined3d_private_store_cleanup
(
&
swapchain
->
private_store
);
heap_
free
(
parent
);
free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d11_swapchain_wined3d_parent_ops
=
...
...
@@ -1126,7 +1126,7 @@ static void d3d12_swapchain_op_destroy(struct d3d12_swapchain *swapchain, struct
vk_funcs
->
p_vkFreeMemory
(
swapchain
->
vk_device
,
op
->
resize_buffers
.
vk_memory
,
NULL
);
}
heap_
free
(
op
);
free
(
op
);
}
static
HRESULT
d3d12_swapchain_op_present_execute
(
struct
d3d12_swapchain
*
swapchain
,
struct
d3d12_swapchain_op
*
op
);
...
...
@@ -1224,14 +1224,14 @@ static HRESULT select_vk_format(const struct dxgi_vk_funcs *vk_funcs,
return
DXGI_ERROR_INVALID_CALL
;
}
if
(
!
(
formats
=
heap_
calloc
(
format_count
,
sizeof
(
*
formats
))))
if
(
!
(
formats
=
calloc
(
format_count
,
sizeof
(
*
formats
))))
return
E_OUTOFMEMORY
;
if
((
vr
=
vk_funcs
->
p_vkGetPhysicalDeviceSurfaceFormatsKHR
(
vk_physical_device
,
vk_surface
,
&
format_count
,
formats
))
<
0
)
{
WARN
(
"Failed to enumerate supported surface formats, vr %d.
\n
"
,
vr
);
heap_
free
(
formats
);
free
(
formats
);
return
hresult_from_vk_result
(
vr
);
}
...
...
@@ -1254,7 +1254,7 @@ static HRESULT select_vk_format(const struct dxgi_vk_funcs *vk_funcs,
}
}
}
heap_
free
(
formats
);
free
(
formats
);
if
(
i
==
format_count
)
{
FIXME
(
"Failed to find Vulkan swapchain format for %s.
\n
"
,
debug_dxgi_format
(
swapchain_desc
->
Format
));
...
...
@@ -1313,7 +1313,7 @@ static BOOL d3d12_swapchain_is_present_mode_supported(struct d3d12_swapchain *sw
supported
=
FALSE
;
if
(
!
(
modes
=
heap_
calloc
(
count
,
sizeof
(
*
modes
))))
if
(
!
(
modes
=
calloc
(
count
,
sizeof
(
*
modes
))))
return
FALSE
;
if
((
vr
=
vk_funcs
->
p_vkGetPhysicalDeviceSurfacePresentModesKHR
(
vk_physical_device
,
swapchain
->
vk_surface
,
&
count
,
modes
))
>=
0
)
...
...
@@ -1331,7 +1331,7 @@ static BOOL d3d12_swapchain_is_present_mode_supported(struct d3d12_swapchain *sw
{
WARN
(
"Failed to get available present modes, vr %d.
\n
"
,
vr
);
}
heap_
free
(
modes
);
free
(
modes
);
return
supported
;
}
...
...
@@ -1983,7 +1983,7 @@ static ULONG STDMETHODCALLTYPE d3d12_swapchain_Release(IDXGISwapChain4 *iface)
if
(
!
refcount
)
{
d3d12_swapchain_destroy
(
swapchain
);
heap_
free
(
swapchain
);
free
(
swapchain
);
}
return
refcount
;
...
...
@@ -2216,7 +2216,7 @@ static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain,
return
S_OK
;
}
if
(
!
(
op
=
heap_alloc_zero
(
sizeof
(
*
op
))))
if
(
!
(
op
=
calloc
(
1
,
sizeof
(
*
op
))))
{
WARN
(
"Cannot allocate memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -2499,7 +2499,7 @@ static HRESULT d3d12_swapchain_resize_buffers(struct d3d12_swapchain *swapchain,
return
S_OK
;
}
if
(
!
(
op
=
heap_alloc_zero
(
sizeof
(
*
op
))))
if
(
!
(
op
=
calloc
(
1
,
sizeof
(
*
op
))))
{
WARN
(
"Cannot allocate memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -3304,13 +3304,13 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
fullscreen_desc
=
&
default_fullscreen_desc
;
}
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
ID3D12CommandQueue_GetDevice
(
queue
,
&
IID_ID3D12Device
,
(
void
**
)
&
device
)))
{
ERR
(
"Failed to get d3d12 device, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -3318,7 +3318,7 @@ HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *qu
ID3D12Device_Release
(
device
);
if
(
FAILED
(
hr
))
{
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
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