[mono] Use DefaultDllSearchPaths attribute for PInvokes (#38975)
authorAlexis Christoforides <alexis@thenull.net>
Tue, 28 Jul 2020 05:22:22 +0000 (01:22 -0400)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2020 05:22:22 +0000 (01:22 -0400)
commit7e98079afbf860d04d95330d0f00ee235383e6b1
tree15d1175c78ed857ef2305389a2dd9cb2940619f0
parent56d45b13c092c8ed3642113fc1991aacd86d26ef
[mono] Use DefaultDllSearchPaths attribute for PInvokes (#38975)

* [mono] Use DefaultDllSearchPaths attribute for PInvokes

So far we have been ignoring the flags contained in the attribute.

Attribute can be applied to a pinvoke method or an assembly. See https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.defaultdllimportsearchpathsattribute.-ctor?view=netcore-3.1#System_Runtime_InteropServices_DefaultDllImportSearchPathsAttribute__ctor_System_Runtime_InteropServices_DllImportSearchPath_

* Update src/mono/mono/metadata/native-library.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Minor fixes to comments and error handling

* Additional fixes

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Ryan Lucia <rylucia@microsoft.com>
src/mono/mono/metadata/custom-attrs.c
src/mono/mono/metadata/native-library.c