title: How Do I Properly Call GetLongPathName Using Delphi 2009 and Unicode Strings?
body: <p>I need to change the old Win98 short path names to long path names. I had a routine that worked fine with Delphi 4, but when I upgraded to Delphi 2009 and Unicode, it didn't work with Unicode strings.</p>
  
  <p>I looked around and couldn't find a Unicode-compatible version of it.</p>
  
  <p>It appears that the correct routine to use is <a href="http://msdn.microsoft.com/en-us/library/aa364980.aspx" rel="nofollow noreferrer">GetLongPathName from the WinAPI</a>. But it doesn't seem to be in the SysUtils library of Delphi 2009 and I have not been able to figure out how to declare it properly to access the WinAPI routine.</p>
  
  <p>Also, it does seem that it may be tricky to call, because I've read the SO Question: <a href="https://stackoverflow.com/questions/3440492/delphi-tpath-gettemppath-result-is-cropped">Delphi TPath.GetTempPath result is cropped</a> but that didn't help me get to first base.</p>
  
  <p>Can someone please explain how to declare this function and use it properly passing a Unicode string in Delphi 2009?</p>