diff options
Diffstat (limited to 'tun/wintun/guid/guid_windows.go')
-rw-r--r-- | tun/wintun/guid/guid_windows.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tun/wintun/guid/guid_windows.go b/tun/wintun/guid/guid_windows.go index 0078d2c..c5f4be6 100644 --- a/tun/wintun/guid/guid_windows.go +++ b/tun/wintun/guid/guid_windows.go @@ -12,7 +12,7 @@ import ( "golang.org/x/sys/windows" ) -//sys clsidFromString(lpsz *uint16, pclsid *windows.GUID) (hr int32) = ole32.CLSIDFromString +//sys clsidFromString(lpsz *uint16, pclsid *windows.GUID) (err error) [failretval!=0] = ole32.CLSIDFromString // // FromString parses "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" string to GUID. @@ -22,14 +22,11 @@ func FromString(str string) (*windows.GUID, error) { if err != nil { return nil, err } - guid := &windows.GUID{} - - hr := clsidFromString(strUTF16, guid) - if hr < 0 { - return nil, syscall.Errno(hr) + err = clsidFromString(strUTF16, guid) + if err != nil { + return nil, err } - return guid, nil } |