locked
NetValidatePasswordPolicy issue on XP and Vista RRS feed

  • Question

  • Folks
        My project has a requirement that it needs to check the password complexity before create the new account. 
        My code looks like this :

          NET_API_STATUS stat;
          NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG InputArg = {0};
          NET_VALIDATE_OUTPUT_ARG* pOutputArg = NULL;
          wchar_t* wzServer = 0;
         wchar_t wzPwd[32] = {0};
         wprintf(L"Input the password to check: ");
         wscanf(L"%s", wzPwd);    // for example, the password is He12@#$DFE
          InputArg.ClearPassword = wzPwd;
          InputArg.PasswordMatch = TRUE;
          stat = NetValidatePasswordPolicy(wzServer, NULL, NetValidatePasswordChange, &InputArg, (void**)&pOutputArg);
          printf("stat = %d, ValidationStatus = %d\n", stat, pOutputArg->ValidationStatus);
          NetValidatePasswordPolicyFree((void**)&pOutputArg);
          return 0; 

        The code works well on vista, but when i try to run it on my XP, a warning message prompt. it said : 
        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?


    snaxum
    • Moved by nobugz Monday, August 25, 2008 8:28 AM Not BCL (Moved from .NET Base Class Library to Off-Topic Posts (Do Not Post Here))
    Saturday, August 23, 2008 3:40 AM

Answers

All replies