Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated win_delay_load_hook.cc to work with /clr #1819

Closed
wants to merge 1 commit into from

Conversation

ipetrovic11
Copy link
Contributor

Added support for native managed modules with delay load

To support native modules that use managed code(/clr) with delay load
we need to compile win_delay_load_hook.cc as unmanaged by setting
#pragma unmanaged

Added "#pragma unmanaged" in win_delay_load_hook.cc to support clr
@rvagg rvagg requested review from bzoz and joaocgreis July 15, 2019 05:20
@joaocgreis
Copy link
Member

@ipetrovic11 if I read https://docs.microsoft.com/en-us/cpp/preprocessor/managed-unmanaged?view=vs-2019 correctly, shouldn't the pragma directive be placed right before the function definition?

@ipetrovic11
Copy link
Contributor Author

@joaocgreis it doesn't have to be just for one function.

#pragma unmanaged
// Unmanaged code here, could be multiple functions
#pragma managed

It should be related to one source file, so if you state at the top that #pragma unmanaged, the whole file will be considered as unmanaged. I believe that win_delay_load_hook.cc should be unmanaged.

@joaocgreis
Copy link
Member

joaocgreis pushed a commit that referenced this pull request Jul 18, 2019
Added "#pragma unmanaged" in win_delay_load_hook.cc to support clr

PR-URL: #1819
Reviewed-By: João Reis <reis@janeasystems.com>
@joaocgreis
Copy link
Member

Landed in 5736079. Thanks!

@joaocgreis joaocgreis closed this Jul 18, 2019
@rvagg rvagg mentioned this pull request Sep 26, 2019
rvagg pushed a commit that referenced this pull request Sep 26, 2019
Added "#pragma unmanaged" in win_delay_load_hook.cc to support clr

PR-URL: #1819
Reviewed-By: João Reis <reis@janeasystems.com>
@rvagg rvagg mentioned this pull request Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants