尝试清除特定票证时,LsaCallAuthenticationPackage 返回 ERROR_INVALID_PARAMETER 87 (0x57)
我正在尝试使用 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 < pTktCacheResponse->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; 请求.LogonId.HighPart = 请求.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);
}
}
谢谢!!
I'm trying to purge a specific ticket from the cache,using LsaCallAuthenticationPackage.
I always get ERROR_INVALID_PARAMETER 87 in the package status.
What could be the reason?
Here is my code (All other steps succeeded):
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 < pTktCacheResponse->CountOfTickets; ++i)
{
KERB_TICKET_CACHE_INFO& ti = pTktCacheResponse->Tickets[i];
if (/Some condition/)
{
KERB_PURGE_TKT_CACHE_REQUEST req;
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);
}
}
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须使用原始 Microsoft klist 中的内存分配模型(可在 Microsoft Windows Platform SDK 的示例中找到),并使其正常工作。
谢谢。
I kust use the memory allocation model as in the original Microsoft's klist (found in Microsoft Windows Platform SDK's samples), and got it works.
Thanks.