开发者

NetValidatePasswordPolicy issue on XP

开发者 https://www.devze.com 2023-02-06 00:25 出处:网络
My project has a requirement that it needs to check the password complexity before create the new account.

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 :)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号