I wanted to read credentials from Windows Credential Manager. When I used credread() it finds the entry and gives me the username but for password (CredentialBlob) is says bad pointer and CredentialBlobSize contains zero.
I'm reading an entry in "Windows Credentials" but not the one in "Generic Credentials" in the credentials manager.
I wanted to use these credentials in ManagementScope object to connect to a remote machine. I think ideally it should connect without username and password as they are stored in the credentials manager but it is not.
Can someone help me with it?
CREDENTIALW pcred; BOOL ok = ::CredReadW (L"win2012cluster", 2, 0, &pcred); wprintf (L"CredRead() - errno %d\n", ok ? 0 : ::GetLastError()); if (!ok) exit(1); wprintf (L"Read username = '%s', password='%s' (%d bytes)\n", pcred->UserName, (char*)pcred->CredentialBlob, pcred->CredentialBlobSize); ::CredFree (pcred);Thanks