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
be68d56e
Commit
be68d56e
authored
Oct 25, 2011
by
Rico Schüller
Committed by
Alexandre Julliard
Oct 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve argument check in D3DXFindShaderComment().
parent
6ffe4cb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
shader.c
dlls/d3dx9_36/shader.c
+3
-0
shader.c
dlls/d3dx9_36/tests/shader.c
+10
-2
No files found.
dlls/d3dx9_36/shader.c
View file @
be68d56e
...
...
@@ -153,6 +153,9 @@ HRESULT WINAPI D3DXFindShaderComment(CONST DWORD* byte_code, DWORD fourcc, LPCVO
TRACE
(
"(%p, %x, %p, %p)
\n
"
,
byte_code
,
fourcc
,
data
,
size
);
if
(
data
)
*
data
=
NULL
;
if
(
size
)
*
size
=
0
;
if
(
!
byte_code
)
return
D3DERR_INVALIDCALL
;
...
...
dlls/d3dx9_36/tests/shader.c
View file @
be68d56e
...
...
@@ -215,23 +215,31 @@ static void test_get_shader_version(void)
static
void
test_find_shader_comment
(
void
)
{
HRESULT
hr
;
LPCVOID
data
;
UINT
size
;
LPCVOID
data
=
(
LPVOID
)
0xdeadbeef
;
UINT
size
=
100
;
hr
=
D3DXFindShaderComment
(
NULL
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
&
data
,
&
size
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got result %x, expected %x (D3DERR_INVALIDCALL)
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
ok
(
!
data
,
"Got %p, expected NULL
\n
"
,
data
);
ok
(
!
size
,
"Got %u, expected 0
\n
"
,
size
);
hr
=
D3DXFindShaderComment
(
shader_with_ctab
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
NULL
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got result %x, expected 0 (D3D_OK)
\n
"
,
hr
);
ok
(
size
==
28
,
"Got %u, expected 28
\n
"
,
size
);
hr
=
D3DXFindShaderComment
(
shader_with_ctab
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
&
data
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got result %x, expected 0 (D3D_OK)
\n
"
,
hr
);
ok
(
data
==
(
LPCVOID
)(
shader_with_ctab
+
6
),
"Got result %p, expected %p
\n
"
,
data
,
shader_with_ctab
+
6
);
hr
=
D3DXFindShaderComment
(
shader_with_ctab
,
0
,
&
data
,
&
size
);
ok
(
hr
==
S_FALSE
,
"Got result %x, expected 1 (S_FALSE)
\n
"
,
hr
);
ok
(
!
data
,
"Got %p, expected NULL
\n
"
,
data
);
ok
(
!
size
,
"Got %u, expected 0
\n
"
,
size
);
hr
=
D3DXFindShaderComment
(
shader_with_ctab
,
MAKEFOURCC
(
'X'
,
'X'
,
'X'
,
'X'
),
&
data
,
&
size
);
ok
(
hr
==
S_FALSE
,
"Got result %x, expected 1 (S_FALSE)
\n
"
,
hr
);
ok
(
!
data
,
"Got %p, expected NULL
\n
"
,
data
);
ok
(
!
size
,
"Got %u, expected 0
\n
"
,
size
);
hr
=
D3DXFindShaderComment
(
shader_with_ctab
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
&
data
,
&
size
);
ok
(
hr
==
D3D_OK
,
"Got result %x, expected 0 (D3D_OK)
\n
"
,
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