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
2b04143e
Commit
2b04143e
authored
Oct 21, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxva2: Fix valid handle range test.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7bbd46ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
main.c
dlls/dxva2/main.c
+1
-1
dxva2.c
dlls/dxva2/tests/dxva2.c
+10
-0
No files found.
dlls/dxva2/main.c
View file @
2b04143e
...
...
@@ -562,7 +562,7 @@ static HRESULT WINAPI device_manager_OpenDeviceHandle(IDirect3DDeviceManager9 *i
static
HRESULT
device_manager_get_handle_index
(
struct
device_manager
*
manager
,
HANDLE
hdevice
,
size_t
*
idx
)
{
if
(
hdevice
>
ULongToHandle
(
manager
->
count
))
if
(
!
hdevice
||
hdevice
>
ULongToHandle
(
manager
->
count
))
return
E_HANDLE
;
*
idx
=
(
ULONG_PTR
)
hdevice
-
1
;
return
S_OK
;
...
...
dlls/dxva2/tests/dxva2.c
View file @
2b04143e
...
...
@@ -115,6 +115,9 @@ static void test_device_manager(void)
hr
=
IDirect3DDeviceManager9_LockDevice
(
manager
,
0
,
&
device2
,
FALSE
);
ok
(
hr
==
DXVA2_E_NOT_INITIALIZED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
manager
,
0
);
ok
(
hr
==
E_HANDLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Invalid token. */
hr
=
IDirect3DDeviceManager9_ResetDevice
(
manager
,
device
,
token
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -123,9 +126,13 @@ static void test_device_manager(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
refcount
=
get_refcount
(
device
);
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
manager
,
0
);
ok
(
hr
==
E_HANDLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
handle1
=
NULL
;
hr
=
IDirect3DDeviceManager9_OpenDeviceHandle
(
manager
,
&
handle1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
handle1
,
"Unexpected handle value.
\n
"
);
refcount2
=
get_refcount
(
device
);
ok
(
refcount2
==
refcount
,
"Unexpected refcount %d.
\n
"
,
refcount
);
...
...
@@ -152,6 +159,9 @@ static void test_device_manager(void)
hr
=
IDirect3DDeviceManager9_TestDevice
(
manager
,
handle1
);
ok
(
hr
==
E_HANDLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDeviceManager9_TestDevice
(
manager
,
0
);
ok
(
hr
==
E_HANDLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
handle
=
NULL
;
hr
=
IDirect3DDeviceManager9_OpenDeviceHandle
(
manager
,
&
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\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