Changeset 46593 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Jun 17, 2013 2:32:51 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86471
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/ldr/ldr.cpp
r46164 r46593 94 94 95 95 96 RTDECL(PFNRT) RTLdrGetFunction(RTLDRMOD hLdrMod, const char *pszSymbol) 97 { 98 PFNRT pfn; 99 int rc = RTLdrGetSymbol(hLdrMod, pszSymbol, (void **)&pfn); 100 if (RT_SUCCESS(rc)) 101 return pfn; 102 return NULL; 103 } 104 RT_EXPORT_SYMBOL(RTLdrGetFunction); 105 106 96 107 RTDECL(RTLDRFMT) RTLdrGetFormat(RTLDRMOD hLdrMod) 97 108 { -
trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp
r46164 r46593 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 63 63 * Operations for a native module. 64 64 */ 65 static const RTLDROPS s_rtldrNativeOps =65 static const RTLDROPS g_rtldrNativeOps = 66 66 { 67 67 "native", … … 131 131 pMod->Core.u32Magic = RTLDRMOD_MAGIC; 132 132 pMod->Core.eState = LDR_STATE_LOADED; 133 pMod->Core.pOps = & s_rtldrNativeOps;133 pMod->Core.pOps = &g_rtldrNativeOps; 134 134 pMod->Core.pReader = NULL; 135 135 pMod->Core.enmFormat = RTLDRFMT_NATIVE; … … 148 148 #endif 149 149 pMod->hNative = ~(uintptr_t)0; 150 pMod->fFlags = fFlags; 150 151 151 152 /* … … 171 172 172 173 174 RTDECL(int) RTLdrLoadSystem(const char *pszFilename, bool fNoUnload, PRTLDRMOD phLdrMod) 175 { 176 LogFlow(("RTLdrLoadSystem: pszFilename=%p:{%s} fNoUnload=%RTbool phLdrMod=%p\n", 177 pszFilename, pszFilename, fNoUnload, phLdrMod)); 178 179 /* 180 * Validate input. 181 */ 182 AssertPtrReturn(phLdrMod, VERR_INVALID_PARAMETER); 183 *phLdrMod = NIL_RTLDRMOD; 184 AssertPtrReturn(pszFilename, VERR_INVALID_PARAMETER); 185 AssertMsgReturn(!RTPathHavePath(pszFilename), ("%s\n", pszFilename), VERR_INVALID_PARAMETER); 186 187 /* 188 * Check the filename. 189 */ 190 size_t cchFilename = strlen(pszFilename); 191 AssertMsgReturn(cchFilename < (RTPATH_MAX / 4) * 3, ("%zu\n", cchFilename), VERR_INVALID_PARAMETER); 192 193 const char *pszExt = ""; 194 if (!RTPathHaveExt(pszFilename)) 195 pszExt = RTLdrGetSuff(); 196 197 /* 198 * Let the platform specific code do the rest. 199 */ 200 int rc = rtldrNativeLoadSystem(pszFilename, pszExt, fNoUnload ? RTLDRLOAD_FLAGS_NO_UNLOAD : 0, phLdrMod); 201 LogFlow(("RTLdrLoadSystem: returns %Rrc\n", rc)); 202 return rc; 203 } 204 205 206 RTDECL(void *) RTLdrGetSystemSymbol(const char *pszFilename, const char *pszSymbol) 207 { 208 void *pvRet = NULL; 209 RTLDRMOD hLdrMod; 210 int rc = RTLdrLoadSystem(pszFilename, true /*fNoUnload*/, &hLdrMod); 211 if (RT_SUCCESS(rc)) 212 { 213 rc = RTLdrGetSymbol(hLdrMod, pszSymbol, &pvRet); 214 if (RT_FAILURE(rc)) 215 pvRet = NULL; /* paranoia */ 216 RTLdrClose(hLdrMod); 217 } 218 return pvRet; 219 } 220 221 173 222 /** 174 223 * Loads a dynamic load library (/shared object) image file residing in the … … 258 307 RT_EXPORT_SYMBOL(RTLdrGetSuff); 259 308 309 310 RTDECL(uintptr_t) RTLdrGetNativeHandle(RTLDRMOD hLdrMod) 311 { 312 PRTLDRMODNATIVE pThis = (PRTLDRMODNATIVE)hLdrMod; 313 AssertPtrReturn(pThis, ~(uintptr_t)0); 314 AssertReturn(pThis->Core.u32Magic == RTLDRMOD_MAGIC, ~(uintptr_t)0); 315 AssertReturn(pThis->Core.pOps == &g_rtldrNativeOps, ~(uintptr_t)0); 316 return pThis->hNative; 317 } 318 RT_EXPORT_SYMBOL(RTLdrGetNativeHandle); 319 -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r44528 r46593 184 184 return rc; 185 185 } 186 187 188 #ifdef IN_RING3 189 /** 190 * Called when IPRT was first initialized in unobtrusive mode and later changed 191 * to obtrustive. 192 * 193 * This is only applicable in ring-3. 194 */ 195 DECLHIDDEN(void) rtThreadReInitObtrusive(void) 196 { 197 rtThreadNativeReInitObtrusive(); 198 } 199 #endif 186 200 187 201
Note:
See TracChangeset
for help on using the changeset viewer.