74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions,
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * guest user reporting / utility functions.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * Copyright (C) 2013 Oracle Corporation
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * available from http://www.virtualbox.org. This file is free software;
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * you can redistribute it and/or modify it under the terms of the GNU
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * General Public License (GPL) as published by the Free Software
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * The contents of this file may alternatively be used under the terms
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * of the Common Development and Distribution License Version 1.0
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * VirtualBox OSE distribution, in which case the provisions of the
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * CDDL are applicable instead of those of the GPL.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * You may elect to license modified versions of this file under the
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * terms and conditions of either the GPL or the CDDL or both.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync/*******************************************************************************
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync* Header Files *
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync*******************************************************************************/
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * Reports a state change of a specific guest user.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @returns IPRT status value
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @param pszUser Guest user name to report state for.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @param pszDomain Domain the guest user's account is bound to.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @param enmState Guest user state to report.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @param puDetails Pointer to state details. Optional.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * @param cbDetails Size (in bytes) of state details. Pass 0
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * if puDetails is NULL.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsyncVBGLR3DECL(int) VbglR3GuestUserReportState(const char *pszUser,
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync /* pszDomain is optional. */
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync /* puDetails is optional. */
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync uint32_t cbBase = sizeof(VMMDevReportGuestUserState);
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync uint32_t cbUser = strlen(pszUser) + 1; /* Include terminating zero */
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync uint32_t cbDomain = pszDomain ? strlen(pszDomain) + 1 /* Dito */ : 0;
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync /* Allocate enough space for all fields. */
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync int rc = vmmdevInitRequest(&pReport->header, VMMDevReq_ReportGuestUserState);
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * Note: cbOffDynamic contains the first dynamic array entry within
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * VBoxGuestUserStatus.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * Therefore it's vital to *not* change the order of the struct members
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync * without altering this code. Don't try this at home.
74b44b648d73d1b635a78405f0ae332c408ca529vboxsync /* pDynamic marks the beginning for the dynamically allocated areas. */