Changeset 45061 in vbox
- Timestamp:
- Mar 18, 2013 2:09:03 PM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r45047 r45061 1171 1171 1172 1172 /* 1173 * Init the static parts. 1174 */ 1175 pThis->pDrvIns = pDrvIns; 1176 pThis->pNATState = NULL; 1177 pThis->pszTFTPPrefix = NULL; 1178 pThis->pszBootFile = NULL; 1179 pThis->pszNextServer = NULL; 1180 pThis->hSlirpReqQueue = NIL_RTREQQUEUE; 1181 pThis->hUrgRecvReqQueue = NIL_RTREQQUEUE; 1182 pThis->EventRecv = NIL_RTSEMEVENT; 1183 pThis->EventUrgRecv = NIL_RTSEMEVENT; 1184 1185 /* IBase */ 1186 pDrvIns->IBase.pfnQueryInterface = drvNATQueryInterface; 1187 1188 /* INetwork */ 1189 pThis->INetworkUp.pfnBeginXmit = drvNATNetworkUp_BeginXmit; 1190 pThis->INetworkUp.pfnAllocBuf = drvNATNetworkUp_AllocBuf; 1191 pThis->INetworkUp.pfnFreeBuf = drvNATNetworkUp_FreeBuf; 1192 pThis->INetworkUp.pfnSendBuf = drvNATNetworkUp_SendBuf; 1193 pThis->INetworkUp.pfnEndXmit = drvNATNetworkUp_EndXmit; 1194 pThis->INetworkUp.pfnSetPromiscuousMode = drvNATNetworkUp_SetPromiscuousMode; 1195 pThis->INetworkUp.pfnNotifyLinkChanged = drvNATNetworkUp_NotifyLinkChanged; 1196 1197 /* NAT engine configuration */ 1198 pThis->INetworkNATCfg.pfnRedirectRuleCommand = drvNATNetworkNatConfig_RedirectRuleCommand; 1199 1200 /* 1173 1201 * Validate the config. 1174 1202 */ … … 1187 1215 N_("Unknown NAT configuration option, only supports PassDomain," 1188 1216 " TFTPPrefix, BootFile and Network")); 1189 1190 /*1191 * Init the static parts.1192 */1193 pThis->pDrvIns = pDrvIns;1194 pThis->pNATState = NULL;1195 pThis->pszTFTPPrefix = NULL;1196 pThis->pszBootFile = NULL;1197 pThis->pszNextServer = NULL;1198 pThis->hSlirpReqQueue = NIL_RTREQQUEUE;1199 pThis->hUrgRecvReqQueue = NIL_RTREQQUEUE;1200 pThis->EventRecv = NIL_RTSEMEVENT;1201 pThis->EventUrgRecv = NIL_RTSEMEVENT;1202 1203 /* IBase */1204 pDrvIns->IBase.pfnQueryInterface = drvNATQueryInterface;1205 1206 /* INetwork */1207 pThis->INetworkUp.pfnBeginXmit = drvNATNetworkUp_BeginXmit;1208 pThis->INetworkUp.pfnAllocBuf = drvNATNetworkUp_AllocBuf;1209 pThis->INetworkUp.pfnFreeBuf = drvNATNetworkUp_FreeBuf;1210 pThis->INetworkUp.pfnSendBuf = drvNATNetworkUp_SendBuf;1211 pThis->INetworkUp.pfnEndXmit = drvNATNetworkUp_EndXmit;1212 pThis->INetworkUp.pfnSetPromiscuousMode = drvNATNetworkUp_SetPromiscuousMode;1213 pThis->INetworkUp.pfnNotifyLinkChanged = drvNATNetworkUp_NotifyLinkChanged;1214 1215 /* NAT engine configuration */1216 pThis->INetworkNATCfg.pfnRedirectRuleCommand = drvNATNetworkNatConfig_RedirectRuleCommand;1217 1217 1218 1218 /* -
trunk/src/VBox/Devices/Network/DrvNetShaper.cpp
r44528 r45061 427 427 pThis->INetworkUpR3.pfnSetPromiscuousMode = drvNetShaperUp_SetPromiscuousMode; 428 428 pThis->INetworkUpR3.pfnNotifyLinkChanged = drvR3NetShaperUp_NotifyLinkChanged; 429 /* 430 * Resolve the ring-0 context interface addresses. 431 */ 429 /* Resolve the ring-0 context interface addresses. */ 432 430 int rc = pDrvIns->pHlpR3->pfnLdrGetR0InterfaceSymbols(pDrvIns, &pThis->INetworkUpR0, 433 431 sizeof(pThis->INetworkUpR0), -
trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
r44528 r45061 358 358 RTCritSectDelete(&pThis->XmitLock); 359 359 360 RTFileClose(pThis->hFile); 361 pThis->hFile = NIL_RTFILE; 360 if (pThis->hFile != NIL_RTFILE) 361 { 362 RTFileClose(pThis->hFile); 363 pThis->hFile = NIL_RTFILE; 364 } 362 365 } 363 366 -
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r44580 r45061 777 777 */ 778 778 int rc; 779 rc = RTPipeClose(pThis->hPipeWrite); AssertRC(rc); 780 pThis->hPipeWrite = NIL_RTPIPE; 781 rc = RTPipeClose(pThis->hPipeRead); AssertRC(rc); 782 pThis->hPipeRead = NIL_RTPIPE; 779 if (pThis->hPipeWrite != NIL_RTPIPE) 780 { 781 rc = RTPipeClose(pThis->hPipeWrite); AssertRC(rc); 782 pThis->hPipeWrite = NIL_RTPIPE; 783 } 784 if (pThis->hPipeRead != NIL_RTPIPE) 785 { 786 rc = RTPipeClose(pThis->hPipeRead); AssertRC(rc); 787 pThis->hPipeRead = NIL_RTPIPE; 788 } 783 789 784 790 #ifdef RT_OS_SOLARIS … … 786 792 if (pThis->hFileDevice != NIL_RTFILE) 787 793 { 788 int rc = RTFileClose(pThis->hFileDevice); 789 AssertRC(rc); 794 int rc = RTFileClose(pThis->hFileDevice); AssertRC(rc); 790 795 pThis->hFileDevice = NIL_RTFILE; 791 796 } … … 808 813 MMR3HeapFree(pThis->pszDeviceName); 809 814 #endif 815 pThis->pszDeviceName = NULL; 810 816 MMR3HeapFree(pThis->pszSetupApplication); 817 pThis->pszSetupApplication = NULL; 811 818 MMR3HeapFree(pThis->pszTerminateApplication); 819 pThis->pszTerminateApplication = NULL; 812 820 813 821 /* … … 846 854 pThis->pDrvIns = pDrvIns; 847 855 pThis->hFileDevice = NIL_RTFILE; 856 pThis->hPipeWrite = NIL_RTPIPE; 857 pThis->hPipeRead = NIL_RTPIPE; 848 858 pThis->pszDeviceName = NULL; 849 859 #ifdef RT_OS_SOLARIS -
trunk/src/VBox/Devices/Network/DrvUDPTunnel.cpp
r44528 r45061 404 404 405 405 if (pThis->pszInstance) 406 { 406 407 RTStrFree(pThis->pszInstance); 408 pThis->pszInstance = NULL; 409 } 407 410 408 411 if (pThis->pszDestIP) 412 { 409 413 MMR3HeapFree(pThis->pszDestIP); 414 pThis->pszDestIP = NULL; 415 } 410 416 411 417 if (pThis->pServer) -
trunk/src/VBox/Devices/Network/DrvVDE.cpp
r44528 r45061 481 481 * Terminate the control pipe. 482 482 */ 483 RTPipeClose(pThis->hPipeWrite); 484 pThis->hPipeWrite = NIL_RTPIPE; 485 RTPipeClose(pThis->hPipeRead); 486 pThis->hPipeRead = NIL_RTPIPE; 483 if (pThis->hPipeWrite != NIL_RTPIPE) 484 { 485 RTPipeClose(pThis->hPipeWrite); 486 pThis->hPipeWrite = NIL_RTPIPE; 487 } 488 if (pThis->hPipeRead != NIL_RTPIPE) 489 { 490 RTPipeClose(pThis->hPipeRead); 491 pThis->hPipeRead = NIL_RTPIPE; 492 } 487 493 488 494 MMR3HeapFree(pThis->pszDeviceName); 495 pThis->pszDeviceName = NULL; 489 496 490 497 /* … … 494 501 RTCritSectDelete(&pThis->XmitLock); 495 502 496 vde_close(pThis->pVdeConn); 497 pThis->pVdeConn = NULL; 503 if (pThis->pVdeConn) 504 { 505 vde_close(pThis->pVdeConn); 506 pThis->pVdeConn = NULL; 507 } 498 508 499 509 #ifdef VBOX_WITH_STATISTICS -
trunk/src/VBox/Devices/PC/DrvACPI.cpp
r44528 r45061 925 925 926 926 #ifdef RT_OS_LINUX 927 RTSemEventDestroy(pThis->hPollerSleepEvent); 928 pThis->hPollerSleepEvent = NIL_RTSEMEVENT; 927 if (pThis->hPollerSleepEvent != NIL_RTSEMEVENT) 928 { 929 RTSemEventDestroy(pThis->hPollerSleepEvent); 930 pThis->hPollerSleepEvent = NIL_RTSEMEVENT; 931 } 929 932 RTCritSectDelete(&pThis->CritSect); 930 933 #endif … … 946 949 */ 947 950 pThis->pDrvIns = pDrvIns; 951 #ifdef RT_OS_LINUX 952 pThis->hPollerSleepEvent = NIL_RTSEMEVENT; 953 #endif 948 954 /* IBase */ 949 955 pDrvIns->IBase.pfnQueryInterface = drvACPIQueryInterface; -
trunk/src/VBox/Devices/PC/DrvAcpiCpu.cpp
r44528 r45061 38 38 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase); 39 39 return NULL; 40 }41 42 /**43 * Destruct a driver instance.44 *45 * Most VM resources are freed by the VM. This callback is provided so that any non-VM46 * resources can be freed correctly.47 *48 * @param pDrvIns The driver instance data.49 */50 static DECLCALLBACK(void) drvACPICpuDestruct(PPDMDRVINS pDrvIns)51 {52 LogFlow(("drvACPICpuDestruct\n"));53 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);54 40 } 55 41 … … 111 97 drvACPICpuConstruct, 112 98 /* pfnDestruct */ 113 drvACPICpuDestruct,99 NULL, 114 100 /* pfnRelocate */ 115 101 NULL, -
trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp
r43458 r45061 873 873 ioctl(RTFileToNative(pThis->hFileDevice), PPRELEASE); 874 874 875 rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc); 876 pThis->hWakeupPipeW = NIL_RTPIPE; 877 878 rc = RTPipeClose(pThis->hWakeupPipeR); AssertRC(rc); 879 pThis->hWakeupPipeR = NIL_RTPIPE; 880 881 rc = RTFileClose(pThis->hFileDevice); AssertRC(rc); 882 pThis->hFileDevice = NIL_RTFILE; 875 if (pThis->hWakeupPipeW != NIL_RTPIPE) 876 { 877 rc = RTPipeClose(pThis->hWakeupPipeW); AssertRC(rc); 878 pThis->hWakeupPipeW = NIL_RTPIPE; 879 } 880 881 if (pThis->hWakeupPipeR != NIL_RTPIPE) 882 { 883 rc = RTPipeClose(pThis->hWakeupPipeR); AssertRC(rc); 884 pThis->hWakeupPipeR = NIL_RTPIPE; 885 } 886 887 if (pThis->hFileDevice != NIL_RTFILE) 888 { 889 rc = RTFileClose(pThis->hFileDevice); AssertRC(rc); 890 pThis->hFileDevice = NIL_RTFILE; 891 } 883 892 884 893 if (pThis->pszDevicePath) … … 887 896 pThis->pszDevicePath = NULL; 888 897 } 889 #else /* VBOX_WITH_WIN_PARPORT_SUP */898 #else /* VBOX_WITH_WIN_PARPORT_SUP */ 890 899 if (pThis->hWinFileDevice != NIL_RTFILE) 900 { 891 901 rc = RTFileClose(pThis->hWinFileDevice); AssertRC(rc); 902 pThis->hWinFileDevice = NIL_RTFILE; 903 } 892 904 #endif /* VBOX_WITH_WIN_PARPORT_SUP */ 893 905 } … … 914 926 pThis->hWakeupPipeR = NIL_RTPIPE; 915 927 pThis->hWakeupPipeW = NIL_RTPIPE; 916 #else /* VBOX_WITH_WIN_PARPORT_SUP */928 #else 917 929 pThis->hWinFileDevice = NIL_RTFILE; 918 930 #endif -
trunk/src/VBox/Devices/Serial/DrvChar.cpp
r44528 r45061 305 305 { 306 306 RTSemEventSignal(pThis->SendSem); 307 pThis->SendSem = NIL_RTSEMEVENT; 307 308 } 308 309 -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r44528 r45061 1070 1070 1071 1071 /* Empty the send queue */ 1072 RTSemEventDestroy(pThis->SendSem); 1073 pThis->SendSem = NIL_RTSEMEVENT; 1072 if (pThis->SendSem != NIL_RTSEMEVENT) 1073 { 1074 RTSemEventDestroy(pThis->SendSem); 1075 pThis->SendSem = NIL_RTSEMEVENT; 1076 } 1074 1077 1075 1078 int rc; … … 1092 1095 } 1093 1096 # endif 1094 rc = RTFileClose(pThis->hDeviceFile); AssertRC(rc); 1095 pThis->hDeviceFile = NIL_RTFILE; 1097 if (pThis->hDeviceFile != NIL_RTFILE) 1098 { 1099 rc = RTFileClose(pThis->hDeviceFile); AssertRC(rc); 1100 pThis->hDeviceFile = NIL_RTFILE; 1101 } 1096 1102 1097 1103 #elif defined(RT_OS_WINDOWS) … … 1136 1142 pThis->hDeviceFile = INVALID_HANDLE_VALUE; 1137 1143 #endif 1144 pThis->SendSem = NIL_RTSEMEVENT; 1138 1145 /* IBase. */ 1139 1146 pDrvIns->IBase.pfnQueryInterface = drvHostSerialQueryInterface; … … 1143 1150 pThis->ICharConnector.pfnSetModemLines = drvHostSerialSetModemLines; 1144 1151 pThis->ICharConnector.pfnSetBreak = drvHostSerialSetBreak; 1145 1146 /** @todo Initialize all members with NIL values!! The destructor is ALWAYS called. */1147 1152 1148 1153 /* -
trunk/src/VBox/Devices/Serial/DrvRawFile.cpp
r44528 r45061 140 140 MMR3HeapFree(pThis->pszLocation); 141 141 142 RTFileClose(pThis->hOutputFile); 143 pThis->hOutputFile = NIL_RTFILE; 142 if (pThis->hOutputFile != NIL_RTFILE) 143 { 144 RTFileClose(pThis->hOutputFile); 145 pThis->hOutputFile = NIL_RTFILE; 146 } 144 147 } 145 148 -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r44528 r45061 1878 1878 pThis->enmType = enmType; 1879 1879 //pThis->cErrors = 0; 1880 pThis->fAttachFailError = true; /* It's an error until we've read the config. */ 1880 1881 1881 1882 pThis->pfnGetMediaSize = drvHostBaseGetMediaSize; -
trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
r40282 r45061 759 759 760 760 /* 761 * Validate configuration.762 */763 if (!CFGMR3AreValuesValid(pCfg, "Path\0Interval\0Locked\0BIOSVisible\0AttachFailError\0Passthrough\0"))764 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;765 766 767 /*768 761 * Init instance data. 769 762 */ … … 772 765 { 773 766 /* 774 * Override stuff.767 * Validate configuration. 775 768 */ 769 if (CFGMR3AreValuesValid(pCfg, "Path\0Interval\0Locked\0BIOSVisible\0AttachFailError\0Passthrough\0")) 770 { 771 /* 772 * Override stuff. 773 */ 776 774 #ifdef RT_OS_LINUX 777 pThis->pbDoubleBuffer = (uint8_t *)RTMemAlloc(SCSI_MAX_BUFFER_SIZE);778 if (!pThis->pbDoubleBuffer)779 return VERR_NO_MEMORY;775 pThis->pbDoubleBuffer = (uint8_t *)RTMemAlloc(SCSI_MAX_BUFFER_SIZE); 776 if (!pThis->pbDoubleBuffer) 777 return VERR_NO_MEMORY; 780 778 #endif 781 779 782 780 #ifndef RT_OS_L4 /* Passthrough is not supported on L4 yet */ 783 bool fPassthrough; 784 rc = CFGMR3QueryBool(pCfg, "Passthrough", &fPassthrough); 785 if (RT_SUCCESS(rc) && fPassthrough) 781 bool fPassthrough; 782 rc = CFGMR3QueryBool(pCfg, "Passthrough", &fPassthrough); 783 if (RT_SUCCESS(rc) && fPassthrough) 784 { 785 pThis->IBlock.pfnSendCmd = drvHostDvdSendCmd; 786 /* Passthrough requires opening the device in R/W mode. */ 787 pThis->fReadOnlyConfig = false; 788 # ifdef VBOX_WITH_SUID_WRAPPER /* Solaris setuid for Passthrough mode. */ 789 rc = solarisCheckUserAuth(); 790 if (RT_FAILURE(rc)) 791 { 792 Log(("DVD: solarisCheckUserAuth failed. Permission denied!\n")); 793 return rc; 794 } 795 # endif /* VBOX_WITH_SUID_WRAPPER */ 796 } 797 #endif /* !RT_OS_L4 */ 798 799 pThis->IMount.pfnUnmount = drvHostDvdUnmount; 800 pThis->pfnDoLock = drvHostDvdDoLock; 801 #ifdef USE_MEDIA_POLLING 802 if (!fPassthrough) 803 pThis->pfnPoll = drvHostDvdPoll; 804 else 805 pThis->pfnPoll = NULL; 806 #endif 807 #ifdef RT_OS_LINUX 808 pThis->pfnGetMediaSize = drvHostDvdGetMediaSize; 809 #endif 810 811 /* 812 * 2nd init part. 813 */ 814 rc = DRVHostBaseInitFinish(pThis); 815 } 816 else 786 817 { 787 pThis->IBlock.pfnSendCmd = drvHostDvdSendCmd; 788 /* Passthrough requires opening the device in R/W mode. */ 789 pThis->fReadOnlyConfig = false; 790 # ifdef VBOX_WITH_SUID_WRAPPER /* Solaris setuid for Passthrough mode. */ 791 rc = solarisCheckUserAuth(); 792 if (RT_FAILURE(rc)) 793 { 794 Log(("DVD: solarisCheckUserAuth failed. Permission denied!\n")); 795 return rc; 796 } 797 # endif /* VBOX_WITH_SUID_WRAPPER */ 818 pThis->fAttachFailError = true; 819 rc = VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 798 820 } 799 #endif /* !RT_OS_L4 */800 801 pThis->IMount.pfnUnmount = drvHostDvdUnmount;802 pThis->pfnDoLock = drvHostDvdDoLock;803 #ifdef USE_MEDIA_POLLING804 if (!fPassthrough)805 pThis->pfnPoll = drvHostDvdPoll;806 else807 pThis->pfnPoll = NULL;808 #endif809 #ifdef RT_OS_LINUX810 pThis->pfnGetMediaSize = drvHostDvdGetMediaSize;811 #endif812 813 /*814 * 2nd init part.815 */816 rc = DRVHostBaseInitFinish(pThis);817 821 } 818 822 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Storage/DrvHostFloppy.cpp
r44528 r45061 185 185 186 186 /* 187 * Validate configuration.188 */189 if (!CFGMR3AreValuesValid(pCfg, "Path\0ReadOnly\0Interval\0Locked\0BIOSVisible\0"))190 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;191 192 /*193 187 * Init instance data. 194 188 */ … … 197 191 { 198 192 /* 199 * Override stuff.193 * Validate configuration. 200 194 */ 195 if (CFGMR3AreValuesValid(pCfg, "Path\0ReadOnly\0Interval\0Locked\0BIOSVisible\0")) 196 { 197 /* 198 * Override stuff. 199 */ 201 200 #ifdef RT_OS_WINDOWS 202 pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;201 pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize; 203 202 #endif 204 203 #ifdef RT_OS_LINUX 205 pThis->Base.pfnPoll = drvHostFloppyPoll;206 pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize;204 pThis->Base.pfnPoll = drvHostFloppyPoll; 205 pThis->Base.pfnGetMediaSize = drvHostFloppyGetMediaSize; 207 206 #endif 208 207 209 /* 210 * 2nd init part. 211 */ 212 rc = DRVHostBaseInitFinish(&pThis->Base); 208 /* 209 * 2nd init part. 210 */ 211 rc = DRVHostBaseInitFinish(&pThis->Base); 212 } 213 else 214 { 215 pThis->fAttachFailError = true; 216 rc = VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 217 } 213 218 } 214 219 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Storage/DrvMediaISO.cpp
r44528 r45061 197 197 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 198 198 199 RTFileClose(pThis->hFile); 200 pThis->hFile = NIL_RTFILE; 199 if (pThis->hFile != NIL_RTFILE) 200 { 201 RTFileClose(pThis->hFile); 202 pThis->hFile = NIL_RTFILE; 203 } 201 204 202 205 if (pThis->pszFilename) -
trunk/src/VBox/Devices/Storage/DrvRawImage.cpp
r44528 r45061 235 235 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 236 236 237 RTFileClose(pThis->hFile); 238 pThis->hFile = NIL_RTFILE; 237 if (pThis->hFile != NIL_RTFILE) 238 { 239 RTFileClose(pThis->hFile); 240 pThis->hFile = NIL_RTFILE; 241 } 239 242 240 243 if (pThis->pszFilename) -
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r44889 r45061 847 847 848 848 /* Free the VSCSI device and LUN handle. */ 849 VSCSILUN hVScsiLun; 850 int rc = VSCSIDeviceLunDetach(pThis->hVScsiDevice, 0, &hVScsiLun); 851 AssertRC(rc); 852 853 Assert(hVScsiLun == pThis->hVScsiLun); 854 rc = VSCSILunDestroy(hVScsiLun); 855 AssertRC(rc); 856 rc = VSCSIDeviceDestroy(pThis->hVScsiDevice); 857 AssertRC(rc); 849 if (pThis->hVScsiDevice) 850 { 851 VSCSILUN hVScsiLun; 852 int rc = VSCSIDeviceLunDetach(pThis->hVScsiDevice, 0, &hVScsiLun); 853 AssertRC(rc); 854 855 Assert(hVScsiLun == pThis->hVScsiLun); 856 rc = VSCSILunDestroy(hVScsiLun); 857 AssertRC(rc); 858 rc = VSCSIDeviceDestroy(pThis->hVScsiDevice); 859 AssertRC(rc); 860 861 pThis->hVScsiDevice = NULL; 862 pThis->hVScsiLun = NULL; 863 } 858 864 } 859 865 … … 868 874 PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI); 869 875 LogFlowFunc(("pDrvIns=%#p pCfg=%#p\n", pDrvIns, pCfg)); 870 LogRelFunc(("pDrvIns=%#p pCfg=%#p\n", pDrvIns, pCfg));871 876 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 872 877 -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r44358 r45061 2069 2069 static DECLCALLBACK(void) drvvdDestruct(PPDMDRVINS pDrvIns) 2070 2070 { 2071 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns); 2071 2072 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 2072 2073 LogFlowFunc(("\n")); 2073 PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);2074 2074 2075 2075 RTSEMFASTMUTEX mutex; … … 2088 2088 } 2089 2089 2090 if ( VALID_PTR(pThis->pBlkCache))2090 if (RT_VALID_PTR(pThis->pBlkCache)) 2091 2091 { 2092 2092 PDMR3BlkCacheRelease(pThis->pBlkCache); … … 2094 2094 } 2095 2095 2096 if ( VALID_PTR(pThis->pDisk))2096 if (RT_VALID_PTR(pThis->pDisk)) 2097 2097 { 2098 2098 VDDestroy(pThis->pDisk); … … 2108 2108 } 2109 2109 if (pThis->pbData) 2110 { 2110 2111 RTMemFree(pThis->pbData); 2112 pThis->pbData = NULL; 2113 } 2111 2114 if (pThis->pszBwGroup) 2112 2115 { … … 2121 2124 * @copydoc FNPDMDRVCONSTRUCT 2122 2125 */ 2123 static DECLCALLBACK(int) drvvdConstruct(PPDMDRVINS pDrvIns, 2124 PCFGMNODE pCfg, 2125 uint32_t fFlags) 2126 static DECLCALLBACK(int) drvvdConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 2126 2127 { 2127 2128 LogFlowFunc(("\n")); 2129 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 2128 2130 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 2129 2131 int rc = VINF_SUCCESS; … … 2135 2137 bool fMaybeReadOnly; /**< True if the media may or may not be read-only. */ 2136 2138 bool fHonorZeroWrites; /**< True if zero blocks should be written. */ 2137 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);2138 2139 2139 2140 /* … … 2148 2149 pThis->fMergePending = false; 2149 2150 pThis->MergeCompleteMutex = NIL_RTSEMFASTMUTEX; 2151 pThis->MergeLock = NIL_RTSEMRW; 2150 2152 pThis->uMergeSource = VD_LAST_IMAGE; 2151 2153 pThis->uMergeTarget = VD_LAST_IMAGE; … … 2739 2741 /* Open the cache image if set. */ 2740 2742 if ( RT_SUCCESS(rc) 2741 && VALID_PTR(pszCachePath))2743 && RT_VALID_PTR(pszCachePath)) 2742 2744 { 2743 2745 /* Insert the custom I/O interface only if we're told to use new IO. … … 2772 2774 } 2773 2775 2774 if ( VALID_PTR(pszCachePath))2776 if (RT_VALID_PTR(pszCachePath)) 2775 2777 MMR3HeapFree(pszCachePath); 2776 if ( VALID_PTR(pszCacheFormat))2778 if (RT_VALID_PTR(pszCacheFormat)) 2777 2779 MMR3HeapFree(pszCacheFormat); 2778 2780 … … 2866 2868 if (RT_FAILURE(rc)) 2867 2869 { 2868 if ( VALID_PTR(pszName))2870 if (RT_VALID_PTR(pszName)) 2869 2871 MMR3HeapFree(pszName); 2870 if ( VALID_PTR(pszFormat))2872 if (RT_VALID_PTR(pszFormat)) 2871 2873 MMR3HeapFree(pszFormat); 2872 2874 /* drvvdDestruct does the rest. */ -
trunk/src/VBox/VMM/VMMR3/PDMNetShaper.cpp
r44528 r45061 346 346 VM_ASSERT_EMT(pUVM->pVM); 347 347 AssertPtrReturn(pFilter, VERR_INVALID_POINTER); 348 /* Now, return quietly if the filter isn't attached since driver/device 349 destructors are called on constructor failure. */ 350 if (!pFilter->pBwGroupR3) 351 return VINF_SUCCESS; 348 352 AssertPtrReturn(pFilter->pBwGroupR3, VERR_INVALID_POINTER); 349 353
Note:
See TracChangeset
for help on using the changeset viewer.