VirtualBox

Ignore:
Timestamp:
Sep 11, 2010 6:02:17 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65796
Message:

scm cleanup

Location:
trunk/src/VBox/Additions/WINNT/VBoxCredProv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.cpp

    r30252 r32431  
    6969
    7070
    71 /* 
     71/*
    7272 * SetUsageScenario is the provider's cue that it's going to be asked for tiles
    7373 * in a subsequent call. This call happens after the user pressed CTRL+ALT+DEL
    74  * and we need to handle the CPUS_LOGON event. 
     74 * and we need to handle the CPUS_LOGON event.
    7575 */
    7676HRESULT VBoxCredProv::SetUsageScenario(CREDENTIAL_PROVIDER_USAGE_SCENARIO cpUsageScenario,
     
    105105                {
    106106                    hr = m_pCred->Initialize(m_cpUsageScenario,
    107                                              s_rgCredProvFieldDescriptors, 
     107                                             s_rgCredProvFieldDescriptors,
    108108                                             s_rgFieldStatePairs);
    109109                }
     
    134134        case CPUS_CREDUI:
    135135        case CPUS_PLAP:
    136        
     136
    137137            hr = E_NOTIMPL;
    138138            break;
     
    149149
    150150
    151 /* 
     151/*
    152152 * SetSerialization takes the kind of buffer that you would normally return to LogonUI for
    153153 * an authentication attempt.  It's the opposite of ICredentialProviderCredential::GetSerialization.
     
    168168
    169169
    170 /* 
     170/*
    171171 * Called by LogonUI to give you a callback.  Providers often use the callback if they
    172172 * some event would cause them to need to change the set of tiles (visible UI elements)
    173  * that they enumerated. 
     173 * that they enumerated.
    174174 */
    175175HRESULT VBoxCredProv::Advise(ICredentialProviderEvents *pcpEvents,
     
    187187    /*
    188188     * Save advice context for later use when binding to
    189      * certain ICredentialProviderEvents events. 
     189     * certain ICredentialProviderEvents events.
    190190     */
    191191    m_upAdviseContext = upAdviseContext;
     
    199199    Log(("VBoxCredProv::UnAdvise\n"));
    200200    if (m_pCredProvEvents != NULL)
    201     {     
     201    {
    202202        m_pCredProvEvents->Release();
    203203        m_pCredProvEvents = NULL;
     
    208208
    209209
    210 /* 
     210/*
    211211 * Called by LogonUI to determine the number of fields in your tiles. This
    212212 * does mean that all your tiles must have the same number of fields.
     
    248248
    249249
    250 /* 
     250/*
    251251 * Sets pdwCount to the number of tiles that we wish to show at this time.
    252252 * Sets pdwDefault to the index of the tile which should be used as the default.
     
    317317       && ppCredProvCredential)
    318318    {
    319         hr = m_pCred->QueryInterface(IID_ICredentialProviderCredential, 
     319        hr = m_pCred->QueryInterface(IID_ICredentialProviderCredential,
    320320                                     reinterpret_cast<void**>(ppCredProvCredential));
    321321    }
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.h

    r30252 r32431  
    9191
    9292        /** Interface reference count. */
    93         LONG                                     m_cRef;                             
     93        LONG                                     m_cRef;
    9494        /** Our one and only credential. */
    95         VBoxCredential                          *m_pCred; 
    96         /** Poller thread for credential lookup. */                           
     95        VBoxCredential                          *m_pCred;
     96        /** Poller thread for credential lookup. */
    9797        VBoxCredPoller                          *m_pPoller;
    9898        /** Used to tell our owner to re-enumerate credentials. */
    9999        ICredentialProviderEvents               *m_pCredProvEvents;
    100         /** Used to tell our owner who we are when asking to re-enumerate credentials. */           
     100        /** Used to tell our owner who we are when asking to re-enumerate credentials. */
    101101        UINT_PTR                                 m_upAdviseContext;
    102102        /** Saved usage scenario. */
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredential.cpp

    r30367 r32431  
    105105    PWSTR *ppwszStored;
    106106
    107     /* 
     107    /*
    108108     * Update domain name (can be NULL) and will
    109109     * be later replaced by the local computer name in the
     
    138138        else
    139139        {
    140             /* 
    141              * Oky, no display name, but mabye it's a 
     140            /*
     141             * Oky, no display name, but mabye it's a
    142142             * principal name from which we have to extract the
    143143             * domain from? ([email protected] -> jdoe in
     
    175175
    176176
    177 /* 
     177/*
    178178 * Initializes one credential with the field information passed in.
    179179 * Set the value of the SFI_USERNAME field to pwzUsername.
     
    190190    m_cpUS = cpus;
    191191
    192     /* 
     192    /*
    193193     * Copy the field descriptors for each field. This is useful if you want to vary the
    194      * field descriptors based on what Usage scenario the credential was created for. 
     194     * field descriptors based on what Usage scenario the credential was created for.
    195195     */
    196196    for (DWORD i = 0; SUCCEEDED(hr) && i < ARRAYSIZE(m_rgCredProvFieldDescriptors); i++)
     
    207207
    208208
    209 /* 
     209/*
    210210 * LogonUI calls this in order to give us a callback in case we need to notify it of anything.
    211  * Store this callback pointer for later use. 
     211 * Store this callback pointer for later use.
    212212 */
    213213HRESULT VBoxCredential::Advise(ICredentialProviderCredentialEvents* pcpce)
     
    230230    /*
    231231     * We're done with the current iteration, trigger a refresh of ourselves
    232      * to reset credentials and to keep the logon UI clean (no stale entries anymore). 
     232     * to reset credentials and to keep the logon UI clean (no stale entries anymore).
    233233     */
    234234    Reset();
    235235
    236     /* 
     236    /*
    237237     * Force a re-iteration of the provider (which will give zero credentials
    238      * to try out because we just resetted our one and only a line above. 
     238     * to try out because we just resetted our one and only a line above.
    239239     */
    240240    if (m_pProvider)
     
    260260    Log(("VBoxCredential::SetSelected\n"));
    261261
    262     /* 
     262    /*
    263263     * Don't do auto logon here because it would retry too often with
    264264     * every credential field (user name, password, domain, ...) which makes
     
    363363                              &dwTotalEntries,
    364364                              &dwResumeHandle);
    365         if (   (nStatus == NERR_Success) 
     365        if (   (nStatus == NERR_Success)
    366366            || (nStatus == ERROR_MORE_DATA))
    367367        {
     
    370370                for (DWORD i = 0; i < dwEntriesRead; i++)
    371371                {
    372                     /* 
    373                      * Search for the "display name" - that might be 
     372                    /*
     373                     * Search for the "display name" - that might be
    374374                     * "John Doe" or something similar the user recognizes easier
    375375                     * and may not the same as the "account" name (e.g. "jdoe").
    376376                     */
    377                     if (   pCurBuf 
     377                    if (   pCurBuf
    378378                        && pCurBuf->usri2_full_name
    379379                        && StrCmpI(pwszDisplayName, pCurBuf->usri2_full_name) == 0)
    380380                    {
    381                         /* 
    382                          * Copy the real user name (e.g. "jdoe") to our 
     381                        /*
     382                         * Copy the real user name (e.g. "jdoe") to our
    383383                         * output buffer.
    384384                         */
     
    411411    }
    412412
    413     Log(("VBoxCredential::TranslateAccountName: Returned nStatus=%ld, fFound=%s\n", 
     413    Log(("VBoxCredential::TranslateAccountName: Returned nStatus=%ld, fFound=%s\n",
    414414         nStatus, fFound ? "Yes" : "No"));
    415415    return fFound;
     
    427427        if (TranslateNameW(pwszName, NameUnknown, NameUserPrincipal, ppwszAccoutName, &cbLen))
    428428        {
    429             Log(("VBoxCredential::GetAccountName: Real ADS account name of '%ls' is '%ls'\n", 
     429            Log(("VBoxCredential::GetAccountName: Real ADS account name of '%ls' is '%ls'\n",
    430430                 pwszName, ppwszAccoutName));
    431431        }
     
    442442    {
    443443        dwErr = NO_ERROR;
    444        
     444
    445445    }
    446446#endif
     
    514514    /* Check to make sure dwFieldID is a legitimate index. */
    515515    HRESULT hr;
    516     if (   dwFieldID < ARRAYSIZE(m_rgCredProvFieldDescriptors) 
     516    if (   dwFieldID < ARRAYSIZE(m_rgCredProvFieldDescriptors)
    517517        && ppwszString)
    518518    {
     
    524524
    525525                /*
    526                  * Make a copy of the string and return that, the caller is responsible for freeing it. 
     526                 * Make a copy of the string and return that, the caller is responsible for freeing it.
    527527                 * Note that there can be empty fields (like a missing domain name); handle them
    528528                 * by writing an empty string.
     
    570570
    571571
    572 /* 
     572/*
    573573 * Sets the value of a field which can accept a string as a value.
    574574 * This is called on each keystroke when a user types into an edit field.
     
    577577                                       PCWSTR pcwzString)
    578578{
    579     Log(("VBoxCredential::SetStringValue: dwFieldID=%ld, pcwzString=%ls\n", 
     579    Log(("VBoxCredential::SetStringValue: dwFieldID=%ld, pcwzString=%ls\n",
    580580         dwFieldID, pcwzString));
    581581
     
    589589    /* Validate parameters. */
    590590    if (   dwFieldID < ARRAYSIZE(m_rgCredProvFieldDescriptors)
    591         && (   CPFT_EDIT_TEXT     == m_rgCredProvFieldDescriptors[dwFieldID].cpft 
     591        && (   CPFT_EDIT_TEXT     == m_rgCredProvFieldDescriptors[dwFieldID].cpft
    592592            || CPFT_PASSWORD_TEXT == m_rgCredProvFieldDescriptors[dwFieldID].cpft))
    593593    {
     
    709709            hr = UnicodeStringInitWithString(wszComputerName, &kil.LogonDomainName);
    710710        else
    711             hr = UnicodeStringInitWithString(m_rgFieldStrings [SFI_DOMAINNAME], 
     711            hr = UnicodeStringInitWithString(m_rgFieldStrings [SFI_DOMAINNAME],
    712712                                             &kil.LogonDomainName);
    713713
     
    723723                    /* Allocate copies of, and package, the strings in a binary blob. */
    724724                    kil.MessageType = KerbInteractiveLogon;
    725                     hr = KerbInteractiveLogonPack(kil, 
    726                                                   &pcpCredentialSerialization->rgbSerialization, 
     725                    hr = KerbInteractiveLogonPack(kil,
     726                                                  &pcpCredentialSerialization->rgbSerialization,
    727727                                                  &pcpCredentialSerialization->cbSerialization);
    728728                    if (SUCCEEDED(hr))
     
    739739                             * By setting this to CPGSR_RETURN_CREDENTIAL_FINISHED we are letting logonUI know
    740740                             * that we have all the information we need and it should attempt to submit the
    741                              * serialized credential. 
     741                             * serialized credential.
    742742                             */
    743743                            *pcpGetSerializationResponse = CPGSR_RETURN_CREDENTIAL_FINISHED;
     
    759759
    760760
    761 /* 
     761/*
    762762 * ReportResult is completely optional.  Its purpose is to allow a credential to customize the string
    763763 * and the icon displayed in the case of a logon failure.  For example, we have chosen to
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredential.h

    r30367 r32431  
    124124        LONG                                  m_cRef;
    125125        /** The usage scenario for which we were enumerated. */
    126         CREDENTIAL_PROVIDER_USAGE_SCENARIO    m_cpUS;     
     126        CREDENTIAL_PROVIDER_USAGE_SCENARIO    m_cpUS;
    127127        /** Holding type and name of each field in the tile. */
    128128        CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR  m_rgCredProvFieldDescriptors[SFI_NUM_FIELDS];
    129129        /** Holding state of each field in the tile. */
    130         FIELD_STATE_PAIR                      m_rgFieldStatePairs[SFI_NUM_FIELDS];         
     130        FIELD_STATE_PAIR                      m_rgFieldStatePairs[SFI_NUM_FIELDS];
    131131        /** Holding string value of each field. This is different from the name of
    132132            the field held in m_rgCredProvFieldDescriptors. */
    133         PWSTR                                 m_rgFieldStrings[SFI_NUM_FIELDS];           
     133        PWSTR                                 m_rgFieldStrings[SFI_NUM_FIELDS];
    134134        ICredentialProviderCredentialEvents  *m_pCredProvCredentialEvents;
    135135
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette