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
bee387dc
Commit
bee387dc
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_BusNumber for GPUs.
parent
80910517
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
driver.c
dlls/gdi32/tests/driver.c
+12
-0
sysparams.c
dlls/win32u/sysparams.c
+19
-0
No files found.
dlls/gdi32/tests/driver.c
View file @
bee387dc
...
@@ -1006,6 +1006,7 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
...
@@ -1006,6 +1006,7 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
WCHAR
device_id
[
256
];
WCHAR
device_id
[
256
];
DEVPROPTYPE
type
;
DEVPROPTYPE
type
;
unsigned
int
i
;
unsigned
int
i
;
UINT32
value
;
HDEVINFO
set
;
HDEVINFO
set
;
BOOL
ret
;
BOOL
ret
;
...
@@ -1030,6 +1031,17 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
...
@@ -1030,6 +1031,17 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu.
\n
"
,
ret
,
GetLastError
());
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu.
\n
"
,
ret
,
GetLastError
());
ok
(
type
==
DEVPROP_TYPE_STRING
,
"Got type %ld.
\n
"
,
type
);
ok
(
type
==
DEVPROP_TYPE_STRING
,
"Got type %ld.
\n
"
,
type
);
ret
=
SetupDiGetDevicePropertyW
(
set
,
&
device_data
,
&
DEVPKEY_Device_BusNumber
,
&
type
,
(
BYTE
*
)
&
value
,
sizeof
(
value
),
NULL
,
0
);
if
(
!
wcsicmp
(
device_id
,
L"root
\\
basicrender"
)
||
!
wcsicmp
(
device_id
,
L"root
\\
basicdisplay"
))
{
ok
(
!
ret
,
"Found Bus Id.
\n
"
);
}
else
{
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu, %s.
\n
"
,
ret
,
GetLastError
(),
debugstr_w
(
device_id
));
ok
(
type
==
DEVPROP_TYPE_UINT32
,
"Got type %ld.
\n
"
,
type
);
}
++
i
;
++
i
;
}
}
SetupDiDestroyDeviceInfoList
(
set
);
SetupDiDestroyDeviceInfoList
(
set
);
...
...
dlls/win32u/sysparams.c
View file @
bee387dc
...
@@ -101,6 +101,14 @@ static const WCHAR devpkey_device_matching_device_id[] =
...
@@ -101,6 +101,14 @@ static const WCHAR devpkey_device_matching_device_id[] =
'\\'
,
'0'
,
'0'
,
'0'
,
'8'
'\\'
,
'0'
,
'0'
,
'0'
,
'8'
};
};
static
const
WCHAR
devpkey_device_bus_number
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
'\\'
,
'{'
,
'A'
,
'4'
,
'5'
,
'C'
,
'2'
,
'5'
,
'4'
,
'E'
,
'-'
,
'D'
,
'F'
,
'1'
,
'C'
,
'-'
,
'4'
,
'E'
,
'F'
,
'D'
,
'-'
,
'8'
,
'0'
,
'2'
,
'0'
,
'-'
,
'6'
,
'7'
,
'D'
,
'1'
,
'4'
,
'6'
,
'A'
,
'8'
,
'5'
,
'0'
,
'E'
,
'0'
,
'}'
,
'\\'
,
'0'
,
'0'
,
'1'
,
'7'
};
static
const
WCHAR
devpropkey_device_ispresentW
[]
=
static
const
WCHAR
devpropkey_device_ispresentW
[]
=
{
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
...
@@ -1237,6 +1245,17 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
...
@@ -1237,6 +1245,17 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
NtClose
(
subkey
);
NtClose
(
subkey
);
}
}
if
(
gpu
->
vendor_id
&&
gpu
->
device_id
)
{
if
((
subkey
=
reg_create_key
(
hkey
,
devpkey_device_bus_number
,
sizeof
(
devpkey_device_bus_number
),
0
,
NULL
)))
{
set_reg_value
(
subkey
,
NULL
,
0xffff0000
|
DEVPROP_TYPE_UINT32
,
&
gpu_index
,
sizeof
(
gpu_index
)
);
NtClose
(
subkey
);
}
}
desc
=
gpu
->
name
;
desc
=
gpu
->
name
;
if
(
!
desc
[
0
])
desc
=
wine_adapterW
;
if
(
!
desc
[
0
])
desc
=
wine_adapterW
;
set_reg_value
(
hkey
,
device_descW
,
REG_SZ
,
desc
,
(
lstrlenW
(
desc
)
+
1
)
*
sizeof
(
WCHAR
)
);
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