/* unmap the share and free global info [sf_g] */ static void sf_glob_free(struct sf_glob_info *sf_g) { int rc; TRACE(); rc = vboxCallUnmapFolder(&client_handle, &sf_g->map); if (RT_FAILURE(rc)) LogFunc(("vboxCallUnmapFolder failed rc=%d\n", rc)); if (sf_g->nls) unload_nls(sf_g->nls); kfree(sf_g); }
NTSTATUS VBoxMRxFinalizeNetRoot(IN PMRX_NET_ROOT pNetRoot, IN PBOOLEAN ForceDisconnect) { PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(pNetRoot); Log(("VBOXSF: MRxFinalizeNetRoot: NET_ROOT %p\n", pNetRoot)); if (pNetRootExtension->phgcmClient) { int vboxRC = vboxCallUnmapFolder(pNetRootExtension->phgcmClient, &pNetRootExtension->map); if (vboxRC != VINF_SUCCESS) Log(("VBOXSF: MRxFinalizeVNetRoot: vboxCallUnmapFolder failed with %d\n", vboxRC)); pNetRootExtension->phgcmClient = NULL; } return STATUS_SUCCESS; }
static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) { struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); int rc; int flags = 0; rc = vboxCallUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); if (RT_FAILURE(rc)) printf("Failed to unmap shared folder\n"); if (mntflags & MNT_FORCE) flags |= FORCECLOSE; /* There is 1 extra root vnode reference (vnode_root). */ rc = vflush(mp, 1, flags, td); if (rc) return rc; RTMemFree(pShFlGlobalInfo); mp->mnt_data = NULL; return 0; }