I agree with Cypher. Whoever wrote the original code was an idiot. Oh right.
Also, the whole x86/x64 switching thing didn't work too well, so you're probably better off compiling as x86 (unless you're working with x64 targets, in which case I believe there will be other issues you'll run into).Code:finally { if (hModule != IntPtr.Zero) { Imports.FreeLibrary(hModule); } }