Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAudioMeterInformationVtbl struct order of uintptr is incorrect for GetChannelsPeakValues and GetMeteringChannelCount #18

Open
MAVREE opened this issue Jan 21, 2024 · 0 comments · May be fixed by #19

Comments

@MAVREE
Copy link

MAVREE commented Jan 21, 2024

What version of Go are you using (go version)?

go 1.21.1 amd64

What did you do?

This is the 0.3.0 VTable for the IAudioMeterInformation interface, I had failures in trying to get channel counts and corresponding peak values, when I realized the VTable had wrong orders for those two pointers (they're inverted).

I checked by making the syscall by myself and it works, I had E_POINTER errors on calling GetMeteringChannelCount and panic errors on calling GetChannelsPeakValues

type IAudioMeterInformationVtbl struct {
	ole.IUnknownVtbl
	GetPeakValue            uintptr
	GetChannelsPeakValues   uintptr
	GetMeteringChannelCount uintptr
	QueryHardwareSupport    uintptr
}

The working VTable:

type IAudioMeterInformationVtbl struct {
	ole.IUnknownVtbl
	GetPeakValue            uintptr
	GetMeteringChannelCount uintptr
	GetChannelsPeakValues   uintptr
	QueryHardwareSupport    uintptr
}

I've simply worked around it by making the syscall by myself, I don't know if it's simply because I'm using Windows 10 (?)

@MAVREE MAVREE linked a pull request Jan 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant