It is not necessary to know what happens inside the DLL; the main question is why reading works but writing does not. And this only happens in .NET 8 — because if I do this in .NET Framework, everything works fine.