Changeset 23845 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 19, 2009 8:49:10 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53607
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/MouseFilter/Makefile.kmk
r23452 r23845 45 45 VBoxMouse-inf_INST = $(INST_ADDITIONS) 46 46 VBoxMouse-inf_MODE = a+r,u+w 47 ifndef VBOX_SIGNING_MODE 48 VBoxMouse-inf_SOURCES = VBoxMouse.inf 49 else 50 VBoxMouse-inf_SOURCES = \ 51 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf \ 52 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.cat 47 VBoxMouse-inf_BLDDIRS = $(PATH_TARGET)/VBoxMouseCat.dir 53 48 VBoxMouse-inf_CLEAN += \ 54 49 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.cat \ 55 50 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.sys \ 56 51 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf 57 VBoxMouse-inf_BLDDIRS = $(PATH_TARGET)/VBoxMouseCat.dir 52 53 ifndef VBOX_SIGNING_MODE 54 VBoxMouse-inf_SOURCES = $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf 55 else 56 VBoxMouse-inf_SOURCES = \ 57 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf \ 58 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.cat 59 60 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.cat: $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf $$(TARGET_VBoxMouse) 61 $(call MSG_TOOL,Inf2Cat,VBoxMouse-inf,$@,$<) 62 $(INSTALL) -m 644 $(TARGET_VBoxMouse) $(@D) 63 $(call VBOX_MAKE_CAT_FN, $(@D),$@) 64 endif # signing 58 65 59 66 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf: $(PATH_SUB_CURRENT)/VBoxMouse.inf $(MAKEFILE_CURRENT) | $$(call DIRDEP,$$(@D)) … … 61 68 $(call VBOX_EDIT_INF_FN,$<,$@) 62 69 63 $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.cat: $(PATH_TARGET)/VBoxMouseCat.dir/VBoxMouse.inf $$(TARGET_VBoxMouse)64 $(call MSG_TOOL,Inf2Cat,VBoxMouse-inf,$@,$<)65 $(INSTALL) -m 644 $(TARGET_VBoxMouse) $(@D)66 $(call VBOX_MAKE_CAT_FN, $(@D),$@)67 endif # signing68 69 70 include $(KBUILD_PATH)/subfooter.kmk 70 71 -
trunk/src/VBox/Additions/WINNT/MouseFilter/VBoxMouse.cpp
r21227 r23845 83 83 DriverObject->DriverExtension->AddDevice = VBoxMouse_AddDevice; 84 84 85 dprintf((" leaving DriverEntry with success\n"));85 dprintf(("VBoxMouse::DriverEntry: Leaving DriverEntry with success\n")); 86 86 return STATUS_SUCCESS; 87 87 } -
trunk/src/VBox/Additions/WINNT/MouseFilter/VBoxMouse.inf
r11636 r23845 22 22 Class=Mouse 23 23 ClassGuid={4D36E96F-E325-11CE-BFC1-08002BE10318} 24 Provider=%SUN% 25 LayoutFile=layout.inf 24 26 ;edit-DriverVer=08/26/2008,2.00.0000 25 27 ;cat CatalogFile=VBoxMouse.cat 26 28 27 [SourceDisksNames] 29 ;x86 [SourceDisksNames] 30 ;amd64 [SourceDisksNames.amd64] 28 31 1 = %VBoxMouse.MediaDesc% 29 32 … … 38 41 ;amd64 %SUN%=VBoxMouse, NTamd64 39 42 40 [DefaultInstall] 41 ; 42 ; DefaultInstall section is used to install the class filter driver. 43 ; 44 CopyFiles = @VBoxMouse.sys 43 ;x86 [VBoxMouse] 44 ;amd64 [VBoxMouse.NTamd64] 45 %VBoxMouse.SvcDesc% = VBoxMouse_Install, *PNP0F03 ; PS/2 device 46 47 [VBoxMouse_Install] 48 CopyFiles = VBoxMouse_CopyFiles 45 49 AddReg = VBoxMouse_AddReg 50 AddServices = VBoxMouse_AddServices 51 52 [VBoxMouse_CopyFiles] 53 VBoxMouse.sys 46 54 47 55 [VBoxMouse_AddReg] 48 56 HKLM, System\CurrentControlSet\Control\Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}, UpperFilters, 0x00010000, "VBoxMouse", "mouclass" 49 57 50 [ DefaultInstall.Services]58 [VBoxMouse_AddServices] 51 59 AddService = VBoxMouse, , VBoxMouse_Service_Inst 52 53 60 54 61 [VBoxMouse_Service_Inst] … … 59 66 ServiceBinary = %12%\VBoxMouse.sys 60 67 68 [ClassInstall32] 69 ; This should fix the error 0xe0000101 (The required section was not found in the INF). 61 70 62 71 [Strings] -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp
r23836 r23845 27 27 #include <VBox/VBoxGuestLib.h> 28 28 29 /* Returns 0 if equal, 1 if Ver1 is greater, 2 if Ver2 is greater 30 * Requires strings in form of "majorVer.minorVer.build" */ 31 /** @todo should be common code in the guest lib / headers */ 32 int VBoxCompareVersion (const char* pszVer1, const char* pszVer2) 33 { 34 int rc = 0; 35 int iVer1Major, iVer1Minor, iVer1Build; 36 sscanf(pszVer1, "%d.%d.%d", &iVer1Major, &iVer1Minor, &iVer1Build); 37 int iVer2Major, iVer2Minor, iVer2Build; 38 sscanf(pszVer2, "%d.%d.%d", &iVer2Major, &iVer2Minor, &iVer2Build); 39 40 int iVer1Final = (iVer1Major * 10000) + (iVer1Minor * 100) + iVer1Build; 41 int iVer2Final = (iVer2Major * 10000) + (iVer2Minor * 100) + iVer2Build; 42 43 if (iVer1Final > iVer2Final) 44 rc = 1; 45 else if (iVer2Final > iVer1Final) 46 rc = 2; 47 return rc; 48 } 29 49 30 50 int VBoxCheckHostVersion () 31 51 { 32 52 int rc; 33 char *pszHostVersion; 34 char *pszGuestVersion; 35 rc = VbglR3HostVersionCheckForUpdate(&pszHostVersion, &pszGuestVersion); 53 uint32_t uGuestPropSvcClientID; 54 55 rc = VbglR3GuestPropConnect(&uGuestPropSvcClientID); 56 if (RT_SUCCESS(rc)) 57 Log(("VBoxTray: Property Service Client ID: %ld\n", uGuestPropSvcClientID)); 58 else 59 Log(("VBoxTray: Failed to connect to the guest property service! Error: %d\n", rc)); 60 61 /* Do we need to do all this stuff? */ 62 char *pszCheckHostVersion; 63 rc = VbglR3GuestPropReadValueAlloc(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/CheckHostVersion", &pszCheckHostVersion); 64 if (RT_FAILURE(rc)) 65 { 66 if (rc == VERR_NOT_FOUND) 67 rc = VINF_SUCCESS; /* If we don't find the value above we do the check by default */ 68 else 69 Log(("VBoxTray: Could not read check host version flag! rc = %d\n", rc)); 70 } 71 else 72 { 73 /* Only don't do the check if we have a valid "0" in it */ 74 if ( atoi(pszCheckHostVersion) == 0 75 && strlen(pszCheckHostVersion)) 76 { 77 rc = VERR_NOT_SUPPORTED; 78 } 79 VbglR3GuestPropReadValueFree(pszCheckHostVersion); 80 } 81 if (rc == VERR_NOT_SUPPORTED) 82 Log(("VBoxTray: No host version check performed.")); 83 84 char szMsg[256] = "\0"; /* Sizes according to MSDN. */ 85 char szTitle[64] = "\0"; 86 36 87 if (RT_SUCCESS(rc)) 37 88 { 38 char szMsg[256]; /* Sizes according to MSDN. */ 39 char szTitle[64]; 89 /* Look up host version (revision) */ 90 char *pszVBoxHostVer; 91 rc = VbglR3GuestPropReadValueAlloc(uGuestPropSvcClientID, "/VirtualBox/HostInfo/VBoxVer", &pszVBoxHostVer); 92 if (RT_FAILURE(rc)) 93 { 94 Log(("VBoxTray: Could not read VBox host version! rc = %d\n", rc)); 95 } 96 else 97 { 98 Log(("VBoxTray: Host version: %s\n", pszVBoxHostVer)); 40 99 41 /** @todo add some translation macros here */ 42 _snprintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions update available!"); 43 _snprintf(szMsg, sizeof(szMsg), "Your guest is currently running the Guest Additions version %s. " 44 "We recommend updating to the latest version (%s) by choosing the " 45 "install option from the Devices menu.", pszGuestVersion, pszHostVersion); 100 /* Look up guest version */ 101 char szVBoxGuestVer[32]; 102 char szVBoxGuestRev[32]; 46 103 104 rc = getAdditionsVersion(szVBoxGuestVer, sizeof(szVBoxGuestVer), szVBoxGuestRev, sizeof(szVBoxGuestRev)); 105 if (RT_SUCCESS(rc)) 106 { 107 Log(("VBoxTray: Additions version: %s\n", szVBoxGuestVer)); 108 109 /* Look up last informed host version */ 110 char szVBoxHostVerLastChecked[32]; 111 HKEY hKey; 112 LONG lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions\\VBoxTray", 0, KEY_READ, &hKey); 113 if (lRet == ERROR_SUCCESS) 114 { 115 DWORD dwType; 116 DWORD dwSize = sizeof(szVBoxHostVerLastChecked); 117 lRet = RegQueryValueEx(hKey, "HostVerLastChecked", NULL, &dwType, (BYTE*)szVBoxHostVerLastChecked, &dwSize); 118 if (lRet != ERROR_SUCCESS && lRet != ERROR_FILE_NOT_FOUND) 119 Log(("VBoxTray: Could not read HostVerLastChecked! Error = %ld\n", lRet)); 120 RegCloseKey(hKey); 121 } 122 else if (lRet != ERROR_FILE_NOT_FOUND) 123 { 124 Log(("VBoxTray: Could not open VBoxTray registry key! Error = %ld\n", lRet)); 125 rc = RTErrConvertFromWin32(lRet); 126 } 127 128 /* Compare both versions and prepare message */ 129 if ( RT_SUCCESS(rc) 130 && strcmp(pszVBoxHostVer, szVBoxHostVerLastChecked) != 0 /* Make sure we did not process this host version already */ 131 && VBoxCompareVersion(pszVBoxHostVer, szVBoxGuestVer) == 1) /* Is host version greater than guest add version? */ 132 { 133 /** @todo add some translation macros here */ 134 _snprintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions update available!"); 135 _snprintf(szMsg, sizeof(szMsg), "Your guest is currently running the Guest Additions version %s. " 136 "We recommend updating to the latest version (%s) by choosing the " 137 "install option from the Devices menu.", szVBoxGuestVer, pszVBoxHostVer); 138 139 /* Save the version to just do a balloon once per new version */ 140 if (RT_SUCCESS(rc)) 141 { 142 lRet = RegCreateKeyEx (HKEY_LOCAL_MACHINE, 143 "SOFTWARE\\Sun\\VirtualBox Guest Additions\\VBoxTray", 144 0, /* Reserved */ 145 NULL, /* lpClass [in, optional] */ 146 0, /* dwOptions [in] */ 147 KEY_WRITE, 148 NULL, /* lpSecurityAttributes [in, optional] */ 149 &hKey, 150 NULL); /* lpdwDisposition [out, optional] */ 151 if (lRet == ERROR_SUCCESS) 152 { 153 lRet = RegSetValueEx(hKey, "HostVerLastChecked", 0, REG_SZ, (BYTE*)pszVBoxHostVer, (DWORD)(strlen(pszVBoxHostVer)*sizeof(char))); 154 if (lRet != ERROR_SUCCESS) 155 Log(("VBoxTray: Could not write HostVerLastChecked! Error = %ld\n", lRet)); 156 RegCloseKey(hKey); 157 } 158 else 159 Log(("VBoxTray: Could not open VBoxTray registry key! Error = %ld\n", lRet)); 160 161 if (lRet != ERROR_SUCCESS) 162 rc = RTErrConvertFromWin32(lRet); 163 } 164 } 165 } 166 } 167 VbglR3GuestPropReadValueFree(pszVBoxHostVer); 168 } 169 170 if (RT_SUCCESS(rc) && strlen(szMsg)) 171 { 47 172 rc = showBalloonTip(gInstance, gToolWindow, ID_TRAYICON, szMsg, szTitle, 5000, 0); 48 173 if (RT_FAILURE(rc)) 49 174 Log(("VBoxTray: Could not show version notifier balloon tooltip! rc = %d\n", rc)); 50 51 VbglR3GuestPropReadValueFree(pszHostVersion);52 VbglR3GuestPropReadValueFree(pszGuestVersion);53 175 } 54 176 … … 56 178 if (rc == VERR_NOT_SUPPORTED) 57 179 rc = VINF_SUCCESS; 180 181 VbglR3GuestPropDisconnect(uGuestPropSvcClientID); 58 182 return rc; 59 183 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.h
r23835 r23845 25 25 26 26 #endif /* !___VBoxHostVersion_h */ 27 -
trunk/src/VBox/Additions/WINNT/VBoxTray/helpers.cpp
r23835 r23845 256 256 return 0; 257 257 } 258 259 /** @todo move this in guest lib, also used in a similar way in VBoxService */ 260 int getAdditionsVersion(char *pszVer, size_t cbSizeVer, char *pszRev, size_t cbSizeRev) 261 { 262 HKEY hKey; 263 int rc; 264 265 /* Check the new path first. */ 266 rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 267 #ifdef RT_ARCH_AMD64 268 if (rc != ERROR_SUCCESS) 269 { 270 /* Check Wow6432Node (for new entries). */ 271 rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 272 } 273 #endif 274 275 /* Still no luck? Then try the old xVM paths ... */ 276 if (RT_FAILURE(rc)) 277 { 278 rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 279 #ifdef RT_ARCH_AMD64 280 if (rc != ERROR_SUCCESS) 281 { 282 /* Check Wow6432Node (for new entries). */ 283 rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 284 } 285 #endif 286 } 287 288 /* Did we get something worth looking at? */ 289 if (RT_SUCCESS(rc)) 290 { 291 DWORD dwSize; 292 DWORD dwType; 293 294 /* Revision. */ 295 dwSize = cbSizeRev; 296 rc = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize); 297 /* Version. */ 298 dwSize = cbSizeVer; 299 rc = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize); 300 } 301 302 if (NULL != hKey) 303 RegCloseKey(hKey); 304 305 return rc; 306 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/helpers.h
r23835 r23845 33 33 void resizeRect(RECTL *paRects, unsigned nRects, unsigned iPrimary, unsigned iResized, int NewWidth, int NewHeight); 34 34 int showBalloonTip (HINSTANCE hInst, HWND hWnd, UINT uID, const char *pszMsg, const char *pszTitle, UINT uTimeout, DWORD dwInfoFlags); 35 int getAdditionsVersion(char *pszVer, size_t cbSizeVer, char *pszRev, size_t cbSizeRev); 35 36 36 37 #endif /* !___VBOXTRAY_HELPERS_H */ -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r23839 r23845 86 86 VBoxGuestR3LibDaemonize.cpp \ 87 87 VBoxGuestR3LibGR.cpp \ 88 $(if $(VBOX_WITH_GUEST_PROPS), \ 89 VBoxGuestR3LibGuestProp.cpp \ 90 VBoxGuestR3LibHostVersion.cpp,) \ 88 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 91 89 VBoxGuestR3LibMouse.cpp \ 92 90 VBoxGuestR3LibMisc.cpp \ … … 98 96 VBoxGuestR3Lib.cpp \ 99 97 VBoxGuestR3LibGR.cpp \ 100 $(if $(VBOX_WITH_GUEST_PROPS), \ 101 VBoxGuestR3LibGuestProp.cpp \ 102 VBoxGuestR3LibHostVersion.cpp,) \ 98 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 103 99 VBoxGuestR3LibMisc.cpp \ 104 100 VBoxGuestR3LibTime.cpp -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r23843 r23845 26 26 #include <iprt/mem.h> 27 27 #include <VBox/log.h> 28 28 29 #include "VBGLR3Internal.h" 29 30 … … 193 194 } 194 195 195 196 /** @todo Docs */197 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev)198 {199 int rc;200 #ifdef RT_OS_WINDOWS201 HKEY hKey;202 LONG r;203 204 /* Check the new path first. */205 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);206 # ifdef RT_ARCH_AMD64207 if (r != ERROR_SUCCESS)208 {209 /* Check Wow6432Node (for new entries). */210 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);211 }212 # endif213 214 /* Still no luck? Then try the old xVM paths ... */215 if (FAILED(r))216 {217 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);218 # ifdef RT_ARCH_AMD64219 if (r != ERROR_SUCCESS)220 {221 /* Check Wow6432Node (for new entries). */222 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);223 }224 # endif225 }226 227 /* Did we get something worth looking at? */228 if (SUCCEEDED(r))229 {230 /* Version. */231 DWORD dwType;232 DWORD dwSize = 32;233 char *pszVer = (char*)RTMemAlloc(dwSize);234 if (pszVer)235 {236 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize))237 *ppszVer = pszVer;238 }239 /* Revision. */240 if (ppszRev)241 {242 dwSize = 32;243 char *pszRev = (char*)RTMemAlloc(dwSize);244 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize))245 *ppszRev = pszRev;246 }247 }248 rc = RTErrConvertFromWin32(r);249 250 if (NULL != hKey)251 RegCloseKey(hKey);252 #else253 rc = VERR_NOT_IMPLEMENTED;254 #endif /* RT_OS_WINDOWS */255 return rc;256 } -
trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
r23835 r23845 30 30 VBoxClient_TEMPLATE = VBOXGUESTR3CPPEXE 31 31 VBoxClient_DEFS += VBOX_X11_CLIPBOARD VBOX_WITH_HGCM 32 ifdef VBOX_WITH_DBUS33 VBoxClient_DEFS += VBOX_WITH_DBUS34 endif35 32 VBoxClient_DEFS.linux += _GNU_SOURCE 36 33 VBoxClient_SOURCES = \ … … 65 62 Xext Xmu 66 63 endif 67 ifdef VBOX_WITH_GUEST_PROPS 68 VBoxClient_SOURCES += hostversion.cpp 69 VBoxClient_DEFS += VBOX_WITH_GUEST_PROPS 70 endif 64 71 65 # 72 66 # Link aginst libstdc++.a. (http://www.trilithium.com/johan/2005/06/static-libstdc/). -
trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
r23819 r23845 46 46 extern Service *GetSeamlessService(); 47 47 extern Service *GetDisplayService(); 48 extern Service *GetHostVersionService();49 48 50 49 extern void CleanUp(); -
trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
r23835 r23845 136 136 RTPrintf("Start the VirtualBox X Window System guest services.\n\n"); 137 137 RTPrintf("Options:\n"); 138 RTPrintf(" --checkhostversion checks for a new VirtualBox host version\n");139 138 RTPrintf(" --clipboard start the shared clipboard service\n"); 140 139 RTPrintf(" --display start the display management service\n"); … … 191 190 fSuccess = false; 192 191 } 193 #ifdef VBOX_WITH_GUEST_PROPS194 else if (!strcmp(argv[i], "--checkhostversion"))195 {196 if (g_pService == NULL)197 g_pService = VBoxClient::GetHostVersionService();198 else199 fSuccess = false;200 }201 #endif202 192 else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) 203 193 {
Note:
See TracChangeset
for help on using the changeset viewer.