Changeset 47236 in vbox for trunk/include/iprt/win
- Timestamp:
- Jul 18, 2013 7:04:29 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87354
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/win/lazy-dbghelp.h
r46126 r47236 38 38 static int rtLdrLazyLoadDbgHelp(const char *pszFile, PRTLDRMOD phMod) 39 39 { 40 char szPath[RTPATH_MAX]; 41 size_t cchPath; 42 int rc = RTEnvGetEx(RTENV_DEFAULT, "ProgramFiles", szPath, sizeof(szPath), &cchPath); 43 if (RT_SUCCESS(rc)) 40 static const struct 44 41 { 45 /** @todo try Windows SDK location. */ 46 #ifdef RT_ARCH_X86 47 rc = RTPathAppend(szPath, sizeof(szPath), "Debugging Tools for Windows (x86)\\dbghelp.dll"); 42 const char *pszEnv; 43 const char *pszSubDir; 44 } s_aLocations[] = 45 { 46 #ifdef RT_ARCH_AMD64 47 { "ProgramFiles(x86)", "Windows Kits\\8.1\\Debuggers\\x64\\dbghelp.dll" }, 48 { "ProgramFiles(x86)", "Windows Kits\\8.0\\Debuggers\\x64\\dbghelp.dll" }, 49 { "ProgramFiles", "Debugging Tools for Windows (x64)\\dbghelp.dll" }, 48 50 #else 49 rc = RTPathAppend(szPath, sizeof(szPath), "Debugging Tools for Windows (x64)\\dbghelp.dll"); 50 #endif 51 if (RTPathExists(szPath)) 51 { "ProgramFiles", "Windows Kits\\8.1\\Debuggers\\x86\\dbghelp.dll" }, 52 { "ProgramFiles", "Windows Kits\\8.0\\Debuggers\\x86\\dbghelp.dll" }, 53 { "ProgramFiles", "Debugging Tools for Windows (x86)\\dbghelp.dll" }, 54 #endif /** @todo More places we should look? */ 55 }; 56 uint32_t i; 57 for (i = 0; i < RT_ELEMENTS(s_aLocations); i++) 58 { 59 char szPath[RTPATH_MAX]; 60 size_t cchPath; 61 int rc = RTEnvGetEx(RTENV_DEFAULT, s_aLocations[i].pszEnv, szPath, sizeof(szPath), &cchPath); 62 if (RT_SUCCESS(rc)) 52 63 { 53 rc = RT LdrLoad(szPath, phMod);64 rc = RTPathAppend(szPath, sizeof(szPath), s_aLocations[i].pszSubDir); 54 65 if (RT_SUCCESS(rc)) 55 return rc; 66 { 67 rc = RTLdrLoad(szPath, phMod); 68 if (RT_SUCCESS(rc)) 69 return rc; 70 } 56 71 } 57 72 } 58 73 59 return RTLdrLoad(pszFile, phMod); 74 /* Fall back on the system one, if present. */ 75 return RTLdrLoadSystem(pszFile, true /*fNoUnload*/, phMod); 60 76 } 61 77
Note:
See TracChangeset
for help on using the changeset viewer.