quote:
Originally posted by Eljay
not as nicely styled as matty's but at least mine works
code:
function GetUserName()
{
var sBuffer = Interop.Allocate((255+1) * 2);
var nBufferLength = Interop.Allocate(4);
nBufferLength.WriteDWORD(0, 255);
Interop.Call('advapi32.dll', 'GetUserNameW', sBuffer, nBufferLength);
Debug.Trace('sBuffer: ' + sBuffer.ReadString(0));
}
Oops... I forgot about the last param needing to be a datablock too. I will update mine.