| Previous | Next |
| TPM_E_BAD_DELEGATE | TPM_E_TOOMANYCONTEXTS |
TPM_E_BADCONTEXT
What failed and what did not
TPM_E_BADCONTEXT (0x8028005A) belongs to TPM 1.2 resources, delegation and contexts. The base What Is page already shows the short Windows message; the additional diagnostic value is that this result marks the TPM 1.2 saved-context blob fails validation or no longer represents a loadable context.
The first producer to identify for this HRESULT 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.
Read this result as its own boundary in a sequence, not as a verdict that every TPM feature is broken. The sequence reaches the TPM 1.2 saved-context blob fails validation or no longer represents a loadable context, and the component returns 0x8028005A before the application can safely assume that later key, attestation, boot or licensing work occurred.
Collect a useful trace
- Request identity: exact function or command, input lengths, flags, caller context and this result.
- State identity: blob bytes and length, resource type, context count, integrity protection, originating TPM, boot lifetime, and storage transformations.
- Platform identity for this HRESULT: TPM generation, manufacturer/firmware revision, Windows build and relevant service events.
- Binary identity: preserve opaque structures byte-for-byte and log
0x8028005Ain hexadecimal.
Narrow experiment
Save and immediately reload a fresh context without encoding, transport or persistence changes. Keep every other this result test condition unchanged. If the comparison reaches a later checkpoint, then the original the condition has been isolated even when a second defect remains.
| Observed outcome | Interpretation |
|---|---|
| The exact request succeeds | The changed condition belongs to the rejected the TPM 1.2 saved-context blob fails validation or no longer represents a loadable context. |
| A more specific earlier code appears | Preserve the earlier result in the result trace; the previous trace probably lost the first producer. |
| The same code returns with identical bytes | Escalate the persistent it with firmware, service and command evidence rather than broad configuration changes. |
| The code disappears only after destructive reset | The result experiment is not diagnostic because original protected state and evidence were removed. |
Similar-looking outcomes
| Nearby constant | Why it is different |
|---|---|
TPM_E_TOOMANYCONTEXTS | Too many contexts held by the TPM — a separate checkpoint when compared with it. |
TPM_E_BAD_DELEGATE | Delegation is not correct — a separate checkpoint when compared with it. |
TPM_E_NOCONTEXTSPACE | There is no room in the context list for additional contexts — a separate checkpoint when compared with it. |
For this page, the useful contrast is: TPM_E_CONTEXT_GAP specifically reports an excessive counter gap, while this code covers broader context invalidity.
Operational response
Apply the narrow remedy: treat context blobs as opaque, TPM-bound and short-lived; recreate the resource when the blob cannot be validated. 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.
Close the incident only when the same API or TPM command passes with the intended hardware-backed behavior and the expected output can be independently validated.
References
- Microsoft: Resource Virtualization in TBS — source for the checkpoint.
- Microsoft: Command Scheduling in TBS — source for the checkpoint.
- Microsoft: Using TPM Base Services — source for the checkpoint.
- TCG: TPM 1.2 Part 3 — Context commands — source for the checkpoint.
Looking for a different code? Search another status or error code.
