XP 上的 NetValidatePasswordPolicy 问题

发布于 2024-10-12 10:30:38 字数 997 浏览 2 评论 0原文

我的项目有一个要求,在创建新帐户之前需要检查密码复杂性。

My code looks like:

NET_API_STATUS status;
NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG inputArg = {0};
NET_VALIDATE_OUTPUT_ARG* pOutputArg = NULL;

inputArg.ClearPassword = NewPass;    
inputArg.PasswordMatch = TRUE;

status = NetValidatePasswordPolicy(DC, NULL, NetValidatePasswordChange,
            &inputArg, (void**)&pOutputArg);    
printf("status: %d, validationStatus: %d\n", status, pOutputArg->ValidationStatus);

NetValidatePasswordPolicyFree((void**)&pOutputArg);

我正在Windows XP上工作。当我尝试运行时,它提示警告说:

程序入口点NetValidPasswordPolicyFree无法位于动态链接库NETAPI32.dll中

从MSDN上说API是仅在2003服务器和2008服务器中有效。 这是否意味着它不能在XP上运行? 或者我可以找到任何其他 API 来执行与 NetValidPasswordPolicy 相同的操作吗?

我在谷歌上搜索了很多这个问题,发现有人问过类似的问题,但没有得到答复:(。所以,我在这里试试运气。

甚至我尝试在 Reflector 中分​​析 'NETAPI32.dll' 。 exe,但在打开 .dll 文件时出现错误: 未将对象引用设置为对象的实例。

我陷入困境,无法找到任何方法,我们将不胜感激: )

My project has a requirement that it needs to check the password complexity before create the new account.

My code looks like:

NET_API_STATUS status;
NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG inputArg = {0};
NET_VALIDATE_OUTPUT_ARG* pOutputArg = NULL;

inputArg.ClearPassword = NewPass;    
inputArg.PasswordMatch = TRUE;

status = NetValidatePasswordPolicy(DC, NULL, NetValidatePasswordChange,
            &inputArg, (void**)&pOutputArg);    
printf("status: %d, validationStatus: %d\n", status, pOutputArg->ValidationStatus);

NetValidatePasswordPolicyFree((void**)&pOutputArg);

I am working on windows XP.When I try to run, it prompt waring saying:

The procedure entry point NetValidPasswordPolicyFree could not be located in the dynamic link library NETAPI32.dll

From the MSDN it said the API is only valid in 2003 server and 2008 server.
Does it mean it can not work on XP?
Or can i find any other APIs to do the same thing as NetValidPasswordPolicy?

I googled a lot for this issue and found someone had asked similar question but it went unanswered :(. So, here I am trying my luck.

Even I tried to analyze 'NETAPI32.dll' in Reflector.exe, but while opening the .dll file it error out: Object reference not set to an instance of an object.

I am stuck badly and could not able to find any way. Any help will be appreciated :)

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

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

发布评论

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

评论(1

独享拥抱 2024-10-19 10:30:38

问题已经解决了:)。

'NETAPI32.dll' 中的 NetValidPasswordPolicy API 要求不支持“客户端”。由于此要求,我收到警告:未找到入口点。
我在 Windows 2003 服务器上尝试了我的项目,它成功了。

我关于“​​Reflector.exe”的第二个问题也是无效的,因为“NETAPI32.dll”不是 .Net dll,因此 Reflector 无法识别它。

Issue has been solved :).

NetValidPasswordPolicy API from 'NETAPI32.dll' has requirements that it is not 'client' supported. Because of this requirement I am getting the warning: Entry point not found.
I tried my project on Windows 2003 server and it worked.

And my second question about 'Reflector.exe' is also invalid because 'NETAPI32.dll' is not .Net dll so Reflector wont recognize it.

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