Importing from DLL/SO and function pointers

Interoperability in .NET is an interesting topic, but it would be much better to refer to proper resources dedicated to it. Here, we will only consider .NET's analogs of function pointers and misbelief dynamic importing of functions exported by DLLs and shared objects. But, first, let's construct the class, import the GetPointers() procedure, and define function pointer delegates:

internal class Crypto{   Funcs  functions;   IntPtr buffer;   byte[] data;   // The following two lines make up the properties of the class   internal byte[] Data { get { return data; } }   internal int Length { get { return data.Length; } }      // Declare binding for GetPointers() // The following line is written for 64-bit targets, ...

Get Mastering Assembly Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.