It's the same line of code described here:
https://github.com/aybe/Windows-API-...k-1.1/issues/3
What I don't understand is why it's another type of exception, my code was casting to int while the code that is said to work uses intptr.ToInt64, maybe the integer size is different on your system, I don't get it, anyway, I upload a build in a few minutes which I hope will work.