Changeset 46083 in vbox for trunk/src/VBox/Runtime/common/ldr/ldrMemory.cpp
- Timestamp:
- May 14, 2013 11:39:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldrMemory.cpp
r46082 r46083 264 264 LogFlow(("RTLdrOpenInMemory: pszName=%p:{%s} fFlags=%#x enmArch=%d cbImage=%#zu pfnRead=%p pfnDtor=%p pvUser=%p phLdrMod=%p\n", 265 265 pszName, pszName, fFlags, enmArch, cbImage, pfnRead, pfnDtor, pvUser, phLdrMod)); 266 AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER); 267 AssertMsgReturn(enmArch > RTLDRARCH_INVALID && enmArch < RTLDRARCH_END, ("%d\n", enmArch), VERR_INVALID_PARAMETER); 266 268 267 if (!pfnRead || !pfnDtor) 269 268 AssertPtrReturn(pvUser, VERR_INVALID_POINTER); 269 if (!pfnDtor) 270 pfnDtor = rtldrRdrMemDefaultDtor; 271 else 272 AssertPtrReturn(pfnRead, VERR_INVALID_POINTER); 273 274 /* The rest of the validations will call the destructor. */ 275 AssertMsgReturnStmt(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), 276 pfnDtor(pvUser), VERR_INVALID_PARAMETER); 277 AssertMsgReturnStmt(enmArch > RTLDRARCH_INVALID && enmArch < RTLDRARCH_END, ("%d\n", enmArch), 278 pfnDtor(pvUser), VERR_INVALID_PARAMETER); 270 279 if (!pfnRead) 271 280 pfnRead = rtldrRdrMemDefaultReader; 272 281 else 273 AssertPtrReturn(pfnRead, VERR_INVALID_POINTER); 274 if (!pfnDtor) 275 pfnDtor = rtldrRdrMemDefaultDtor; 276 else 277 AssertPtrReturn(pfnRead, VERR_INVALID_POINTER); 278 AssertReturn(cbImage > 0, VERR_INVALID_PARAMETER); 279 282 AssertReturnStmt(RT_VALID_PTR(pfnRead), pfnDtor(pvUser), VERR_INVALID_POINTER); 283 AssertReturnStmt(cbImage > 0, pfnDtor(pvUser), VERR_INVALID_PARAMETER); 280 284 281 285 /* … … 304 308 return rc; 305 309 } 310 306 311 pReader->pfnDestroy(pReader); 307 312 } 313 else 314 pfnDtor(pvUser), 308 315 *phLdrMod = NIL_RTLDRMOD; 316 309 317 LogFlow(("RTLdrOpen: return %Rrc\n", rc)); 310 318 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.