FreeRDP
TestQuerySecurityPackageInfo.c
1 
2 #include <stdio.h>
3 #include <winpr/sspi.h>
4 #include <winpr/winpr.h>
5 #include <winpr/tchar.h>
6 
7 int TestQuerySecurityPackageInfo(int argc, char* argv[])
8 {
9  int rc = 0;
10  SECURITY_STATUS status = 0;
11  SecPkgInfo* pPackageInfo = NULL;
12  SecurityFunctionTable* table = NULL;
13 
14  WINPR_UNUSED(argc);
15  WINPR_UNUSED(argv);
16 
17  sspi_GlobalInit();
18  table = InitSecurityInterfaceEx(0);
19 
20  status = table->QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
21 
22  if (status != SEC_E_OK)
23  rc = -1;
24  else
25  {
26  _tprintf(_T("\nQuerySecurityPackageInfo:\n"));
27  _tprintf(_T("\"%s\", \"%s\"\n"), pPackageInfo->Name, pPackageInfo->Comment);
28  rc = 0;
29  }
30 
31  table->FreeContextBuffer(pPackageInfo);
32  sspi_GlobalFinish();
33  return rc;
34 }