Click to Rate and Give Feedback
MSDN
MSDN Library
Security
CNG Reference
 BCryptResolveProviders Function
BCryptResolveProviders Function

The BCryptResolveProviders function obtains a collection of all of the providers that meet the specified criteria.

Syntax

NTSTATUS WINAPI BCryptResolveProviders(
  __in     LPCWSTR pszContext,
  __in     ULONG dwInterface,
  __in     LPCWSTR pszFunction,
  __in     LPCWSTR pszProvider,
  __in     ULONG dwMode,
  __in     ULONG dwFlags,
  __inout  ULONG *pcbBuffer,
  __inout  PCRYPT_PROVIDER_REFS *ppBuffer
);

Parameters

pszContext

A pointer to a null-terminated Unicode string that contains the identifier of the context to obtain the providers for.

dwInterface

The identifier of an interface that the provider must support. This must be one of the CNG Interface Identifiers. If this parameter is zero, all interfaces will be included.

pszFunction

A pointer to a null-terminated Unicode string that contains the algorithm or function identifier that the provider must support. This can be one of the standard CNG Algorithm Identifiers or the identifier for another registered algorithm. If this parameter is NULL, then all algorithms and functions will be included.

pszProvider

A pointer to a null-terminated Unicode string that contains the name of the provider to retrieve. If this parameter is NULL, then all providers will be included.

This parameter allows you to specify a specific provider to retrieve in the event that more than one provider meets the other criteria.

dwMode

Specifies the type of provider to retrieve. This can be one of the following values.

Value Meaning

CRYPT_UM

Retrieve user mode providers.

CRYPT_KM

Retrieve kernel mode providers.

CRYPT_MM

Retrieve both user mode and kernel mode providers.

dwFlags

A set of flags that modify the behavior of this function.

This can be a zero or a combination of one or more of the following values.

Value Meaning

CRYPT_ALL_FUNCTIONS
1

This function will retrieve all of the functions supported by each provider that meets the specified criteria. If this flag is not specified, this function will only retrieve the first function of the provider or providers that meet the specified criteria.

CRYPT_ALL_PROVIDERS
2

This function will retrieve all of the providers that meet the specified criteria. If this flag is not specified, this function will only retrieve the first provider that is found that meets the specified criteria.

pcbBuffer

A pointer to a ULONG value that, on entry, contains the size, in bytes, of the buffer pointed to by the ppBuffer parameter. On exit, this value receives either the number of bytes copied to the buffer or the required size, in bytes, of the buffer.

ppBuffer

The address of a CRYPT_PROVIDER_REFS pointer that receives the collection of providers that meet the specified criteria.

If this parameter is NULL, this function will return STATUS_BUFFER_TOO_SMALL and place in the value pointed to by the pcbBuffer parameter, the required size, in bytes, of all the data.

If this parameter is the address of a NULL pointer, this function will allocate the required memory, fill the memory with the information about the providers, and place the pointer to this memory in this parameter. When you have finished using this memory, free it by passing this pointer to the BCryptFreeBuffer function.

If this parameter is the address of a non-NULL pointer, this function will copy the provider information into this buffer. The pcbBuffer parameter must contain the size, in bytes, of the entire buffer. If the buffer is not large enough to hold all of the provider information, this function will return STATUS_BUFFER_TOO_SMALL.

Return Value

Returns a status code that indicates the success or failure of the function.

Possible return codes include, but are not limited to, the following.

Return code Description

STATUS_SUCCESS

The function was successful.

STATUS_BUFFER_TOO_SMALL

The size specified by the pcbBuffer parameter is not large enough to hold all of the data.

STATUS_INVALID_PARAMETER

One or more parameters are not valid.

STATUS_NOT_FOUND

No provider could be found that meets all of the specified criteria.

Remarks

BCryptResolveProviders can be called either from user mode or kernel mode. Kernel mode callers must be executing at PASSIVE_LEVEL IRQL.

Requirements

Client Requires Windows Vista.
Server Requires Windows Server 2008.
Header

Declared in Bcrypt.h.

Library

Use Bcrypt.lib.

DLL

Requires Bcrypt.dll.


Send comments about this topic to Microsoft

Build date: 5/22/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker