title: Calling Win32 functions returning strings with alien in Lua
body: <p>I'm trying to use <a href="http://alien.luaforge.net/" rel="noreferrer">alien</a> to call Win32 functions. I tried this code, but it crashes and I don't understand why.</p>
  
  <pre><code>require( "alien" )
  
  local f = alien.Kernel32.ExpandEnvironmentStringsA
  f:types( "int", "string", "pointer", "int" )
  local buffer = alien.buffer( 512 )
  f( "%USERPROFILE%", 0, 512 )
  </code></pre>