Index: /trunk/include/VBox/VBoxGuestLib.h
===================================================================
--- /trunk/include/VBox/VBoxGuestLib.h	(revision 68435)
+++ /trunk/include/VBox/VBoxGuestLib.h	(revision 68436)
@@ -526,4 +526,9 @@
                                             unsigned *px, unsigned *py, bool *pfEnabled);
 /** @}  */
+
+/** @name VRDP
+ * @{ */
+VBGLR3DECL(int)     VbglR3VrdpGetChangeRequest(bool *pfActive, uint32_t *puExperienceLevel);
+/** @} */
 
 /** @name VM Statistics
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk	(revision 68435)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk	(revision 68436)
@@ -123,11 +123,12 @@
 	VBoxGuestR3LibTime.cpp \
  	VBoxGuestR3LibModule.cpp \
- 	VBoxGuestR3LibPidFile.cpp
-ifneq ($(KBUILD_TARGET),win) ## @todo get rid of this hack (as soon as it's all implemented / #defined).
- VBoxGuestR3Lib_SOURCES   += \
- 	VBoxGuestR3LibDaemonize.cpp \
+ 	VBoxGuestR3LibPidFile.cpp \
+ 	VBoxGuestR3LibVrdp.cpp \
  	VBoxGuestR3LibMouse.cpp \
  	VBoxGuestR3LibSeamless.cpp \
  	VBoxGuestR3LibVideo.cpp
+ifneq ($(KBUILD_TARGET),win)
+ VBoxGuestR3Lib_SOURCES   += \
+ 	VBoxGuestR3LibDaemonize.cpp
 endif
 ifdef VBOX_WITH_GUEST_PROPS
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h	(revision 68435)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLR3Internal.h	(revision 68436)
@@ -47,5 +47,5 @@
 
 int     vbglR3DoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
-int     vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType);
+int     vbglR3GRAlloc(VMMDevRequestHeader **ppReq, size_t cb, VMMDevRequestType enmReqType);
 int     vbglR3GRPerform(VMMDevRequestHeader *pReq);
 void    vbglR3GRFree(VMMDevRequestHeader *pReq);
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp	(revision 68435)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp	(revision 68436)
@@ -36,26 +36,27 @@
 
 
-int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType)
+int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, size_t cb, VMMDevRequestType enmReqType)
 {
     VMMDevRequestHeader *pReq;
 
     AssertPtrReturn(ppReq, VERR_INVALID_PARAMETER);
-    AssertMsgReturn(cb >= sizeof(VMMDevRequestHeader), ("%#x vs %#zx\n", cb, sizeof(VMMDevRequestHeader)),
+    AssertMsgReturn(cb >= sizeof(VMMDevRequestHeader) && cb < _1G, ("%#zx vs %#zx\n", cb, sizeof(VMMDevRequestHeader)),
                     VERR_INVALID_PARAMETER);
 
     pReq = (VMMDevRequestHeader *)RTMemTmpAlloc(cb);
-    if (RT_UNLIKELY(!pReq))
-        return VERR_NO_MEMORY;
+    if (RT_LIKELY(pReq))
+    {
+        pReq->size        = (uint32_t)cb;
+        pReq->version     = VMMDEV_REQUEST_HEADER_VERSION;
+        pReq->requestType = enmReqType;
+        pReq->rc          = VERR_GENERAL_FAILURE;
+        pReq->reserved1   = 0;
+        pReq->reserved2   = 0;
 
-    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;
 
-    *ppReq = pReq;
-
-    return VINF_SUCCESS;
+        return VINF_SUCCESS;
+    }
+    return VERR_NO_MEMORY;
 }
 
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp	(revision 68435)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp	(revision 68436)
@@ -106,6 +106,5 @@
                  || cbReq == RT_OFFSETOF(VMMDevReqMousePointer, pointerData) + cbImg,
                  VERR_INVALID_PARAMETER);
-    int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, cbReq,
-                           VMMDevReq_SetPointerShape);
+    int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, cbReq, VMMDevReq_SetPointerShape);
     if (RT_SUCCESS(rc))
     {
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVrdp.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVrdp.cpp	(revision 68436)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVrdp.cpp	(revision 68436)
@@ -0,0 +1,52 @@
+/* $Id$ */
+/** @file
+ * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, VRDP.
+ */
+
+/*
+ * Copyright (C) 2007-2017 Oracle Corporation
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include <iprt/time.h>
+#include "VBGLR3Internal.h"
+
+
+VBGLR3DECL(int) VbglR3VrdpGetChangeRequest(bool *pfActive, uint32_t *puExperienceLevel)
+{
+    VMMDevVRDPChangeRequest Req = {0};
+    vmmdevInitRequest(&Req.header, VMMDevReq_GetVRDPChangeRequest); //VMMDEV_REQ_HDR_INIT(&Req.header, sizeof(Req), VMMDevReq_GetVRDPChangeRequest);
+    int rc = vbglR3GRPerform(&Req.header);
+    if (RT_SUCCESS(rc))
+    {
+        *pfActive          = Req.u8VRDPActive != 0;
+        *puExperienceLevel = Req.u32VRDPExperienceLevel;
+    }
+    else
+    {
+        *pfActive          = false;
+        *puExperienceLevel = 0;
+    }
+    return rc;
+}
+
