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
80910517
Commit
80910517
authored
Mar 20, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Apr 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Set DEVPKEY_Device_MatchingDeviceId for GPUs.
parent
2c02d6e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
driver.c
dlls/gdi32/tests/driver.c
+50
-0
sysparams.c
dlls/win32u/sysparams.c
+19
-0
No files found.
dlls/gdi32/tests/driver.c
View file @
80910517
...
...
@@ -32,6 +32,7 @@
#include "initguid.h"
#include "setupapi.h"
#include "ntddvdeo.h"
#include "devpkey.h"
#include "wine/test.h"
...
...
@@ -996,6 +997,54 @@ static void test_D3DKMTQueryVideoMemoryInfo(void)
ok
(
status
==
STATUS_SUCCESS
,
"Got unexpected return code %#lx.
\n
"
,
status
);
}
static
void
test_gpu_device_properties_guid
(
const
GUID
*
devinterface_guid
)
{
BYTE
iface_detail_buffer
[
sizeof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_W
)
+
256
*
sizeof
(
WCHAR
)];
SP_DEVINFO_DATA
device_data
=
{
sizeof
(
device_data
)};
SP_DEVICE_INTERFACE_DATA
iface
=
{
sizeof
(
iface
)};
SP_DEVICE_INTERFACE_DETAIL_DATA_W
*
iface_data
;
WCHAR
device_id
[
256
];
DEVPROPTYPE
type
;
unsigned
int
i
;
HDEVINFO
set
;
BOOL
ret
;
/* Make sure display devices are initialized. */
SendMessageW
(
GetDesktopWindow
(),
WM_NULL
,
0
,
0
);
set
=
SetupDiGetClassDevsW
(
devinterface_guid
,
NULL
,
NULL
,
DIGCF_DEVICEINTERFACE
|
DIGCF_PRESENT
);
ok
(
set
!=
INVALID_HANDLE_VALUE
,
"SetupDiGetClassDevs failed, error %lu.
\n
"
,
GetLastError
());
iface_data
=
(
SP_DEVICE_INTERFACE_DETAIL_DATA_W
*
)
iface_detail_buffer
;
iface_data
->
cbSize
=
sizeof
(
*
iface_data
);
i
=
0
;
while
(
SetupDiEnumDeviceInterfaces
(
set
,
NULL
,
devinterface_guid
,
i
,
&
iface
))
{
ret
=
SetupDiGetDeviceInterfaceDetailW
(
set
,
&
iface
,
iface_data
,
sizeof
(
iface_detail_buffer
),
NULL
,
&
device_data
);
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu.
\n
"
,
ret
,
GetLastError
());
ret
=
SetupDiGetDevicePropertyW
(
set
,
&
device_data
,
&
DEVPKEY_Device_MatchingDeviceId
,
&
type
,
(
BYTE
*
)
device_id
,
sizeof
(
device_id
),
NULL
,
0
);
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu.
\n
"
,
ret
,
GetLastError
());
ok
(
type
==
DEVPROP_TYPE_STRING
,
"Got type %ld.
\n
"
,
type
);
++
i
;
}
SetupDiDestroyDeviceInfoList
(
set
);
}
static
void
test_gpu_device_properties
(
void
)
{
winetest_push_context
(
"GUID_DEVINTERFACE_DISPLAY_ADAPTER"
);
test_gpu_device_properties_guid
(
&
GUID_DEVINTERFACE_DISPLAY_ADAPTER
);
winetest_pop_context
();
winetest_push_context
(
"GUID_DISPLAY_DEVICE_ARRIVAL"
);
test_gpu_device_properties_guid
(
&
GUID_DISPLAY_DEVICE_ARRIVAL
);
winetest_pop_context
();
}
START_TEST
(
driver
)
{
HMODULE
gdi32
=
GetModuleHandleA
(
"gdi32.dll"
);
...
...
@@ -1025,6 +1074,7 @@ START_TEST(driver)
test_D3DKMTCheckOcclusion
();
test_D3DKMTOpenAdapterFromDeviceName
();
test_D3DKMTQueryVideoMemoryInfo
();
test_gpu_device_properties
();
FreeLibrary
(
dwmapi
);
}
dlls/win32u/sysparams.c
View file @
80910517
...
...
@@ -93,6 +93,14 @@ static const WCHAR devpropkey_gpu_luidW[] =
'\\'
,
'0'
,
'0'
,
'0'
,
'2'
};
static
const
WCHAR
devpkey_device_matching_device_id
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
'\\'
,
'{'
,
'A'
,
'8'
,
'B'
,
'8'
,
'6'
,
'5'
,
'D'
,
'D'
,
'-'
,
'2'
,
'E'
,
'3'
,
'D'
,
'-'
,
'4'
,
'0'
,
'9'
,
'4'
,
'-'
,
'A'
,
'D'
,
'9'
,
'7'
,
'-'
,
'E'
,
'5'
,
'9'
,
'3'
,
'A'
,
'7'
,
'0'
,
'C'
,
'7'
,
'5'
,
'D'
,
'6'
,
'}'
,
'\\'
,
'0'
,
'0'
,
'0'
,
'8'
};
static
const
WCHAR
devpropkey_device_ispresentW
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
...
...
@@ -1218,6 +1226,17 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
bufferW
[
size
/
sizeof
(
WCHAR
)]
=
0
;
/* for REG_MULTI_SZ */
set_reg_value
(
hkey
,
hardware_idW
,
REG_MULTI_SZ
,
bufferW
,
size
+
sizeof
(
WCHAR
)
);
if
((
subkey
=
reg_create_key
(
hkey
,
devpkey_device_matching_device_id
,
sizeof
(
devpkey_device_matching_device_id
),
0
,
NULL
)))
{
if
(
gpu
->
vendor_id
&&
gpu
->
device_id
)
set_reg_value
(
subkey
,
NULL
,
0xffff0000
|
DEVPROP_TYPE_STRING
,
bufferW
,
size
);
else
set_reg_value
(
subkey
,
NULL
,
0xffff0000
|
DEVPROP_TYPE_STRING
,
bufferW
,
asciiz_to_unicode
(
bufferW
,
"ROOT
\\
BasicRender"
));
NtClose
(
subkey
);
}
desc
=
gpu
->
name
;
if
(
!
desc
[
0
])
desc
=
wine_adapterW
;
set_reg_value
(
hkey
,
device_descW
,
REG_SZ
,
desc
,
(
lstrlenW
(
desc
)
+
1
)
*
sizeof
(
WCHAR
)
);
...
...
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