diff options
| author | Felix Geyer <debfx-pkg@fobos.de> | 2011-06-28 12:27:03 +0200 |
|---|---|---|
| committer | Felix Geyer <debfx-pkg@fobos.de> | 2011-06-28 12:27:03 +0200 |
| commit | 6a16f6900dd884e07125b51c9625f6be0a1f9b70 (patch) | |
| tree | ca3a5bca20c886411320d15508fbd741cba63545 /src/VBox/Additions | |
| parent | 0056814bdb2f8a457b56803fd24c72347173250d (diff) | |
| download | virtualbox-6a16f6900dd884e07125b51c9625f6be0a1f9b70.tar.gz | |
Imported Upstream version 4.0.10-dfsgupstream/4.0.10-dfsg
Diffstat (limited to 'src/VBox/Additions')
8 files changed, 185 insertions, 144 deletions
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp index 69ffcb308..8e2f8c0e7 100644 --- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp +++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp @@ -240,9 +240,14 @@ NTSTATUS vboxguestwinPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp) /* This IRP passed down to lower driver. */ pIrp->IoStatus.Status = STATUS_SUCCESS; - rc = vboxguestwinSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE); + IoSkipCurrentIrpStackLocation(pIrp); - /* Do not complete the IRP. */ + rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp); + Log(("VBoxGuest::vboxguestwinGuestPnp: QUERY_REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); + + /* we must not do anything the IRP after doing IoSkip & CallDriver + * since the driver below us will complete (or already have completed) the IRP. + * I.e. just return the status we got from IoCallDriver */ return rc; } @@ -330,9 +335,14 @@ NTSTATUS vboxguestwinPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp) /* This IRP passed down to lower driver. */ pIrp->IoStatus.Status = STATUS_SUCCESS; - rc = vboxguestwinSendIrpSynchronously(pDevExt->win.s.pNextLowerDriver, pIrp, TRUE); + IoSkipCurrentIrpStackLocation(pIrp); + + rc = IoCallDriver(pDevExt->win.s.pNextLowerDriver, pIrp); + Log(("VBoxGuest::vboxguestwinGuestPnp: QUERY_STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); - /* Do not complete the IRP. */ + /* we must not do anything with the IRP after doing IoSkip & CallDriver + * since the driver below us will complete (or already have completed) the IRP. + * I.e. just return the status we got from IoCallDriver */ return rc; } diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp index b530f4316..0353f046a 100644 --- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp +++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp @@ -36,55 +36,58 @@ /** - * Fallback for vbglR3GetAdditionsVersion. + * Fallback for VbglR3GetAdditionsVersion. */ static int vbglR3GetAdditionsCompileTimeVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) { - /* Raw version string: major.minor.build. */ + int rc = VINF_SUCCESS; if (ppszVer) + rc = RTStrDupEx(ppszVer, VBOX_VERSION_STRING_RAW); + if (RT_SUCCESS(rc)) { - *ppszVer = RTStrDup(VBOX_VERSION_STRING_RAW); - if (!*ppszVer) - return VERR_NO_STR_MEMORY; - } - - /* Extended version string: major.minor.build (+ vendor [suffix(es)]). */ - if (ppszVerEx) - { - *ppszVerEx = RTStrDup(VBOX_VERSION_STRING); - if (!*ppszVerEx) - return VERR_NO_STR_MEMORY; - } - - if (ppszRev) - { - char szRev[64]; - RTStrPrintf(szRev, sizeof(szRev), "%d", VBOX_SVN_REV); - *ppszRev = RTStrDup(szRev); - if (!*ppszRev) + if (ppszVerEx) + rc = RTStrDupEx(ppszVerEx, VBOX_VERSION_STRING); + if (RT_SUCCESS(rc)) { - if (ppszVer) + if (ppszRev) { - RTStrFree(*ppszVer); - *ppszVer = NULL; +#if 0 + char szRev[64]; + RTStrPrintf(szRev, sizeof(szRev), "%d", VBOX_SVN_REV); + rc = RTStrDupEx(ppszRev, szRev); +#else + rc = RTStrDupEx(ppszRev, RT_XSTR(VBOX_SVN_REV)); +#endif } - return VERR_NO_STR_MEMORY; + if (RT_SUCCESS(rc)) + return VINF_SUCCESS; + + /* bail out: */ + } + if (ppszVerEx) + { + RTStrFree(*ppszVerEx); + *ppszVerEx = NULL; } } - - return VINF_SUCCESS; + if (ppszVer) + { + RTStrFree(*ppszVer); + *ppszVer = NULL; + } + return rc; } #ifdef RT_OS_WINDOWS + /** * Looks up the storage path handle (registry). * * @returns IPRT status value - * @param hKey Receives pointer of allocated version string. NULL is - * accepted. The returned pointer must be closed by - * vbglR3CloseAdditionsWinStoragePath(). + * @param hKey Receives storage path handle on success. + * The returned handle must be closed by vbglR3CloseAdditionsWinStoragePath(). */ -static int vbglR3GetAdditionsWinStoragePath(PHKEY phKey) +static int vbglR3QueryAdditionsWinStoragePath(PHKEY phKey) { /* * Try get the *installed* version first. @@ -138,7 +141,7 @@ static int vbglR3GetAdditionsWinStoragePath(PHKEY phKey) * * @returns IPRT status value * @param hKey Handle to close, retrieved by - * vbglR3GetAdditionsWinStoragePath(). + * vbglR3QueryAdditionsWinStoragePath(). */ static int vbglR3CloseAdditionsWinStoragePath(HKEY hKey) { @@ -173,6 +176,36 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, return rc; } +#ifdef RT_OS_WINDOWS + +/** + * Queries a string value from a specified registry key. + * + * @return IPRT status code. + * @param hKey Handle of registry key to use. + * @param pszValName Value name to query value from. + * @param pszBuffer Pointer to buffer which the queried string value gets stored into. + * @param cchBuffer Size (in bytes) of buffer. + */ +static int vbglR3QueryRegistryString(HKEY hKey, const char *pszValName, char *pszBuffer, size_t cchBuffer) +{ + AssertReturn(pszValName, VERR_INVALID_PARAMETER); + AssertReturn(pszBuffer, VERR_INVALID_POINTER); + AssertReturn(cchBuffer, VERR_INVALID_PARAMETER); + + int rc; + DWORD dwType; + DWORD dwSize = (DWORD)cchBuffer; + LONG lRet = RegQueryValueEx(hKey, pszValName, NULL, &dwType, (BYTE *)pszBuffer, &dwSize); + if (lRet == ERROR_SUCCESS) + rc = dwType == REG_SZ ? VINF_SUCCESS : VERR_INVALID_PARAMETER; + else + rc = RTErrConvertFromWin32(lRet); + return rc; +} + +#endif /* RT_OS_WINDOWS */ + /** * Retrieves the installed Guest Additions version and/or revision. * @@ -180,7 +213,7 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, * @param ppszVer Receives pointer of allocated raw version string * (major.minor.build). NULL is accepted. The returned * pointer must be freed using RTStrFree().* - * @param ppszVerEx Receives pointer of allocated full version string + * @param ppszVerExt Receives pointer of allocated full version string * (raw version + vendor suffix(es)). NULL is * accepted. The returned pointer must be freed using * RTStrFree(). @@ -188,94 +221,67 @@ VBGLR3DECL(int) VbglR3ReportAdditionsStatus(VBoxGuestStatusFacility enmFacility, * accepted. The returned pointer must be freed using * RTStrFree(). */ -VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) +VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerExt, char **ppszRev) { + /* + * Zap the return value up front. + */ + if (ppszVer) + *ppszVer = NULL; + if (ppszVerExt) + *ppszVerExt = NULL; + if (ppszRev) + *ppszRev = NULL; + #ifdef RT_OS_WINDOWS HKEY hKey; - int rc = vbglR3GetAdditionsWinStoragePath(&hKey); + int rc = vbglR3QueryAdditionsWinStoragePath(&hKey); if (RT_SUCCESS(rc)) { - /* Version. */ - LONG l; - DWORD dwType; - DWORD dwSize = 32; - char *pszTmp; + /* + * Version. + */ + char szTemp[32]; if (ppszVer) { - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszVer, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "Version", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszVer, szTemp); } - if (ppszVerEx) + + if ( RT_SUCCESS(rc) + && ppszVerExt) { - dwSize = 32; /* Reset */ - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "VersionEx", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszVerEx, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "VersionExt", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszVerExt, szTemp); } - /* Revision. */ - if (ppszRev) + + /* + * Revision. + */ + if ( RT_SUCCESS(rc) + && ppszRev) { - dwSize = 32; /* Reset */ - pszTmp = (char*)RTMemAlloc(dwSize); - if (pszTmp) - { - l = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); - if (l == ERROR_SUCCESS) - { - if (dwType == REG_SZ) - rc = RTStrDupEx(ppszRev, pszTmp); - else - rc = VERR_INVALID_PARAMETER; - } - else - { - rc = RTErrConvertFromWin32(l); - } - RTMemFree(pszTmp); - } - else - rc = VERR_NO_MEMORY; + rc = vbglR3QueryRegistryString(hKey, "Revision", szTemp, sizeof(szTemp)); + if (RT_SUCCESS(rc)) + rc = RTStrDupEx(ppszRev, szTemp); + } - if (RT_FAILURE(rc) && ppszVer) - { + int rc2 = vbglR3CloseAdditionsWinStoragePath(hKey); + if (RT_SUCCESS(rc)) + rc = rc2; + + /* Clean up allocated strings on error. */ + if (RT_FAILURE(rc)) + { + if (ppszVer) RTStrFree(*ppszVer); - *ppszVer = NULL; - } + if (ppszVerExt) + RTStrFree(*ppszVerExt); + if (ppszRev) + RTStrFree(*ppszRev); } - rc = vbglR3CloseAdditionsWinStoragePath(hKey); } else { @@ -283,7 +289,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char * No registry entries found, return the version string compiled * into this binary. */ - rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); + rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerExt, ppszRev); } return rc; @@ -291,7 +297,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char /* * On non-Windows platforms just return the compile-time version string. */ - return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); + return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerExt, ppszRev); #endif /* !RT_OS_WINDOWS */ } @@ -309,7 +315,7 @@ VBGLR3DECL(int) VbglR3GetAdditionsInstallationPath(char **ppszPath) int rc; #ifdef RT_OS_WINDOWS HKEY hKey; - rc = vbglR3GetAdditionsWinStoragePath(&hKey); + rc = vbglR3QueryAdditionsWinStoragePath(&hKey); if (RT_SUCCESS(rc)) { /* Installation directory. */ diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp index d7b100ae0..c82ed08ca 100644 --- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp +++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp @@ -144,6 +144,10 @@ VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects) if (!cRects || !pRects) return VINF_SUCCESS; + AssertMsgReturn(cRects <= _1M, ("%u\n", cRects), VERR_OUT_OF_RANGE); + AssertReturn(sizeof(VMMDevVideoSetVisibleRegion)+(cRects-1)*sizeof(RTRECT) + == sizeof(VMMDevVideoSetVisibleRegion)+(uint64_t)(cRects-1)*sizeof(RTRECT), VERR_INVALID_PARAMETER); + rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevVideoSetVisibleRegion) + (cRects - 1) * sizeof(RTRECT), VMMDevReq_VideoSetVisibleRegion); diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp index 136679fe8..0e5155ef5 100644 --- a/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp +++ b/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp @@ -864,6 +864,9 @@ static int VBoxServiceControlExecCreateProcess(const char *pszExec, const char * /* Process Main flag "ExecuteProcessFlag_Hidden". */ if (fFlags & RT_BIT(2)) uProcFlags = RTPROC_FLAGS_HIDDEN; + /* Process Main flag "ExecuteProcessFlag_NoProfile". */ + if (fFlags & RT_BIT(3)) + uProcFlags = RTPROC_FLAGS_NO_PROFILE; } /* If no user name specified run with current credentials (e.g. diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp index 59f24e72b..85f17e5ef 100644 --- a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp +++ b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp @@ -189,19 +189,19 @@ static void vboxserviceVMInfoWriteFixedProperties(void) * Retrieve version information about Guest Additions and installed files (components). */ char *pszAddVer; - char *pszAddVerEx; + char *pszAddVerExt; char *pszAddRev; - rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAddVerEx, &pszAddRev); + rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAddVerExt, &pszAddRev); VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version", "%s", RT_FAILURE(rc) ? "" : pszAddVer); - VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/VersionEx", - "%s", RT_FAILURE(rc) ? "" : pszAddVerEx); + VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/VersionExt", + "%s", RT_FAILURE(rc) ? "" : pszAddVerExt); VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", "%s", RT_FAILURE(rc) ? "" : pszAddRev); if (RT_SUCCESS(rc)) { RTStrFree(pszAddVer); - RTStrFree(pszAddVerEx); + RTStrFree(pszAddVerExt); RTStrFree(pszAddRev); } diff --git a/src/VBox/Additions/linux/drm/vboxvideo_drm.c b/src/VBox/Additions/linux/drm/vboxvideo_drm.c index 8ac7896fc..b335f76eb 100644 --- a/src/VBox/Additions/linux/drm/vboxvideo_drm.c +++ b/src/VBox/Additions/linux/drm/vboxvideo_drm.c @@ -62,6 +62,14 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) +# ifdef RHEL_RELEASE_CODE +# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1) +# define DRM_RHEL61 +# endif +# endif +# endif + #include "drm/drmP.h" #include "vboxvideo_drm.h" @@ -83,8 +91,8 @@ static struct drm_driver driver = /* .driver_features = DRIVER_USE_MTRR, */ .load = vboxvideo_driver_load, .reclaim_buffers = drm_core_reclaim_buffers, - /* As of Linux 2.65.37, always the internal functions are used. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) + /* As of Linux 2.6.37, always the internal functions are used. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37) && !defined(DRM_RHEL61) .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, #endif diff --git a/src/VBox/Additions/solaris/Installer/VBox.sh b/src/VBox/Additions/solaris/Installer/VBox.sh index 842cbc1fd..5beedbc52 100755 --- a/src/VBox/Additions/solaris/Installer/VBox.sh +++ b/src/VBox/Additions/solaris/Installer/VBox.sh @@ -2,7 +2,7 @@ # # VirtualBox startup script for Solaris Guests Additions # -# Copyright (C) 2008-2010 Oracle Corporation +# Copyright (C) 2008-2011 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -22,27 +22,27 @@ # terms and conditions of either the GPL or the CDDL or both. # -CPUTYPE=`isainfo -k` -ISADIR="" -if test "$CPUTYPE" = "amd64"; then - ISADIR="amd64" +CURRENT_ISA=`isainfo -k` +if test "$CURRENT_ISA" = "amd64"; then + INSTALL_DIR="/opt/VirtualBoxAdditions/amd64" +else + INSTALL_DIR="/opt/VirtualBoxAdditions" fi -INSTALL_DIR="/opt/VirtualBoxAdditions" -APP=`which $0` -APP=`basename $APP` +APP=`basename $0` case "$APP" in - VBoxClient) - exec "$INSTALL_DIR/$ISADIR/VBoxClient" "$@" - ;; - VBoxService) - exec "$INSTALL_DIR/$ISADIR/VBoxService" "$@" - ;; - VBoxControl) - exec "$INSTALL_DIR/$ISADIR/VBoxControl" "$@" - ;; - *) - echo "Unknown application - $APP" - ;; + VBoxClient) + exec "$INSTALL_DIR/VBoxClient" "$@" + ;; + VBoxService) + exec "$INSTALL_DIR/VBoxService" "$@" + ;; + VBoxControl) + exec "$INSTALL_DIR/VBoxControl" "$@" + ;; + *) + echo "Unknown application - $APP" + exit 1 + ;; esac - +exit 0 diff --git a/src/VBox/Additions/solaris/Installer/postinstall.sh b/src/VBox/Additions/solaris/Installer/postinstall.sh index 98d3ebfad..467605307 100755 --- a/src/VBox/Additions/solaris/Installer/postinstall.sh +++ b/src/VBox/Additions/solaris/Installer/postinstall.sh @@ -22,6 +22,9 @@ # terms and conditions of either the GPL or the CDDL or both. # +LANG=C +export LANG + # uncompress(directory, file) # Updates package metadata and uncompresses the file. uncompress_file() @@ -214,8 +217,15 @@ if test ! -z "$xorgbin"; then # snv_163 drops 32-bit support completely, and uses 32-bit locations for the 64-bit stuff. Ugly. # We try to detect this by looking at bitness of "mouse_drv.so", and adjust our destination paths accordingly. - bitsize=`file $vboxmouse32_dest_base/mouse_drv.so | grep "32-bit"` - skip32="no" + # We do not rely on using Xorg -version's ABI output because some builds (snv_162 iirc) have 64-bit ABI with + # 32-bit file locations. + if test -f "$vboxmouse32_dest_base/mouse_drv.so"; then + bitsize=`file "$vboxmouse32_dest_base/mouse_drv.so" | grep -i "32-bit"` + skip32="no" + else + echo "* Warning mouse_drv.so missing. Assuming Xorg ABI is 64-bit..." + fi + if test -z "$bitsize"; then skip32="yes" vboxmouse64_dest_base=$vboxmouse32_dest_base |
