VBoxCredProvProvider.cpp revision 9dfe45f98c4eace98447efa6bead6f5d23454e27
* available from http://www.virtualbox.org. This file is free software;
#include <credentialprovider.h>
#include "VBoxCredentialProvider.h"
#include "VBoxCredProvProvider.h"
#include "VBoxCredProvCredential.h"
m_fHandleRemoteSessions(false)
if (m_pCred)
if (m_pPoller)
delete m_pPoller;
cRefs);
return cRefs;
cRefs);
if (!cRefs)
return cRefs;
if (ppvInterface)
return hr;
DWORD dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Oracle\\VirtualBox Guest Additions\\AutoLogon",
m_fHandleRemoteSessions = true;
return ERROR_SUCCESS;
rc);
bool fHandle = false;
fHandle = true;
fHandle = true;
return fHandle;
VBoxCredProvProvider::SetUsageScenario(CREDENTIAL_PROVIDER_USAGE_SCENARIO enmUsageScenario, DWORD dwFlags)
switch (m_enmUsageScenario)
case CPUS_LOGON:
case CPUS_UNLOCK_WORKSTATION:
if (!HandleCurrentSession())
if (!m_pPoller)
VBoxCredProvVerbose(0, "VBoxCredProv::SetUsageScenario: Error initializing poller thread, rc=%Rrc\n", rc);
&& !m_pCred)
case CPUS_CHANGE_PASSWORD:
case CPUS_CREDUI:
case CPUS_PLAP:
return hr;
VBoxCredProvProvider::SetSerialization(const CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION *pcpCredentialSerialization)
return E_NOTIMPL;
if (m_pEvents)
if (m_pEvents)
return S_OK;
if (m_pEvents)
return S_OK;
if (pdwCount)
return S_OK;
VBoxCredProvProvider::GetFieldDescriptorAt(DWORD dwIndex, CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR **ppFieldDescriptor)
(PCREDENTIAL_PROVIDER_FIELD_DESCRIPTOR)CoTaskMemAlloc(sizeof(CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR));
if (pcpFieldDesc)
return hr;
VBoxCredProvProvider::GetCredentialCount(DWORD *pdwCount, DWORD *pdwDefault, BOOL *pfAutoLogonWithDefault)
bool fHasCredentials = false;
if (m_pCred)
if (fHasCredentials)
*pfAutoLogonWithDefault = TRUE; /* We always at least try to auto-login (if password is correct). */
*pdwCount = 0;
VBoxCredProvVerbose(0, "VBoxCredProv::GetCredentialCount: *pdwCount=%ld, *pdwDefault=%ld, *pfAutoLogonWithDefault=%s\n",
return S_OK;
* Called by Winlogon to retrieve the interface of our current ICredentialProviderCredential interface.
VBoxCredProvProvider::GetCredentialAt(DWORD dwIndex, ICredentialProviderCredential **ppCredProvCredential)
if (!m_pCred)
return E_INVALIDARG;
if ( dwIndex == 0
reinterpret_cast<void**>(ppCredProvCredential));
return hr;
if (m_pEvents)
return hr;