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
568d0a5d
Commit
568d0a5d
authored
Nov 27, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Explicitly check for d3d device interface in ResetDevice().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4862f38d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
main.c
dlls/mfplat/main.c
+16
-10
No files found.
dlls/mfplat/main.c
View file @
568d0a5d
...
...
@@ -8570,7 +8570,7 @@ struct dxgi_device_manager
IMFDXGIDeviceManager
IMFDXGIDeviceManager_iface
;
LONG
refcount
;
UINT
token
;
I
DXGIDevice
*
device
;
I
Unknown
*
device
;
unsigned
int
*
handles
;
size_t
count
;
...
...
@@ -8633,7 +8633,7 @@ static ULONG WINAPI dxgi_device_manager_Release(IMFDXGIDeviceManager *iface)
if
(
!
refcount
)
{
if
(
manager
->
device
)
I
DXGIDevice
_Release
(
manager
->
device
);
I
Unknown
_Release
(
manager
->
device
);
DeleteCriticalSection
(
&
manager
->
cs
);
free
(
manager
->
handles
);
free
(
manager
);
...
...
@@ -8709,7 +8709,7 @@ static HRESULT WINAPI dxgi_device_manager_GetVideoService(IMFDXGIDeviceManager *
if
(
manager
->
handles
[
idx
]
&
DXGI_DEVICE_HANDLE_FLAG_INVALID
)
hr
=
MF_E_DXGI_NEW_VIDEO_DEVICE
;
else
if
(
manager
->
handles
[
idx
]
&
DXGI_DEVICE_HANDLE_FLAG_OPEN
)
hr
=
I
DXGIDevice
_QueryInterface
(
manager
->
device
,
riid
,
service
);
hr
=
I
Unknown
_QueryInterface
(
manager
->
device
,
riid
,
service
);
else
hr
=
E_HANDLE
;
}
...
...
@@ -8738,7 +8738,7 @@ static HRESULT WINAPI dxgi_device_manager_LockDevice(IMFDXGIDeviceManager *iface
}
else
if
(
manager
->
locking_tid
==
GetCurrentThreadId
())
{
if
(
SUCCEEDED
(
hr
=
I
DXGIDevice
_QueryInterface
(
manager
->
device
,
riid
,
obj
)))
if
(
SUCCEEDED
(
hr
=
I
Unknown
_QueryInterface
(
manager
->
device
,
riid
,
obj
)))
dxgi_device_manager_lock_handle
(
manager
,
idx
);
}
else
if
(
manager
->
locking_tid
&&
!
block
)
...
...
@@ -8756,7 +8756,7 @@ static HRESULT WINAPI dxgi_device_manager_LockDevice(IMFDXGIDeviceManager *iface
{
if
(
manager
->
handles
[
idx
]
&
DXGI_DEVICE_HANDLE_FLAG_INVALID
)
hr
=
MF_E_DXGI_NEW_VIDEO_DEVICE
;
else
if
(
SUCCEEDED
(
hr
=
I
DXGIDevice
_QueryInterface
(
manager
->
device
,
riid
,
obj
)))
else
if
(
SUCCEEDED
(
hr
=
I
Unknown
_QueryInterface
(
manager
->
device
,
riid
,
obj
)))
{
manager
->
locking_tid
=
GetCurrentThreadId
();
dxgi_device_manager_lock_handle
(
manager
,
idx
);
...
...
@@ -8814,7 +8814,7 @@ static HRESULT WINAPI dxgi_device_manager_OpenDeviceHandle(IMFDXGIDeviceManager
static
HRESULT
WINAPI
dxgi_device_manager_ResetDevice
(
IMFDXGIDeviceManager
*
iface
,
IUnknown
*
device
,
UINT
token
)
{
struct
dxgi_device_manager
*
manager
=
impl_from_IMFDXGIDeviceManager
(
iface
);
I
DXGIDevice
*
dxgi
_device
;
I
Unknown
*
d3d
_device
;
size_t
i
;
TRACE
(
"%p, %p, %u.
\n
"
,
iface
,
device
,
token
);
...
...
@@ -8822,8 +8822,14 @@ static HRESULT WINAPI dxgi_device_manager_ResetDevice(IMFDXGIDeviceManager *ifac
if
(
!
device
||
token
!=
manager
->
token
)
return
E_INVALIDARG
;
if
(
FAILED
(
IUnknown_QueryInterface
(
device
,
&
IID_IDXGIDevice
,
(
void
**
)
&
dxgi_device
)))
return
E_INVALIDARG
;
if
(
FAILED
(
IUnknown_QueryInterface
(
device
,
&
IID_ID3D11Device
,
(
void
**
)
&
d3d_device
)))
{
if
(
FAILED
(
IUnknown_QueryInterface
(
device
,
&
IID_ID3D12Device
,
(
void
**
)
&
d3d_device
)))
{
WARN
(
"Unsupported device interface.
\n
"
);
return
E_INVALIDARG
;
}
}
EnterCriticalSection
(
&
manager
->
cs
);
...
...
@@ -8836,9 +8842,9 @@ static HRESULT WINAPI dxgi_device_manager_ResetDevice(IMFDXGIDeviceManager *ifac
}
manager
->
locking_tid
=
0
;
manager
->
locks
=
0
;
I
DXGIDevice
_Release
(
manager
->
device
);
I
Unknown
_Release
(
manager
->
device
);
}
manager
->
device
=
d
xgi
_device
;
manager
->
device
=
d
3d
_device
;
LeaveCriticalSection
(
&
manager
->
cs
);
...
...
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