Started a new hresultwrap in Go. I'll run it locally.
This commit is contained in:
parent
2df2d565f9
commit
c33ea32e0f
|
@ -0,0 +1,18 @@
|
|||
# 8 august 2018
|
||||
|
||||
func: {
|
||||
name: "RegisterClassW"
|
||||
arg: "_In_ CONST WNDCLASSW *lpWndClass"
|
||||
ret: "ATOM"
|
||||
failval: "0"
|
||||
save: true
|
||||
}
|
||||
|
||||
func: {
|
||||
name: "UnregisterClassW"
|
||||
arg: "_In_ LPCWSTR lpClassName"
|
||||
arg: "_In_opt_ HINSTANCE hInstance"
|
||||
ret: "BOOL"
|
||||
failval: "0"
|
||||
cleanup: true
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
// 8 august 2018
|
||||
// usage: hresultwrap funclist template out
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) != 2 {
|
||||
fmt.Fprintf(os.Stderr, "usage: %s funclist\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
b, err := ioutil.ReadFile(os.Args[1])
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error reading %s: %v\n", os.Args[1], err)
|
||||
os.Exit(1)
|
||||
}
|
||||
var f File
|
||||
err = proto.UnmarshalText(string(b), &f)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error parsing %s: %v\n", os.Args[1], err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Println(f)
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
// 8 august 2018
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "main";
|
||||
|
||||
message File {
|
||||
repeated Function func = 1;
|
||||
}
|
||||
|
||||
message Function {
|
||||
string name = 1;
|
||||
string calling_convention = 2; // defaults to WINAPI
|
||||
repeated string arg = 3;
|
||||
string ret = 4;
|
||||
string failval = 5;
|
||||
bool save = 6;
|
||||
bool cleanup = 7;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
rm -f hresultwrap.pb.go hresultwrap
|
||||
protoc --go_out=. hresultwrap.proto
|
||||
go build hresultwrap.go hresultwrap.pb.go
|
Loading…
Reference in New Issue