credui

DefaultNetworkCredentials has null values. Need to prompt user... how?

Under certain circumstances my desktop app using SharePoint web services ends up with DefaultNetworkCredentials having null values, and so the call fails. I need to then obtain the users credentials, but I haven't found a straightfoward way to do so. I'm considering implementing the solution outlined in http://www.pinvoke.net/default.a...

Win32: CredUIConfirmCredentials behaves unexpectedly

I'm using CredUIConfirmCredentials in combination with CredUIPromptForCredentials. I set the EXPECT_CONFIRMATION, and when the credentials are first provided by the user the call to CredUIConfirmCredentials returns NO_ERROR as expected. However, on all subsequent calls to CredUIConfirmCredentials, with the same credentials, ERROR_I...

CredWrite returns Win32 error code 2 (ERROR_INVALID_FUNCTION) "Incorrect function."

i'm trying to call CredWrite, but it is returning ERROR_INVALID_FUNCTION. i can call CredRead to fetch credentials out of the password store, and i can store new credentials by using CredUIPromptForCredentials. But i cannot figure out how to get CredWrite to work. The code i'm using is: var Target, Username, Password: WideString; b...