mirror of
https://github.com/yv1ing/ShotRDP.git
synced 2025-09-16 15:10:57 +08:00
30 lines
457 B
Go
30 lines
457 B
Go
package main
|
|
|
|
/*
|
|
#include <stdlib.h>
|
|
*/
|
|
import "C"
|
|
import (
|
|
"ShotRDP/client"
|
|
"unsafe"
|
|
)
|
|
|
|
//export GetScreen
|
|
func GetScreen(host *C.char, data **C.char, length *C.int) *C.char {
|
|
imgBytes, err := client.RealGetScreen(C.GoString(host))
|
|
if err != nil {
|
|
return C.CString(err.Error())
|
|
}
|
|
|
|
*data = (*C.char)(C.CBytes(imgBytes))
|
|
*length = C.int(len(imgBytes))
|
|
return nil
|
|
}
|
|
|
|
//export Free
|
|
func Free(p *C.char) {
|
|
C.free(unsafe.Pointer(p))
|
|
}
|
|
|
|
func main() {}
|