Andrew Schwartzmeyer
052ecc801d
Use icu for Unicode conversion and fix lpnSize
...
A careful reading of the GetUserName documentation and Windows Data
Types says that lpnSize is "the number of TCHARs copied to the
buffer...including the terminating null character," and a TCHAR in this
environment is a CHAR because we assume UNICODE is always defined for
CoreCLR. A CHAR is a byte. So lpSize is number of bytes, not number of
UTF-16 characters as we previously believed.
2015-08-04 14:16:49 -07:00
Andrew Schwartzmeyer
d589ac1cbf
Refactor setting of lpnSize when buffer size is insufficient
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
865fd0a56b
Remove unnecessary static qualifier from const string
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
b36cdcdc12
Use std::string instead of C99 dynamic array
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
bb8d0b793e
Use LOGIN_NAME_MAX instead of L_cuserid
...
Since L_cuserid is only for cuserid, not getlogin_r
Unit test for L_cuserid removed because the macro may not be available
on all platforms.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
876a88c7d8
Set lpnSize when insufficient
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
59eb8a5799
Use L_cuserid instead of 64 and given lpnSize
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
097d2e3821
Factor out using directives
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
14cec68d08
Change global to local static const
...
To avoid polluting the global namespace without using a namespace.
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
00390847e6
Convert get_login_r to UTF-16 and return
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
e14934d06d
Check for invalid parameters in GetUserName
2015-08-03 13:00:34 -07:00
Andrew Schwartzmeyer
83d2162dc1
Use getlogin_r() in GetUserName and map errno
2015-08-03 12:53:39 -07:00
Andrew Schwartzmeyer
197938c6a6
Check locale in GetUserName
2015-08-03 12:53:39 -07:00
Andrew Schwartzmeyer
61b4e5513a
Update GetUserName signature
2015-08-03 12:53:39 -07:00
Peter Honeder
f8f4b5e380
added libps.so, added stub for GetUserName
2015-06-16 14:02:19 -07:00