Skip to content

wasapi: preserve GetBuffer Win32 HRESULT errors - #312

Merged
hajimehoshi merged 1 commit into
ebitengine:mainfrom
kumagi:codex/wasapi-getbuffer-oom
Oct 9, 2026
Merged

hajimehoshi merged 1 commit into
ebitengine:mainfrom
kumagi:codex/wasapi-getbuffer-oom

Conversation

@kumagi

@kumagi kumagi commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What issue is this addressing?

None

What type of issue is this addressing?

bug

What this PR does | solves

GetBuffer formats E_OUTOFMEMORY as plain text, so the existing bounded OOM recovery in wasapiContext.run cannot recognize it with errors.Is. Wrap Win32 HRESULTs in the existing _WIN32_ERR type, preserving the AUDCLNT path and other HRESULT diagnostics.

Validation: a private harness extracted the actual wrapper and substituted its native syscall result. OOM failed errors.Is before the fix and passed afterward; DEVICE_INVALIDATED and RESOURCES_INVALIDATED remained recognizable. This is a wrapper regression check, not native Windows device testing.

Native macOS builds and internal package race tests passed, as did Windows 386/amd64/arm64 and WebAssembly cross-builds. The full macOS suite fails AudioQueueStart and then times out in TestSetBufferSize on both the unchanged upstream and this checkout; macOS vet reports the same pre-existing driver_darwin.go unsafe.Pointer warning.

@hajimehoshi hajimehoshi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hajimehoshi
hajimehoshi merged commit 60ea429 into ebitengine:main Oct 9, 2026
9 checks passed
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 this pull request may close these issues.

2 participants