dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 510 forks source link

Add marshalling support for CriticalHandle #2570

Open shrah opened 7 years ago

shrah commented 7 years ago

We need to port CriticalHandle and HandleRef to CoreLib in order to have P/Invoke support for them.

farkasmark commented 7 years ago

Do you know if any progress is made or planned in this issue?

MichalStrehovsky commented 7 years ago

Both classes are already ported to CoreRT, but the marshalling code generator in the CoreRT compiler doesn't handle them.

I think we can repurpose this issue to track implementing this in the CoreRT compiler. (Cc @shrah)

@farkasmark Are you asking about support for this in the CoreRT compiler?

farkasmark commented 7 years ago

@MichalStrehovsky Yes, I am asking about the CoreRT compiler support. I can build the solution successfully but I get a runtime exception from the natively compiled application.

shrah commented 7 years ago

@farkasmark I should be able to work on the marshalling support for CriticalHandle and HandleRef around mid July if that works for you.

farkasmark commented 7 years ago

@shrah That would be perfect! Let me know if I can assist you in that! (in testing for example)

farkasmark commented 7 years ago

@shrah May I ask if you could have made any progress on this matter? Thanks a lot!

farkasmark commented 7 years ago

Does anyone have any idea how to get started with this? Thanks!

shrah commented 7 years ago

@farkasmark I apologize for not getting to you sooner. With shipping .NET Native and parental leave I couldn't get to it in time.

If you want to work on it, you can start by looking into the corresponding CoreCLR implementation here https://github.com/dotnet/coreclr/blob/52a816d3011f4d03b80b5940dc036b40d701f52d/src/vm/ilmarshalers.cpp#L3002

farkasmark commented 7 years ago

@shrah Congratulations! :) No problem, I try to make it work based on the corresponding CoreCLR implementation you have given! Thanks for the help and I get back to you if I stuck.

jkotas commented 6 years ago

This should not be hard - marking up-for-grabs.

MichalStrehovsky commented 5 years ago

HandleRef is done in #6395. What's left is CriticalHandle. It shouldn't be hard to implement based on the information in this issue, so that's still up for grabs.