[MSTSC] Send computer name as client name when available. Patch by Stas'M. Thanks...
authorPeter Hater <7element@mail.bg>
Wed, 17 May 2017 10:47:39 +0000 (10:47 +0000)
committerPeter Hater <7element@mail.bg>
Wed, 17 May 2017 10:47:39 +0000 (10:47 +0000)
svn path=/trunk/; revision=74567

reactos/base/applications/mstsc/win32.c

index 91cb4a8..1bc1a76 100644 (file)
@@ -1125,6 +1125,7 @@ wWinMain(HINSTANCE hInstance,
                                                       pRdpSettings))
                 {
                     char szValue[MAXVALUE];
                                                       pRdpSettings))
                 {
                     char szValue[MAXVALUE];
+                    DWORD dwSize = MAXVALUE;
 
                     uni_to_str(szValue, GetStringFromSettings(pRdpSettings, L"full address"));
 
 
                     uni_to_str(szValue, GetStringFromSettings(pRdpSettings, L"full address"));
 
@@ -1134,7 +1135,10 @@ wWinMain(HINSTANCE hInstance,
                     uni_to_str(szValue, GetStringFromSettings(pRdpSettings, L"username"));
                     SetDomainAndUsername(szValue);
                     strcpy(g_password, "");
                     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);
                     g_server_depth = GetIntegerFromSettings(pRdpSettings, L"session bpp");
                     g_screen_width = GetSystemMetrics(SM_CXSCREEN);
                     g_screen_height = GetSystemMetrics(SM_CYSCREEN);