summaryrefslogtreecommitdiff
path: root/src/pal/inc
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@microsoft.com>2015-09-25 17:23:43 -0700
committerKoundinya Veluri <kouvel@microsoft.com>2015-09-25 17:23:43 -0700
commit65663fe8c455fad5c1e54fc068d2ec077bee7222 (patch)
tree2cb474ef0cc9174a5a8774589d55e7a1fd3b2018 /src/pal/inc
parenta52b9639ac96a05844bac11560c4a99cddb6eb06 (diff)
downloadcoreclr-65663fe8c455fad5c1e54fc068d2ec077bee7222.tar.gz
coreclr-65663fe8c455fad5c1e54fc068d2ec077bee7222.tar.bz2
coreclr-65663fe8c455fad5c1e54fc068d2ec077bee7222.zip
Add AssemblyLoadContext.LoadUnmanagedDllFromPathfor use by overriders of AssemblyLoadContext.LoadUnmanagedDll
LoadUnmanagedDllFromPath needs to call LoadLibrary or dlopen, and return the system handle to the library through LoadUnmanagedDll. Outside Windows, when LoadUnmanagedDll returns a system handle to a library, the handle needs to be registered with PAL's module list for lifetime management. From that point on, the system handle is tracked as part of the PAL handle. To handle both of the above, I have refactored module.cpp!LOADLoadLibrary into a LoadLibraryDirect portion and a RegisterLibrary component. LoadLibraryDirect loads the specified library directly using the system call, without appending or prepending anything to the library name RegisterLibrary registers a system library handle with PAL to get a PAL handle This patch contains the necessary changes to coreclr and mscorlib. Tests will be added separately, after the new APIs are published and can be consumed. Fixes dotnet/coreclr#935 Part of dotnet/coreclr#937 and dotnet/corefx#3054 See https://github.com/dotnet/coreclr/pull/1500 [tfs-changeset: 1529692]
Diffstat (limited to 'src/pal/inc')
-rw-r--r--src/pal/inc/pal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index 6f88513d29..e995549a4f 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -3658,6 +3658,19 @@ LoadLibraryExW(
IN /*Reserved*/ HANDLE hFile,
IN DWORD dwFlags);
+PALIMPORT
+HMODULE
+PALAPI
+PAL_LoadLibraryDirect(
+ IN LPCWSTR lpLibFileName);
+
+PALIMPORT
+HMODULE
+PALAPI
+PAL_RegisterLibraryDirect(
+ IN HMODULE dl_handle,
+ IN LPCWSTR lpLibFileName);
+
/*++
Function:
PAL_LOADLoadPEFile