NCryptOpenKey returning x80090016 and 0x80280185 [Note change in function]

Wise42 1 Reputation point
2021-03-04T13:02:13.963+00:00

I'm getting the errors x80090016 and 0x80280185 from NCryptOpenKey occasionally. What are all the possible reasons for these errors.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,412 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Strive Sun-MSFT 426 Reputation points
    2021-03-05T03:15:50.393+00:00

    Hello, @Wise42

    You can refer COM Error Codes(Seurity and Setup)which provides a list of error codes used by COM-based APIs.

    NTE_BAD_KEYSET 0x80090016 Keyset does not exist

    You can also check the NCryptOpenKey documentation to determine the error message

    I did not find the error message about 0x80280185, please help to check the error code.

    ----------

    Thank you!

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Wise42 1 Reputation point
    2021-03-05T14:03:25.967+00:00

    When using the platform provider (e.g., the TPM) is there a case where an error in the TPM can cause this error to occur? IOW: If there were an error in the TPM would that always return a different error?

    I'll double check on the other error code.