I found out, that these memory exception only occurs by using garbage collection. Apparently you can't create a Win32-Dll with GC which you can run with RunDll32 or this is a bug in memory management of GC.