【发布时间】:2010-03-16 10:06:56
【问题描述】:
我正在尝试使用 LsaCallAuthenticationPackage 从缓存中清除特定票证。 我总是在包状态中得到 ERROR_INVALID_PARAMETER 87 。 可能是什么原因? 这是我的代码(所有其他步骤都成功):
KERB_QUERY_TKT_CACHE_REQUEST tktCacheRequest = {
KerbQueryTicketCacheMessage};
void* pRep;
DWORD cbRep;
NTSTATUS pkgStatus;
NTSTATUS s = LsaCallAuthenticationPackage(
* hLsa, * nAuthPackage,
&tktCacheRequest, sizeof tktCacheRequest,
&pRep, &cbRep, &pkgStatus);
pTktCacheResponse = (KERB_QUERY_TKT_CACHE_RESPONSE)pRep;
for (ULONG i = 0; i CountOfTickets; ++i)
{
KERB_TICKET_CACHE_INFO& ti = pTktCacheResponse->Tickets[i];
if (/一些条件/)
{
KERB_PURGE_TKT_CACHE_REQUEST 请求;
req.MessageType = KerbPurgeTicketCacheMessage;
req.ServerName = ti.ServerName;
req.RealmName = ti.ServerName;
req.LogonId.HighPart = req.LogonId.LowPart = 0;
NTSTATUS pkgStatus = 0;
PVOID pReturnBuffer = NULL;
ULONG nReturnedBufferLen = 0;
NTSTATUS s = LsaCallAuthenticationPackage(
hLsa, nAuthPackage,
&req, sizeof (req) *2,
0, 0, &pkgStatus);
ULONG winErr = LsaNtStatusToWinError(pkgStatus);
}
}
谢谢!!
【问题讨论】:
标签: c++ windows winapi authentication kerberos