CNA-GAP-049: StorageDevice::DeviceChanged is declared but never raised
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). 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.
The static event exists for API compatibility, but nothing in the snapshot raises it; genuine XNA 4.0 raises it through FrameworkCallbackLinker.StorageDeviceChanged when a storage device changes, and CNA's desktop storage root has no such change source.
- Identifier
CNA-GAP-049- Category
- Functional gap
- Subsystem
- Storage
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Microsoft::Xna::Framework::Storage::StorageDevice::DeviceChanged
Expected behaviour
XNA 4.0 subscribes StorageDevice.OnDeviceChanged to FrameworkCallbackLinker.StorageDeviceChanged and raises DeviceChanged when a device is added or removed.
Actual behaviour at TARGET
StorageDevice.cpp defines the event; no CNA source raises it (the C API only subscribes and unsubscribes).
Source locations
modules/storage/src/StorageDevice.cpp— StorageDevice::DeviceChanged definition, no raise sitemodules/storage/include/Microsoft/Xna/Framework/Storage/StorageDevice.hpp— public static event
Evidence
Checked by reading at 009d40f5 and the XNA 4.0 Storage IL in the reference cache; not executed.
Independent re-verification: Checked by reading at 009d40f5 and the decompiled XNA 4.0 Storage IL and FrameworkDispatcher; not executed. In XNA the static constructor wires StorageDevice.OnDeviceChanged to FrameworkCallbackLinker.StorageDeviceChanged, which FrameworkDispatcher.Update raises when a native System_DeviceChanged call was queued; the documented meaning is 'a device is removed or inserted'. No managed source of that call exists in the decompiled assemblies, so how often genuine XNA raises it on Windows is not established. Tests: CApi_StorageSmoke (C ABI builds only) subscribes, unsubscribes and checks stale-registration refusal for the event, but no test can make it fire because nothing in CNA raises it.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
None.
Regression test
If a change source is added (for example removable media), a test that it raises the event.
Blast radius
Games that re-select storage on DeviceChanged never get the notification; on desktop the storage root does not change.
Workaround
No workaround is known.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Storage
- Internals
- Storage internals: gaps
- Known issues
- Functional gap index