More syscall fixes

This commit is contained in:
Lea O'Anthony 2024-08-29 06:49:17 +10:00
commit 60c9d1a070
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
5 changed files with 11 additions and 13 deletions

View file

@ -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)

View file

@ -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)))

View file

@ -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)

View file

@ -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)),

View file

@ -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)))