PS:
A buffer size of (UNLEN + 1) characters will hold the maximum length user name including the terminating null character. UNLEN is defined in Lmcons.h.
And Lmcons.h defines UNLEN as being 256 characters. So I suppose the correct length for the (unicode) buffer should be 2*(256+1)
PS2:
quote:
// Free the memory we allocated
sBuffer.Size = 0;
lBuffer.Size = 0;
Will be done automatically as soon as the function ends since the two are local variables though.