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
c4073d5a
Commit
c4073d5a
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_RemovalPolicy for GPUs.
parent
bee387dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
driver.c
dlls/gdi32/tests/driver.c
+8
-0
sysparams.c
dlls/win32u/sysparams.c
+19
-0
cfgmgr32.h
include/cfgmgr32.h
+4
-0
No files found.
dlls/gdi32/tests/driver.c
View file @
c4073d5a
...
...
@@ -33,6 +33,7 @@
#include "setupapi.h"
#include "ntddvdeo.h"
#include "devpkey.h"
#include "cfgmgr32.h"
#include "wine/test.h"
...
...
@@ -1042,6 +1043,13 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
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
);
}
ret
=
SetupDiGetDevicePropertyW
(
set
,
&
device_data
,
&
DEVPKEY_Device_RemovalPolicy
,
&
type
,
(
BYTE
*
)
&
value
,
sizeof
(
value
),
NULL
,
0
);
ok
(
ret
,
"Got unexpected ret %d, GetLastError() %lu, %s.
\n
"
,
ret
,
GetLastError
(),
debugstr_w
(
device_id
));
ok
(
value
==
CM_REMOVAL_POLICY_EXPECT_NO_REMOVAL
||
value
==
CM_REMOVAL_POLICY_EXPECT_ORDERLY_REMOVAL
||
value
==
CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL
,
"Got value %d.
\n
"
,
value
);
ok
(
type
==
DEVPROP_TYPE_UINT32
,
"Got type %ld.
\n
"
,
type
);
++
i
;
}
SetupDiDestroyDeviceInfoList
(
set
);
...
...
dlls/win32u/sysparams.c
View file @
c4073d5a
...
...
@@ -32,6 +32,7 @@
#include "ntgdi_private.h"
#include "ntuser_private.h"
#include "devpropdef.h"
#include "cfgmgr32.h"
#include "wine/wingdi16.h"
#include "wine/server.h"
...
...
@@ -109,6 +110,14 @@ static const WCHAR devpkey_device_bus_number[] =
'\\'
,
'0'
,
'0'
,
'1'
,
'7'
};
static
const
WCHAR
devpkey_device_removal_policy
[]
=
{
'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'
,
'2'
,
'1'
};
static
const
WCHAR
devpropkey_device_ispresentW
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
...
...
@@ -1256,6 +1265,16 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
}
}
if
((
subkey
=
reg_create_key
(
hkey
,
devpkey_device_removal_policy
,
sizeof
(
devpkey_device_removal_policy
),
0
,
NULL
)))
{
unsigned
int
removal_policy
=
CM_REMOVAL_POLICY_EXPECT_NO_REMOVAL
;
set_reg_value
(
subkey
,
NULL
,
0xffff0000
|
DEVPROP_TYPE_UINT32
,
&
removal_policy
,
sizeof
(
removal_policy
)
);
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
)
);
...
...
include/cfgmgr32.h
View file @
c4073d5a
...
...
@@ -180,6 +180,10 @@ typedef DWORD CONFIGRET;
#define CM_REGISTRY_USER 0x0100
#define CM_REGISTRY_CONFIG 0x0200
#define CM_REMOVAL_POLICY_EXPECT_NO_REMOVAL 1
#define CM_REMOVAL_POLICY_EXPECT_ORDERLY_REMOVAL 2
#define CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL 3
typedef
DWORD
DEVINST
,
*
PDEVINST
;
typedef
DWORD
DEVNODE
,
*
PDEVNODE
;
typedef
HANDLE
HMACHINE
,
*
PHMACHINE
;
...
...
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