The SafeHandleZeroOrMinusOneIsInvalid or similar classes cannot be used in a Portable Class Library targeting .NET 4.0 and Windows Store Apps.
Does anybody know why or how one could use this or use a different class?
Yes, I would like some unsafe stuff in a portable class library.
Portable is limited to the platforms that you are targeting. In this case, Windows Store apps doesn’t expose this type. It’s implementation is very simple, here’s one I just whipped up: