I had an important realization about the directory check. If the source filename ends with a backslash, the MoveFileW call will only succeed if the source file is a directory. That should remove the need to check beforehand and eliminate the time-of-check to time-of-use problem.
It does still require remapping some error codes. I get `ERROR_FILE_NOT_FOUND` if it doesn't exist and `ERROR_INVALID_NAME` if it's a regular file. But I think it'd be an improvement overall.