19 #include <winpr/error.h>
20 #include <winpr/ncrypt.h>
21 #include <winpr/string.h>
22 #include <winpr/wlog.h>
23 #include <winpr/smartcard.h>
25 #define TAG "testNCrypt"
27 int TestNCryptProviders(
int argc,
char* argv[])
29 SECURITY_STATUS status = 0;
36 status = NCryptEnumStorageProviders(&nproviders, &providers, NCRYPT_SILENT_FLAG);
37 if (status != ERROR_SUCCESS)
40 for (DWORD i = 0; i < nproviders; i++)
43 char providerNameStr[256] = { 0 };
45 (void)ConvertWCharToUtf8(provider->pszName, providerNameStr, ARRAYSIZE(providerNameStr));
46 printf(
"%d: %s\n", i, providerNameStr);
49 NCryptFreeBuffer(providers);
a provider name descriptor