No, and I should have spotted the problem immediately - it requires a pointer to some memory to dump the name into.
Here's the way I'd do it:
GetName as string
GetNameLength as dword
` Create a string large enough to hold the result
GetName = space$(64)
` Allocate 4 bytes to hold the string length in
GetNameLength = make memory(4)
` Poke the string length into that memory (could use my POKE DWORD command here, but we'll do without the Matrix1Utils completely in this code)
*GetNameLength = len(GetName)
print "Loading DLL..."
load dll "advapi32.dll", 1
Result = call dll (1, "GetUserNameA", GetName, GetNameLength)
print GetName
` Release the 4 bytes - we don't really care what windows dumped into the memory
delete memory GetNameLength
delete dll 1
wait key
Others would muck around with memblocks and convert the memblock into string data byte-by-byte - however, since DBPro passes strings around as pointers anyway, we can simply pass the string (it's pointer actually) directly into the function call.