Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Merge changes from TFS#3420

Merged
jkotas merged 1 commit intodotnet:nmirrorfrom
dotnet-bot:from-tfs
Apr 25, 2017
Merged

Merge changes from TFS#3420
jkotas merged 1 commit intodotnet:nmirrorfrom
dotnet-bot:from-tfs

Conversation

@dotnet-bot
Copy link
Collaborator

No description provided.

 Change Description:
     For Pinvoke function, Currently Mcg will try to resolve its 'real' native exported function name through lib file. This add a hard dependency on Lib files to allow pinvoke works correctly
     If one of its lib file doesn't exists,
         if UseDefaultPInvoke is set, then the app may fail to launch
         if UseDefaultPInvoke isn't set, then throw exception if someone try to call this function during runtime.

     The change will to use LoadLibrary/GetProcAddress to fetch native function during runtime when passing IFS:UseLoadLibraryForPInvoke to ilc.
     Also since it isn't clear whether Windows will allow to use LoadLibrary/GetProcAddress in UWP, so add  LoadLibrary/GetProcAddress support code into Mcg Code template

     Changes:
     1. Move McgGeneratedNativeCallCodeAttribute from S.P.Interop to S.P.Corelib
         The LoadLibray/GetProcAddress support itself need to call some pinvokes(CoTaskMemAlloc/CoTaskMemFree), thus Mcg should skip these these pinvokes(CoTaskMemAlloc/CoTaskMemFree).
     2. Add IFS:UseLoadLibraryForPInvoke to enable LoadLibrary Support. By default, don't use LoadLibrary
     3. Add EntryPointNotFoundException and DllNotFoundException as wellknown type, since mcg generated code depends on these two types

     Remaining:
     1. Stdcall convention support for missing lib case

[tfs-changeset: 1655835]
@jkotas jkotas merged commit 7400669 into dotnet:nmirror Apr 25, 2017
@dotnet-bot dotnet-bot deleted the from-tfs branch April 25, 2017 00:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants