From 175ba1c0794958bb7d006544b87e00675de742fc Mon Sep 17 00:00:00 2001 From: Swaroop Sridhar Date: Wed, 21 Nov 2018 11:42:01 -0800 Subject: Introduce Marshall.LoadLibrary API (#20871) Implement Native LoadLibrary API This change commits the following changes: 1) Refactoring DllImport code to reuse LodLibrary by search for pInvoke and LoadLibrary cases 2) Implement the new Native Library API in System.Runtime.Interop.Marshall 3) Add tests for the new APIs --- src/pal/inc/pal.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/pal/inc/pal.h') diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 45989998e8..e304d854e9 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -2552,6 +2552,8 @@ OpenFileMappingW( #define OpenFileMapping OpenFileMappingA #endif +typedef INT_PTR (PALAPI *FARPROC)(); + PALIMPORT LPVOID PALAPI @@ -2604,9 +2606,22 @@ PALIMPORT HMODULE PALAPI PAL_RegisterLibraryDirect( - IN void *dl_handle, + IN NATIVE_LIBRARY_HANDLE dl_handle, IN LPCWSTR lpLibFileName); +PALIMPORT +BOOL +PALAPI +PAL_FreeLibraryDirect( + IN NATIVE_LIBRARY_HANDLE dl_handle); + +PALIMPORT +FARPROC +PALAPI +PAL_GetProcAddressDirect( + IN NATIVE_LIBRARY_HANDLE dl_handle, + IN LPCSTR lpProcName); + /*++ Function: PAL_LOADLoadPEFile @@ -2650,8 +2665,6 @@ PAL_LOADUnloadPEFile(void * ptr); #define LoadLibraryEx LoadLibraryExA #endif -typedef INT_PTR (PALAPI *FARPROC)(); - PALIMPORT FARPROC PALAPI -- cgit v1.2.3