* uinfo.cc (cygheap_user::init): Call GetUserNameW and convert to
multibyte here so as not to rely on the current ANSI page.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | ||||
| 2010-09-26  Corinna Vinschen  <corinna@vinschen.de> | ||||
|  | ||||
| 	* uinfo.cc (cygheap_user::init): Call GetUserNameW and convert to | ||||
| 	multibyte here so as not to rely on the current ANSI page. | ||||
|  | ||||
| 2010-09-26  Christopher Faylor  <me+cygwin@cgf.cx> | ||||
|  | ||||
| 	* dcrt0.cc (__main): Force signal synchronization. | ||||
|   | ||||
| @@ -37,10 +37,15 @@ details. */ | ||||
| void | ||||
| cygheap_user::init () | ||||
| { | ||||
|   char user_name[UNLEN + 1]; | ||||
|   WCHAR user_name[UNLEN + 1]; | ||||
|   DWORD user_name_len = UNLEN + 1; | ||||
|  | ||||
|   set_name (GetUserName (user_name, &user_name_len) ? user_name : "unknown"); | ||||
|   if (!GetUserNameW (user_name, &user_name_len)) | ||||
|     wcpcpy (user_name, L"unknown"); | ||||
|  | ||||
|   char mb_user_name[user_name_len = sys_wcstombs (NULL, 0, user_name)]; | ||||
|   sys_wcstombs (mb_user_name, user_name_len, user_name); | ||||
|   set_name (mb_user_name); | ||||
|  | ||||
|   DWORD siz; | ||||
|   PSECURITY_DESCRIPTOR psd; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user