Index: /trunk/include/VBox/VBoxGuest.h
===================================================================
--- /trunk/include/VBox/VBoxGuest.h	(revision 6446)
+++ /trunk/include/VBox/VBoxGuest.h	(revision 6447)
@@ -1388,8 +1388,4 @@
 VBGLR3DECL(int)     VbglR3Init(void);
 VBGLR3DECL(void)    VbglR3Term(void);
-VBGLR3DECL(int)     VbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cbSize,
-                                  VMMDevRequestType reqType);
-VBGLR3DECL(int)     VbglR3GRPerform(VMMDevRequestHeader *pReq);
-VBGLR3DECL(void)    VbglR3GRFree(VMMDevRequestHeader *pReq);
 # ifdef ___iprt_time_h
 VBGLR3DECL(int)     VbglR3GetHostTime(PRTTIMESPEC pTime);
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk	(revision 6446)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk	(revision 6447)
@@ -98,6 +98,10 @@
 VBoxGuestR3Lib_SOURCES     = \
 	VBoxGuestR3Lib.cpp \
+	VBoxGuestR3LibClipboard.cpp \
 	VBoxGuestR3LibDaemonize.cpp \
-	VBoxGuestR3LibClipboard.cpp
+	VBoxGuestR3LibGR.cpp \
+	VBoxGuestR3LibMouse.cpp \
+	VBoxGuestR3LibMisc.cpp \
+	VBoxGuestR3LibTime.cpp \
 
 
@@ -151,9 +155,5 @@
 #
 VBoxGuestR3LibLinux_TEMPLATE = VBOXLNX32GUESTR3LIB
-VBoxGuestR3LibLinux_SOURCES  = \
-	VBoxGuestR3Lib.cpp \
-	VBoxGuestR3LibDaemonize.cpp \
-	VBoxGuestR3LibClipboard.cpp \
-	VBoxGuestR3LibSeamless.cpp
+VBoxGuestR3LibLinux_SOURCES  = $(VBoxGuestR3Lib_SOURCES)
 VBoxGuestR3LibLinux_DEFS     = VBOX_HGCM
 
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h	(revision 6447)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h	(revision 6447)
@@ -0,0 +1,59 @@
+/* $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 support library for the guest additions, Internal header.
+ */
+
+/*
+ * Copyright (C) 2006-2007 innotek GmbH
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ */
+
+#ifndef ___VBGLR3Internal_h
+#define ___VBGLR3Internal_h
+
+#include <VBox/VBoxGuest.h>
+
+__BEGIN_DECLS
+
+int     vbglR3DoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
+int     vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType);
+int     vbglR3GRPerform(VMMDevRequestHeader *pReq);
+void    vbglR3GRFree(VMMDevRequestHeader *pReq);
+
+
+
+DECLINLINE(void) VbglHGCMParmUInt32Set(HGCMFunctionParameter *pParm, uint32_t u32)
+{
+    pParm->type = VMMDevHGCMParmType_32bit;
+    pParm->u.value32 = u32;
+}
+
+
+DECLINLINE(int) VbglHGCMParmUInt32Get(HGCMFunctionParameter *pParm, uint32_t *pu32)
+{
+    if (pParm->type == VMMDevHGCMParmType_32bit)
+    {
+        *pu32 = pParm->u.value32;
+        return VINF_SUCCESS;
+    }
+    return VERR_INVALID_PARAMETER;
+}
+
+
+DECLINLINE(void) VbglHGCMParmPtrSet(HGCMFunctionParameter *pParm, void *pv, uint32_t cb)
+{
+    pParm->type                    = VMMDevHGCMParmType_LinAddr;
+    pParm->u.Pointer.size          = cb;
+    pParm->u.Pointer.u.linearAddr  = (vmmDevHypPtr)pv;
+}
+
+__END_DECLS
+
+#endif
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp	(revision 6446)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp	(revision 6447)
@@ -1,5 +1,5 @@
-/** $Id$ */
+/* $Id$ */
 /** @file
- * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions.
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Core.
  */
 
@@ -39,4 +39,5 @@
 #include <iprt/alloca.h>
 #include <VBox/VBoxGuest.h>
+#include "VBGLR3Internal.h"
 
 
@@ -183,141 +184,2 @@
 }
 
