| Previous | Next |
| VFW_E_INVALID_FILE_VERSION | VFW_E_INVALID_MEDIA_TYPE |
VFW_E_INVALID_CLSID
Exact result and bit fields
VFW_E_INVALID_CLSID has the unsigned HRESULT value 2147746375 (0x80040247) and the signed 32-bit representation -2147220921. AllStat describes it as “This file is corrupt: it contains an invalid class identifier”. In the operation that produces this result, a stored DirectShow graph names a class identifier that is syntactically invalid or cannot be interpreted as a CLSID while reconstructing the graph.
The high bit is set, so this value is a failure HRESULT. Its facility field is 4 (FACILITY_ITF) and its low code is 583 (0x0247). These fields classify this result, but they do not identify which filter, thread, device, file or graph generation returned it.
Contract boundary
This result is a DirectShow contract failure whose owner must be identified from the exact interface, filter instance, graph generation and operation stage.
The practical owner to locate for this HRESULT is the filter graph, device or persisted configuration that first returned the result. When handling this result, capture the native result before a wrapper replaces it with a generic exception, and keep the graph generation or object identity with the record.
Evidence worth preserving
Log the interface and method, filter CLSID and friendly name, process and thread, graph state, connected pin names, media-type summary, renderer or device identity where relevant, and the first preceding HRESULT. Record lengths and hashes instead of raw content when the incident includes media paths, device identifiers, registry values and stream metadata.
- Evidence 1 for this HRESULT: offending byte range or GUID text.
- Evidence 2 for this HRESULT: filter position in the persisted graph.
- Evidence 3 for this HRESULT: original writer build and the expected filter class.
Conditions that can produce it
- Cause 1 for this HRESULT: the serialized CLSID field is truncated.
- Cause 2 for this HRESULT: text conversion introduced non-hexadecimal characters.
- Cause 3 for this HRESULT: custom persistence wrote an interface IID or arbitrary GUID into a class slot.
Step-by-step diagnosis
- Capture it at the first native return, not only at the top-level playback failure.
- identify the exact graph stage described here: a stored DirectShow graph names a class identifier that is syntactically invalid or cannot be interpreted as a CLSID while reconstructing the graph.
- compare the live object state, topology and input with the documented interface preconditions.
- Before changing filters, drivers, registry data or media for this HRESULT, collect the code-specific evidence below.
- Test one evidence-backed the correction on the smallest reproducible graph.
- Verify that the corrected run no longer returns it and does not merely replace it with a nearby HRESULT.
Retry and recovery
Retry rule for this HRESULT: Retry after replacing the invalid identifier; registering additional filters does not make a malformed CLSID valid. A safe it retry must use a changed capability, state, object generation or input. While recovering from it, preserve cancellation and avoid replaying side effects when the original operation may have partially completed.
Correction strategy
- Action 1 for this HRESULT: repair or regenerate the persisted graph from known filter identities.
- Action 2 for this HRESULT: parse and validate every CLSID before calling COM activation.
- Action 3 for this HRESULT: keep class and interface identifiers in distinct schema fields.
Example incident
A hand-edited graph file contains a GUID with one missing digit; parsing the identifier before loading identifies the exact field behind it. This example keeps the diagnosis at the specific the boundary instead of treating every DirectShow failure as a codec reinstall problem.
Implementation notes
Code that handles it should preserve the original HRESULT, the failed stage and an opaque correlation identifier. After it, do not infer success from partial graph construction, and do not continue using interfaces retained from a graph or device generation that has already changed.
Operational remediation for this HRESULT should favor supported component installation, device configuration and documented DirectShow calls. Manual registry or driver changes are appropriate only when the collected evidence for this HRESULT points to that layer and a rollback is available.
How it differs from nearby results
VFW_E_CANNOT_LOAD_SOURCE_FILTER can follow a valid but unactivatable CLSID, while it means the stored class identifier itself is invalid. Keep those cases separate in telemetry, UI messages and retry policy because their next actions are different.
Official Microsoft references
- Microsoft: DirectShow error and success codes
- Microsoft: saving a filter graph to a GraphEdit file
- Microsoft: DirectShow filters and pins
Looking for a different code? Search another status or error code.