File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -474,18 +474,17 @@ bool AddPythonDLLToSearchPath() {
474474#endif
475475
476476#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
477- // / Returns whether `python3x.dll` is in the DLL search path .
477+ // / Returns true if `python3x.dll` can be loaded .
478478bool IsPythonDLLInPath () {
479479#define WIDEN2 (x ) L##x
480480#define WIDEN (x ) WIDEN2(x)
481- WCHAR foundPath[MAX_PATH];
482- DWORD result =
483- SearchPathW (nullptr , WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME), nullptr ,
484- MAX_PATH, foundPath, nullptr );
481+ HMODULE h = LoadLibraryW (WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME));
482+ if (!h)
483+ return false ;
484+ FreeLibrary (h);
485+ return true ;
485486#undef WIDEN2
486487#undef WIDEN
487-
488- return result > 0 ;
489488}
490489#endif
491490
You can’t perform that action at this time.
0 commit comments