title: Why is COMMON_APPDATA returned as a null string on Windows XP
body: <p>One of my users at a large university (with, I imagine, the aggressive security settings that university IT departments general have on their computers) is getting an <em>empty string</em> returned by Windows XP for CSIDL_COMMON_APPDATA or CSIDL_PERSONAL.  (I'm not sure which of these is returning the empty string, because I haven't yet examined his computer to see how he's installed the software, but I'm pretty sure it's the COMMON_APPDATA...)</p>
  
  <p>Has anyone encountered this or have suggestions on how to deal with this?</p>
  
  <p>Here's the Delphi code I'm using to retrieve the value:</p>
  
  <pre><code>Function GetSpecialFolder( FolderID: Integer):String;
  var
    PIDL: PItemIDList;
    Path: array[0..MAX_PATH] of Char;
  begin
    SHGetSpecialFolderLocation(Application.Handle, FolderID, PIDL);
    SHGetPathFromIDList(PIDL, Path);
    Result := Path;
  end;  { GetSpecialFolder }
  
  ShowMessage(GetSpecialFolder(CSIDL_COMMON_APPDATA));  &lt;--- This is an empty string
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Figuring out this API made me feel like I was chasing my tail - I went in circles trying to find the right call. This method and others similar to it are said to be deprecated by Microsoft (as well as by a earlier poster to this question (@TLama?) who subsequently deleted the post.) But, it seems like most of us, including me, regularly and safely ignore that status.  </p>
  
  <p>In my searches, I found a good answer here on SO from some time ago, including sample code for the <em>non</em>-deprecated way of doing this: <a href="https://stackoverflow.com/questions/11222132/what-causes-this-error-unable-to-write-to-application-file-ini">what causes this error &#39;Unable to write to application file.ini&#39;</a>.</p>