Author: phater
Date: Wed May 17 10:47:39 2017
New Revision: 74567
URL:
http://svn.reactos.org/svn/reactos?rev=74567&view=rev
Log:
[MSTSC] Send computer name as client name when available. Patch by Stas'M. Thanks.
CORE-13237
Modified:
trunk/reactos/base/applications/mstsc/win32.c
Modified: trunk/reactos/base/applications/mstsc/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/wi…
==============================================================================
--- trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] Wed May 17 10:47:39 2017
@@ -1125,6 +1125,7 @@
pRdpSettings))
{
char szValue[MAXVALUE];
+ DWORD dwSize = MAXVALUE;
uni_to_str(szValue, GetStringFromSettings(pRdpSettings, L"full
address"));
@@ -1134,7 +1135,10 @@
uni_to_str(szValue, GetStringFromSettings(pRdpSettings,
L"username"));
SetDomainAndUsername(szValue);
strcpy(g_password, "");
- strcpy(g_hostname, tcp_get_address());
+ if (GetComputerNameA(szValue, &dwSize))
+ strcpy(g_hostname, szValue);
+ else
+ strcpy(g_hostname, tcp_get_address());
g_server_depth = GetIntegerFromSettings(pRdpSettings, L"session
bpp");
g_screen_width = GetSystemMetrics(SM_CXSCREEN);
g_screen_height = GetSystemMetrics(SM_CYSCREEN);