AcquireCredentialsHandle 返回 SEC_E_SECPKG_NOT_FOUND

发布于 2025-01-15 08:51:24 字数 400 浏览 2 评论 0原文

当尝试在 Windows 10 上检索凭据处理程序时,无论我为安全包提供什么功能,我都会收到此错误。 Kerberos 是 Windows 系统上的默认设置,因此我尝试进行以下调用:

SEC_WINNT_AUTH_IDENTITY *ident = NULL; // 这里填写了有效的凭据 静态 CredHandle 信用句柄;

AcquireCredentialsHandle( NULL, "Kerberos", SECPKG_CRED_OUTBOUND, NULL, (void*)ident, NULL, NULL, &credHandle, NULL );

我已在注册表中验证 Kerberos 是否与其他安全包一起存在。无论我尝试使用哪个包(Kerberos、SChannel、NTLM 等),我都会不断收到相同的错误。

When attempting to retrieve the credential handler on Windows 10, I get this error no matter what I provide the function for the security package. Kerberos is the default on Windows systems so I am attempting to make the following call:

SEC_WINNT_AUTH_IDENTITY *ident = NULL; // this is filled in with valid credentials
static CredHandle credHandle;

AcquireCredentialsHandle( NULL, "Kerberos", SECPKG_CRED_OUTBOUND, NULL, (void*)ident, NULL, NULL, &credHandle, NULL );

I've verified in my registry that Kerberos is present with other security packages. It does not matter which package I try to use (Kerberos, SChannel, NTLM, etc), I keep getting the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

胡大本事 2025-01-22 08:51:25

我发现了问题所在。仅使用“Negotiate”等字符串会出现 UTF-8 到 UTF-16 转换问题。为了解决这个问题,必须使用以下内容代替普通字符串:
(TCHAR*)TEXT(“谈判”)

I discovered what the issue was. There is a UTF-8 to UTF-16 conversion issue with just using a string such as "Negotiate". In order to resolve this the following must be used in place of a plain string:
(TCHAR*)TEXT("Negotiate")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文