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

AtlasEngine: Fix several error handling bugs #17193

Merged
merged 2 commits into from
May 6, 2024

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented May 4, 2024

This fixes:

  • HRESULTs not being shown as unsigned hex
  • D2DERR_RECREATE_TARGET not being handled
  • 4 calls not checking their HRESULT return
    Out of the 4 only CreateCompatibleRenderTarget will throw in
    practice, however it throws D2DERR_RECREATE_TARGET which is common.
    Without this error handling, AtlasEngine may crash.

Validation Steps Performed

  • Set Graphics API to Direct2D
  • Use DXGIAdapterRemovalSupportTest.exe to trigger
    D2DERR_RECREATE_TARGET
  • No error message is shown ✅
  • If the D2DERR_RECREATE_TARGET handling is removed, the application
    never crashes due to cursorRenderTarget being nullptr

@lhecker lhecker added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-1 A description (P1) Area-AtlasEngine labels May 4, 2024
@carlos-zamora carlos-zamora added this pull request to the merge queue May 6, 2024
Merged via the queue into main with commit b31059e May 6, 2024
20 checks passed
@carlos-zamora carlos-zamora deleted the dev/lhecker/atlas-engine-d2d-fix branch May 6, 2024 18:51
DHowett pushed a commit that referenced this pull request May 6, 2024
This fixes:
* `HRESULT`s not being shown as unsigned hex
* `D2DERR_RECREATE_TARGET` not being handled
* 4 calls not checking their `HRESULT` return
  Out of the 4 only `CreateCompatibleRenderTarget` will throw in
  practice, however it throws `D2DERR_RECREATE_TARGET` which is common.
  Without this error handling, AtlasEngine may crash.

## Validation Steps Performed
* Set Graphics API to Direct2D
* Use `DXGIAdapterRemovalSupportTest.exe` to trigger
  `D2DERR_RECREATE_TARGET`
* No error message is shown ✅
* If the `D2DERR_RECREATE_TARGET` handling is removed, the application
  never crashes due to `cursorRenderTarget` being `nullptr` ✅

(cherry picked from commit b31059e)
Service-Card-Id: 92492429
Service-Version: 1.21
DHowett pushed a commit that referenced this pull request May 6, 2024
This fixes:
* `HRESULT`s not being shown as unsigned hex
* `D2DERR_RECREATE_TARGET` not being handled
* 4 calls not checking their `HRESULT` return
  Out of the 4 only `CreateCompatibleRenderTarget` will throw in
  practice, however it throws `D2DERR_RECREATE_TARGET` which is common.
  Without this error handling, AtlasEngine may crash.

* Set Graphics API to Direct2D
* Use `DXGIAdapterRemovalSupportTest.exe` to trigger
  `D2DERR_RECREATE_TARGET`
* No error message is shown ✅
* If the `D2DERR_RECREATE_TARGET` handling is removed, the application
  never crashes due to `cursorRenderTarget` being `nullptr` ✅

(cherry picked from commit b31059e)
Service-Card-Id: 92500372
Service-Version: 1.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AtlasEngine Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants