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
56debb49
Commit
56debb49
authored
May 31, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx10: Don't ignore HRESULT parameter in D3DX10CreateTextureFromMemory.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
parent
5beba20e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
d3dx10.c
dlls/d3dx10_43/tests/d3dx10.c
+5
-0
texture.c
dlls/d3dx10_43/texture.c
+25
-7
No files found.
dlls/d3dx10_43/tests/d3dx10.c
View file @
56debb49
...
...
@@ -2173,6 +2173,11 @@ static void test_create_texture(void)
/* D3DX10CreateTextureFromMemory tests */
resource
=
(
ID3D10Resource
*
)
0xdeadbeef
;
hr
=
D3DX10CreateTextureFromMemory
(
NULL
,
test_bmp_1bpp
,
sizeof
(
test_bmp_1bpp
),
NULL
,
NULL
,
&
resource
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
resource
==
(
ID3D10Resource
*
)
0xdeadbeef
,
"Got unexpected resource %p.
\n
"
,
resource
);
resource
=
(
ID3D10Resource
*
)
0xdeadbeef
;
hr
=
D3DX10CreateTextureFromMemory
(
device
,
NULL
,
0
,
NULL
,
NULL
,
&
resource
,
NULL
);
ok
(
hr
==
E_FAIL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
resource
==
(
ID3D10Resource
*
)
0xdeadbeef
,
"Got unexpected resource %p.
\n
"
,
resource
);
...
...
dlls/d3dx10_43/texture.c
View file @
56debb49
...
...
@@ -581,7 +581,9 @@ HRESULT WINAPI D3DX10CreateTextureFromFileA(ID3D10Device *device, const char *sr
TRACE
(
"device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.
\n
"
,
device
,
debugstr_a
(
src_file
),
load_info
,
pump
,
texture
,
hresult
);
if
(
!
src_file
||
!
texture
)
if
(
!
device
)
return
E_INVALIDARG
;
if
(
!
src_file
)
return
E_FAIL
;
if
(
!
(
str_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src_file
,
-
1
,
NULL
,
0
)))
...
...
@@ -608,11 +610,17 @@ HRESULT WINAPI D3DX10CreateTextureFromFileW(ID3D10Device *device, const WCHAR *s
TRACE
(
"device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.
\n
"
,
device
,
debugstr_w
(
src_file
),
load_info
,
pump
,
texture
,
hresult
);
if
(
!
src_file
||
!
texture
)
if
(
!
device
)
return
E_INVALIDARG
;
if
(
!
src_file
)
return
E_FAIL
;
if
(
FAILED
((
hr
=
load_file
(
src_file
,
&
buffer
,
&
size
))))
{
if
(
hresult
)
*
hresult
=
hr
;
return
hr
;
}
hr
=
D3DX10CreateTextureFromMemory
(
device
,
buffer
,
size
,
load_info
,
pump
,
texture
,
hresult
);
...
...
@@ -631,8 +639,8 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceA(ID3D10Device *device, HMODULE mo
TRACE
(
"device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.
\n
"
,
device
,
module
,
debugstr_a
(
resource
),
load_info
,
pump
,
texture
,
hresult
);
if
(
!
resource
||
!
textur
e
)
return
D3DX10_ERR_INVALID_DATA
;
if
(
!
devic
e
)
return
E_INVALIDARG
;
hr
=
load_resourceA
(
module
,
resource
,
&
buffer
,
&
size
);
if
(
FAILED
(
hr
))
...
...
@@ -651,8 +659,8 @@ HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE mo
TRACE
(
"device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.
\n
"
,
device
,
module
,
debugstr_w
(
resource
),
load_info
,
pump
,
texture
,
hresult
);
if
(
!
resource
||
!
textur
e
)
return
D3DX10_ERR_INVALID_DATA
;
if
(
!
devic
e
)
return
E_INVALIDARG
;
hr
=
load_resourceW
(
module
,
resource
,
&
buffer
,
&
size
);
if
(
FAILED
(
hr
))
...
...
@@ -684,7 +692,9 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
TRACE
(
"device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.
\n
"
,
device
,
src_data
,
src_data_size
,
load_info
,
pump
,
texture
,
hresult
);
if
(
!
src_data
||
!
src_data_size
||
!
texture
)
if
(
!
device
)
return
E_INVALIDARG
;
if
(
!
src_data
)
return
E_FAIL
;
if
(
load_info
)
FIXME
(
"load_info is ignored.
\n
"
);
...
...
@@ -692,10 +702,16 @@ HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *s
FIXME
(
"Thread pump is not supported yet.
\n
"
);
if
(
FAILED
(
D3DX10GetImageInfoFromMemory
(
src_data
,
src_data_size
,
NULL
,
&
img_info
,
NULL
)))
{
if
(
hresult
)
*
hresult
=
E_FAIL
;
return
E_FAIL
;
}
if
(
img_info
.
MiscFlags
&
D3D10_RESOURCE_MISC_TEXTURECUBE
)
{
FIXME
(
"Cube map is not supported.
\n
"
);
if
(
hresult
)
*
hresult
=
E_FAIL
;
return
E_FAIL
;
}
...
...
@@ -807,5 +823,7 @@ end:
if
(
factory
)
IWICImagingFactory_Release
(
factory
);
if
(
hresult
)
*
hresult
=
hr
;
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