Validate Win32 error codes instead of error messages because this is more robust across O/S versions and locales.