2012-10-01 04:15:42 +04:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <winpr/crt.h>
|
|
|
|
#include <winpr/sspi.h>
|
|
|
|
#include <winpr/winpr.h>
|
2016-06-01 17:26:26 +03:00
|
|
|
#include <winpr/tchar.h>
|
2012-10-01 04:15:42 +04:00
|
|
|
|
|
|
|
int TestEnumerateSecurityPackages(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
ULONG cPackages;
|
|
|
|
SECURITY_STATUS status;
|
|
|
|
SecPkgInfo* pPackageInfo;
|
|
|
|
|
2021-07-29 11:18:52 +03:00
|
|
|
WINPR_UNUSED(argc);
|
|
|
|
WINPR_UNUSED(argv);
|
|
|
|
|
2012-10-01 04:15:42 +04:00
|
|
|
sspi_GlobalInit();
|
|
|
|
|
|
|
|
status = EnumerateSecurityPackages(&cPackages, &pPackageInfo);
|
|
|
|
|
|
|
|
if (status != SEC_E_OK)
|
|
|
|
{
|
|
|
|
sspi_GlobalFinish();
|
2019-11-06 17:24:51 +03:00
|
|
|
return -1;
|
2012-10-01 04:15:42 +04:00
|
|
|
}
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
_tprintf(_T("\nEnumerateSecurityPackages (%") _T(PRIu32) _T("):\n"), cPackages);
|
2012-10-01 04:15:42 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
for (index = 0; index < (int)cPackages; index++)
|
2012-10-01 04:15:42 +04:00
|
|
|
{
|
2016-06-01 17:26:26 +03:00
|
|
|
_tprintf(_T("\"%s\", \"%s\"\n"), pPackageInfo[index].Name, pPackageInfo[index].Comment);
|
2012-10-01 04:15:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
FreeContextBuffer(pPackageInfo);
|
|
|
|
sspi_GlobalFinish();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|