VBoxGuestR3LibInfoSvc.cpp revision b357df727b216b85d4517efecf466a7b14c2e80c
/* $Id$ */
/** @file
* VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, information service.
*/
/*
* Copyright (C) 2007 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.
*
* 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 "VBGLR3Internal.h"
using namespace svcInfo;
/**
* Connects to the information service.
*
* @returns VBox status code
* @param pu32ClientId Where to put the client id on success. The client id
* must be passed to all the other calls to the service.
*/
{
Info.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc))
}
return rc;
}
/**
* Disconnect from the information service.
*
* @returns VBox status code.
* @param u32ClientId The client id returned by VbglR3InfoSvcConnect().
*/
{
Info.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */
if (RT_SUCCESS(rc))
return rc;
}
/**
* Write a key value.
*
* @returns VBox status code.
* @param u32ClientId The client id returned by VbglR3InvsSvcConnect().
* @param pszKey The key to save to. Utf8
* @param pszValue The value to store. Utf8. If this is NULL then
* the key will be removed.
*/
{
int rc;
{
Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */
if (RT_SUCCESS(rc))
}
else
{
Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */
if (RT_SUCCESS(rc))
}
return rc;
}
/**
* Retrieve a key value.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success, pszValue and pcbActual containing valid data.
* @retval VERR_BUFFER_OVERFLOW if the buffer is too small, pcbActual will contain
* the require buffer size. Note race condition here when retrying wrt
* someone updating it.
* @retval VERR_NOT_FOUND if the key wasn't found.
*
* @param u32ClientId The client id returned by VbglR3ClipboardConnect().
* @param pszKey The key to read. Utf8
* @param pszValue Where to store the value retrieved. Utf8.
* @param cbValue The size of the buffer pszValue points to.
* @param pcbActual Where to store the required buffer size if cbValue
* is too small. On success this contains the
* actual size of the value retrieved. Optional.
*/
{
Msg.hdr.result = (uint32_t)VERR_WRONG_ORDER; /** @todo drop the cast when the result type has been fixed! */
if (RT_SUCCESS(rc))
{
if (RT_SUCCESS(rc2))
{
}
else
}
return rc;
}