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
9a5b854e
Commit
9a5b854e
authored
Oct 29, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use CRT allocation functions.
parent
6db89702
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
68 additions
and
83 deletions
+68
-83
buffer.c
dlls/d3d9/buffer.c
+2
-2
d3d9_main.c
dlls/d3d9/d3d9_main.c
+4
-4
d3d9_private.h
dlls/d3d9/d3d9_private.h
+0
-1
device.c
dlls/d3d9/device.c
+33
-47
directx.c
dlls/d3d9/directx.c
+7
-7
query.c
dlls/d3d9/query.c
+1
-1
shader.c
dlls/d3d9/shader.c
+2
-2
stateblock.c
dlls/d3d9/stateblock.c
+1
-1
surface.c
dlls/d3d9/surface.c
+2
-2
swapchain.c
dlls/d3d9/swapchain.c
+3
-3
texture.c
dlls/d3d9/texture.c
+1
-1
vertexdeclaration.c
dlls/d3d9/vertexdeclaration.c
+11
-11
volume.c
dlls/d3d9/volume.c
+1
-1
No files found.
dlls/d3d9/buffer.c
View file @
9a5b854e
...
...
@@ -266,7 +266,7 @@ static void STDMETHODCALLTYPE d3d9_vertexbuffer_wined3d_object_destroyed(void *p
if
(
buffer
->
draw_buffer
)
wined3d_buffer_decref
(
buffer
->
wined3d_buffer
);
d3d9_resource_cleanup
(
&
buffer
->
resource
);
heap_
free
(
buffer
);
free
(
buffer
);
}
static
const
struct
wined3d_parent_ops
d3d9_vertexbuffer_wined3d_parent_ops
=
...
...
@@ -586,7 +586,7 @@ static void STDMETHODCALLTYPE d3d9_indexbuffer_wined3d_object_destroyed(void *pa
struct
d3d9_indexbuffer
*
buffer
=
parent
;
d3d9_resource_cleanup
(
&
buffer
->
resource
);
heap_
free
(
buffer
);
free
(
buffer
);
}
static
const
struct
wined3d_parent_ops
d3d9_indexbuffer_wined3d_parent_ops
=
...
...
dlls/d3d9/d3d9_main.c
View file @
9a5b854e
...
...
@@ -38,13 +38,13 @@ IDirect3D9 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT sdk_version)
TRACE
(
"sdk_version %#x.
\n
"
,
sdk_version
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
NULL
;
if
(
!
d3d9_init
(
object
,
FALSE
))
{
WARN
(
"Failed to initialize d3d9.
\n
"
);
heap_
free
(
object
);
free
(
object
);
return
NULL
;
}
...
...
@@ -59,13 +59,13 @@ HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT sdk_version, IDirect3D9E
TRACE
(
"sdk_version %#x, d3d9ex %p.
\n
"
,
sdk_version
,
d3d9ex
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
!
d3d9_init
(
object
,
TRUE
))
{
WARN
(
"Failed to initialize d3d9.
\n
"
);
heap_
free
(
object
);
free
(
object
);
return
D3DERR_NOTAVAILABLE
;
}
...
...
dlls/d3d9/d3d9_private.h
View file @
9a5b854e
...
...
@@ -32,7 +32,6 @@
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "d3d9.h"
#include "wine/wined3d.h"
...
...
dlls/d3d9/device.c
View file @
9a5b854e
This diff is collapsed.
Click to expand it.
dlls/d3d9/directx.c
View file @
9a5b854e
...
...
@@ -83,8 +83,8 @@ static ULONG WINAPI d3d9_Release(IDirect3D9Ex *iface)
{
wined3d_decref
(
d3d9
->
wined3d
);
heap_
free
(
d3d9
->
wined3d_outputs
);
heap_
free
(
d3d9
);
free
(
d3d9
->
wined3d_outputs
);
free
(
d3d9
);
}
return
refcount
;
...
...
@@ -489,14 +489,14 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDevice(IDirect3D9Ex *iface, U
TRACE
(
"iface %p, adapter %u, device_type %#x, focus_window %p, flags %#lx, parameters %p, device %p.
\n
"
,
iface
,
adapter
,
device_type
,
focus_window
,
flags
,
parameters
,
device
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
hr
=
device_init
(
object
,
d3d9
,
d3d9
->
wined3d
,
adapter
,
device_type
,
focus_window
,
flags
,
parameters
,
NULL
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize device, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -610,14 +610,14 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDeviceEx(IDirect3D9Ex *iface,
TRACE
(
"iface %p, adapter %u, device_type %#x, focus_window %p, flags %#lx, parameters %p, mode %p, device %p.
\n
"
,
iface
,
adapter
,
device_type
,
focus_window
,
flags
,
parameters
,
mode
,
device
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
hr
=
device_init
(
object
,
d3d9
,
d3d9
->
wined3d
,
adapter
,
device_type
,
focus_window
,
flags
,
parameters
,
mode
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize device, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
@@ -710,7 +710,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
output_count
+=
wined3d_adapter_get_output_count
(
wined3d_adapter
);
}
d3d9
->
wined3d_outputs
=
heap_
calloc
(
output_count
,
sizeof
(
*
d3d9
->
wined3d_outputs
));
d3d9
->
wined3d_outputs
=
calloc
(
output_count
,
sizeof
(
*
d3d9
->
wined3d_outputs
));
if
(
!
d3d9
->
wined3d_outputs
)
{
wined3d_decref
(
d3d9
->
wined3d
);
...
...
dlls/d3d9/query.c
View file @
9a5b854e
...
...
@@ -78,7 +78,7 @@ static ULONG WINAPI d3d9_query_Release(IDirect3DQuery9 *iface)
{
wined3d_query_decref
(
query
->
wined3d_query
);
IDirect3DDevice9Ex_Release
(
query
->
parent_device
);
heap_
free
(
query
);
free
(
query
);
}
return
refcount
;
}
...
...
dlls/d3d9/shader.c
View file @
9a5b854e
...
...
@@ -119,7 +119,7 @@ static const IDirect3DVertexShader9Vtbl d3d9_vertexshader_vtbl =
static
void
STDMETHODCALLTYPE
d3d9_vertexshader_wined3d_object_destroyed
(
void
*
parent
)
{
heap_
free
(
parent
);
free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d9_vertexshader_wined3d_parent_ops
=
...
...
@@ -262,7 +262,7 @@ static const IDirect3DPixelShader9Vtbl d3d9_pixelshader_vtbl =
static
void
STDMETHODCALLTYPE
d3d9_pixelshader_wined3d_object_destroyed
(
void
*
parent
)
{
heap_
free
(
parent
);
free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d9_pixelshader_wined3d_parent_ops
=
...
...
dlls/d3d9/stateblock.c
View file @
9a5b854e
...
...
@@ -69,7 +69,7 @@ static ULONG WINAPI d3d9_stateblock_Release(IDirect3DStateBlock9 *iface)
wined3d_stateblock_decref
(
stateblock
->
wined3d_stateblock
);
IDirect3DDevice9Ex_Release
(
stateblock
->
parent_device
);
heap_
free
(
stateblock
);
free
(
stateblock
);
}
return
refcount
;
...
...
dlls/d3d9/surface.c
View file @
9a5b854e
...
...
@@ -345,7 +345,7 @@ static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent)
{
struct
d3d9_surface
*
surface
=
parent
;
d3d9_resource_cleanup
(
&
surface
->
resource
);
heap_
free
(
surface
);
free
(
surface
);
}
static
const
struct
wined3d_parent_ops
d3d9_surface_wined3d_parent_ops
=
...
...
@@ -359,7 +359,7 @@ struct d3d9_surface *d3d9_surface_create(struct wined3d_texture *wined3d_texture
IDirect3DBaseTexture9
*
texture
;
struct
d3d9_surface
*
surface
;
if
(
!
(
surface
=
heap_alloc_zero
(
sizeof
(
*
surface
))))
if
(
!
(
surface
=
calloc
(
1
,
sizeof
(
*
surface
))))
return
NULL
;
surface
->
IDirect3DSurface9_iface
.
lpVtbl
=
&
d3d9_surface_vtbl
;
...
...
dlls/d3d9/swapchain.c
View file @
9a5b854e
...
...
@@ -348,7 +348,7 @@ static const struct IDirect3DSwapChain9ExVtbl d3d9_swapchain_vtbl =
static
void
STDMETHODCALLTYPE
d3d9_swapchain_wined3d_object_released
(
void
*
parent
)
{
heap_
free
(
parent
);
free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d9_swapchain_wined3d_parent_ops
=
...
...
@@ -399,13 +399,13 @@ HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapcha
unsigned
int
i
;
HRESULT
hr
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
swapchain_init
(
object
,
device
,
desc
,
swap_interval
)))
{
WARN
(
"Failed to initialize swapchain, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
dlls/d3d9/texture.c
View file @
9a5b854e
...
...
@@ -1264,7 +1264,7 @@ static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed(void *parent
if
(
texture
->
draw_texture
)
wined3d_texture_decref
(
texture
->
wined3d_texture
);
d3d9_resource_cleanup
(
&
texture
->
resource
);
heap_
free
(
texture
);
free
(
texture
);
}
static
const
struct
wined3d_parent_ops
d3d9_texture_wined3d_parent_ops
=
...
...
dlls/d3d9/vertexdeclaration.c
View file @
9a5b854e
...
...
@@ -88,7 +88,7 @@ HRESULT vdecl_convert_fvf(
has_psize
+
has_diffuse
+
has_specular
+
num_textures
+
1
;
/* convert the declaration */
if
(
!
(
elements
=
heap_
alloc
(
size
*
sizeof
(
*
elements
))))
if
(
!
(
elements
=
m
alloc
(
size
*
sizeof
(
*
elements
))))
return
D3DERR_OUTOFVIDEOMEMORY
;
elements
[
size
-
1
]
=
end_element
;
...
...
@@ -305,8 +305,8 @@ struct d3d9_vertex_declaration *unsafe_impl_from_IDirect3DVertexDeclaration9(IDi
static
void
STDMETHODCALLTYPE
d3d9_vertexdeclaration_wined3d_object_destroyed
(
void
*
parent
)
{
struct
d3d9_vertex_declaration
*
declaration
=
parent
;
heap_
free
(
declaration
->
elements
);
heap_
free
(
declaration
);
free
(
declaration
->
elements
);
free
(
declaration
);
}
static
const
struct
wined3d_parent_ops
d3d9_vertexdeclaration_wined3d_parent_ops
=
...
...
@@ -333,7 +333,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem
/* Skip the END element */
--
count
;
if
(
!
(
*
wined3d_elements
=
heap_
alloc
(
count
*
sizeof
(
**
wined3d_elements
))))
if
(
!
(
*
wined3d_elements
=
m
alloc
(
count
*
sizeof
(
**
wined3d_elements
))))
{
FIXME
(
"Memory allocation failed
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
...
...
@@ -344,7 +344,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem
if
(
d3d9_elements
[
i
].
Type
>=
ARRAY_SIZE
(
d3d_dtype_lookup
))
{
WARN
(
"Invalid element type %#x.
\n
"
,
d3d9_elements
[
i
].
Type
);
heap_
free
(
*
wined3d_elements
);
free
(
*
wined3d_elements
);
return
E_FAIL
;
}
(
*
wined3d_elements
)[
i
].
format
=
d3d_dtype_lookup
[
d3d9_elements
[
i
].
Type
].
format
;
...
...
@@ -384,9 +384,9 @@ static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaratio
declaration
->
refcount
=
1
;
element_count
=
wined3d_element_count
+
1
;
if
(
!
(
declaration
->
elements
=
heap_
alloc
(
element_count
*
sizeof
(
*
declaration
->
elements
))))
if
(
!
(
declaration
->
elements
=
m
alloc
(
element_count
*
sizeof
(
*
declaration
->
elements
))))
{
heap_
free
(
wined3d_elements
);
free
(
wined3d_elements
);
ERR
(
"Failed to allocate vertex declaration elements memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
...
...
@@ -397,10 +397,10 @@ static HRESULT vertexdeclaration_init(struct d3d9_vertex_declaration *declaratio
hr
=
wined3d_vertex_declaration_create
(
device
->
wined3d_device
,
wined3d_elements
,
wined3d_element_count
,
declaration
,
&
d3d9_vertexdeclaration_wined3d_parent_ops
,
&
declaration
->
wined3d_declaration
);
wined3d_mutex_unlock
();
heap_
free
(
wined3d_elements
);
free
(
wined3d_elements
);
if
(
FAILED
(
hr
))
{
heap_
free
(
declaration
->
elements
);
free
(
declaration
->
elements
);
WARN
(
"Failed to create wined3d vertex declaration, hr %#lx.
\n
"
,
hr
);
if
(
hr
==
E_INVALIDARG
)
hr
=
E_FAIL
;
...
...
@@ -419,14 +419,14 @@ HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device,
struct
d3d9_vertex_declaration
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
hr
=
vertexdeclaration_init
(
object
,
device
,
elements
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize vertex declaration, hr %#lx.
\n
"
,
hr
);
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
...
...
dlls/d3d9/volume.c
View file @
9a5b854e
...
...
@@ -193,7 +193,7 @@ static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent)
{
struct
d3d9_volume
*
volume
=
parent
;
d3d9_resource_cleanup
(
&
volume
->
resource
);
heap_
free
(
volume
);
free
(
volume
);
}
static
const
struct
wined3d_parent_ops
d3d9_volume_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