title: Read EDID direct from monitor NO drivers
body: <p>I got this <a href="/questions/tagged/c%23" class="post-tag" title="show questions tagged 'c#'" rel="tag">c#</a> project where I'm trying to extract the <a href="/questions/tagged/edid" class="post-tag" title="show questions tagged 'edid'" rel="tag">edid</a> directly from the monitor. 
  The goal is to make a application which can run on <a href="/questions/tagged/winpe" class="post-tag" title="show questions tagged 'winpe'" rel="tag">winpe</a> without any drivers installed.
  I know it is possible to get the information with the registration database or <a href="/questions/tagged/wmi" class="post-tag" title="show questions tagged 'wmi'" rel="tag">wmi</a>, but this is not possible in this project because it won't provide the correct information without drivers installed. We got this attached code that works, but I guess it asks the drivers for the resolutions, because it won't work when we try on a <a href="/questions/tagged/winpe" class="post-tag" title="show questions tagged 'winpe'" rel="tag">winpe</a> installation.
  Here's the code that can display the resolutions, when the drivers are installed..</p>
  
  <pre><code>[DllImport("user32.dll")]
  [return: MarshalAs(UnmanagedType.Bool)]
  private static extern bool EnumDisplaySettings([MarshalAs(UnmanagedType.LPStr)] string lpszDeviceName, int iModeNum, out Program.DEVMODE lpDevMode);
  public static List&lt;Tuple&lt;int, int&gt;&gt; GetScreenResolutions()
  {
      List&lt;Tuple&lt;int, int&gt;&gt; list = new List&lt;Tuple&lt;int, int&gt;&gt;();
      try
      {
          int num = 0;
          Program.DEVMODE dEVMODE;
          while (Program.EnumDisplaySettings(null, num++, out dEVMODE))
          {
              Tuple&lt;int, int&gt; item = Tuple.Create&lt;int, int&gt;(dEVMODE.dmPelsWidth, dEVMODE.dmPelsHeight);
              if (!list.Contains(item))
              {
                  list.Add(item);
              }
          }
      }
      catch
      {
          Console.WriteLine("Could not get screen resolutions.");
      }
      return list;
  }
  </code></pre>