locked
Cryptographic Provider Development Kit - Key Storage Provider Sample Does not run RRS feed

  • Question

  • I am running on Windows 2008 R2 SP1

    Using Visual Studio 2010

    The Key Storage Provider Sample fails when I try to register it.  For this exercise I am using the sample code exactly as is shipped with the Cryptographic Provider Development Kit.  I am building for 64 bit but have tried 32 bit as well.

    The errors it generates are:

    output:

    BCryptRegisterProvider failed with error code 0xc0000034
    BCryptAddContextFunctionProvider failed with error code 0xc0000225

    code where the errors occurs:

        ntStatus = BCryptRegisterProvider(

                        SAMPLEKSP_PROVIDER_NAME,

                        0,                         

    // Flags: fail if provider is already registered


                        &SampleKSPProvider

                        );


    ....

        ntStatus = BCryptAddContextFunctionProvider(

                        CRYPT_LOCAL,                   

    // Scope: local machine only


                        NULL,                          

    // Application context: default


                        NCRYPT_KEY_STORAGE_INTERFACE,  

    // Algorithm class


                        NCRYPT_KEY_STORAGE_ALGORITHM,  

    // Algorithm name


                        SAMPLEKSP_PROVIDER_NAME,       

    // Provider name


                        CRYPT_PRIORITY_BOTTOM          

    // Lowest priority


                        );


    Friday, October 18, 2013 11:08 AM

All replies

  • I re-attempted on a fresh system and building the code as shipped and moving the dll to the system32 folder fixed the problem.
    Friday, October 18, 2013 1:08 PM
  • Thanks for posting the solution - I'd just run into the same problem, and moving the dll was the trick.
    Thursday, December 22, 2016 10:00 AM