In local security policy (PC-Control panel-Administration-local security policy) there is a parameter “Minimum length of the password” and a parameter “Password must meet complexity requirements” (true/false). How can I read them in Delphi (for WinXpSp3-Win2003-Vista-Win7-Win2008(+r2))?

I’m looking for something like:
Function DetectSystemMinPassLength:integer;
begin
//?
end;
Function DetectSystemPassComplexity:boolean;
begin
//?
end;
Additional question:
Does there exist in Delphi (or WinApi) function which can check if a given password conforms to system policies (or set)?
For example:
Function MyCheckPassComplexity (Password:string):boolean;
begin
// ???
end;
use
MyCheckPassComplexity (' 12345 '); //result False
MyCheckPassComplexity (' MyCoolPassword9999 '); //result True
Usually to read a local or group policy setting you must use the
Group Policy Settings Reference for Windows and Windows Serverwhich basically is a set of excel files which contains the windows registry keys where is stored such info. unfortunately in this case if you check such reference for these Account policies (Enforce password history,Maximum password age, Minimum password age, Minimum password length) you will find this message:
Exist a set of WMI classes in the
root\RSOP\Computernamespace like RSOP_SecuritySettingBoolean, RSOP_SecuritySettingNumeric , RSOP_SecuritySettings to access the an account policy but these classes only works (I mean retrieve information) on systems which is are in a domain, but it does not work in a workgroup.For the moment I think which you best option is export the local policies to a ini file using this command (and then parse the result using a TIniFile class)
This command will create a file like this
About your second question to validate a password you can use the
NetValidatePasswordPolicyWinAPI function.