Status = STATUS_NOT_IMPLEMENTED;
break;
+ case IOCTL_VIDEO_ENUM_MONITOR_PDO:
+ WARN_(VIDEOPRT, "- IOCTL_VIDEO_ENUM_MONITOR_PDO is UNIMPLEMENTED!\n");
+ Status = STATUS_NOT_IMPLEMENTED;
+ break;
+
case IOCTL_VIDEO_INIT_WIN32K_CALLBACKS:
INFO_(VIDEOPRT, "- IOCTL_VIDEO_INIT_WIN32K_CALLBACKS\n");
Status = VideoPortInitWin32kCallbacks(DeviceObject,
// if (Win32kCallbacks.DualviewFlags & ???)
pGraphicsDevice->PhysDeviceHandle = Win32kCallbacks.pPhysDeviceObject;
+ /* FIXME: Enumerate children monitor devices for this video adapter
+ *
+ * - Force the adapter to re-enumerate its monitors:
+ * IoSynchronousInvalidateDeviceRelations(pdo, BusRelations)
+ *
+ * - Retrieve all monitor PDOs from VideoPrt:
+ * EngDeviceIoControl(0x%p, IOCTL_VIDEO_ENUM_MONITOR_PDO)
+ *
+ * - Initialize these fields and structures accordingly:
+ * pGraphicsDevice->dwMonCnt
+ * pGraphicsDevice->pvMonDev[0..dwMonCnt-1]
+ */
+
/* Copy the device name */
RtlStringCbCopyNW(pGraphicsDevice->szNtDeviceName,
sizeof(pGraphicsDevice->szNtDeviceName),
if (pustrDevice && pustrDevice->Buffer)
{
- /* Loop through the list of devices */
+ /* Find specified video adapter by name */
for (pGraphicsDevice = gpGraphicsDeviceFirst;
pGraphicsDevice;
pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice)
break;
}
}
+
+ if (pGraphicsDevice)
+ {
+ /* Validate selected monitor number */
+#if 0
+ if (iDevNum >= pGraphicsDevice->dwMonCnt)
+ pGraphicsDevice = NULL;
+#else
+ /* FIXME: dwMonCnt not initialized, see EngpRegisterGraphicsDevice */
+#endif
+ }
}
else
{
- /* Loop through the list of devices */
+ /* Select video adapter by device number */
for (pGraphicsDevice = gpGraphicsDeviceFirst, i = 0;
pGraphicsDevice && i < iDevNum;
pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice, i++);
DWORD dwFlags)
{
PGRAPHICS_DEVICE pGraphicsDevice;
+ PDEVICE_OBJECT pdo;
PWCHAR pHardwareId;
ULONG cbSize, dwLength;
HKEY hkey;
pdispdev->DeviceID[0] = UNICODE_NULL;
/* Fill in DeviceID */
- if (pGraphicsDevice->PhysDeviceHandle != NULL)
+ if (!pustrDevice)
+ pdo = pGraphicsDevice->PhysDeviceHandle;
+ else
+#if 0
+ pdo = pGraphicsDevice->pvMonDev[iDevNum].pdo;
+#else
+ /* FIXME: pvMonDev not initialized, see EngpRegisterGraphicsDevice */
+ pdo = NULL;
+#endif
+
+ if (pdo != NULL)
{
- Status = IoGetDeviceProperty(pGraphicsDevice->PhysDeviceHandle,
+ Status = IoGetDeviceProperty(pdo,
DevicePropertyHardwareID,
0,
NULL,
return STATUS_INSUFFICIENT_RESOURCES;
}
- Status = IoGetDeviceProperty(pGraphicsDevice->PhysDeviceHandle,
+ Status = IoGetDeviceProperty(pdo,
DevicePropertyHardwareID,
dwLength,
pHardwareId,
* which usually is the longest one and unique enough */
RtlStringCbCopyW(pdispdev->DeviceID, sizeof(pdispdev->DeviceID), pHardwareId);
- /* For monitors it should be the first Hardware ID
- * concatenated with the unique driver registry key */
+ if (pustrDevice)
+ {
+ /* For monitors it should be the first Hardware ID,
+ * which we already have obtained above,
+ * concatenated with the unique driver registry key */
+
+ RtlStringCbCatW(pdispdev->DeviceID, sizeof(pdispdev->DeviceID), L"\\");
+
+ /* FIXME: DevicePropertyDriverKeyName string should be appended */
+ pHardwareId[0] = UNICODE_NULL;
+ RtlStringCbCatW(pdispdev->DeviceID, sizeof(pdispdev->DeviceID), pHardwareId);
+ }
- /* FIXME: Handle monitors! */
TRACE("Hardware ID: %ls\n", pdispdev->DeviceID);
}