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
223292da
Commit
223292da
authored
Jan 15, 2024
by
Krzysztof Bogacki
Committed by
Alexandre Julliard
Feb 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Implement NtGdiDdDDIEnumAdapters2.
Signed-off-by:
Krzysztof Bogacki
<
krzysztof.bogacki@leancode.pl
>
parent
800b5e44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
3 deletions
+77
-3
driver.c
dlls/gdi32/tests/driver.c
+1
-1
sysparams.c
dlls/win32u/sysparams.c
+76
-2
No files found.
dlls/gdi32/tests/driver.c
View file @
223292da
...
@@ -199,7 +199,7 @@ static void test_D3DKMTEnumAdapters2(void)
...
@@ -199,7 +199,7 @@ static void test_D3DKMTEnumAdapters2(void)
if
(
!
pD3DKMTEnumAdapters2
||
pD3DKMTEnumAdapters2
(
&
enum_adapters_2_desc
)
==
STATUS_PROCEDURE_NOT_FOUND
)
if
(
!
pD3DKMTEnumAdapters2
||
pD3DKMTEnumAdapters2
(
&
enum_adapters_2_desc
)
==
STATUS_PROCEDURE_NOT_FOUND
)
{
{
skip
(
"D3DKMTEnumAdapters2() is unavailable.
\n
"
);
win_
skip
(
"D3DKMTEnumAdapters2() is unavailable.
\n
"
);
return
;
return
;
}
}
...
...
dlls/win32u/sysparams.c
View file @
223292da
...
@@ -6656,6 +6656,80 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
...
@@ -6656,6 +6656,80 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
*/
*/
NTSTATUS
WINAPI
NtGdiDdDDIEnumAdapters2
(
D3DKMT_ENUMADAPTERS2
*
desc
)
NTSTATUS
WINAPI
NtGdiDdDDIEnumAdapters2
(
D3DKMT_ENUMADAPTERS2
*
desc
)
{
{
FIXME
(
" (%p): stub
\n
"
,
desc
);
D3DKMT_OPENADAPTERFROMLUID
open_adapter_from_luid
;
return
STATUS_PROCEDURE_NOT_FOUND
;
static
const
ULONG
max_adapters
=
34
;
D3DKMT_CLOSEADAPTER
close_adapter
;
NTSTATUS
status
=
STATUS_SUCCESS
;
ULONG
idx
=
0
,
count
;
struct
gpu
*
gpu
;
TRACE
(
"(%p)
\n
"
,
desc
);
if
(
!
desc
)
return
STATUS_INVALID_PARAMETER
;
if
(
!
desc
->
pAdapters
)
{
desc
->
NumAdapters
=
max_adapters
;
return
STATUS_SUCCESS
;
}
if
(
!
lock_display_devices
())
return
STATUS_UNSUCCESSFUL
;
if
((
count
=
list_count
(
&
gpus
))
>
max_adapters
)
{
WARN
(
"Too many adapters (%u), only up to %u can be enumerated.
\n
"
,
(
unsigned
int
)
count
,
(
unsigned
int
)
max_adapters
);
count
=
max_adapters
;
}
if
(
count
>
desc
->
NumAdapters
)
{
status
=
STATUS_BUFFER_TOO_SMALL
;
goto
done
;
}
LIST_FOR_EACH_ENTRY
(
gpu
,
&
gpus
,
struct
gpu
,
entry
)
{
if
(
gpu
->
luid
.
LowPart
||
gpu
->
luid
.
HighPart
)
{
open_adapter_from_luid
.
AdapterLuid
=
gpu
->
luid
;
/* give the GDI driver a chance to be notified about new adapter handle */
if
(
NT_SUCCESS
(
NtGdiDdDDIOpenAdapterFromLuid
(
&
open_adapter_from_luid
)
))
{
desc
->
pAdapters
[
idx
].
hAdapter
=
open_adapter_from_luid
.
hAdapter
;
desc
->
pAdapters
[
idx
].
AdapterLuid
=
gpu
->
luid
;
desc
->
pAdapters
[
idx
].
NumOfSources
=
gpu
->
adapter_count
;
desc
->
pAdapters
[
idx
].
bPrecisePresentRegionsPreferred
=
FALSE
;
idx
+=
1
;
continue
;
}
else
{
ERR
(
"Failed to open adapter %u from LUID.
\n
"
,
(
unsigned
int
)
idx
);
}
}
else
{
ERR
(
"Adapter %u does not have a LUID.
\n
"
,
(
unsigned
int
)
idx
);
}
while
(
idx
--
)
{
close_adapter
.
hAdapter
=
desc
->
pAdapters
[
idx
].
hAdapter
;
NtGdiDdDDICloseAdapter
(
&
close_adapter
);
}
memset
(
desc
->
pAdapters
,
0
,
desc
->
NumAdapters
*
sizeof
(
D3DKMT_ADAPTERINFO
)
);
status
=
STATUS_UNSUCCESSFUL
;
break
;
}
done:
if
(
status
==
STATUS_SUCCESS
)
desc
->
NumAdapters
=
idx
;
unlock_display_devices
();
return
status
;
}
}
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