修正vnc发送数据类型问题

This commit is contained in:
lwch
2021-10-29 18:55:19 +08:00
parent ab3c7fd476
commit 3b8f70ea2e
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -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)
}
@@ -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)
}