title: Enumerating a List of systems Com Ports in Delphi
body: <p><strong>Objective:</strong> I would like to be able to list the available COM Ports on a system in Delphi.</p>
  
  <p><strong>Homework:</strong>
  I have read <a href="https://stackoverflow.com/questions/374200/finding-available-lpt-parallel-ports-and-addresses-in-delphi">this</a> SO thread on enumerating the LPT ports of a system using the registry. I have also found that the COM ports are listed in the registry at <code>HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM</code> but found unanswered gesticulation in the <a href="http://forums.devshed.com/delphi-programming-90/list-of-com-ports-on-machine-510990.html" rel="nofollow noreferrer">same thread</a> that this might not be reliable on different machines and different versions of windows.</p>
  
  <p>I also found articles referencing the use of QueryDosDevice() but upon trying <a href="http://delphi.about.com/cs/adptips2001/a/bltip0501_2.htm" rel="nofollow noreferrer">this sample code</a>, I found that it did not appear to list any COM ports at all.</p>
  
  <p><strong>Question:</strong> What is the most reliable way (across unknown Windows Versions) to list the COM ports on a Windows Machine? </p>