VirtualBox

Ignore:
Timestamp:
Jan 13, 2014 6:40:38 PM (11 years ago)
Author:
vboxsync
Message:

VBoxCredProv: Implemented registry option to disable handling SENS events.

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

Legend:

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

    r46382 r50064  
    55
    66/*
    7  * Copyright (C) 2012-2013 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    142142            && dwSize == sizeof(DWORD))
    143143        {
    144             m_fHandleRemoteSessions = true;
     144            m_fHandleRemoteSessions = RT_BOOL(dwValue);
    145145        }
    146146
     
    286286        }
    287287
    288         case CPUS_CHANGE_PASSWORD:
    289         case CPUS_CREDUI:
    290         case CPUS_PLAP:
     288        case CPUS_CHANGE_PASSWORD: /* Asks us to provide a way to change the password. */
     289        case CPUS_CREDUI:          /* Displays an own UI. We don't need that. */
     290        case CPUS_PLAP:            /* See Pre-Logon-Access Provider. Not needed (yet). */
    291291
    292292            hr = E_NOTIMPL;
  • trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredentialProvider.cpp

    r46593 r50064  
    55
    66/*
    7  * Copyright (C) 2012-2013 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646
    4747#ifdef VBOX_WITH_SENS
     48static bool g_fSENSEnabled = false;
    4849static IEventSystem *g_pIEventSystem;   /**< Pointer to IEventSystem interface. */
    4950
     
    388389        case DLL_THREAD_DETACH:
    389390            break;
     391
     392        default:
     393            break;
    390394    }
    391395
     
    442446    if (!g_cDllRefs)
    443447    {
    444         VBoxCredentialProviderUnregisterSENS();
     448        if (g_fSENSEnabled)
     449            VBoxCredentialProviderUnregisterSENS();
    445450
    446451        CoUninitialize();
     
    477482
    478483#ifdef VBOX_WITH_SENS
    479             if (SUCCEEDED(hr))
     484            g_fSENSEnabled = true; /* By default SENS support is enabled. */
     485
     486            HKEY hKey;
     487            /** @todo Add some registry wrapper function(s) as soon as we got more values to retrieve. */
     488            DWORD dwRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Oracle\\VirtualBox Guest Additions\\AutoLogon",
     489                                       0L, KEY_QUERY_VALUE, &hKey);
     490            if (dwRet == ERROR_SUCCESS)
     491            {
     492                DWORD dwValue;
     493                DWORD dwType = REG_DWORD;
     494                DWORD dwSize = sizeof(DWORD);
     495
     496                dwRet = RegQueryValueEx(hKey, L"HandleSENS", NULL, &dwType, (LPBYTE)&dwValue, &dwSize);
     497                if (   dwRet  == ERROR_SUCCESS
     498                    && dwType == REG_DWORD
     499                    && dwSize == sizeof(DWORD))
     500                {
     501                    g_fSENSEnabled = RT_BOOL(dwValue);
     502                }
     503
     504                RegCloseKey(hKey);
     505            }
     506
     507            VBoxCredProvVerbose(0, "VBoxCredentialProviderCreate: g_fSENSEnabled=%RTbool\n",
     508                                g_fSENSEnabled);
     509            if (   SUCCEEDED(hr)
     510                && g_fSENSEnabled)
    480511            {
    481512                HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    482513                VBoxCredentialProviderRegisterSENS();
    483514            }
     515#else
     516            VBoxCredProvVerbose(0, "VBoxCredentialProviderCreate: SENS support is disabled\n");
    484517#endif
    485518        }
Note: See TracChangeset for help on using the changeset viewer.

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