-
-VBGLR3DECL(int) VbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType)
-{
-    VMMDevRequestHeader *pReq;
-
-    AssertPtrReturn(ppReq, VERR_INVALID_PARAMETER);
-    AssertMsgReturn(cb >= sizeof(VMMDevRequestHeader), ("%#x vs %#zx\n", cb, sizeof(VMMDevRequestHeader)),
-                    VERR_INVALID_PARAMETER);
-
-    pReq = (VMMDevRequestHeader *)RTMemTmpAlloc(cb);
-    if (RT_UNLIKELY(!pReq))
-        return VERR_NO_MEMORY;
-
-    pReq->size        = cb;
-    pReq->version     = VMMDEV_REQUEST_HEADER_VERSION;
-    pReq->requestType = enmReqType;
-    pReq->rc          = VERR_GENERAL_FAILURE;
-    pReq->reserved1   = 0;
-    pReq->reserved2   = 0;
-
-    *ppReq = pReq;
-
-    return VINF_SUCCESS;
-}
-
-
-VBGLR3DECL(int) VbglR3GRPerform(VMMDevRequestHeader *pReq)
-{
-    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_VMMREQUEST(pReq->size), pReq, pReq->size);
-}
-
-
-VBGLR3DECL(void) VbglR3GRFree(VMMDevRequestHeader *pReq)
-{
-    RTMemTmpFree(pReq);
-}
-
-
-VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime)
-{
-    VMMDevReqHostTime Req;
-    vmmdevInitRequest(&Req.header, VMMDevReq_GetHostTime);
-    Req.time = UINT64_MAX;
-    int rc = VbglR3GRPerform(&Req.header);
-    if (RT_SUCCESS(rc))
-        RTTimeSpecSetMilli(pTime, (int64_t)Req.time);
-    return rc;
-}
-
-
-VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py)
-{
-    VMMDevReqMouseStatus Req;
-    vmmdevInitRequest(&Req.header, VMMDevReq_GetMouseStatus);
-    Req.mouseFeatures = 0;
-    Req.pointerXPos = 0;
-    Req.pointerYPos = 0;
-    int rc = VbglR3GRPerform(&Req.header);
-    if (RT_SUCCESS(rc))
-    {
-        if (pfFeatures)
-            *pfFeatures = Req.mouseFeatures;
-        if (px)
-            *px = Req.pointerXPos;
-        if (py)
-            *py = Req.pointerYPos;
-    }
-    return rc;
-}
-
-
-VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures)
-{
-    VMMDevReqMouseStatus Req;
-    vmmdevInitRequest(&Req.header, VMMDevReq_SetMouseStatus);
-    Req.mouseFeatures = fFeatures;
-    Req.pointerXPos = 0;
-    Req.pointerYPos = 0;
-    return VbglR3GRPerform(&Req.header);
-}
-
-
-/**
- * Cause any pending WaitEvent calls (VBOXGUEST_IOCTL_WAITEVENT) to return
- * with a VERR_INTERRUPTED status.
- *
- * Can be used in combination with a termination flag variable for interrupting
- * event loops. Avoiding race conditions is the responsibility of the caller.
- *
- * @returns IPRT status code
- */
-VBGLR3DECL(int) VbglR3InterruptEventWaits(void)
-{
-    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT_INTERRUPT_ALL, 0, 0);
-}
-
-
-/**
- * Write to the backdoor logger from ring 3 guest code.
- *
- * @returns IPRT status code
- *
- * @remarks This currently does not accept more than 255 bytes of data at
- *          one time. It should probably be rewritten to use pass a pointer
- *          in the IOCtl.
- */
-VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cb)
-{
-    /*
-     * Solaris does not accept more than 255 bytes of data per ioctl request,
-     * so split large string into 128 byte chunks to prevent truncation.
-     */
-#define STEP 128 /** @todo increase to 512 when solaris ioctl code is fixed. (darwin limits us to 1024 IIRC) */
-    int rc = VINF_SUCCESS;
-    for (size_t off = 0; off < cb && RT_SUCCESS(rc); off += STEP)
-    {
-        size_t cbStep = RT_MIN(cb - off, STEP);
-        rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_LOG(cbStep), (char *)pch + off, cbStep);
-    }
-#undef STEP
-    return rc;
-}
-
-
-/**
- * Change the IRQ filter mask.
- *
- * @returns IPRT status code
- * @param   fOr     The OR mask.
- * @param   fNo     The NOT mask.
- */
-VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot)
-{
-    VBoxGuestFilterMaskInfo Info;
-    Info.u32OrMask = fOr;
-    Info.u32NotMask = fNot;
-    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_CTL_FILTER_MASK, &Info, sizeof(Info));
-}
-
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp	(revision 6446)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp	(revision 6447)
@@ -1,3 +1,3 @@
-/** $Id$ */
+/* $Id$ */
 /** @file
  * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Clipboard.
@@ -24,37 +24,6 @@
 #include <iprt/string.h>
 #include <iprt/assert.h>
-
-
-/* Move this to a header { */
-
-extern int vbglR3DoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
-
-
-DECLINLINE(void) VbglHGCMParmUInt32Set(HGCMFunctionParameter *pParm, uint32_t u32)
-{
-    pParm->type = VMMDevHGCMParmType_32bit;
-    pParm->u.value32 = u32;
-}
-
-
-DECLINLINE(int) VbglHGCMParmUInt32Get(HGCMFunctionParameter *pParm, uint32_t *pu32)
-{
-    if (pParm->type == VMMDevHGCMParmType_32bit)
-    {
-        *pu32 = pParm->u.value32;
-        return VINF_SUCCESS;
-    }
-    return VERR_INVALID_PARAMETER;
-}
-
-
-DECLINLINE(void) VbglHGCMParmPtrSet(HGCMFunctionParameter *pParm, void *pv, uint32_t cb)
-{
-    pParm->type                    = VMMDevHGCMParmType_LinAddr;
-    pParm->u.Pointer.size          = cb;
-    pParm->u.Pointer.u.linearAddr  = (vmmDevHypPtr)pv;
-}
-
-/* } */
+#include "VBGLR3Internal.h"
+
 
 
@@ -62,5 +31,5 @@
 /**
  * Connects to the clipboard service.
- * 
+ *
  * @returns VBox status code
  * @param   pu32ClientId    Where to put the client id on success. The client id
@@ -88,5 +57,5 @@
 /**
  * Disconnect from the clipboard service.
- * 
+ *
  * @returns VBox status code.
  * @param   u32ClientId     The client id returned by VbglR3ClipboardConnect().
@@ -107,7 +76,7 @@
 /**
  * Get a host message.
- * 
+ *
  * This will block until a message becomes available.
- * 
+ *
  * @returns VBox status code.
  * @param   u32ClientId     The client id returned by VbglR3ClipboardConnect().
@@ -154,13 +123,13 @@
 /**
  * Reads data from the host clipboard.
- * 
+ *
  * @returns VBox status code.
  * @retval  VINF_BUFFER_OVERFLOW    If there is more data available than the caller provided buffer space for.
- * 
+ *
  * @param   u32ClientId     The client id returned by VbglR3ClipboardConnect().
  * @param   fFormat         The format we're requesting the data in.
  * @param   pv              Where to store the data.
  * @param   cb              The size of the buffer pointed to by pv.
- * @param   pcb             The actual size of the host clipboard data. May be larger than cb. 
+ * @param   pcb             The actual size of the host clipboard data. May be larger than cb.
  */
 VBGLR3DECL(int) VbglR3ClipboardReadData(uint32_t u32ClientId, uint32_t fFormat, void *pv, uint32_t cb, uint32_t *pcb)
