Hey dahall, thanks a lot! It solved the problem.
Seems like it's a bug in "CredentialsDialog.RunDialog" method, in the following line -
......
if (this.ValidatePassword && !IsValidPassword(this.UserName, password.ToString()))
......
Instead of using "this.UserName", it should just use "userName" cause that one is filled after calling "CredUIPromptForCredentials" method, right?