Skip to content

Instantly share code, notes, and snippets.

@scdub
Created June 30, 2020 03:58
Show Gist options
  • Save scdub/67a7cdf4fa9f7bd070b98f031ccdf2f8 to your computer and use it in GitHub Desktop.
Save scdub/67a7cdf4fa9f7bd070b98f031ccdf2f8 to your computer and use it in GitHub Desktop.
diff --git a/python/0020-Add-CondaEcosystemModifyDllSearchPath.patch b/python/0020-Add-CondaEcosystemModifyDllSearchPath.patch
index baa429d0..686efea8 100644
--- a/python/0020-Add-CondaEcosystemModifyDllSearchPath.patch
+++ b/python/0020-Add-CondaEcosystemModifyDllSearchPath.patch
@@ -27,7 +27,7 @@ index 5076d5442c..094813e954 100644
#endif
#ifdef _MSC_VER
-@@ -343,6 +347,375 @@ run_file(FILE *fp, const wchar_t *filename, PyCompilerFlags *p_cf)
+@@ -343,6 +352,379 @@ run_file(FILE *fp, const wchar_t *filename, PyCompilerFlags *p_cf)
}
@@ -238,7 +238,11 @@ index 5076d5442c..094813e954 100644
+ int SetDllDirectoryValue = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS;
+ if (sv_failed_to_find_dll_fns)
+ return 1;
-+
++ /* if the CondaEcosystemModifyDllSearchPath_Init(argc, argv) code hasn't been run
++ * or failed to bind to the required functions in kernel32.dll, fail early to avoid
++ * an access violation. */
++ if (pSetDefaultDllDirectories == NULL || pSetDllDirectory == NULL || pAddDllDirectory == NULL)
++ return 1;
+ if (_wgetenv(L"CONDA_DLL_SEARCH_MODIFICATION_ENABLE") == NULL)
+ return 0;
+ if (_wgetenv(L"CONDA_DLL_SEARCH_MODIFICATION_NEVER_ADD_WINDOWS_DIRECTORY"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment