-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0004-setupapi-SetupDiGetDeviceRegistryProperty-now-return.patch
More file actions
57 lines (51 loc) · 2.03 KB
/
0004-setupapi-SetupDiGetDeviceRegistryProperty-now-return.patch
File metadata and controls
57 lines (51 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 30482750d2541bbe7bc7c91b33ccc5ce4697a5f1 Mon Sep 17 00:00:00 2001
From: JS Deck <jsdeckerido@gmail.com>
Date: Sun, 7 Dec 2025 02:55:09 -0400
Subject: [PATCH 04/11] setupapi: SetupDiGetDeviceRegistryProperty now returns
all lower case for SPDRP_BASE_CONTAINERID; SetupDiGetDeviceRegistryPropertyA
should return wide string for type GUID.
---
dlls/setupapi/devinst.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 7690a50506b..b1f55f80145 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -3699,7 +3699,16 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(HDEVINFO devinfo,
if (Property < ARRAY_SIZE(PropertyMap) && PropertyMap[Property].nameA)
{
DWORD size = PropertyBufferSize;
- LONG l = RegQueryValueExA(device->key, PropertyMap[Property].nameA,
+ LONG l;
+
+ /* Despite GUID returned as REG_SZ, it's always wide string on Windows. */
+ if (PropertyMap[Property].devPropType == DEVPROP_TYPE_GUID)
+ return SetupDiGetDeviceRegistryPropertyW(
+ devinfo, device_data, Property, PropertyRegDataType,
+ PropertyBuffer, PropertyBufferSize, RequiredSize
+ );
+
+ l = RegQueryValueExA(device->key, PropertyMap[Property].nameA,
NULL, PropertyRegDataType, PropertyBuffer, &size);
if (l == ERROR_FILE_NOT_FOUND)
@@ -3713,6 +3722,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(HDEVINFO devinfo,
if (RequiredSize)
*RequiredSize = size;
}
+
return ret;
}
@@ -3754,7 +3764,12 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO devinfo,
SetLastError(l);
if (RequiredSize)
*RequiredSize = size;
+
+ /* Death Stranding Director's Cut expect the containerId string to be all lower case. */
+ if (ret && PropertyMap[Property].devPropType == DEVPROP_TYPE_GUID)
+ _wcslwr((LPWSTR)PropertyBuffer);
}
+
return ret;
}
--
2.53.0