Changeset 58195 in vbox for trunk/src/VBox/Additions/solaris
- Timestamp:
- Oct 12, 2015 3:13:47 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_prov.c
r51729 r58195 90 90 return NULL; 91 91 } 92 rc = vboxInit();92 rc = VbglR0SfInit(); 93 93 if (RT_SUCCESS(rc)) 94 94 { 95 rc = vboxConnect(&vbox_client);95 rc = VbglR0SfConnect(&vbox_client); 96 96 if (RT_SUCCESS(rc)) 97 97 { 98 rc = vboxCallSetUtf8(&vbox_client);98 rc = VbglR0SfSetUtf8(&vbox_client); 99 99 if (RT_SUCCESS(rc)) 100 100 { … … 102 102 } 103 103 else 104 cmn_err(CE_WARN, "sfprov_connect: vboxCallSetUtf8() failed\n");105 106 vboxDisconnect(&vbox_client);104 cmn_err(CE_WARN, "sfprov_connect: VbglR0SfSetUtf8() failed\n"); 105 106 VbglR0SfDisconnect(&vbox_client); 107 107 } 108 108 else 109 cmn_err(CE_WARN, "sfprov_connect: vboxConnect() failed rc=%d\n", rc);110 vboxUninit();109 cmn_err(CE_WARN, "sfprov_connect: VbglR0SfConnect() failed rc=%d\n", rc); 110 VbglR0SfTerm(); 111 111 } 112 112 else 113 cmn_err(CE_WARN, "sfprov_connect: vboxInit() failed rc=%d\n", rc);113 cmn_err(CE_WARN, "sfprov_connect: VbglR0SfInit() failed rc=%d\n", rc); 114 114 return (NULL); 115 115 } … … 120 120 if (conn != (sfp_connection_t *)&vbox_client) 121 121 cmn_err(CE_WARN, "sfprov_disconnect: bad argument\n"); 122 vboxDisconnect(&vbox_client);123 vboxUninit();122 VbglR0SfDisconnect(&vbox_client); 123 VbglR0SfTerm(); 124 124 } 125 125 … … 135 135 m = kmem_zalloc(sizeof (*m), KM_SLEEP); 136 136 str = sfprov_string(path, &size); 137 rc = vboxCallMapFolder(&vbox_client, str, &m->map);137 rc = VbglR0SfMapFolder(&vbox_client, str, &m->map); 138 138 if (RT_FAILURE(rc)) { 139 cmn_err(CE_WARN, "sfprov_mount: vboxCallMapFolder() failed. path=%s rc=%d\n", path, rc);139 cmn_err(CE_WARN, "sfprov_mount: VbglR0SfMapFolder() failed. path=%s rc=%d\n", path, rc); 140 140 kmem_free(m, sizeof (*m)); 141 141 *mnt = NULL; … … 154 154 int rc; 155 155 156 rc = vboxCallUnmapFolder(&vbox_client, &mnt->map);156 rc = VbglR0SfUnmapFolder(&vbox_client, &mnt->map); 157 157 if (RT_FAILURE(rc)) { 158 cmn_err(CE_WARN, "sfprov_mount: vboxCallUnmapFolder() failed rc=%d\n", rc);158 cmn_err(CE_WARN, "sfprov_mount: VbglR0SfUnmapFolder() failed rc=%d\n", rc); 159 159 rc = EINVAL; 160 160 } else { … … 175 175 uint32_t bytes = sizeof(SHFLVOLINFO); 176 176 177 rc = vboxCallFSInfo(&vbox_client, &mnt->map, 0,178 (SHFL_INFO_GET | SHFL_INFO_VOLUME),&bytes, (SHFLDIRINFO *)&info);177 rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, 0, SHFL_INFO_GET | SHFL_INFO_VOLUME, 178 &bytes, (SHFLDIRINFO *)&info); 179 179 if (RT_FAILURE(rc)) 180 180 return (EINVAL); … … 336 336 parms.CreateFlags = SHFL_CF_ACT_CREATE_IF_NEW | 337 337 SHFL_CF_ACT_REPLACE_IF_EXISTS | SHFL_CF_ACCESS_READWRITE; 338 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);338 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 339 339 kmem_free(str, size); 340 340 … … 342 342 { 343 343 if (rc != VERR_ACCESS_DENIED && rc != VERR_WRITE_PROTECT) 344 cmn_err(CE_WARN, "sfprov_create: vboxCallCreate failed! path=%s rc=%d\n", path, rc);344 cmn_err(CE_WARN, "sfprov_create: VbglR0SfCreate failed! path=%s rc=%d\n", path, rc); 345 345 return (sfprov_vbox2errno(rc)); 346 346 } … … 379 379 * Open the host directory. 380 380 */ 381 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);381 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 382 382 383 383 /* … … 439 439 * Open/create the host file. 440 440 */ 441 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);441 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 442 442 443 443 /* … … 467 467 int rc; 468 468 469 rc = vboxCallClose(&vbox_client, &fp->map, fp->handle);469 rc = VbglR0SfClose(&vbox_client, &fp->map, fp->handle); 470 470 kmem_free(fp, sizeof(sfp_file_t)); 471 471 return (0); … … 477 477 int rc; 478 478 479 rc = vboxCallRead(&vbox_client, &fp->map, fp->handle, offset,480 numbytes, (uint8_t *)buffer, 0); /* what is that last arg? */479 rc = VbglR0SfRead(&vbox_client, &fp->map, fp->handle, offset, 480 numbytes, (uint8_t *)buffer, 0 /*fLocked*/); 481 481 if (RT_FAILURE(rc)) 482 482 return (EINVAL); … … 489 489 int rc; 490 490 491 rc = vboxCallWrite(&vbox_client, &fp->map, fp->handle, offset,492 numbytes, (uint8_t *)buffer, 0); /* what is that last arg? */491 rc = VbglR0SfWrite(&vbox_client, &fp->map, fp->handle, offset, 492 numbytes, (uint8_t *)buffer, 0 /*fLocked*/); 493 493 if (RT_FAILURE(rc)) 494 494 return (EINVAL); … … 501 501 int rc; 502 502 503 rc = vboxCallFlush(&vbox_client, &fp->map, fp->handle);503 rc = VbglR0SfFlush(&vbox_client, &fp->map, fp->handle); 504 504 if (RT_FAILURE(rc)) 505 505 return (EIO); … … 520 520 parms.Info.cbObject = 0; 521 521 parms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW; 522 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);522 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 523 523 kmem_free(str, size); 524 524 … … 644 644 | SHFL_CF_ACCESS_ATTR_WRITE; 645 645 646 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);646 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 647 647 648 648 if (RT_FAILURE(rc)) { 649 cmn_err(CE_WARN, "sfprov_set_attr: vboxCallCreate(%s) failed rc=%d\n",649 cmn_err(CE_WARN, "sfprov_set_attr: VbglR0SfCreate(%s) failed rc=%d\n", 650 650 path, rc); 651 651 err = EINVAL; … … 668 668 669 669 bytes = sizeof(info); 670 rc = vboxCallFSInfo(&vbox_client, &mnt->map, parms.Handle,671 (SHFL_INFO_SET | SHFL_INFO_FILE),&bytes, (SHFLDIRINFO *)&info);670 rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, SHFL_INFO_SET | SHFL_INFO_FILE, 671 &bytes, (SHFLDIRINFO *)&info); 672 672 if (RT_FAILURE(rc)) { 673 673 if (rc != VERR_ACCESS_DENIED && rc != VERR_WRITE_PROTECT) 674 674 { 675 cmn_err(CE_WARN, "sfprov_set_attr: vboxCallFSInfo(%s, FILE) failed rc=%d\n",675 cmn_err(CE_WARN, "sfprov_set_attr: VbglR0SfFsInfo(%s, FILE) failed rc=%d\n", 676 676 path, rc); 677 677 } … … 683 683 684 684 fail1: 685 rc = vboxCallClose(&vbox_client, &mnt->map, parms.Handle);685 rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); 686 686 if (RT_FAILURE(rc)) { 687 cmn_err(CE_WARN, "sfprov_set_attr: vboxCallClose(%s) failed rc=%d\n",687 cmn_err(CE_WARN, "sfprov_set_attr: VbglR0SfClose(%s) failed rc=%d\n", 688 688 path, rc); 689 689 } … … 710 710 | SHFL_CF_ACCESS_WRITE; 711 711 712 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);712 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 713 713 714 714 if (RT_FAILURE(rc)) { 715 cmn_err(CE_WARN, "sfprov_set_size: vboxCallCreate(%s) failed rc=%d\n",715 cmn_err(CE_WARN, "sfprov_set_size: VbglR0SfCreate(%s) failed rc=%d\n", 716 716 path, rc); 717 717 err = EINVAL; … … 726 726 info.cbObject = size; 727 727 bytes = sizeof(info); 728 rc = vboxCallFSInfo(&vbox_client, &mnt->map, parms.Handle,729 (SHFL_INFO_SET | SHFL_INFO_SIZE),&bytes, (SHFLDIRINFO *)&info);728 rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, SHFL_INFO_SET | SHFL_INFO_SIZE, 729 &bytes, (SHFLDIRINFO *)&info); 730 730 if (RT_FAILURE(rc)) { 731 cmn_err(CE_WARN, "sfprov_set_size: vboxCallFSInfo(%s, SIZE) failed rc=%d\n",731 cmn_err(CE_WARN, "sfprov_set_size: VbglR0SfFsInfo(%s, SIZE) failed rc=%d\n", 732 732 path, rc); 733 733 err = sfprov_vbox2errno(rc); … … 738 738 739 739 fail1: 740 rc = vboxCallClose(&vbox_client, &mnt->map, parms.Handle);740 rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); 741 741 if (RT_FAILURE(rc)) { 742 cmn_err(CE_WARN, "sfprov_set_size: vboxCallClose(%s) failed rc=%d\n",742 cmn_err(CE_WARN, "sfprov_set_size: VbglR0SfClose(%s) failed rc=%d\n", 743 743 path, rc); 744 744 } … … 771 771 parms.CreateFlags = SHFL_CF_DIRECTORY | SHFL_CF_ACT_CREATE_IF_NEW | 772 772 SHFL_CF_ACT_FAIL_IF_EXISTS | SHFL_CF_ACCESS_READ; 773 rc = vboxCallCreate(&vbox_client, &mnt->map, str, &parms);773 rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); 774 774 kmem_free(str, size); 775 775 … … 794 794 int rc; 795 795 796 rc = vboxCallSetSymlinks(&vbox_client);796 rc = VbglR0SfSetSymlinks(&vbox_client); 797 797 if (RT_FAILURE(rc)) 798 798 return (sfprov_vbox2errno(rc)); … … 809 809 810 810 str = sfprov_string(path, &size); 811 rc = vboxCallRemove(&vbox_client, &mnt->map, str,812 SHFL_REMOVE_FILE | (is_link ? SHFL_REMOVE_SYMLINK : 0));811 rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, 812 SHFL_REMOVE_FILE | (is_link ? SHFL_REMOVE_SYMLINK : 0)); 813 813 kmem_free(str, size); 814 814 if (RT_FAILURE(rc)) … … 830 830 str = sfprov_string(path, &size); 831 831 832 rc = vboxReadLink(&vbox_client, &mnt->map, str, (uint32_t) tgt_size,832 rc = VbglR0SfReadLink(&vbox_client, &mnt->map, str, (uint32_t) tgt_size, 833 833 target); 834 834 if (RT_FAILURE(rc)) … … 854 854 tgt = sfprov_string(target, &tgt_size); 855 855 856 rc = vboxCallSymlink(&vbox_client, &mnt->map, lnk, tgt, &info);856 rc = VbglR0SfSymlink(&vbox_client, &mnt->map, lnk, tgt, &info); 857 857 if (RT_FAILURE(rc)) { 858 858 rc = sfprov_vbox2errno(rc); … … 878 878 879 879 str = sfprov_string(path, &size); 880 rc = vboxCallRemove(&vbox_client, &mnt->map, str, SHFL_REMOVE_DIR);880 rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, SHFL_REMOVE_DIR); 881 881 kmem_free(str, size); 882 882 if (RT_FAILURE(rc)) … … 894 894 old = sfprov_string(from, &old_size); 895 895 new = sfprov_string(to, &new_size); 896 rc = vboxCallRename(&vbox_client, &mnt->map, old, new, 897 (is_dir ? SHFL_RENAME_DIR : SHFL_RENAME_FILE) | 898 SHFL_RENAME_REPLACE_IF_EXISTS); 896 rc = VbglR0SfRename(&vbox_client, &mnt->map, old, new, 897 (is_dir ? SHFL_RENAME_DIR : SHFL_RENAME_FILE) | SHFL_RENAME_REPLACE_IF_EXISTS); 899 898 kmem_free(old, old_size); 900 899 kmem_free(new, new_size); … … 974 973 975 974 /* 976 * Now loop using vboxCallDirInfo975 * Now loop using VbglR0SfDirInfo 977 976 */ 978 977 infobuff = kmem_alloc(infobuff_alloc, KM_SLEEP); … … 985 984 for (;;) { 986 985 numbytes = infobuff_alloc; 987 error = vboxCallDirInfo(&vbox_client, &fp->map, fp->handle,988 986 error = VbglR0SfDirInfo(&vbox_client, &fp->map, fp->handle, 987 mask_str, 0, 0, &numbytes, infobuff, &nents); 989 988 switch (error) { 990 989
Note:
See TracChangeset
for help on using the changeset viewer.