Changeset 38547 in vbox for trunk/include/iprt
- Timestamp:
- Aug 26, 2011 12:58:47 PM (13 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/ldr.h
r38515 r38547 38 38 39 39 RT_C_DECLS_BEGIN 40 41 /** Loader address (unsigned integer). */ 42 typedef RTUINTPTR RTLDRADDR; 43 /** Pointer to a loader address. */ 44 typedef RTLDRADDR *PRTLDRADDR; 45 /** Pointer to a const loader address. */ 46 typedef RTLDRADDR const *PCRTLDRADDR; 47 /** The max loader address value. */ 48 #define RTLDRADDR_MAX RTUINTPTR_MAX 49 /** NIL loader address value. */ 50 #define NIL_RTLDRADDR RTLDRADDR_MAX 40 51 41 52 … … 237 248 * @param pValue Where to store the symbol value. 238 249 */ 239 RTDECL(int) RTLdrGetSymbolEx(RTLDRMOD hLdrMod, const void *pvBits, RTUINTPTR BaseAddress, const char *pszSymbol, RTUINTPTR *pValue); 250 RTDECL(int) RTLdrGetSymbolEx(RTLDRMOD hLdrMod, const void *pvBits, RTLDRADDR BaseAddress, const char *pszSymbol, 251 PRTLDRADDR pValue); 240 252 241 253 /** … … 261 273 * @param pvUser User argument. 262 274 */ 263 typedef DECLCALLBACK(int) RTLDRIMPORT(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser); 275 typedef DECLCALLBACK(int) RTLDRIMPORT(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, 276 PRTLDRADDR pValue, void *pvUser); 264 277 /** Pointer to a FNRTLDRIMPORT() callback function. */ 265 278 typedef RTLDRIMPORT *PFNRTLDRIMPORT; … … 278 291 * @remark Not supported for RTLdrLoad() images. 279 292 */ 280 RTDECL(int) RTLdrGetBits(RTLDRMOD hLdrMod, void *pvBits, RT UINTPTR BaseAddress, PFNRTLDRIMPORT pfnGetImport, void *pvUser);293 RTDECL(int) RTLdrGetBits(RTLDRMOD hLdrMod, void *pvBits, RTLDRADDR BaseAddress, PFNRTLDRIMPORT pfnGetImport, void *pvUser); 281 294 282 295 /** … … 294 307 * @remark Not supported for RTLdrLoad() images. 295 308 */ 296 RTDECL(int) RTLdrRelocate(RTLDRMOD hLdrMod, void *pvBits, RT UINTPTR NewBaseAddress, RTUINTPTR OldBaseAddress,309 RTDECL(int) RTLdrRelocate(RTLDRMOD hLdrMod, void *pvBits, RTLDRADDR NewBaseAddress, RTLDRADDR OldBaseAddress, 297 310 PFNRTLDRIMPORT pfnGetImport, void *pvUser); 298 311 … … 307 320 * @param pvUser The user argument specified to RTLdrEnumSymbols(). 308 321 */ 309 typedef DECLCALLBACK(int) RTLDRENUMSYMS(RTLDRMOD hLdrMod, const char *pszSymbol, unsigned uSymbol, RT UINTPTR Value, void *pvUser);322 typedef DECLCALLBACK(int) RTLDRENUMSYMS(RTLDRMOD hLdrMod, const char *pszSymbol, unsigned uSymbol, RTLDRADDR Value, void *pvUser); 310 323 /** Pointer to a RTLDRENUMSYMS() callback function. */ 311 324 typedef RTLDRENUMSYMS *PFNRTLDRENUMSYMS; … … 324 337 * @remark Not supported for RTLdrLoad() images. 325 338 */ 326 RTDECL(int) RTLdrEnumSymbols(RTLDRMOD hLdrMod, unsigned fFlags, const void *pvBits, RT UINTPTR BaseAddress, PFNRTLDRENUMSYMS pfnCallback, void *pvUser);339 RTDECL(int) RTLdrEnumSymbols(RTLDRMOD hLdrMod, unsigned fFlags, const void *pvBits, RTLDRADDR BaseAddress, PFNRTLDRENUMSYMS pfnCallback, void *pvUser); 327 340 328 341 /** @name RTLdrEnumSymbols flags. … … 377 390 * if there isn't any specific file location. 378 391 * @param LinkAddress The link address of the debug info if it's 379 * loadable. RTUINTPTR_MAXif not loadable.392 * loadable. NIL_RTLDRADDR if not loadable. 380 393 * @param cb The size of the debug information. -1 is used if 381 394 * this isn't applicable. … … 387 400 typedef DECLCALLBACK(int) FNRTLDRENUMDBG(RTLDRMOD hLdrMod, uint32_t iDbgInfo, RTLDRDBGINFOTYPE enmType, 388 401 uint16_t iMajorVer, uint16_t iMinorVer, const char *pszPartNm, 389 RTFOFF offFile, RT UINTPTR LinkAddress, RTUINTPTR cb,402 RTFOFF offFile, RTLDRADDR LinkAddress, RTLDRADDR cb, 390 403 const char *pszExtFile, void *pvUser); 391 404 /** Pointer to a debug info enumerator callback. */ 392 405 typedef FNRTLDRENUMDBG *PFNRTLDRENUMDBG; 393 394 406 395 407 /** … … 407 419 RTDECL(int) RTLdrEnumDbgInfo(RTLDRMOD hLdrMod, const void *pvBits, PFNRTLDRENUMDBG pfnCallback, void *pvUser); 408 420 421 422 /** 423 * Loader segment. 424 */ 425 typedef struct RTLDRSEG 426 { 427 /** The segment name. (Might not be zero terminated!) */ 428 const char *pchName; 429 /** The length of the segment name. */ 430 uint32_t cchName; 431 /** The flat selector to use for the segment (i.e. data/code). 432 * Primarily a way for the user to specify selectors for the LX/LE and NE interpreters. */ 433 uint16_t SelFlat; 434 /** The 16-bit selector to use for the segment. 435 * Primarily a way for the user to specify selectors for the LX/LE and NE interpreters. */ 436 uint16_t Sel16bit; 437 /** Segment flags. */ 438 uint32_t fFlags; 439 /** The segment protection (RTMEM_PROT_XXX). */ 440 uint32_t fProt; 441 /** The size of the segment. */ 442 RTLDRADDR cb; 443 /** The required segment alignment. 444 * The to 0 if the segment isn't supposed to be mapped. */ 445 RTLDRADDR Alignment; 446 /** The link address. 447 * Set to NIL_RTLDRADDR if the segment isn't supposed to be mapped or if 448 * the image doesn't have link addresses. */ 449 RTLDRADDR LinkAddress; 450 /** File offset of the segment. 451 * Set to -1 if no file backing (like BSS). */ 452 RTFOFF offFile; 453 /** Size of the file bits of the segment. 454 * Set to -1 if no file backing (like BSS). */ 455 RTFOFF cbFile; 456 /** The relative virtual address when mapped. 457 * Set to NIL_RTLDRADDR if the segment isn't supposed to be mapped. */ 458 RTLDRADDR RVA; 459 /** The size of the segment including the alignment gap up to the next segment when mapped. 460 * This is set to NIL_RTLDRADDR if not implemented. */ 461 RTLDRADDR cbMapped; 462 } RTLDRSEG; 463 /** Pointer to a loader segment. */ 464 typedef RTLDRSEG *PRTLDRSEG; 465 /** Pointer to a read only loader segment. */ 466 typedef RTLDRSEG const *PCRTLDRSEG; 467 468 469 /** @name Segment flags 470 * @{ */ 471 /** The segment is 16-bit. When not set the default of the target architecture is assumed. */ 472 #define RTLDRSEG_FLAG_16BIT UINT32_C(1) 473 /** The segment requires a 16-bit selector alias. (OS/2) */ 474 #define RTLDRSEG_FLAG_OS2_ALIAS16 UINT32_C(2) 475 /** Conforming segment (x86 weirdness). (OS/2) */ 476 #define RTLDRSEG_FLAG_OS2_CONFORM UINT32_C(4) 477 /** IOPL (ring-2) segment. (OS/2) */ 478 #define RTLDRSEG_FLAG_OS2_IOPL UINT32_C(8) 479 /** @} */ 480 481 /** 482 * Segment enumerator callback. 483 * 484 * @returns VINF_SUCCESS to continue the enumeration. Any other status code 485 * will cause RTLdrEnumSegments to immediately return with that 486 * status. 487 * 488 * @param hLdrMod The module handle. 489 * @param pSeg The segment information. 490 * @param pvUser The user parameter specified to RTLdrEnumSegments. 491 */ 492 typedef DECLCALLBACK(int) FNRTLDRENUMSEGS(RTLDRMOD hLdrMod, PCRTLDRSEG pSeg, void *pvUser); 493 /** Pointer to a segment enumerator callback. */ 494 typedef FNRTLDRENUMSEGS *PFNRTLDRENUMSEGS; 495 496 /** 497 * Enumerate the debug info contained in the executable image. 498 * 499 * @returns IPRT status code or whatever pfnCallback returns. 500 * 501 * @param hLdrMod The module handle. 502 * @param pfnCallback The callback function. 503 * @param pvUser The user argument. 504 */ 505 RTDECL(int) RTLdrEnumSegments(RTLDRMOD hLdrMod, PFNRTLDRENUMSEGS pfnCallback, void *pvUser); 506 507 409 508 RT_C_DECLS_END 410 509 -
trunk/include/iprt/mangling.h
r38539 r38547 552 552 # define RTLdrClose RT_MANGLER(RTLdrClose) 553 553 # define RTLdrEnumDbgInfo RT_MANGLER(RTLdrEnumDbgInfo) 554 # define RTLdrEnumSegments RT_MANGLER(RTLdrEnumSegments) 554 555 # define RTLdrEnumSymbols RT_MANGLER(RTLdrEnumSymbols) 555 556 # define RTLdrGetBits RT_MANGLER(RTLdrGetBits)
Note:
See TracChangeset
for help on using the changeset viewer.