summaryrefslogtreecommitdiff
path: root/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp')
-rw-r--r--src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
index d46f9853bba..01933f9b49d 100644
--- a/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
+++ b/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvProvider.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2012-2016 Oracle Corporation
+ * Copyright (C) 2012-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -416,18 +416,28 @@ VBoxCredProvProvider::GetFieldDescriptorAt(DWORD dwIndex, CREDENTIAL_PROVIDER_FI
pcpFieldDesc->dwFieldID = field.desc.dwFieldID;
pcpFieldDesc->cpft = field.desc.cpft;
- if (field.desc.pszLabel)
+
+ PCRTUTF16 pcwszField = NULL;
+
+ if (dwIndex != VBOXCREDPROV_FIELDID_PASSWORD) /* Don't ever get any password. Never ever, ever. */
{
- hr = SHStrDupW(field.desc.pszLabel, &pcpFieldDesc->pszLabel);
+ if (m_pCred) /* If we have retrieved credentials, get the actual (current) value. */
+ pcwszField = m_pCred->getField(dwIndex);
+ else /* Otherwise get the default value. */
+ pcwszField = field.desc.pszLabel;
+ }
- VBoxCredProvVerbose(0, "VBoxCredProv::GetFieldDescriptorAt: dwIndex=%ld, pszLabel=%ls\n",
- dwIndex,
+ hr = SHStrDupW(pcwszField ? pcwszField : L"", &pcpFieldDesc->pszLabel);
+
+ VBoxCredProvVerbose(0, "VBoxCredProv::GetFieldDescriptorAt: dwIndex=%ld, pszLabel=%ls, hr=0x%08x\n",
+ dwIndex,
#ifdef DEBUG /* Don't show any (sensitive data) in release mode. */
- field.desc.pszLabel);
+ pcwszField ? pcwszField : L"",
#else
- L"XXX");
+ L"XXX",
#endif
- }
+ hr);
+
pcpFieldDesc->guidFieldType = field.desc.guidFieldType;
}
else