<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 11/25/21 9:07 AM, Zhiyi Zhang wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:90adf6cc-0593-bac0-f9ed-92d8cbb3125a@codeweavers.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       
      <blockquote type="cite"
        cite="mid:406e6e24-5937-743d-7f1e-a4b0b9660ab7@codeweavers.com">
        <pre class="moz-quote-pre" wrap=""> 
+static BOOL update_display_cache(void)
+{
+    struct device_manager_ctx ctx = { 0 };
+
+    user_driver->pUpdateDisplayDevices( &device_manager, FALSE, &ctx );
+    release_display_manager_ctx( &ctx );
+
+    if (update_display_cache_from_registry()) return TRUE;
+    if (ctx.gpu_count)
+    {
+        ERR( "driver reported devices, but we failed to read them\n" );
+        return FALSE;
+    }
+
+    user_driver->pUpdateDisplayDevices( &device_manager, TRUE, &ctx );
+    if (!ctx.gpu_count)
+    {
+        static const struct gdi_monitor default_monitor =
+        {
+            .rc_work.right = 1024,
+            .rc_work.bottom = 768,
+            .rc_monitor.right = 1024,
+            .rc_monitor.bottom = 768,
+            .state_flags = DISPLAY_DEVICE_ACTIVE,</pre>
      </blockquote>
      <br>
      You probably should add DISPLAY_DEVICE_ATTACHED as well.</blockquote>
    <p>
</p>
    <p>Yes, I will add it in v2.
</p>
    <p>
</p>
    <blockquote type="cite"
      cite="mid:90adf6cc-0593-bac0-f9ed-92d8cbb3125a@codeweavers.com">And
      there should be a name, e.g., "Generic Non-PnP Monitor".
      <style type="text/css">p, li { white-space: pre-wrap; }</style>
      <style type="text/css">p, li { white-space: pre-wrap; }</style></blockquote>
    <p>
</p>
    <p>Similar to GPU, default name is handled by add_monitor.</p>
    <p>
</p>
    <p>Thanks,</p>
    <p>Jacek
</p>
  </body>
</html>