summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>2019-01-18 15:39:54 -0800
committerGitHub <noreply@github.com>2019-01-18 15:39:54 -0800
commit0c6ad4c8d3869b54364b15f21b8b6b5a6fe7a94a (patch)
tree256d6ab0839dfd15a85fb72c02018d06ed541b3e /src
parent87fb9af12afb29087a818bd588037996a97bf000 (diff)
downloadcoreclr-0c6ad4c8d3869b54364b15f21b8b6b5a6fe7a94a.tar.gz
coreclr-0c6ad4c8d3869b54364b15f21b8b6b5a6fe7a94a.tar.bz2
coreclr-0c6ad4c8d3869b54364b15f21b8b6b5a6fe7a94a.zip
Fix calling conventions on reverse PInvoke callbacks. (#22044)
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs b/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
index a05b71c9e3..f1a2a1f9fb 100644
--- a/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
+++ b/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
@@ -64,6 +64,7 @@ namespace System.Runtime.Loader
{
// Reset the error write to the one used before
corehost_set_error_writer(previousErrorWriterPtr);
+ GC.KeepAlive(errorWriter);
}
}
catch (EntryPointNotFoundException entryPointNotFoundException)
@@ -289,13 +290,13 @@ namespace System.Runtime.Loader
}
#endif
- [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = HostpolicyCharSet)]
+ [UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = HostpolicyCharSet)]
internal delegate void corehost_resolve_component_dependencies_result_fn(
string assembly_paths,
string native_search_paths,
string resource_search_paths);
- [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = HostpolicyCharSet)]
+ [UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = HostpolicyCharSet)]
internal delegate void corehost_error_writer_fn(
string message);