| Previous | Next |
| STATUS_PCP_DEVICE_NOT_READY | STATUS_PCP_INVALID_PARAMETER |
STATUS_PCP_INVALID_HANDLE
Invalid Platform Crypto Provider handle
STATUS_PCP_INVALID_HANDLE is returned below the NCrypt/CNG key-storage layer when the TPM-backed Platform Crypto Provider cannot use the handle supplied by the caller. It is about provider object lifetime, not a Windows file or registry handle.
This commonly points to using a provider, key, or operation handle after close/free, mixing handles between providers, or passing a handle from a failed create/open path. TPM-backed keys should be kept in the same provider context that created or opened them.
Diagnostic focus
- Check the matching
NCryptOpenStorageProvider, key-open/create call, and close/free path. - Verify that the handle belongs to Microsoft Platform Crypto Provider and not another KSP.
- Look for cleanup code that frees an NCrypt object and then continues with a cached handle value.
References
- Microsoft: CNG key storage providers
- Microsoft: NCryptOpenStorageProvider
- Microsoft: Key storage and retrieval
- Microsoft: TPM Base Services
- Microsoft: COM error codes for TPM, PLA and FVE
Looking for a different code? Search another status or error code.