Changeset 31052 in vbox for trunk/src/VBox/Additions/common/VBoxControl
- Timestamp:
- Jul 23, 2010 12:10:41 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63977
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r31041 r31052 1274 1274 bool usageOK = true; 1275 1275 bool fOnlyShowAutoMount = false; 1276 if ( argc == 1 1277 && ( RTStrICmp(argv[0], "-automount") == 0 1276 if (argc == 1) 1277 { 1278 if ( RTStrICmp(argv[0], "-automount") == 0 1278 1279 || RTStrICmp(argv[0], "/automount") == 0) 1279 ) 1280 { 1281 fOnlyShowAutoMount = true; 1280 { 1281 fOnlyShowAutoMount = true; 1282 } 1283 else 1284 usageOK = false; 1282 1285 } 1283 1286 else if (argc > 1) … … 1296 1299 else 1297 1300 { 1298 uint32_t cMappings = 64; /* See shflsvc.h for define; should be used later. */ 1299 uint32_t cbMappings = cMappings * sizeof(VBGLR3SHAREDFOLDERMAPPING); 1300 VBGLR3SHAREDFOLDERMAPPING *paMappings = (PVBGLR3SHAREDFOLDERMAPPING)RTMemAlloc(cbMappings); 1301 1302 if (paMappings) 1303 { 1304 rc = VbglR3SharedFolderGetMappings(u32ClientId, fOnlyShowAutoMount, 1305 paMappings, cbMappings, 1306 &cMappings); 1307 if (RT_SUCCESS(rc)) 1301 PVBGLR3SHAREDFOLDERMAPPING paMappings; 1302 uint32_t cMappings; 1303 rc = VbglR3SharedFolderGetMappings(u32ClientId, fOnlyShowAutoMount, 1304 &paMappings, &cMappings); 1305 if (RT_SUCCESS(rc)) 1306 { 1307 if (fOnlyShowAutoMount) 1308 RTPrintf("Auto-mounted Shared Folder mappings (%u):\n\n", cMappings); 1309 else 1310 RTPrintf("Shared Folder mappings (%u):\n\n", cMappings); 1311 1312 for (uint32_t i = 0; i < cMappings; i++) 1308 1313 { 1309 /* Maximum mappings, see shflsvc.h */ 1310 if (cMappings > 64) 1311 cMappings = 64; 1312 RTPrintf("Shared Folder Mappings (%u):\n\n", cMappings); 1313 for (uint32_t i = 0; i < cMappings; i++) 1314 char *pszName; 1315 rc = VbglR3SharedFolderGetName(u32ClientId, paMappings[i].u32Root, &pszName); 1316 if (RT_SUCCESS(rc)) 1314 1317 { 1315 char *pszName; 1316 rc = VbglR3SharedFolderGetName(u32ClientId, paMappings[i].u32Root, &pszName); 1317 if (RT_SUCCESS(rc)) 1318 { 1319 RTPrintf("%02u - %s\n", i + 1, pszName); 1320 RTStrFree(pszName); 1321 } 1322 else 1323 VBoxControlError("Error while getting the shared folder name for root node = %u, rc = %Rrc\n", 1324 paMappings[i].u32Root, rc); 1318 RTPrintf("%02u - %s\n", i + 1, pszName); 1319 RTStrFree(pszName); 1325 1320 } 1326 if (cMappings == 0) 1327 RTPrintf("No Shared Folders available.\n"); 1321 else 1322 VBoxControlError("Error while getting the shared folder name for root node = %u, rc = %Rrc\n", 1323 paMappings[i].u32Root, rc); 1328 1324 } 1329 else1330 VBoxControlError("Error while getting the shared folder mappings, rc = %Rrc\n", rc);1331 RTMemFree(paMappings);1325 if (cMappings == 0) 1326 RTPrintf("No Shared Folders available.\n"); 1327 VbglR3SharedFolderFreeMappings(paMappings); 1332 1328 } 1333 1329 else 1334 rc = VERR_NO_MEMORY;1330 VBoxControlError("Error while getting the shared folder mappings, rc = %Rrc\n", rc); 1335 1331 VbglR3SharedFolderDisconnect(u32ClientId); 1336 1332 }
Note:
See TracChangeset
for help on using the changeset viewer.