FreeRDP/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c

37 lines
673 B
C
Raw Normal View History

2012-10-01 04:15:42 +04:00
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/sspi.h>
#include <winpr/winpr.h>
int TestEnumerateSecurityPackages(int argc, char* argv[])
{
int index;
ULONG cPackages;
SECURITY_STATUS status;
SecPkgInfo* pPackageInfo;
sspi_GlobalInit();
status = EnumerateSecurityPackages(&cPackages, &pPackageInfo);
if (status != SEC_E_OK)
{
sspi_GlobalFinish();
return -1;
}
printf("\nEnumerateSecurityPackages (%d):\n", (unsigned int)cPackages);
for (index = 0; index < cPackages; index++)
{
printf("\"%s\", \"%s\"\n", pPackageInfo[index].Name, pPackageInfo[index].Comment);
}
FreeContextBuffer(pPackageInfo);
sspi_GlobalFinish();
return 0;
}