Hans is correct. I have a computer that is part of the AD domain, and before logging into the domain GetUserNameEx(3) returns error 1332 (ERROR_NONE_MAPPED). After entering the domain GetUserNameEx(3) returns name that is equal to the displayName field in the LDAP database. Behaviour is the same for Windows 7 and Windows 10.