RTSystemQueryDmiString-solaris.cpp revision 18ef45ed44013c0259d156b9a9dfe79e1a752dc2
/* $Id$ */
/** @file
* IPRT - RTSystemQueryDmiString, solaris ring-3.
*/
/*
* Copyright (C) 2010 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <smbios.h>
{
*pszBuf = '\0';
AssertReturn(enmString > RTSYSDMISTR_INVALID && enmString < RTSYSDMISTR_END, VERR_INVALID_PARAMETER);
int rc = VINF_SUCCESS;
int err = 0;
if (pSMB)
{
{
if (hSMBInfoId != SMB_ERR)
{
switch (enmString)
{
case RTSYSDMISTR_PRODUCT_UUID:
{
char szData[64];
{
if (i == 3 || i == 5 || i == 7 || i == 9)
*pszData++ = '-';
}
*pszData = '\0';
rc = VINF_SUCCESS;
break;
}
case RTSYSDMISTR_PRODUCT_NAME: RTStrPrintf(pszBuf, cbBuf, "%s", hSMBInfo.smbi_product); rc = VINF_SUCCESS; break;
case RTSYSDMISTR_PRODUCT_VERSION: RTStrPrintf(pszBuf, cbBuf, "%s", hSMBInfo.smbi_version); rc = VINF_SUCCESS; break;
case RTSYSDMISTR_PRODUCT_SERIAL: RTStrPrintf(pszBuf, cbBuf, "%s", hSMBInfo.smbi_serial); rc = VINF_SUCCESS; break;
default:
}
}
else
}
else
}
else
return rc;
}