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
c27b83ec
Commit
c27b83ec
authored
May 24, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
May 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Introduce a helper function to allocate arrays.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
22d52ed5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
d3d11_private.h
dlls/d3d11/d3d11_private.h
+7
-0
inputlayout.c
dlls/d3d11/inputlayout.c
+1
-2
shader.c
dlls/d3d11/shader.c
+1
-2
No files found.
dlls/d3d11/d3d11_private.h
View file @
c27b83ec
...
@@ -79,6 +79,13 @@ HRESULT d3d_set_private_data(struct wined3d_private_store *store,
...
@@ -79,6 +79,13 @@ HRESULT d3d_set_private_data(struct wined3d_private_store *store,
HRESULT
d3d_set_private_data_interface
(
struct
wined3d_private_store
*
store
,
HRESULT
d3d_set_private_data_interface
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
const
IUnknown
*
object
)
DECLSPEC_HIDDEN
;
REFGUID
guid
,
const
IUnknown
*
object
)
DECLSPEC_HIDDEN
;
static
inline
void
*
d3d11_calloc
(
SIZE_T
count
,
SIZE_T
size
)
{
if
(
count
>
~
(
SIZE_T
)
0
/
size
)
return
NULL
;
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
count
*
size
);
}
static
inline
void
read_dword
(
const
char
**
ptr
,
DWORD
*
d
)
static
inline
void
read_dword
(
const
char
**
ptr
,
DWORD
*
d
)
{
{
memcpy
(
d
,
*
ptr
,
sizeof
(
*
d
));
memcpy
(
d
,
*
ptr
,
sizeof
(
*
d
));
...
...
dlls/d3d11/inputlayout.c
View file @
c27b83ec
...
@@ -54,8 +54,7 @@ static HRESULT d3d11_input_layout_to_wined3d_declaration(const D3D11_INPUT_ELEME
...
@@ -54,8 +54,7 @@ static HRESULT d3d11_input_layout_to_wined3d_declaration(const D3D11_INPUT_ELEME
return
E_FAIL
;
return
E_FAIL
;
}
}
*
wined3d_elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
element_count
*
sizeof
(
**
wined3d_elements
));
if
(
!
(
*
wined3d_elements
=
d3d11_calloc
(
element_count
,
sizeof
(
**
wined3d_elements
))))
if
(
!*
wined3d_elements
)
{
{
ERR
(
"Failed to allocate wined3d vertex element array memory.
\n
"
);
ERR
(
"Failed to allocate wined3d vertex element array memory.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
is
.
elements
);
HeapFree
(
GetProcessHeap
(),
0
,
is
.
elements
);
...
...
dlls/d3d11/shader.c
View file @
c27b83ec
...
@@ -121,8 +121,7 @@ HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d
...
@@ -121,8 +121,7 @@ HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
e
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
e
));
if
(
!
(
e
=
d3d11_calloc
(
count
,
sizeof
(
*
e
))))
if
(
!
e
)
{
{
ERR
(
"Failed to allocate input signature memory.
\n
"
);
ERR
(
"Failed to allocate input signature memory.
\n
"
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
...
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