@@ -199,5 +168,5 @@
 /**
  * Advertises guest clipboard formats to the host.
- * 
+ *
  * @returns VBox status code.
  * @param   u32ClientId     The client id returned by VbglR3ClipboardConnect().
@@ -223,8 +192,8 @@
 /**
  * Send guest clipboard data to the host.
- * 
- * This is usually called in reply to a VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message 
+ *
+ * This is usually called in reply to a VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message
  * from the host.
- * 
+ *
  * @returns VBox status code.
  * @param   u32ClientId     The client id returned by VbglR3ClipboardConnect().
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp	(revision 6447)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp	(revision 6447)
@@ -0,0 +1,65 @@
+/* $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, GR.
+ */
+
+/*
+ * Copyright (C) 2007 innotek GmbH
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <iprt/mem.h>
+#include <iprt/assert.h>
+#include <iprt/string.h>
+#include <iprt/err.h>
+#include <VBox/VBoxGuest.h>
+#include "VBGLR3Internal.h"
+
+
+int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType)
+{
+    VMMDevRequestHeader *pReq;
+
+    AssertPtrReturn(ppReq, VERR_INVALID_PARAMETER);
+    AssertMsgReturn(cb >= sizeof(VMMDevRequestHeader), ("%#x vs %#zx\n", cb, sizeof(VMMDevRequestHeader)),
+                    VERR_INVALID_PARAMETER);
+
+    pReq = (VMMDevRequestHeader *)RTMemTmpAlloc(cb);
+    if (RT_UNLIKELY(!pReq))
+        return VERR_NO_MEMORY;
+
+    pReq->size        = cb;
+    pReq->version     = VMMDEV_REQUEST_HEADER_VERSION;
+    pReq->requestType = enmReqType;
+    pReq->rc          = VERR_GENERAL_FAILURE;
+    pReq->reserved1   = 0;
+    pReq->reserved2   = 0;
+
+    *ppReq = pReq;
+
+    return VINF_SUCCESS;
+}
+
+
+int vbglR3GRPerform(VMMDevRequestHeader *pReq)
+{
+    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_VMMREQUEST(pReq->size), pReq, pReq->size);
+}
+
+
+void vbglR3GRFree(VMMDevRequestHeader *pReq)
+{
+    RTMemTmpFree(pReq);
+}
+
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp	(revision 6447)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp	(revision 6447)
@@ -0,0 +1,82 @@
+/* $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Misc.
+ */
+
+/*
+ * Copyright (C) 2007 innotek GmbH
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <iprt/assert.h>
+#include "VBGLR3Internal.h"
+
+
+/**
+ * Cause any pending WaitEvent calls (VBOXGUEST_IOCTL_WAITEVENT) to return
+ * with a VERR_INTERRUPTED status.
+ *
+ * Can be used in combination with a termination flag variable for interrupting
+ * event loops. Avoiding race conditions is the responsibility of the caller.
+ *
+ * @returns IPRT status code
+ */
+VBGLR3DECL(int) VbglR3InterruptEventWaits(void)
+{
+    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT_INTERRUPT_ALL, 0, 0);
+}
+
+
+/**
+ * Write to the backdoor logger from ring 3 guest code.
+ *
+ * @returns IPRT status code
+ *
+ * @remarks This currently does not accept more than 255 bytes of data at
+ *          one time. It should probably be rewritten to use pass a pointer
+ *          in the IOCtl.
+ */
+VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cb)
+{
+    /*
+     * Solaris does not accept more than 255 bytes of data per ioctl request,
+     * so split large string into 128 byte chunks to prevent truncation.
+     */
+#define STEP 128 /** @todo increase to 512 when solaris ioctl code is fixed. (darwin limits us to 1024 IIRC) */
+    int rc = VINF_SUCCESS;
+    for (size_t off = 0; off < cb && RT_SUCCESS(rc); off += STEP)
+    {
+        size_t cbStep = RT_MIN(cb - off, STEP);
+        rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_LOG(cbStep), (char *)pch + off, cbStep);
+    }
+#undef STEP
+    return rc;
+}
+
+
+/**
+ * Change the IRQ filter mask.
+ *
+ * @returns IPRT status code
+ * @param   fOr     The OR mask.
+ * @param   fNo     The NOT mask.
+ */
+VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot)
+{
+    VBoxGuestFilterMaskInfo Info;
+    Info.u32OrMask = fOr;
+    Info.u32NotMask = fNot;
+    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_CTL_FILTER_MASK, &Info, sizeof(Info));
+}
+
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp	(revision 6447)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp	(revision 6447)
@@ -0,0 +1,55 @@
+/* $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Mouse.
+ */
+
+/*
+ * Copyright (C) 2007 innotek GmbH
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include "VBGLR3Internal.h"
+
+
+VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py)
+{
+    VMMDevReqMouseStatus Req;
+    vmmdevInitRequest(&Req.header, VMMDevReq_GetMouseStatus);
+    Req.mouseFeatures = 0;
+    Req.pointerXPos = 0;
+    Req.pointerYPos = 0;
+    int rc = vbglR3GRPerform(&Req.header);
+    if (RT_SUCCESS(rc))
+    {
+        if (pfFeatures)
+            *pfFeatures = Req.mouseFeatures;
+        if (px)
+            *px = Req.pointerXPos;
+        if (py)
+            *py = Req.pointerYPos;
+    }
+    return rc;
+}
+
+
+VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures)
+{
+    VMMDevReqMouseStatus Req;
+    vmmdevInitRequest(&Req.header, VMMDevReq_SetMouseStatus);
+    Req.mouseFeatures = fFeatures;
+    Req.pointerXPos = 0;
+    Req.pointerYPos = 0;
+    return vbglR3GRPerform(&Req.header);
+}
+
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp	(revision 6447)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp	(revision 6447)
@@ -0,0 +1,36 @@
+/** $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Time.
+ */
+
+/*
+ * Copyright (C) 2007 innotek GmbH
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * 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.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include <iprt/time.h>
+#include "VBGLR3Internal.h"
+
+
+VBGLR3DECL(int) VbglR3GetHostTime(PRTTIMESPEC pTime)
+{
+    VMMDevReqHostTime Req;
+    vmmdevInitRequest(&Req.header, VMMDevReq_GetHostTime);
+    Req.time = UINT64_MAX;
+    int rc = vbglR3GRPerform(&Req.header);
+    if (RT_SUCCESS(rc))
+        RTTimeSpecSetMilli(pTime, (int64_t)Req.time);
+    return rc;
+}
+
