informacion sacada de allapi.net
GetUserNameEx
Requires Windows 2000 or later; Win9x/ME: Not supported
The GetUserNameEx function retrieves the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name.
en que SO lo estas Ejecutando ?