Feature: Add MCP device management-control tools (kill/window/service/power)
Add P7 management-control tools behind a single McpManage flag (plus
McpReadonly=0): kill_process, operate_window, control_service and
power_action. The write tools run a ready->confirm lifecycle on their
sub-connection, using a new followUp/followUpSent field to tell the two
arrivals of the same TOKEN_*LIST apart; the write command and the follow-up
refresh command go out as two separate Send2Client calls, with a new
WaitSendIdle() (context.h / Server.h) draining the outbound buffer in between
so the same buffer is never WSASend'd concurrently.
McpSettingsDlg gains a "management operations" checkbox (IDC_MCP_MANAGE), the
main toolbar gains an MCP entry button, and en/de/zh-TW strings are synced.
power_action is fire-and-forget over the main connection (no confirmation).
Verified end-to-end against a real Windows 10/VMware client: kill_process
returns remaining:[] and operate_window/control_service return ok:true with
their confirm packet arriving after an HTTP split. Verification surfaced a
prerequisite parser bug, fixed separately in a72e6eb, where HeaderParser
latched m_bShouldUnmask FALSE on HTTP continuation chunks and dropped the
confirm packet.
Co-Authored-By: deepseek-v4-pro
This commit is contained in:
1 parent
a72e6eb391
commit
9eed43bc8d
13 files changed
+932
-10
No files matched your search
@@ -573,6 +573,20 @@ public:
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
// 等待 OutCompressedBuffer 排空。OnClientPostSending 在最后一个 WSASend 完成后
|
||||
// ClearBuffer 使有效长度归零,此处轮询该信号,避免背靠背 Send2Client 对同一缓冲
|
||||
// 并发 WSASend(MCP OnSystemReady 发写命令后补发刷新命令时调用)。
|
||||
bool WaitSendIdle(int timeoutMs) override
|
||||
{
|
||||
ULONGLONG deadline = (timeoutMs > 0) ? (GetTickCount64() + (ULONGLONG)timeoutMs) : 0;
|
||||
while (OutCompressedBuffer.GetBufferLength() != 0) {
|
||||
if (timeoutMs > 0 && GetTickCount64() >= deadline) {
|
||||
return false;
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
VOID SetClientInfo(const CString(&s)[ONLINELIST_MAX], const std::vector<std::string>& a = {})
|
||||
{
|
||||
for (int i = 0; i < ONLINELIST_MAX; i++) {
|
||||
|
||||
Reference in new issue
Block a user