2 Commits
Author SHA1 Message Date
yuanyuanxiang 8c0351b45b fix(server): show UTF-8 process names correctly in the connections dialog
The connections dialog decoded procName with CA2T(x, CP_UTF8). In this MBCS
build CA2T expands to CA2A, whose nCodePage argument ATL explicitly ignores
(atlconv.h: "(void)nCodePage") - the call just memcpy's the bytes. So the
UTF-8 process names sent by the client were copied verbatim into a CString and
rendered as GBK: Chinese names turned into mojibake while pure-ASCII names
looked fine, since UTF-8 and GBK coincide there.

Display via the established pattern instead (same as the client list and the
process manager): convert UTF-8 to UTF-16 with MultiByteToWideChar and write
the item text with LVM_SETITEMTEXTW, bypassing the ANSI code page entirely.
This also keeps Chinese names readable on servers running a non-Chinese ACP.

The sort key keeps the raw UTF-8 bytes: byte-wise comparison of UTF-8 equals
code-point order, and no characters can be lost in conversion.
2026-11-02 19:39:17 +01:00
yuanyuanxianganddeepseek-v4-pro bbdb4104bf Feature: TCP/UDP connection management with force-disconnect
Add a connection-management feature to YAMA: a toolbar button (after MCP)
opens a dialog listing the managed host's TCP/UDP connections, with
right-click force-disconnect for IPv4 TCP rows.

Client: a new CConnectionsManager enumerates connections via iphlpapi
(GetExtendedTcpTable/GetExtendedUdpTable, IPv4+IPv6) and answers the
refresh and kill commands over a sub-connection.

Server: a new CConnectionsDlg (DialogBase) shows the list with sortable
columns and a right-click menu; the title-bar icon reuses the toolbar's
connection icon (res/connections.ico).

Fix byte order found during review: iphlpapi returns an IPv4 address as a
network-order DWORD and the port's low 16 bits in network order, so
storing them raw made the dialog show reversed IPv4 addresses and ports.
The client now stores addresses as network-order bytes and ports as host
order (ntohs), and reverses the conversion on disconnect.

Co-Authored-By: deepseek-v4-pro
2026-10-04 18:23:06 +02:00