| Previous | Next |
| TPM_E_BAD_TYPE | TPM_E_NOTFIPS |
TPM_E_INVALID_RESOURCE
Which layer owns this HRESULT
TPM_E_INVALID_RESOURCE means a resource-type mismatch: a saved-context operation names one TPM resource type while the referenced handle or context contains another.
The first producer to identify is the TPM resource, context or delegation manager, sometimes mediated by TBS virtualization. TBS can virtualize finite TPM resources, but a saved TPM context and a TBS virtual handle are not durable application IDs. Their validity depends on resource type, owning client context, TPM lifecycle and the exact save/load history.
Keep the result value 0x80280035 attached to the symbolic name. Some logs may store it as a negative signed integer or expose only a generic CNG, WMI, BitLocker or enrollment message. Preserve the original HRESULT because those representations can hide the TPM- or TBS-specific condition.
Diagnostic record
- Producer: the TPM resource, context or delegation manager, sometimes mediated by TBS virtualization.
- Rejected invariant: a saved-context operation names one TPM resource type while the referenced handle or context contains another.
- What to capture: resourceType, handle, saved context header, creating command, TBS virtual-handle mapping, and whether the context came from another process or boot.
- Safe comparison: save and reload one fresh resource of the intended type within a single TBS context.
How to verify the distinction
| Question | Evidence |
|---|---|
| What exact state was rejected? | a saved-context operation names one TPM resource type while the referenced handle or context contains another |
| Which layer owns the result? | The TPM resource, context or delegation manager, sometimes mediated by TBS virtualization. |
| What must be correlated? | resourceType, handle, saved context header, creating command, TBS virtual-handle mapping, and whether the context came from another process or boot |
| Controlled comparison | save and reload one fresh resource of the intended type within a single TBS context |
Common false equivalences
| Constant | Meaning |
|---|---|
TPM_E_INVALID_STRUCTURE | The structure tag and version are invalid or inconsistent. |
TPM_E_KEY_OWNER_CONTROL | The key is under control of the TPM Owner and can only be evicted by the TPM Owner. |
TPM_E_BAD_COUNTER | The counter handle is incorrect. |
The codes above may appear in the same workflow, but they are not aliases. TPM_E_BADCONTEXT rejects an invalid context blob, while this code identifies a type mismatch for a context resource.
What a real fix looks like
Keep context blobs paired with their resource type and owning context; discard stale mappings after reboot or service restart. Do not persist volatile TPM or TBS handles as durable identifiers. A numeric handle can be valid only inside the creating context and lifecycle, even when its value looks unchanged after restart.
Proof consists of a successful replay plus validation of the intended key, PCR, NV, context, event-log, provider or service result. A software fallback or a newly provisioned blank TPM answers a different question than the original failure.
Source material
Looking for a different code? Search another status or error code.