summaryrefslogtreecommitdiff
path: root/src/VBox/HostServices
diff options
context:
space:
mode:
authorFelix Geyer <debfx-pkg@fobos.de>2009-12-17 20:44:07 +0100
committerFelix Geyer <debfx-pkg@fobos.de>2009-12-17 20:44:07 +0100
commite931f478402bd35f0754a76ea5560643b9b0d1f5 (patch)
tree55be5016f268f4bbac8fe22ac99dfb782c8a6acf /src/VBox/HostServices
parent92d607e8349d0f1268b236b3bf4cb433179253f1 (diff)
downloadvirtualbox-e931f478402bd35f0754a76ea5560643b9b0d1f5.tar.gz
Imported Upstream version 3.1.2-dfsgupstream/3.1.2-dfsg
Diffstat (limited to 'src/VBox/HostServices')
-rw-r--r--src/VBox/HostServices/GuestProperties/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/GuestProperties/service.cpp152
-rw-r--r--src/VBox/HostServices/GuestProperties/testcase/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp346
-rw-r--r--src/VBox/HostServices/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/SharedClipboard/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp2
-rw-r--r--src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h2
-rw-r--r--src/VBox/HostServices/SharedClipboard/darwin.cpp2
-rw-r--r--src/VBox/HostServices/SharedFolders/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/SharedFolders/testcase/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp5
-rw-r--r--src/VBox/HostServices/SharedFolders/vbsf.cpp4
-rw-r--r--src/VBox/HostServices/SharedOpenGL/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m178
-rw-r--r--src/VBox/HostServices/SharedOpenGL/unpacker/unpack_framebuffer.c2
-rw-r--r--src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c2
-rw-r--r--[-rwxr-xr-x]src/VBox/HostServices/SharedOpenGL/unpacker/unpack_visibleregion.c2
-rw-r--r--src/VBox/HostServices/testcase/Makefile.kmk2
-rw-r--r--src/VBox/HostServices/testcase/tstHGCMSvc.cpp2
24 files changed, 495 insertions, 228 deletions
diff --git a/src/VBox/HostServices/GuestProperties/Makefile.kmk b/src/VBox/HostServices/GuestProperties/Makefile.kmk
index fb39088f3..6f993f83f 100644
--- a/src/VBox/HostServices/GuestProperties/Makefile.kmk
+++ b/src/VBox/HostServices/GuestProperties/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Shared Info Services Host Service.
#
diff --git a/src/VBox/HostServices/GuestProperties/service.cpp b/src/VBox/HostServices/GuestProperties/service.cpp
index 912f33370..9fb60d30f 100644
--- a/src/VBox/HostServices/GuestProperties/service.cpp
+++ b/src/VBox/HostServices/GuestProperties/service.cpp
@@ -154,6 +154,8 @@ private:
typedef Service SELF;
/** HGCM helper functions. */
PVBOXHGCMSVCHELPERS mpHelpers;
+ /** Global flags for the service */
+ ePropFlags meGlobalFlags;
/** The property list */
PropertyList mProperties;
/** The list of property changes for guest notifications */
@@ -222,9 +224,31 @@ private:
return rc;
}
+ /**
+ * Check whether we have permission to change a property.
+ *
+ * @returns Strict VBox status code.
+ * @retval VINF_SUCCESS if we do.
+ * @retval VERR_PERMISSION_DENIED if the value is read-only for the requesting
+ * side.
+ * @retval VINF_PERMISSION_DENIED if the side is globally marked read-only.
+ *
+ * @param eFlags the flags on the property in question
+ * @param isGuest is the guest or the host trying to make the change?
+ */
+ int checkPermission(ePropFlags eFlags, bool isGuest)
+ {
+ if (eFlags & (isGuest ? RDONLYGUEST : RDONLYHOST))
+ return VERR_PERMISSION_DENIED;
+ if (isGuest && (meGlobalFlags & RDONLYGUEST))
+ return VINF_PERMISSION_DENIED;
+ return VINF_SUCCESS;
+ }
+
public:
explicit Service(PVBOXHGCMSVCHELPERS pHelpers)
: mpHelpers(pHelpers)
+ , meGlobalFlags(NILFLAG)
, mPendingDummyReq(NULL)
, mfExitThread(false)
, mpfnHostCallback(NULL)
@@ -629,51 +653,47 @@ int Service::setProperty(uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool isGues
RTSTR_VALIDATE_ENCODING_ZERO_TERMINATED);
if ((3 == cParms) && RT_SUCCESS(rc))
rc = validateFlags(pcszFlags, &fFlags);
-
- /*
- * If the property already exists, check its flags to see if we are allowed
- * to change it.
- */
- PropertyList::iterator it;
- bool found = false;
if (RT_SUCCESS(rc))
+ {
+ /*
+ * If the property already exists, check its flags to see if we are allowed
+ * to change it.
+ */
+ PropertyList::iterator it;
+ bool found = false;
for (it = mProperties.begin(); it != mProperties.end(); ++it)
if (it->mName.compare(pcszName) == 0)
{
found = true;
break;
}
- if (RT_SUCCESS(rc) && found)
- if ( (isGuest && (it->mFlags & RDONLYGUEST))
- || (!isGuest && (it->mFlags & RDONLYHOST))
- )
- rc = VERR_PERMISSION_DENIED;
- /*
- * Set the actual value
- */
- if (RT_SUCCESS(rc))
- {
- if (found)
+ rc = checkPermission(found ? (ePropFlags)it->mFlags : NILFLAG,
+ isGuest);
+ if (rc == VINF_SUCCESS)
{
- it->mValue = pcszValue;
- it->mTimestamp = u64TimeNano;
- it->mFlags = fFlags;
+ /*
+ * Set the actual value
+ */
+ if (found)
+ {
+ it->mValue = pcszValue;
+ it->mTimestamp = u64TimeNano;
+ it->mFlags = fFlags;
+ }
+ else /* This can throw. No problem as we have nothing to roll back. */
+ mProperties.push_back(Property(pcszName, pcszValue, u64TimeNano, fFlags));
+
+ /*
+ * Send a notification to the host and return.
+ */
+ // if (isGuest) /* Notify the host even for properties that the host
+ // * changed. Less efficient, but ensures consistency. */
+ doNotifications(pcszName, u64TimeNano);
+ Log2(("Set string %s, rc=%Rrc, value=%s\n", pcszName, rc, pcszValue));
}
- else /* This can throw. No problem as we have nothing to roll back. */
- mProperties.push_back(Property(pcszName, pcszValue, u64TimeNano, fFlags));
}
- /*
- * Send a notification to the host and return.
- */
- if (RT_SUCCESS(rc))
- {
- // if (isGuest) /* Notify the host even for properties that the host
- // * changed. Less efficient, but ensures consistency. */
- doNotifications(pcszName, u64TimeNano);
- Log2(("Set string %s, rc=%Rrc, value=%s\n", pcszName, rc, pcszValue));
- }
LogFlowThisFunc(("rc = %Rrc\n", rc));
return rc;
}
@@ -706,38 +726,36 @@ int Service::delProperty(uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool isGues
rc = validateName(pcszName, cbName);
else
rc = VERR_INVALID_PARAMETER;
-
- /*
- * If the property exists, check its flags to see if we are allowed
- * to change it.
- */
- PropertyList::iterator it;
- bool found = false;
if (RT_SUCCESS(rc))
+ {
+ /*
+ * If the property exists, check its flags to see if we are allowed
+ * to change it.
+ */
+ PropertyList::iterator it;
+ bool found = false;
for (it = mProperties.begin(); it != mProperties.end(); ++it)
if (it->mName.compare(pcszName) == 0)
{
found = true;
+ rc = checkPermission((ePropFlags)it->mFlags, isGuest);
break;
}
- if (RT_SUCCESS(rc) && found)
- if ( (isGuest && (it->mFlags & RDONLYGUEST))
- || (!isGuest && (it->mFlags & RDONLYHOST))
- )
- rc = VERR_PERMISSION_DENIED;
- /*
- * And delete the property if all is well.
- */
- if (RT_SUCCESS(rc) && found)
- {
- RTTIMESPEC time;
- uint64_t u64Timestamp = RTTimeSpecGetNano(RTTimeNow(&time));
- mProperties.erase(it);
- // if (isGuest) /* Notify the host even for properties that the host
- // * changed. Less efficient, but ensures consistency. */
- doNotifications(pcszName, u64Timestamp);
+ /*
+ * And delete the property if all is well.
+ */
+ if (rc == VINF_SUCCESS && found)
+ {
+ RTTIMESPEC time;
+ uint64_t u64Timestamp = RTTimeSpecGetNano(RTTimeNow(&time));
+ mProperties.erase(it);
+ // if (isGuest) /* Notify the host even for properties that the host
+ // * changed. Less efficient, but ensures consistency. */
+ doNotifications(pcszName, u64Timestamp);
+ }
}
+
LogFlowThisFunc(("rc = %Rrc\n", rc));
return rc;
}
@@ -1047,11 +1065,11 @@ void Service::doNotifications(const char *pszProperty, uint64_t u64Timestamp)
it->mParms[0].getString(&pszPatterns, &cchPatterns);
if (prop.Matches(pszPatterns))
{
- GuestCall call = *it;
- int rc2 = getNotificationWriteOut(call.mParms, prop);
+ GuestCall curCall = *it;
+ int rc2 = getNotificationWriteOut(curCall.mParms, prop);
if (RT_SUCCESS(rc2))
- rc2 = call.mRc;
- mpHelpers->pfnCallComplete (call.mHandle, rc2);
+ rc2 = curCall.mRc;
+ mpHelpers->pfnCallComplete(curCall.mHandle, rc2);
it = mGuestWaiters.erase(it);
}
else
@@ -1291,6 +1309,20 @@ int Service::hostCall (uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paPa
break;
/* The host wishes to flush all pending notification */
+ case SET_GLOBAL_FLAGS_HOST:
+ LogFlowFunc(("SET_GLOBAL_FLAGS_HOST\n"));
+ if (cParms == 1)
+ {
+ uint32_t eFlags;
+ rc = paParms[0].getUInt32(&eFlags);
+ if (RT_SUCCESS(rc))
+ meGlobalFlags = (ePropFlags)eFlags;
+ }
+ else
+ rc = VERR_INVALID_PARAMETER;
+ break;
+
+ /* The host wishes to flush all pending notification */
case FLUSH_NOTIFICATIONS_HOST:
LogFlowFunc(("FLUSH_NOTIFICATIONS_HOST\n"));
if (cParms == 1)
diff --git a/src/VBox/HostServices/GuestProperties/testcase/Makefile.kmk b/src/VBox/HostServices/GuestProperties/testcase/Makefile.kmk
index 33c9f4aac..5cbe00d29 100644
--- a/src/VBox/HostServices/GuestProperties/testcase/Makefile.kmk
+++ b/src/VBox/HostServices/GuestProperties/testcase/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Guest Properties Host Service testcases.
#
diff --git a/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp b/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
index 3ab6f17b6..705c35ed8 100644
--- a/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
+++ b/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
@@ -1,4 +1,4 @@
-/* $Id: tstGuestPropSvc.cpp 16337 2009-01-28 21:03:49Z vboxsync $ */
+/* $Id: tstGuestPropSvc.cpp $ */
/** @file
*
* Testcase for the guest property service.
@@ -397,6 +397,57 @@ int testEnumPropsHost(VBOXHGCMSVCFNTABLE *ptable)
return rc;
}
+/**
+ * Set a property by calling the service
+ * @returns the status returned by the call to the service
+ *
+ * @param pTable the service instance handle
+ * @param pcszName the name of the property to set
+ * @param pcszValue the value to set the property to
+ * @param pcszFlags the flag string to set if one of the SET_PROP[_HOST]
+ * commands is used
+ * @param isHost whether the SET_PROP[_VALUE]_HOST commands should be
+ * used, rather than the guest ones
+ * @param useSetProp whether SET_PROP[_HOST] should be used rather than
+ * SET_PROP_VALUE[_HOST]
+ */
+int doSetProperty(VBOXHGCMSVCFNTABLE *pTable, const char *pcszName,
+ const char *pcszValue, const char *pcszFlags, bool isHost,
+ bool useSetProp)
+{
+ VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS };
+ int command = SET_PROP_VALUE;
+ if (isHost)
+ {
+ if (useSetProp)
+ command = SET_PROP_HOST;
+ else
+ command = SET_PROP_VALUE_HOST;
+ }
+ else if (useSetProp)
+ command = SET_PROP;
+ VBOXHGCMSVCPARM paParms[3];
+ /* Work around silly constant issues - we ought to allow passing
+ * constant strings in the hgcm parameters. */
+ char szName[MAX_NAME_LEN];
+ char szValue[MAX_VALUE_LEN];
+ char szFlags[MAX_FLAGS_LEN];
+ RTStrPrintf(szName, sizeof(szName), "%s", pcszName);
+ RTStrPrintf(szValue, sizeof(szValue), "%s", pcszValue);
+ RTStrPrintf(szFlags, sizeof(szFlags), "%s", pcszFlags);
+ paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1);
+ paParms[1].setPointer (szValue, (uint32_t)strlen(szValue) + 1);
+ paParms[2].setPointer (szFlags, (uint32_t)strlen(szFlags) + 1);
+ if (isHost)
+ callHandle.rc = pTable->pfnHostCall(pTable->pvService, command,
+ useSetProp ? 3 : 2, paParms);
+ else
+ pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, command,
+ useSetProp ? 3 : 2, paParms);
+ return callHandle.rc;
+}
+
+
/** Array of properties for testing SET_PROP_HOST and _GUEST. */
static const struct
{
@@ -435,58 +486,61 @@ setProperties[] =
int testSetProp(VBOXHGCMSVCFNTABLE *pTable)
{
int rc = VINF_SUCCESS;
- VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS };
RTPrintf("Testing the SET_PROP, SET_PROP_VALUE, SET_PROP_HOST and SET_PROP_VALUE_HOST calls.\n");
for (unsigned i = 0; RT_SUCCESS(rc) && (setProperties[i].pcszName != NULL);
++i)
{
- int command = SET_PROP_VALUE;
- if (setProperties[i].isHost)
- {
- if (setProperties[i].useSetProp)
- command = SET_PROP_HOST;
- else
- command = SET_PROP_VALUE_HOST;
- }
- else if (setProperties[i].useSetProp)
- command = SET_PROP;
- VBOXHGCMSVCPARM paParms[3];
- /* Work around silly constant issues - we ought to allow passing
- * constant strings in the hgcm parameters. */
- char szName[MAX_NAME_LEN];
- char szValue[MAX_VALUE_LEN];
- char szFlags[MAX_FLAGS_LEN];
- RTStrPrintf(szName, sizeof(szName), "%s", setProperties[i].pcszName);
- RTStrPrintf(szValue, sizeof(szValue), "%s", setProperties[i].pcszValue);
- RTStrPrintf(szFlags, sizeof(szFlags), "%s", setProperties[i].pcszFlags);
- paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1);
- paParms[1].setPointer (szValue, (uint32_t)strlen(szValue) + 1);
- paParms[2].setPointer (szFlags, (uint32_t)strlen(szFlags) + 1);
- if (setProperties[i].isHost)
- callHandle.rc = pTable->pfnHostCall(pTable->pvService, command,
- setProperties[i].useSetProp
- ? 3 : 2, paParms);
- else
- pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, command,
- setProperties[i].useSetProp ? 3 : 2, paParms);
- if (setProperties[i].isAllowed && RT_FAILURE(callHandle.rc))
- {
+ rc = doSetProperty(pTable, setProperties[i].pcszName,
+ setProperties[i].pcszValue,
+ setProperties[i].pcszFlags,
+ setProperties[i].isHost,
+ setProperties[i].useSetProp);
+ if (setProperties[i].isAllowed && RT_FAILURE(rc))
RTPrintf("Setting property '%s' failed with rc=%Rrc.\n",
- setProperties[i].pcszName, callHandle.rc);
- rc = callHandle.rc;
- }
+ setProperties[i].pcszName, rc);
else if ( !setProperties[i].isAllowed
- && (callHandle.rc != VERR_PERMISSION_DENIED)
- )
+ && (rc != VERR_PERMISSION_DENIED))
{
RTPrintf("Setting property '%s' returned %Rrc instead of VERR_PERMISSION_DENIED.\n",
- setProperties[i].pcszName, callHandle.rc);
- rc = VERR_UNRESOLVED_ERROR;
+ setProperties[i].pcszName, rc);
+ rc = VERR_IPE_UNEXPECTED_STATUS;
}
+ else
+ rc = VINF_SUCCESS;
}
return rc;
}
+/**
+ * Delete a property by calling the service
+ * @returns the status returned by the call to the service
+ *
+ * @param pTable the service instance handle
+ * @param pcszName the name of the property to delete
+ * @param isHost whether the DEL_PROP_HOST command should be used, rather
+ * than the guest one
+ */
+int doDelProp(VBOXHGCMSVCFNTABLE *pTable, const char *pcszName, bool isHost)
+{
+ VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS };
+ int command = DEL_PROP;
+ if (isHost)
+ command = DEL_PROP_HOST;
+ VBOXHGCMSVCPARM paParms[1];
+ /* Work around silly constant issues - we ought to allow passing
+ * constant strings in the hgcm parameters. */
+ char szName[MAX_NAME_LEN];
+ RTStrPrintf(szName, sizeof(szName), "%s", pcszName);
+ paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1);
+ if (isHost)
+ callHandle.rc = pTable->pfnHostCall(pTable->pvService, command,
+ 1, paParms);
+ else
+ pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, command,
+ 1, paParms);
+ return callHandle.rc;
+}
+
/** Array of properties for testing DEL_PROP_HOST and _GUEST. */
static const struct
{
@@ -518,40 +572,25 @@ delProperties[] =
int testDelProp(VBOXHGCMSVCFNTABLE *pTable)
{
int rc = VINF_SUCCESS;
- VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS };
RTPrintf("Testing the DEL_PROP and DEL_PROP_HOST calls.\n");
for (unsigned i = 0; RT_SUCCESS(rc) && (delProperties[i].pcszName != NULL);
++i)
{
- int command = DEL_PROP;
- if (delProperties[i].isHost)
- command = DEL_PROP_HOST;
- VBOXHGCMSVCPARM paParms[1];
- /* Work around silly constant issues - we ought to allow passing
- * constant strings in the hgcm parameters. */
- char szName[MAX_NAME_LEN];
- RTStrPrintf(szName, sizeof(szName), "%s", delProperties[i].pcszName);
- paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1);
- if (delProperties[i].isHost)
- callHandle.rc = pTable->pfnHostCall(pTable->pvService, command,
- 1, paParms);
- else
- pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL, command,
- 1, paParms);
- if (delProperties[i].isAllowed && RT_FAILURE(callHandle.rc))
- {
+ rc = doDelProp(pTable, delProperties[i].pcszName,
+ delProperties[i].isHost);
+ if (delProperties[i].isAllowed && RT_FAILURE(rc))
RTPrintf("Deleting property '%s' failed with rc=%Rrc.\n",
- delProperties[i].pcszName, callHandle.rc);
- rc = callHandle.rc;
- }
+ delProperties[i].pcszName, rc);
else if ( !delProperties[i].isAllowed
- && (callHandle.rc != VERR_PERMISSION_DENIED)
+ && (rc != VERR_PERMISSION_DENIED)
)
{
RTPrintf("Deleting property '%s' returned %Rrc instead of VERR_PERMISSION_DENIED.\n",
- delProperties[i].pcszName, callHandle.rc);
- rc = VERR_UNRESOLVED_ERROR;
+ delProperties[i].pcszName, rc);
+ rc = VERR_IPE_UNEXPECTED_STATUS;
}
+ else
+ rc = VINF_SUCCESS;
}
return rc;
}
@@ -622,7 +661,7 @@ int testGetProp(VBOXHGCMSVCFNTABLE *pTable)
{
RTPrintf("Getting property '%s' returned %Rrc instead of VERR_NOT_FOUND.\n",
getProperties[i].pcszName, rc2);
- rc = VERR_UNRESOLVED_ERROR;
+ rc = VERR_IPE_UNEXPECTED_STATUS;
}
if (RT_SUCCESS(rc) && getProperties[i].exists)
{
@@ -812,6 +851,172 @@ int testAsyncNotification(VBOXHGCMSVCFNTABLE *pTable)
return rc;
}
+/** Array of properties for testing SET_PROP_HOST and _GUEST with the
+ * READONLYGUEST global flag set. */
+static const struct
+{
+ /** Property name */
+ const char *pcszName;
+ /** Property value */
+ const char *pcszValue;
+ /** Property flags */
+ const char *pcszFlags;
+ /** Should this be set as the host or the guest? */
+ bool isHost;
+ /** Should we use SET_PROP or SET_PROP_VALUE? */
+ bool useSetProp;
+ /** Should this succeed or be rejected with VERR_PERMISSION_DENIED? */
+ bool isAllowed;
+}
+setPropertiesROGuest[] =
+{
+ { "Red", "Stop!", "transient", false, true, false },
+ { "Amber", "Caution!", "", false, false, false },
+ { "Green", "Go!", "readonly", true, true, true },
+ { "Blue", "What on earth...?", "", true, false, true },
+ { "/test/name", "test", "", false, true, false },
+ { "TEST NAME", "test", "", true, true, true },
+ { "Green", "gone out...", "", false, false, false },
+ { "Green", "gone out...", "", true, false, false },
+ { NULL, NULL, NULL, false, false, false }
+};
+
+/**
+ * Set the global flags value by calling the service
+ * @returns the status returned by the call to the service
+ *
+ * @param pTable the service instance handle
+ * @param eFlags the flags to set
+ */
+int doSetGlobalFlags(VBOXHGCMSVCFNTABLE *pTable, ePropFlags eFlags)
+{
+ VBOXHGCMSVCPARM paParm;
+ paParm.setUInt32(eFlags);
+ int rc = pTable->pfnHostCall(pTable->pvService, SET_GLOBAL_FLAGS_HOST,
+ 1, &paParm);
+ if (RT_FAILURE(rc))
+ {
+ char szFlags[MAX_FLAGS_LEN];
+ if (RT_FAILURE(writeFlags(eFlags, szFlags)))
+ RTPrintf("Failed to set the global flags.\n");
+ else
+ RTPrintf("Failed to set the global flags \"%s\".\n",
+ szFlags);
+ }
+ return rc;
+}
+
+/**
+ * Test the SET_PROP, SET_PROP_VALUE, SET_PROP_HOST and SET_PROP_VALUE_HOST
+ * functions.
+ * @returns iprt status value to indicate whether the test went as expected.
+ * @note prints its own diagnostic information to stdout.
+ */
+int testSetPropROGuest(VBOXHGCMSVCFNTABLE *pTable)
+{
+ int rc = VINF_SUCCESS;
+ RTPrintf("Testing the SET_PROP, SET_PROP_VALUE, SET_PROP_HOST and SET_PROP_VALUE_HOST calls with READONLYGUEST set globally.\n");
+ rc = VBoxHGCMSvcLoad(pTable);
+ if (RT_FAILURE(rc))
+ RTPrintf("Failed to start the HGCM service.\n");
+ if (RT_SUCCESS(rc))
+ rc = doSetGlobalFlags(pTable, RDONLYGUEST);
+ for (unsigned i = 0; RT_SUCCESS(rc) && (setPropertiesROGuest[i].pcszName != NULL);
+ ++i)
+ {
+ rc = doSetProperty(pTable, setPropertiesROGuest[i].pcszName,
+ setPropertiesROGuest[i].pcszValue,
+ setPropertiesROGuest[i].pcszFlags,
+ setPropertiesROGuest[i].isHost,
+ setPropertiesROGuest[i].useSetProp);
+ if (setPropertiesROGuest[i].isAllowed && RT_FAILURE(rc))
+ RTPrintf("Setting property '%s' failed with rc=%Rrc.\n",
+ setPropertiesROGuest[i].pcszName, rc);
+ else if ( !setPropertiesROGuest[i].isAllowed
+ && (rc != VERR_PERMISSION_DENIED))
+ {
+ RTPrintf("Setting property '%s' returned %Rrc instead of VERR_PERMISSION_DENIED.\n",
+ setPropertiesROGuest[i].pcszName, rc);
+ rc = VERR_IPE_UNEXPECTED_STATUS;
+ }
+ else
+ rc = VINF_SUCCESS;
+ }
+ if (RT_FAILURE(pTable->pfnUnload(pTable->pvService)))
+ RTPrintf("Failed to unload the HGCM service.\n");
+ return rc;
+}
+
+/** Array of properties for testing DEL_PROP_HOST and _GUEST with
+ * READONLYGUEST set globally. */
+static const struct
+{
+ /** Property name */
+ const char *pcszName;
+ /** Should this be deleted as the host (or the guest)? */
+ bool isHost;
+ /** Should this property be created first? (As host, obviously) */
+ bool shouldCreate;
+ /** And with what flags? */
+ const char *pcszFlags;
+ /** Should this succeed or be rejected with VERR_PERMISSION_DENIED? */
+ bool isAllowed;
+}
+delPropertiesROGuest[] =
+{
+ { "Red", true, true, "", true },
+ { "Amber", false, true, "", false },
+ { "Red2", true, false, "", true },
+ { "Amber2", false, false, "", false },
+ { "Red3", true, true, "READONLY", false },
+ { "Amber3", false, true, "READONLY", false },
+ { "Red4", true, true, "RDONLYHOST", false },
+ { "Amber4", false, true, "RDONLYHOST", false },
+ { NULL, false, false, "", false }
+};
+
+/**
+ * Test the DEL_PROP, and DEL_PROP_HOST functions.
+ * @returns iprt status value to indicate whether the test went as expected.
+ * @note prints its own diagnostic information to stdout.
+ */
+int testDelPropROGuest(VBOXHGCMSVCFNTABLE *pTable)
+{
+ int rc = VINF_SUCCESS;
+ RTPrintf("Testing the DEL_PROP and DEL_PROP_HOST calls with RDONLYGUEST set globally.\n");
+ rc = VBoxHGCMSvcLoad(pTable);
+ if (RT_FAILURE(rc))
+ RTPrintf("Failed to start the HGCM service.\n");
+ if (RT_SUCCESS(rc))
+ rc = doSetGlobalFlags(pTable, RDONLYGUEST);
+ for (unsigned i = 0; RT_SUCCESS(rc)
+ && (delPropertiesROGuest[i].pcszName != NULL); ++i)
+ {
+ if (RT_SUCCESS(rc) && delPropertiesROGuest[i].shouldCreate)
+ rc = doSetProperty(pTable, delPropertiesROGuest[i].pcszName,
+ "none", delPropertiesROGuest[i].pcszFlags,
+ true, true);
+ rc = doDelProp(pTable, delPropertiesROGuest[i].pcszName,
+ delPropertiesROGuest[i].isHost);
+ if (delPropertiesROGuest[i].isAllowed && RT_FAILURE(rc))
+ RTPrintf("Deleting property '%s' failed with rc=%Rrc.\n",
+ delPropertiesROGuest[i].pcszName, rc);
+ else if ( !delPropertiesROGuest[i].isAllowed
+ && (rc != VERR_PERMISSION_DENIED)
+ )
+ {
+ RTPrintf("Deleting property '%s' returned %Rrc instead of VERR_PERMISSION_DENIED.\n",
+ delPropertiesROGuest[i].pcszName, rc);
+ rc = VERR_IPE_UNEXPECTED_STATUS;
+ }
+ else
+ rc = VINF_SUCCESS;
+ }
+ if (RT_FAILURE(pTable->pfnUnload(pTable->pvService)))
+ RTPrintf("Failed to unload the HGCM service.\n");
+ return rc;
+}
+
int main(int argc, char **argv)
{
VBOXHGCMSVCFNTABLE svcTable;
@@ -824,7 +1029,7 @@ int main(int argc, char **argv)
/* The function is inside the service, not HGCM. */
if (RT_FAILURE(VBoxHGCMSvcLoad(&svcTable)))
{
- RTPrintf("Failed to start HGCM service.\n");
+ RTPrintf("Failed to start the HGCM service.\n");
return 1;
}
if (RT_FAILURE(testSetPropsHost(&svcTable)))
@@ -846,6 +1051,15 @@ int main(int argc, char **argv)
return 1;
if (RT_FAILURE(testGetNotification(&svcTable)))
return 1;
+ if (RT_FAILURE(svcTable.pfnUnload(svcTable.pvService)))
+ {
+ RTPrintf("Failed to unload the HGCM service.\n");
+ return 1;
+ }
+ if (RT_FAILURE(testSetPropROGuest(&svcTable)))
+ return 1;
+ if (RT_FAILURE(testDelPropROGuest(&svcTable)))
+ return 1;
RTPrintf("tstGuestPropSvc: SUCCEEDED.\n");
return 0;
}
diff --git a/src/VBox/HostServices/Makefile.kmk b/src/VBox/HostServices/Makefile.kmk
index 1d4034581..7136f201f 100644
--- a/src/VBox/HostServices/Makefile.kmk
+++ b/src/VBox/HostServices/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Top-level makefile for the VBox Host Services.
#
diff --git a/src/VBox/HostServices/SharedClipboard/Makefile.kmk b/src/VBox/HostServices/SharedClipboard/Makefile.kmk
index a64a35576..60420a8b1 100644
--- a/src/VBox/HostServices/SharedClipboard/Makefile.kmk
+++ b/src/VBox/HostServices/SharedClipboard/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Shared Clipboard Host Service.
#
diff --git a/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp b/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp
index cf30bd5c0..116c2b128 100644
--- a/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp
+++ b/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp
@@ -1,4 +1,4 @@
-/* $Id: darwin-pasteboard.cpp 21693 2009-07-17 13:55:39Z vboxsync $ */
+/* $Id: darwin-pasteboard.cpp $ */
/** @file
* Shared Clipboard: Mac OS X host implementation.
*/
diff --git a/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h b/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h
index d62f5767e..c6bdb969c 100644
--- a/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h
+++ b/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.h
@@ -1,4 +1,4 @@
-/* $Id: darwin-pasteboard.h 21293 2009-07-07 08:01:25Z vboxsync $ */
+/* $Id: darwin-pasteboard.h $ */
/** @file
* Shared Clipboard: Mac OS X host implementation.
*/
diff --git a/src/VBox/HostServices/SharedClipboard/darwin.cpp b/src/VBox/HostServices/SharedClipboard/darwin.cpp
index d1a607aa4..af3839356 100644
--- a/src/VBox/HostServices/SharedClipboard/darwin.cpp
+++ b/src/VBox/HostServices/SharedClipboard/darwin.cpp
@@ -1,4 +1,4 @@
-/* $Id: darwin.cpp 21293 2009-07-07 08:01:25Z vboxsync $ */
+/* $Id: darwin.cpp $ */
/** @file
* Shared Clipboard: Mac OS X host.
*/
diff --git a/src/VBox/HostServices/SharedFolders/Makefile.kmk b/src/VBox/HostServices/SharedFolders/Makefile.kmk
index 1e801e1e5..0421167d6 100644
--- a/src/VBox/HostServices/SharedFolders/Makefile.kmk
+++ b/src/VBox/HostServices/SharedFolders/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Shared Folders Host Service.
#
diff --git a/src/VBox/HostServices/SharedFolders/testcase/Makefile.kmk b/src/VBox/HostServices/SharedFolders/testcase/Makefile.kmk
index 969dfa937..fb3f2c4ba 100644
--- a/src/VBox/HostServices/SharedFolders/testcase/Makefile.kmk
+++ b/src/VBox/HostServices/SharedFolders/testcase/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the Shared Folders Host Service testcases.
#
diff --git a/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp b/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
index da2b7dd3d..510df2b1e 100644
--- a/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
+++ b/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
@@ -125,8 +125,9 @@ int rtDirClose(PRTDIR pDir)
return VINF_SUCCESS;
}
-int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
+int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
{
+ NOREF(fFlags);
switch(iDirList)
{
case 1:
@@ -228,7 +229,7 @@ static int vbsfCorrectCasing(char *pszFullPath, char *pszStartComponent)
{
size_t cbDirEntrySize = cbDirEntry;
- rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
+ rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
if (rc == VERR_NO_MORE_FILES)
break;
diff --git a/src/VBox/HostServices/SharedFolders/vbsf.cpp b/src/VBox/HostServices/SharedFolders/vbsf.cpp
index 2f1d1c043..8f6b13fd6 100644
--- a/src/VBox/HostServices/SharedFolders/vbsf.cpp
+++ b/src/VBox/HostServices/SharedFolders/vbsf.cpp
@@ -142,7 +142,7 @@ static int vbsfCorrectCasing(char *pszFullPath, char *pszStartComponent)
{
size_t cbDirEntrySize = cbDirEntry;
- rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
+ rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
if (rc == VERR_NO_MORE_FILES)
break;
@@ -1531,7 +1531,7 @@ int vbsfDirList(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLHANDLE Handle, SHFLS
{
pDirEntry = pDirEntryOrg;
- rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
+ rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
if (rc == VERR_NO_MORE_FILES)
{
*pIndex = 0; /* listing completed */
diff --git a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
index 163433b08..e5a8b9543 100644
--- a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
+++ b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the VirtualBox HGCM Service.
#
diff --git a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
index 0f497e3b3..d1c492a97 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
+++ b/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
@@ -1,4 +1,4 @@
-/* $Id: crservice.cpp 24891 2009-11-24 11:36:06Z vboxsync $ */
+/* $Id: crservice.cpp $ */
/** @file
* VBox crOpenGL: Host service entry points.
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c
index c9d33366c..c4892506a 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c
@@ -1,4 +1,4 @@
-/* $Id: server_framebuffer.c 23094 2009-09-17 13:48:46Z vboxsync $ */
+/* $Id: server_framebuffer.c $ */
/** @file
* VBox OpenGL: EXT_framebuffer_object
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
index 6292fbb57..7f110014f 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
@@ -1,4 +1,4 @@
-/* $Id: server_getshaders.c 23399 2009-09-29 05:04:38Z vboxsync $ */
+/* $Id: server_getshaders.c $ */
/** @file
* VBox OpenGL GLSL related get functions
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c
index a63085eda..fd64db8dd 100644
--- a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c
+++ b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c
@@ -1,4 +1,4 @@
-/* $Id: server_glsl.c 23277 2009-09-24 09:38:23Z vboxsync $ */
+/* $Id: server_glsl.c $ */
/** @file
* VBox OpenGL: GLSL related fucntions
diff --git a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
index 9325871cc..9852d2040 100644
--- a/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
+++ b/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m
@@ -155,6 +155,7 @@ while(0);
GLuint m_FBOThumbTexId;
GLfloat m_FBOThumbScaleX;
GLfloat m_FBOThumbScaleY;
+ uint64_t m_uiDockUpdateTime;
/* For clipping */
GLint m_cClipRects;
@@ -370,6 +371,13 @@ while(0);
[super dealloc];
}
+-(bool)isDoubleBuffer
+{
+ GLint val;
+ [m_pPixelFormat getValues:&val forAttribute:NSOpenGLPFADoubleBuffer forVirtualScreen:0];
+ return val == GL_TRUE ? YES : NO;
+}
+
-(void)setView:(NSView*)view
{
#ifdef FBO
@@ -929,7 +937,9 @@ while(0);
GLint tmpFB;
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB);
DEBUG_MSG_1(("Swap GetINT %d\n", tmpFB));
- [m_pGLCtx flushBuffer];
+ /* Don't use flush buffers cause we are using FBOs here */
+// [m_pGLCtx flushBuffer];
+ glFlush();
// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
if (tmpFB == m_FBOId)
{
@@ -951,7 +961,7 @@ while(0);
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &tmpFB);
glFlush();
// glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- DEBUG_MSG_1 (("Flusj GetINT %d\n", tmpFB));
+ DEBUG_MSG_1 (("Flush GetINT %d\n", tmpFB));
if (tmpFB == m_FBOId)
{
if ([self lockFocusIfCanDraw])
@@ -1015,89 +1025,96 @@ while(0);
if (m_FBOThumbTexId > 0 &&
[m_DockTileView thumbBitmap] != nil)
{
+ /* Only update after atleast 200 ms, cause glReadPixels is
+ * heavy performance wise. */
+ uint64_t uiNewTime = RTTimeMilliTS();
+ if (uiNewTime - m_uiDockUpdateTime > 200)
+ {
+ m_uiDockUpdateTime = uiNewTime;
#if 0
- /* todo: check this for optimization */
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, myTextureName);
- glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_STORAGE_HINT_APPLE,
- GL_STORAGE_SHARED_APPLE);
- glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
- glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
- sizex, sizey, 0, GL_BGRA,
- GL_UNSIGNED_INT_8_8_8_8_REV, myImagePtr);
- glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB,
- 0, 0, 0, 0, 0, image_width, image_height);
- glFlush();
- // Do other work processing here, using a double or triple buffer
- glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_BGRA,
- GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
+ /* todo: check this for optimization */
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, myTextureName);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_STORAGE_HINT_APPLE,
+ GL_STORAGE_SHARED_APPLE);
+ glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA,
+ sizex, sizey, 0, GL_BGRA,
+ GL_UNSIGNED_INT_8_8_8_8_REV, myImagePtr);
+ glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB,
+ 0, 0, 0, 0, 0, image_width, image_height);
+ glFlush();
+ // Do other work processing here, using a double or triple buffer
+ glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_BGRA,
+ GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
#endif
- GL_SAVE_STATE;
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOThumbId);
-
- /* We like to read from the primary color buffer */
- glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
-
- NSRect rr = [m_DockTileView frame];
-
- /* Setup all matrices */
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glViewport(0, 0, rr.size.width, rr.size.height);
- glOrtho(0, rr.size.width, 0, rr.size.height, -1, 1);
- glScalef(m_FBOThumbScaleX, m_FBOThumbScaleY, 1.0f);
- glMatrixMode(GL_TEXTURE);
- glLoadIdentity();
- glTranslatef(0.0f, m_RootShift.y, 0.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- /* Clear background to transparent */
- glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glEnable(GL_TEXTURE_RECTANGLE_ARB);
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId);
- GLint i;
- for (i = 0; i < m_cClipRects; ++i)
- {
- GLint x1 = m_paClipRects[4*i];
- GLint y1 = (r.size.height - m_paClipRects[4*i+1]);
- GLint x2 = m_paClipRects[4*i+2];
- GLint y2 = (r.size.height - m_paClipRects[4*i+3]);
- glBegin(GL_QUADS);
+ GL_SAVE_STATE;
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_FBOThumbId);
+
+ /* We like to read from the primary color buffer */
+ glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
+
+ NSRect rr = [m_DockTileView frame];
+
+ /* Setup all matrices */
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glViewport(0, 0, rr.size.width, rr.size.height);
+ glOrtho(0, rr.size.width, 0, rr.size.height, -1, 1);
+ glScalef(m_FBOThumbScaleX, m_FBOThumbScaleY, 1.0f);
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+ glTranslatef(0.0f, m_RootShift.y, 0.0f);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ /* Clear background to transparent */
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_TEXTURE_RECTANGLE_ARB);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_FBOTexId);
+ GLint i;
+ for (i = 0; i < m_cClipRects; ++i)
{
- glTexCoord2i(x1, y1); glVertex2i(x1, y1);
- glTexCoord2i(x1, y2); glVertex2i(x1, y2);
- glTexCoord2i(x2, y2); glVertex2i(x2, y2);
- glTexCoord2i(x2, y1); glVertex2i(x2, y1);
+ GLint x1 = m_paClipRects[4*i];
+ GLint y1 = (r.size.height - m_paClipRects[4*i+1]);
+ GLint x2 = m_paClipRects[4*i+2];
+ GLint y2 = (r.size.height - m_paClipRects[4*i+3]);
+ glBegin(GL_QUADS);
+ {
+ glTexCoord2i(x1, y1); glVertex2i(x1, y1);
+ glTexCoord2i(x1, y2); glVertex2i(x1, y2);
+ glTexCoord2i(x2, y2); glVertex2i(x2, y2);
+ glTexCoord2i(x2, y1); glVertex2i(x2, y1);
+ }
+ glEnd();
}
- glEnd();
+ glFinish();
+
+ /* Here the magic of reading the FBO content in our own buffer
+ * happens. We have to lock this access, in the case the dock
+ * is updated currently. */
+ [m_DockTileView lock];
+ glReadPixels(0, 0, rr.size.width, rr.size.height,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ [[m_DockTileView thumbBitmap] bitmapData]);
+ [m_DockTileView unlock];
+
+ NSDockTile *pDT = [[NSApplication sharedApplication] dockTile];
+
+ /* Send a display message to the dock tile in the main thread */
+ [[[NSApplication sharedApplication] dockTile] performSelectorOnMainThread:@selector(display) withObject:nil waitUntilDone:NO];
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ GL_RESTORE_STATE;
}
- glFinish();
-
- /* Here the magic of reading the FBO content in our own buffer
- * happens. We have to lock this access, in the case the dock
- * is updated currently. */
- [m_DockTileView lock];
- glReadPixels(0, 0, rr.size.width, rr.size.height,
- GL_RGBA,
- GL_UNSIGNED_BYTE,
- [[m_DockTileView thumbBitmap] bitmapData]);
- [m_DockTileView unlock];
-
- NSDockTile *pDT = [[NSApplication sharedApplication] dockTile];
-
- /* Send a display message to the dock tile in the main thread */
- [[[NSApplication sharedApplication] dockTile] performSelectorOnMainThread:@selector(display) withObject:nil waitUntilDone:NO];
-
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
- GL_RESTORE_STATE;
}
/* Clear background to transparent */
glClear(GL_COLOR_BUFFER_BIT);
-
+
/* Blit the content of the FBO to the screen. todo: check for
* optimization with display lists. */
GLint i;
@@ -1300,16 +1317,19 @@ void cocoaViewDestroy(NativeViewRef pView)
[win setContentView: nil];
[[win parentWindow] removeChildWindow: win];
int b = [win retainCount];
- for (; b > 1; --b)
- [win release];
+// for (; b > 1; --b)
+// [win performSelector:@selector(release)]
+ [win performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
+// [win release];
/* There seems to be a bug in the performSelector method which is called in
* parentWindowChanged above. The object is retained but not released. This
* results in an unbalanced reference count, which is here manually
* decremented. */
int a = [pView retainCount];
- for (; a > 1; --a)
- [pView release];
+// for (; a > 1; --a)
+ [pView performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
+// [pView release];
[pPool release];
}
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_framebuffer.c b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_framebuffer.c
index aba391680..df7f5cd87 100644
--- a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_framebuffer.c
+++ b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_framebuffer.c
@@ -1,4 +1,4 @@
-/* $Id: unpack_framebuffer.c 22155 2009-08-11 10:36:56Z vboxsync $ */
+/* $Id: unpack_framebuffer.c $ */
/** @file
* VBox OpenGL: EXT_framebuffer_object
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
index 97c4065c3..d8a2a06c1 100644
--- a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
+++ b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
@@ -1,4 +1,4 @@
-/* $Id: unpack_shaders.c 23399 2009-09-29 05:04:38Z vboxsync $ */
+/* $Id: unpack_shaders.c $ */
/** @file
* VBox OpenGL DRI driver functions
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_visibleregion.c b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_visibleregion.c
index ff4cee7bb..6c6eefb96 100755..100644
--- a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_visibleregion.c
+++ b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_visibleregion.c
@@ -1,4 +1,4 @@
-/* $Id: unpack_visibleregion.c 15532 2008-12-15 18:53:11Z vboxsync $ */
+/* $Id: unpack_visibleregion.c $ */
/** @file
* VBox Packing VisibleRegion information
diff --git a/src/VBox/HostServices/testcase/Makefile.kmk b/src/VBox/HostServices/testcase/Makefile.kmk
index 3b87dee63..1be23737c 100644
--- a/src/VBox/HostServices/testcase/Makefile.kmk
+++ b/src/VBox/HostServices/testcase/Makefile.kmk
@@ -1,4 +1,4 @@
-# $Id: Makefile.kmk 22653 2009-09-01 12:02:32Z vboxsync $
+# $Id: Makefile.kmk $
## @file
# Sub-Makefile for the HGCM service testcase.
#
diff --git a/src/VBox/HostServices/testcase/tstHGCMSvc.cpp b/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
index 7dc1f555d..cd4abab76 100644
--- a/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
+++ b/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
@@ -1,4 +1,4 @@
-/* $Id: tstHGCMSvc.cpp 22653 2009-09-01 12:02:32Z vboxsync $ */
+/* $Id: tstHGCMSvc.cpp $ */
/** @file
* HGCM Service Testcase.
*/