Changeset 78304 in vbox for trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp
- Timestamp:
- Apr 26, 2019 1:19:49 AM (6 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/SharedFolders/driver/net.cpp
r78303 r78304 79 79 PMRX_V_NET_ROOT pVNetRoot = (PMRX_V_NET_ROOT)pCreateNetRootContext->pVNetRoot; 80 80 81 PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension = VBoxMRxGetDeviceExtension(pCreateNetRootContext->RxContext);82 81 PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension = VBoxMRxGetNetRootExtension(pVNetRoot->pNetRoot); 83 82 … … 158 157 * pNetRootExtension is actually the pNetRoot->Context and it is not NULL. 159 158 */ 160 fInitializeNetRoot = (pNetRootExtension->phgcmClient == NULL);161 162 159 Status = STATUS_SUCCESS; 163 160 164 if ( fInitializeNetRoot)161 if (!pNetRootExtension->fInitialized) 165 162 { 166 163 PWCHAR pRootName; … … 172 169 173 170 pNetRoot->MRxNetRootState = MRX_NET_ROOT_STATE_GOOD; 171 pNetRootExtension->map.root = SHFL_ROOT_NIL; 174 172 175 173 RootNameLength = pNetRoot->pNetRootName->Length - pSrvCall->pSrvCallName->Length; … … 193 191 RootNameLength -= sizeof(WCHAR); 194 192 195 if (!pNetRootExtension-> phgcmClient)193 if (!pNetRootExtension->fInitialized) 196 194 { 197 195 Log(("VBOXSF: MRxCreateVNetRoot: Initialize netroot length = %d, name = %.*ls\n", … … 204 202 } 205 203 206 vrc = VbglR0SfMapFolder(& pDeviceExtension->hgcmClient, ParsedPath, &pNetRootExtension->map);204 vrc = VbglR0SfMapFolder(&g_SfClient, ParsedPath, &pNetRootExtension->map); 207 205 vbsfFreeNonPagedMem(ParsedPath); 208 if ( vrc != VINF_SUCCESS)206 if (RT_SUCCESS(vrc)) 209 207 { 210 Log(("VBOXSF: MRxCreateVNetRoot: VbglR0SfMapFolder failed with %d\n", vrc));211 Status = STATUS_ BAD_NETWORK_NAME;208 pNetRootExtension->fInitialized = true; 209 Status = STATUS_SUCCESS; 212 210 } 213 211 else 214 212 { 215 Status = STATUS_SUCCESS; 216 pNetRootExtension->phgcmClient = &pDeviceExtension->hgcmClient; 213 Log(("VBOXSF: MRxCreateVNetRoot: VbglR0SfMapFolder failed with %d\n", vrc)); 214 pNetRootExtension->map.root = SHFL_ROOT_NIL; 215 Status = STATUS_BAD_NETWORK_NAME; 217 216 } 218 217 } … … 259 258 Log(("VBOXSF: MRxFinalizeNetRoot: NET_ROOT %p\n", pNetRoot)); 260 259 261 if (pNetRootExtension->phgcmClient) 262 { 263 int vrc = VbglR0SfUnmapFolder(pNetRootExtension->phgcmClient, &pNetRootExtension->map); 260 if ( pNetRootExtension->fInitialized 261 && g_SfClient.handle != NULL) 262 { 263 int vrc = VbglR0SfUnmapFolder(&g_SfClient, &pNetRootExtension->map); 264 264 if (vrc != VINF_SUCCESS) 265 265 Log(("VBOXSF: MRxFinalizeVNetRoot: VbglR0SfUnmapFolder failed with %d\n", 266 266 vrc)); 267 pNetRootExtension->phgcmClient = NULL; 267 pNetRootExtension->map.root = SHFL_ROOT_NIL; 268 pNetRootExtension->fInitialized = false; 268 269 } 269 270
Note:
See TracChangeset
for help on using the changeset viewer.