I think this is one of the times that Windows sets the error to access denied if the real error doesn't fall into any of the other buckets, making the default case unreachable.