title: Accessing physical cdrom device directly
body: <p>Iam trying to access a physical cdrom device in order to check if it is bootable so i need to read bytes from it. I've tried the following 2 ways with no luck:</p>
  
  <p>Method A:</p>
  
  <pre><code>FileStream stream = new FileStream(H:, FileMode.Open);
  </code></pre>
  
  <p>but i get access denied on H:. which i know i have access.</p>
  
  <p>Method B:
      Through Pinvoke</p>
  
  <pre><code>  IntPtr handle = CreateFile(source, FileAccess.Read, FileShare.ReadWrite, 0, FileMode.Open, 0, IntPtr.Zero);
              binReader = new BinaryReader(new FileStream(handle, FileAccess.Read,true));
  </code></pre>
  
  <p>But i get:</p>
  
  <p>FileStream will not open Win32 devices such as disk partitions and tape drives.
  Avoid use of "\.\" in the path.</p>
  
  <p>Is there any way to accomplish what i want in c#?</p>
  
  <p>Thanks alot </p>