Fix WinPR SSPI unit tests to always use SSPI function table
This commit is contained in:
parent
1d5c0be5ec
commit
227aa6a55f
@ -22,7 +22,7 @@ int TestAcquireCredentialsHandle(int argc, char* argv[])
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
table = InitSecurityInterface();
|
||||
table = InitSecurityInterfaceEx(0);
|
||||
identity.User = (UINT16*)_strdup(test_User);
|
||||
identity.Domain = (UINT16*)_strdup(test_Domain);
|
||||
identity.Password = (UINT16*)_strdup(test_Password);
|
||||
|
@ -11,13 +11,15 @@ int TestEnumerateSecurityPackages(int argc, char* argv[])
|
||||
ULONG cPackages;
|
||||
SECURITY_STATUS status;
|
||||
SecPkgInfo* pPackageInfo;
|
||||
SecurityFunctionTable* table;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
table = InitSecurityInterfaceEx(0);
|
||||
|
||||
status = EnumerateSecurityPackages(&cPackages, &pPackageInfo);
|
||||
status = table->EnumerateSecurityPackages(&cPackages, &pPackageInfo);
|
||||
|
||||
if (status != SEC_E_OK)
|
||||
{
|
||||
@ -32,7 +34,7 @@ int TestEnumerateSecurityPackages(int argc, char* argv[])
|
||||
_tprintf(_T("\"%s\", \"%s\"\n"), pPackageInfo[index].Name, pPackageInfo[index].Comment);
|
||||
}
|
||||
|
||||
FreeContextBuffer(pPackageInfo);
|
||||
table->FreeContextBuffer(pPackageInfo);
|
||||
sspi_GlobalFinish();
|
||||
|
||||
return 0;
|
||||
|
@ -30,8 +30,8 @@ int TestInitializeSecurityContext(int argc, char* argv[])
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
table = InitSecurityInterface();
|
||||
status = QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
table = InitSecurityInterfaceEx(0);
|
||||
status = table->QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
|
||||
if (status != SEC_E_OK)
|
||||
{
|
||||
@ -109,7 +109,7 @@ fail:
|
||||
if (SecIsValidHandle(&credentials))
|
||||
table->FreeCredentialsHandle(&credentials);
|
||||
|
||||
FreeContextBuffer(pPackageInfo);
|
||||
table->FreeContextBuffer(pPackageInfo);
|
||||
sspi_GlobalFinish();
|
||||
return rc;
|
||||
}
|
||||
|
@ -9,12 +9,15 @@ int TestQuerySecurityPackageInfo(int argc, char* argv[])
|
||||
int rc;
|
||||
SECURITY_STATUS status;
|
||||
SecPkgInfo* pPackageInfo;
|
||||
SecurityFunctionTable* table;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
sspi_GlobalInit();
|
||||
status = QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
table = InitSecurityInterfaceEx(0);
|
||||
|
||||
status = table->QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
|
||||
|
||||
if (status != SEC_E_OK)
|
||||
rc = -1;
|
||||
@ -25,7 +28,7 @@ int TestQuerySecurityPackageInfo(int argc, char* argv[])
|
||||
rc = 0;
|
||||
}
|
||||
|
||||
FreeContextBuffer(pPackageInfo);
|
||||
table->FreeContextBuffer(pPackageInfo);
|
||||
sspi_GlobalFinish();
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user