diff --git a/v2/internal/frontend/desktop/windows/winc/w32/user32.go b/v2/internal/frontend/desktop/windows/winc/w32/user32.go index 8ca72ce4b..89ff985af 100644 --- a/v2/internal/frontend/desktop/windows/winc/w32/user32.go +++ b/v2/internal/frontend/desktop/windows/winc/w32/user32.go @@ -639,7 +639,7 @@ func GetSysColorBrush(nIndex int) HBRUSH { return HBRUSH(ret) */ - ret, _, _ := syscall.Syscall(getSysColorBrush, 1, + ret, _, _ := syscall.SyscallN(getSysColorBrush, uintptr(nIndex), 0, 0) diff --git a/v2/internal/go-common-file-dialog/cfd/iShellItem.go b/v2/internal/go-common-file-dialog/cfd/iShellItem.go index 6a747f4d9..c97efd8bb 100644 --- a/v2/internal/go-common-file-dialog/cfd/iShellItem.go +++ b/v2/internal/go-common-file-dialog/cfd/iShellItem.go @@ -40,8 +40,7 @@ func newIShellItem(path string) (*iShellItem, error) { func (vtbl *iShellItemVtbl) getDisplayName(objPtr unsafe.Pointer) (string, error) { var ptr *uint16 - ret, _, _ := syscall.Syscall(vtbl.GetDisplayName, - 2, + ret, _, _ := syscall.SyscallN(vtbl.GetDisplayName, uintptr(objPtr), 0x80058000, // SIGDN_FILESYSPATH uintptr(unsafe.Pointer(&ptr))) diff --git a/v3/internal/go-common-file-dialog/cfd/iFileOpenDialog.go b/v3/internal/go-common-file-dialog/cfd/iFileOpenDialog.go index 42f83814a..404dedc22 100644 --- a/v3/internal/go-common-file-dialog/cfd/iFileOpenDialog.go +++ b/v3/internal/go-common-file-dialog/cfd/iFileOpenDialog.go @@ -164,8 +164,7 @@ func (fileOpenDialog *iFileOpenDialog) setIsMultiselect(isMultiselect bool) erro func (vtbl *iFileOpenDialogVtbl) getResults(objPtr unsafe.Pointer) (*iShellItemArray, error) { var shellItemArray *iShellItemArray - ret, _, _ := syscall.Syscall(vtbl.GetResults, - 1, + ret, _, _ := syscall.SyscallN(vtbl.GetResults, uintptr(objPtr), uintptr(unsafe.Pointer(&shellItemArray)), 0) diff --git a/v3/pkg/w32/utils.go b/v3/pkg/w32/utils.go index f7e3f5bdf..f4e99dbaf 100644 --- a/v3/pkg/w32/utils.go +++ b/v3/pkg/w32/utils.go @@ -76,7 +76,7 @@ func UTF16PtrToString(cstr *uint16) string { } func ComAddRef(unknown *IUnknown) int32 { - ret, _, _ := syscall.Syscall(uintptr(unknown.Vtbl.AddRef), 1, + ret, _, _ := syscall.SyscallN(uintptr(unknown.Vtbl.AddRef), uintptr(unsafe.Pointer(unknown)), 0, 0) @@ -84,7 +84,7 @@ func ComAddRef(unknown *IUnknown) int32 { } func ComRelease(unknown *IUnknown) int32 { - ret, _, _ := syscall.Syscall(uintptr(unknown.Vtbl.Release), 1, + ret, _, _ := syscall.SyscallN(uintptr(unknown.Vtbl.Release), uintptr(unsafe.Pointer(unknown)), 0, 0) @@ -93,7 +93,7 @@ func ComRelease(unknown *IUnknown) int32 { func ComQueryInterface(unknown *IUnknown, id *GUID) *IDispatch { var disp *IDispatch - hr, _, _ := syscall.Syscall(uintptr(unknown.Vtbl.QueryInterface), 3, + hr, _, _ := syscall.SyscallN(uintptr(unknown.Vtbl.QueryInterface), uintptr(unsafe.Pointer(unknown)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(&disp))) @@ -109,7 +109,7 @@ func ComGetIDsOfName(disp *IDispatch, names []string) []int32 { for i := 0; i < len(names); i++ { wnames[i] = syscall.StringToUTF16Ptr(names[i]) } - hr, _, _ := syscall.Syscall6(disp.lpVtbl.pGetIDsOfNames, 6, + hr, _, _ := syscall.SyscallN(disp.lpVtbl.pGetIDsOfNames, uintptr(unsafe.Pointer(disp)), uintptr(unsafe.Pointer(IID_NULL)), uintptr(unsafe.Pointer(&wnames[0])), @@ -205,7 +205,7 @@ func ComInvoke(disp *IDispatch, dispid int32, dispatch int16, params ...interfac var ret VARIANT var excepInfo EXCEPINFO VariantInit(&ret) - hr, _, _ := syscall.Syscall9(disp.lpVtbl.pInvoke, 8, + hr, _, _ := syscall.SyscallN(disp.lpVtbl.pInvoke, uintptr(unsafe.Pointer(disp)), uintptr(dispid), uintptr(unsafe.Pointer(IID_NULL)), diff --git a/v3/pkg/w32/uxtheme.go b/v3/pkg/w32/uxtheme.go index 51ec0035f..ed80d487f 100644 --- a/v3/pkg/w32/uxtheme.go +++ b/v3/pkg/w32/uxtheme.go @@ -83,7 +83,7 @@ func init() { } func CloseThemeData(hTheme HTHEME) HRESULT { - ret, _, _ := syscall.Syscall(closeThemeData, 1, + ret, _, _ := syscall.SyscallN(closeThemeData, uintptr(hTheme), 0, 0) @@ -134,7 +134,7 @@ func GetThemeTextExtent(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText } func OpenThemeData(hwnd HWND, pszClassList *uint16) HTHEME { - ret, _, _ := syscall.Syscall(openThemeData, 2, + ret, _, _ := syscall.SyscallN(openThemeData, uintptr(hwnd), uintptr(unsafe.Pointer(pszClassList)), 0) @@ -143,7 +143,7 @@ func OpenThemeData(hwnd HWND, pszClassList *uint16) HTHEME { } func SetWindowTheme(hwnd HWND, pszSubAppName, pszSubIdList *uint16) HRESULT { - ret, _, _ := syscall.Syscall(setWindowTheme, 3, + ret, _, _ := syscall.SyscallN(setWindowTheme, uintptr(hwnd), uintptr(unsafe.Pointer(pszSubAppName)), uintptr(unsafe.Pointer(pszSubIdList)))