C # shared memory between managed and unmanaged code

Is it possible for windows for unmanaged code (C ++ / c) to be written to the memory area accessed by managed .Net (C #) code (separate processes) I have an ac program that writes data to a circular memory buffer, and I want to process a buffer with unmanaged code.

+3
source share
4 answers

If you are looking for a solution in which an unmanaged process and a managed process can share memory, you can use the MemoryMappedFile class (introduced in .NET 4.0).

, GCHandle , .

+4

,

+3

Yes, look at unsafe and fixed keywords.

+1
source

Yes,

you should use the Marshall class, especially the Marshal.AllocHGlobal. .

+1
source

Source: https://habr.com/ru/post/1793685/


All Articles