Skip to content

Commit cfde03e

Browse files
committed
[VIDEOPRT] Write monitor EDID to registry
This will be used later by win32k to give only valid display modes to user mode.
1 parent 177cbd8 commit cfde03e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

win32ss/drivers/videoprt/child.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ IntVideoPortChildQueryId(
121121
{
122122
PWCHAR Buffer = NULL, StaticBuffer;
123123
UNICODE_STRING UnicodeStr;
124+
HANDLE hKey;
125+
NTSTATUS Status;
124126

125127
switch (IrpSp->Parameters.QueryId.IdType)
126128
{
@@ -197,6 +199,22 @@ IntVideoPortChildQueryId(
197199
/* Add the second null terminator */
198200
Buffer[wcslen(StaticBuffer) + 1] = UNICODE_NULL;
199201
}
202+
203+
/* Try to write EDID to registry (ignore errors) */
204+
Status = IoOpenDeviceRegistryKey(ChildExtension->PhysicalDeviceObject,
205+
PLUGPLAY_REGKEY_DEVICE,
206+
MAXIMUM_ALLOWED,
207+
&hKey);
208+
if (NT_SUCCESS(Status))
209+
{
210+
Status = RtlWriteRegistryValue(RTL_REGISTRY_HANDLE,
211+
hKey,
212+
ChildExtension->EdidValid ? L"EDID" : L"BAD_EDID",
213+
REG_BINARY,
214+
ChildExtension->ChildDescriptor,
215+
sizeof(ChildExtension->ChildDescriptor));
216+
ZwClose(hKey);
217+
}
200218
break;
201219
default:
202220
ASSERT(FALSE);

0 commit comments

Comments
 (0)