CNA-GAP-004: Game::ShowMissingRequirementMessage is a virtual hook that nothing in CNA calls

CNA snapshot 009d40f5  ·  Known Issues › Functional gaps  ·  source links pinned to 009d40f5

✓

Evidence basis: source-verified at the pinned commit. Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

XNA 4.0's Game.Run catches NoSuitableGraphicsDeviceException and NoAudioHardwareException and offers them to ShowMissingRequirementMessage before rethrowing; CNA declares the virtual but Game::Run never invokes it, so an override has no effect.

Identifier
CNA-GAP-004
Category
Functional gap
Subsystem
Core & runtime
Status
Open
Verified against
CNA 009d40f5 (009d40f5dd085c4e674d3479675fac84b12b3e0a)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
None
Affected contract
virtual bool Microsoft::Xna::Framework::Game::ShowMissingRequirementMessage(const std::exception&)

Expected behaviour

In XNA 4.0 (IL of Game.RunGame) the two requirement exceptions are caught and passed to ShowMissingRequirementMessage; the default shows a host message, and the exception is rethrown only if it returns false.

Actual behaviour at TARGET

CNA's implementation returns false and is referenced nowhere else: Game::Run in Game.cpp logs any escaping exception and rethrows it without consulting the hook, so an override is never called. Only exceptions raised inside Run can reach that handler (for example NoAudioHardwareException from SoundEffect or DynamicSoundEffectInstance during LoadContent). The NoSuitableGraphicsDeviceException throw sites read at 009d40f5 (the UseNullDevice/UseReferenceDevice renderer requirement and the DirectX 9 HiDef shader-model check) run while a GraphicsDevice is constructed, which for Game's own device happens in Game's constructor, before Run exists; a hook wired into Run alone would not see those.

Source locations

Evidence

Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. XNA call site read from the genuine XNA 4.0 Game IL.

Independent re-verification: Checked by reading the named sources at 009d40f5 and searching the tree for other references to the hook (none). XNA call site read from the decompiled XNA 4.0 Game.RunGame. Not executed; where each CNA exception is thrown was established by reading, so a regression test has to raise the exception during Run (for example from LoadContent) to reach a wired hook.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

No test references the hook.

Regression test

A Game test whose device creation throws a NoSuitableGraphicsDevice-style exception and whose override records the call and returns true; Run should then return without rethrowing.

Blast radius

Games that override the hook to present their own requirement message; the default behaviour (the exception escapes Run) is the same in both.

Workaround

Catch the exception around Game::Run() in main.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.