From 3b8f70ea2eebae6ae026ce3adce688aa585e4a47 Mon Sep 17 00:00:00 2001 From: lwch Date: Fri, 29 Oct 2021 18:55:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3vnc=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/client/tunnel/vnc/core/capture.go | 1 + code/client/tunnel/vnc/core/process_windows.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/client/tunnel/vnc/core/capture.go b/code/client/tunnel/vnc/core/capture.go index 22dc85a..4e779d2 100644 --- a/code/client/tunnel/vnc/core/capture.go +++ b/code/client/tunnel/vnc/core/capture.go @@ -30,5 +30,6 @@ func captureOK(conn *websocket.Conn, bits, width, height int, data []byte) { Data: data, }, } + data, _ = proto.Marshal(&msg) conn.WriteMessage(websocket.BinaryMessage, data) } diff --git a/code/client/tunnel/vnc/core/process_windows.go b/code/client/tunnel/vnc/core/process_windows.go index 8c61ee3..bb33d5a 100644 --- a/code/client/tunnel/vnc/core/process_windows.go +++ b/code/client/tunnel/vnc/core/process_windows.go @@ -103,7 +103,9 @@ func createWorker(confDir string, tk windows.Token) (*Process, error) { startup.Flags = windows.STARTF_USESHOWWINDOW cmd := windows.StringToUTF16Ptr(dir + fmt.Sprintf(" -conf %s -action vnc.worker -vport %d", confDir, port)) if tk == 0 { - err = windows.CreateProcess(nil, cmd, nil, nil, false, windows.DETACHED_PROCESS, nil, nil, &startup, &process) + // only for debug + startup.Flags = 0 + err = windows.CreateProcess(nil, cmd, nil, nil, false, windows.CREATE_NEW_CONSOLE, nil, nil, &startup, &process) } else { err = windows.CreateProcessAsUser(tk, nil, cmd, nil, nil, false, windows.DETACHED_PROCESS, nil, nil, &startup, &process) }