The ClassWithSafeHandle class in this example only works as expected on Windows because it makes a native library call.