Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion xml/System.Runtime.InteropServices/Marshal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3946,10 +3946,15 @@ The code retrieves a reference to an instance of Microsoft Word successfully. Ho

You must manually keep the delegate from being collected by the garbage collector from managed code. The garbage collector does not track references to unmanaged code.

This API is unsupported in environments that don't support dynamic entry-point allocation, such as `ProcessDynamicCodePolicy` on Windows, `execmem off` in SELinux, and WebAssembly.

It is recommended to use function pointers and <xref:System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute> instead. Function pointers are more efficient, easier to use correctly, and supported in all environments.

]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="d" /> parameter is a generic type definition.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="d" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.PlatformNotSupportedException">Dynamic entrypoint allocation is not supported in the current environment.</exception>
</Docs>
</Member>
<Member MemberName="GetFunctionPointerForDelegate&lt;TDelegate&gt;">
Expand Down Expand Up @@ -4014,11 +4019,15 @@ The code retrieves a reference to an instance of Microsoft Word successfully. Ho
The delegate `d` is converted to a function pointer that can be passed to unmanaged code by using [the default platform calling convention](/dotnet/standard/native-interop/calling-conventions#platform-default-calling-convention). You can set the calling convention by applying the <xref:System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute> to the delegate.

You must manually keep the delegate from being collected by the garbage collector from managed code. The garbage collector does not track references to unmanaged code.


This API is unsupported in environments that don't support dynamic entry-point allocation, such as `ProcessDynamicCodePolicy` on Windows, `execmem off` in SELinux, and WebAssembly.

It is recommended to use function pointers and <xref:System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute> instead. Function pointers are more efficient, easier to use correctly, and supported in all environments.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="d" /> parameter is a generic type definition.</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="d" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.PlatformNotSupportedException">Dynamic entrypoint allocation is not supported in the current environment.</exception>
</Docs>
</Member>
<Member MemberName="GetHINSTANCE">
Expand Down