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
8577ff54
Commit
8577ff54
authored
Sep 11, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Find the correct GUIDs for each D3D version in FindDevice().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
29b794dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
38 deletions
+59
-38
ddraw.c
dlls/ddraw/ddraw.c
+54
-29
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+2
-4
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+3
-5
No files found.
dlls/ddraw/ddraw.c
View file @
8577ff54
...
@@ -4018,35 +4018,20 @@ static HRESULT WINAPI d3d1_CreateViewport(IDirect3D *iface, IDirect3DViewport **
...
@@ -4018,35 +4018,20 @@ static HRESULT WINAPI d3d1_CreateViewport(IDirect3D *iface, IDirect3DViewport **
outer_unknown
);
outer_unknown
);
}
}
/*****************************************************************************
static
HRESULT
ddraw_find_device
(
struct
ddraw
*
ddraw
,
const
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
,
* IDirect3D3::FindDevice
unsigned
int
guid_count
,
const
GUID
*
const
*
guids
)
*
* This method finds a device with the requested properties and returns a
* device description
*
* Versions 1, 2 and 3
* Params:
* fds: Describes the requested device characteristics
* fdr: Returns the device description
*
* Returns:
* D3D_OK on success
* DDERR_INVALIDPARAMS if no device was found
*
*****************************************************************************/
static
HRESULT
WINAPI
d3d3_FindDevice
(
IDirect3D3
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
{
{
struct
ddraw
*
ddraw
=
impl_from_IDirect3D3
(
iface
);
D3DDEVICEDESC7
desc7
;
D3DDEVICEDESC7
desc7
;
D3DDEVICEDESC
desc1
;
D3DDEVICEDESC
desc1
;
unsigned
int
i
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"
iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
TRACE
(
"
ddraw %p, fds %p, fdr %p, guid_count %u, guids %p.
\n
"
,
ddraw
,
fds
,
fdr
,
guid_count
,
guids
);
if
(
!
fds
||
!
fdr
)
return
DDERR_INVALIDPARAMS
;
if
(
!
fds
||
!
fdr
)
return
DDERR_INVALIDPARAMS
;
if
(
fds
->
dwSize
!=
sizeof
(
D3DFINDDEVICESEARCH
)
if
(
fds
->
dwSize
!=
sizeof
(
*
fds
)
||
fdr
->
dwSize
!=
sizeof
(
*
fdr
))
||
fdr
->
dwSize
!=
sizeof
(
D3DFINDDEVICERESULT
))
return
DDERR_INVALIDPARAMS
;
return
DDERR_INVALIDPARAMS
;
if
(
fds
->
dwFlags
&
D3DFDS_COLORMODEL
)
if
(
fds
->
dwFlags
&
D3DFDS_COLORMODEL
)
...
@@ -4054,12 +4039,22 @@ static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fd
...
@@ -4054,12 +4039,22 @@ static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fd
if
(
fds
->
dwFlags
&
D3DFDS_GUID
)
if
(
fds
->
dwFlags
&
D3DFDS_GUID
)
{
{
TRACE
(
"Trying to match guid %s.
\n
"
,
debugstr_guid
(
&
(
fds
->
guid
)));
BOOL
found
=
FALSE
;
if
(
!
IsEqualGUID
(
&
IID_D3DDEVICE_WineD3D
,
&
fds
->
guid
)
&&
!
IsEqualGUID
(
&
IID_IDirect3DHALDevice
,
&
fds
->
guid
)
TRACE
(
"Trying to match GUID %s.
\n
"
,
debugstr_guid
(
&
fds
->
guid
));
&&
!
IsEqualGUID
(
&
IID_IDirect3DRGBDevice
,
&
fds
->
guid
))
for
(
i
=
0
;
i
<
guid_count
;
++
i
)
{
if
(
IsEqualGUID
(
guids
[
i
],
&
fds
->
guid
))
{
found
=
TRUE
;
break
;
}
}
if
(
!
found
)
{
{
WARN
(
"
No match for this GUID.
\n
"
);
WARN
(
"
Failed to match GUID %s.
\n
"
,
debugstr_guid
(
&
fds
->
guid
)
);
return
DDERR_NOTFOUND
;
return
DDERR_NOTFOUND
;
}
}
}
}
...
@@ -4079,22 +4074,52 @@ static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fd
...
@@ -4079,22 +4074,52 @@ static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fd
return
D3D_OK
;
return
D3D_OK
;
}
}
static
HRESULT
WINAPI
d3d3_FindDevice
(
IDirect3D3
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
{
struct
ddraw
*
ddraw
=
impl_from_IDirect3D3
(
iface
);
static
const
GUID
*
const
guids
[]
=
{
&
IID_D3DDEVICE_WineD3D
,
&
IID_IDirect3DHALDevice
,
&
IID_IDirect3DRGBDevice
,
};
TRACE
(
"iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
return
ddraw_find_device
(
ddraw
,
fds
,
fdr
,
ARRAY_SIZE
(
guids
),
guids
);
}
static
HRESULT
WINAPI
d3d2_FindDevice
(
IDirect3D2
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
static
HRESULT
WINAPI
d3d2_FindDevice
(
IDirect3D2
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
{
{
struct
ddraw
*
ddraw
=
impl_from_IDirect3D2
(
iface
);
struct
ddraw
*
ddraw
=
impl_from_IDirect3D2
(
iface
);
static
const
GUID
*
const
guids
[]
=
{
&
IID_D3DDEVICE_WineD3D
,
&
IID_IDirect3DHALDevice
,
&
IID_IDirect3DMMXDevice
,
&
IID_IDirect3DRGBDevice
,
&
IID_IDirect3DRampDevice
,
};
TRACE
(
"iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
TRACE
(
"iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
return
d
3d3_FindDevice
(
&
ddraw
->
IDirect3D3_iface
,
fds
,
fdr
);
return
d
draw_find_device
(
ddraw
,
fds
,
fdr
,
ARRAY_SIZE
(
guids
),
guids
);
}
}
static
HRESULT
WINAPI
d3d1_FindDevice
(
IDirect3D
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
static
HRESULT
WINAPI
d3d1_FindDevice
(
IDirect3D
*
iface
,
D3DFINDDEVICESEARCH
*
fds
,
D3DFINDDEVICERESULT
*
fdr
)
{
{
struct
ddraw
*
ddraw
=
impl_from_IDirect3D
(
iface
);
struct
ddraw
*
ddraw
=
impl_from_IDirect3D
(
iface
);
static
const
GUID
*
const
guids
[]
=
{
&
IID_D3DDEVICE_WineD3D
,
&
IID_IDirect3DHALDevice
,
&
IID_IDirect3DRGBDevice
,
&
IID_IDirect3DRampDevice
,
};
TRACE
(
"iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
TRACE
(
"iface %p, fds %p, fdr %p.
\n
"
,
iface
,
fds
,
fdr
);
return
d
3d3_FindDevice
(
&
ddraw
->
IDirect3D3_iface
,
fds
,
fdr
);
return
d
draw_find_device
(
ddraw
,
fds
,
fdr
,
ARRAY_SIZE
(
guids
),
guids
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
dlls/ddraw/tests/ddraw1.c
View file @
8577ff54
...
@@ -11728,12 +11728,11 @@ static void test_find_device(void)
...
@@ -11728,12 +11728,11 @@ static void test_find_device(void)
{
{
const
GUID
*
guid
;
const
GUID
*
guid
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
todo
;
}
}
tests
[]
=
tests
[]
=
{
{
{
&
IID_IDirect3D
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3D
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DRampDevice
,
D3D_OK
,
TRUE
},
{
&
IID_IDirect3DRampDevice
,
D3D_OK
},
{
&
IID_IDirect3DRGBDevice
,
D3D_OK
},
{
&
IID_IDirect3DRGBDevice
,
D3D_OK
},
{
&
IID_IDirect3DMMXDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DMMXDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DRefDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DRefDevice
,
DDERR_NOTFOUND
},
...
@@ -11784,8 +11783,7 @@ static void test_find_device(void)
...
@@ -11784,8 +11783,7 @@ static void test_find_device(void)
result
.
dwSize
=
sizeof
(
result
);
result
.
dwSize
=
sizeof
(
result
);
hr
=
IDirect3D_FindDevice
(
d3d
,
&
search
,
&
result
);
hr
=
IDirect3D_FindDevice
(
d3d
,
&
search
,
&
result
);
todo_wine_if
(
tests
[
i
].
todo
)
ok
(
hr
==
tests
[
i
].
hr
,
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
ok
(
hr
==
tests
[
i
].
hr
,
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
ok
(
result
.
dwSize
==
sizeof
(
result
),
"Test %u: Got unexpected result size %u.
\n
"
,
i
,
result
.
dwSize
);
ok
(
result
.
dwSize
==
sizeof
(
result
),
"Test %u: Got unexpected result size %u.
\n
"
,
i
,
result
.
dwSize
);
}
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
8577ff54
...
@@ -13010,14 +13010,13 @@ static void test_find_device(void)
...
@@ -13010,14 +13010,13 @@ static void test_find_device(void)
{
{
const
GUID
*
guid
;
const
GUID
*
guid
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
todo
;
}
}
tests
[]
=
tests
[]
=
{
{
{
&
IID_IDirect3D
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3D
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DRampDevice
,
D3D_OK
,
TRUE
},
{
&
IID_IDirect3DRampDevice
,
D3D_OK
},
{
&
IID_IDirect3DRGBDevice
,
D3D_OK
},
{
&
IID_IDirect3DRGBDevice
,
D3D_OK
},
{
&
IID_IDirect3DMMXDevice
,
D3D_OK
,
TRUE
},
{
&
IID_IDirect3DMMXDevice
,
D3D_OK
},
{
&
IID_IDirect3DRefDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DRefDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DTnLHalDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DTnLHalDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DNullDevice
,
DDERR_NOTFOUND
},
{
&
IID_IDirect3DNullDevice
,
DDERR_NOTFOUND
},
...
@@ -13066,8 +13065,7 @@ static void test_find_device(void)
...
@@ -13066,8 +13065,7 @@ static void test_find_device(void)
result
.
dwSize
=
sizeof
(
result
);
result
.
dwSize
=
sizeof
(
result
);
hr
=
IDirect3D2_FindDevice
(
d3d
,
&
search
,
&
result
);
hr
=
IDirect3D2_FindDevice
(
d3d
,
&
search
,
&
result
);
todo_wine_if
(
tests
[
i
].
todo
)
ok
(
hr
==
tests
[
i
].
hr
,
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
ok
(
hr
==
tests
[
i
].
hr
,
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
ok
(
result
.
dwSize
==
sizeof
(
result
),
"Test %u: Got unexpected result size %u.
\n
"
,
i
,
result
.
dwSize
);
ok
(
result
.
dwSize
==
sizeof
(
result
),
"Test %u: Got unexpected result size %u.
\n
"
,
i
,
result
.
dwSize
);
}
}
...
...
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