MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Windows CE 3.0

This function is used to enumerate the types of providers supported on the machine.

BOOL WINAPI CryptEnumProviderTypes( 
DWORD dwIndex,
DWORD *pdwReserved, 
DWORD dwFlags, 
DWORD *pdwProvType,
LPTSTR pszTypeName, 
DWORD *pcbTypeName);


[in] Specifies the index of the next provider type to be enumerated.
[in] Reserved for future use ; set to NULL.
[in] Specifies a bitmask of flags. This parameter is reserved for future use and should always be zero.
[in] Pointer to the DWORD value that designates the enumerated provider type.
[out] Pointer to a buffer that receives the data from the enumerated provider type. A null-terminated string. There are provider types which may not have friendly names and in this case no name will be returned and the returned value pointed to by pcbTypeName will be 0.

This parameter can be NULL if you want to get the size of the name for memory allocation purposes.

[in/out] Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the pszTypeName parameter. When the function returns, the variable pointed to by the pcbTypeName parameter contains the number of bytes stored in the buffer. There are provider types which may not have friendly names and in this case no name will be returned and the returned value pointed to by pcbTypeName will be 0.
Note   When processing the data returned in the buffer, applications need to use the actual size of the data returned. The actual size may be slightly smaller than the size of the buffer specified on input. (On input, buffer sizes are usually specified large enough to ensure that the largest possible output data will fit in the buffer.) On output, the variable pointed to by this parameter is updated to reflect the actual size of the data copied to the buffer.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. Common values for GetLastError are described in the following table. The error values prefaced by "NTE" are generated by the particular CSP you are using.

Value Description
ERROR_NO_MORE_ITEMS There are no more items to enumerate.
ERROR_NOT_ENOUGH_MEMORY The operating system ran out of memory.
NTE_BAD_FLAGS dwFlags has an unrecognized value.
NTE_FAIL Something was wrong with the type registration.


CryptEnumProviderTypes is used to enumerate the provider types on a machine. Once this is done, the providers for a specific type may be enumerated by using CryptEnumProviders.

Windows CE does not support the ANSI version of this function.


long i;
DWORD dwErr;

// Loop through enumerating provider types.
for (i=0;;i++)
if (!CryptEnumProviderTypes(i, NULL, 0, &dwType, NULL, NULL))
 {if (ERROR_NO_MORE_ITEMS != (dwErr = GetLastError()))
 {printf("ERROR - CryptEnumProviderTypes : %X\n", dwErr);
printf ("Provider Type %d\n", dwType);


Runs On Versions Defined in Include Link to
Windows CE OS 2.10 and later Wincrypt.h   Cryptapi.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also


 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.

© 2016 Microsoft