VBoxGuestR3LibAutoLogon.cpp revision 99e94accbcf65ea44e5edb07c8f5dfec0ccc22fe
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * VBoxGuestR3LibAutoLogon - Ring-3 utility functions for auto-logon modules
49dbdb0186eb23d87d685b96eaefa9ec3c71d9b8David Lawrence * (VBoxGINA / VBoxCredProv / pam_vbox).
15a44745412679c30a6d022733925af70a38b715David Lawrence * Copyright (C) 2012 Oracle Corporation
15a44745412679c30a6d022733925af70a38b715David Lawrence * This file is part of VirtualBox Open Source Edition (OSE), as
15a44745412679c30a6d022733925af70a38b715David Lawrence * available from http://www.virtualbox.org. This file is free software;
15a44745412679c30a6d022733925af70a38b715David Lawrence * you can redistribute it and/or modify it under the terms of the GNU
15a44745412679c30a6d022733925af70a38b715David Lawrence * General Public License (GPL) as published by the Free Software
15a44745412679c30a6d022733925af70a38b715David Lawrence * Foundation, in version 2 as it comes in the "COPYING" file of the
15a44745412679c30a6d022733925af70a38b715David Lawrence * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
49dbdb0186eb23d87d685b96eaefa9ec3c71d9b8David Lawrence * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * The contents of this file may alternatively be used under the terms
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * of the Common Development and Distribution License Version 1.0
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * VirtualBox OSE distribution, in which case the provisions of the
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * CDDL are applicable instead of those of the GPL.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * You may elect to license modified versions of this file under the
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * terms and conditions of either the GPL or the CDDL or both.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence/*******************************************************************************
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence* Header Files *
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence*******************************************************************************/
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * Reports the current auto-logon status to the host.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * This makes sure that the Failed state is sticky.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * @return IPRT status code.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * @param enmStatus Status to report to the host.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid LawrenceVBGLR3DECL(int) VbglR3AutoLogonReportStatus(VBoxGuestFacilityStatus enmStatus)
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * VBoxGuestFacilityStatus_Failed is sticky.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence static VBoxGuestFacilityStatus s_enmLastStatus = VBoxGuestFacilityStatus_Inactive;
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence if (s_enmLastStatus != VBoxGuestFacilityStatus_Failed)
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence int rc = VbglR3ReportAdditionsStatus(VBoxGuestFacilityType_AutoLogon,
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * To maintain backwards compatibility to older hosts which don't have
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * VMMDevReportGuestStatus implemented we set the appropriate status via
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence * guest property to have at least something.
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence /** @todo Move VBoxGuestStatusCurrent -> const char* to an own function. */
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Inactive");
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Disabled");
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "PreInit");
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Init");
a904de0bc85cc3974a87a32deedb69d6a68ec36cDavid Lawrence cbRet = RTStrPrintf(szStatus, sizeof(szStatus), "Active");
if (cbRet)
return VINF_SUCCESS;
#ifdef RT_OS_WINDOWS