Added. I don't think there's a meaningful error here other than the file already existing. (Which, to be fair, was an error in my original patch. I've changed FILE_OPEN_IF to FILE_CREATE.) mklink /j, unlike the other variants, doesn't validate the destination at all.
thanks for the update... looks good (yes the non existing target is the one I had in mind)
also, native cmd doesn't handle path:s longer than MAX_PATH characters, so this shall be detected and failed upon
According to my testing it does here, actually.
retested with: [mklink-cmd.patch](/uploads/fc70ee6d2b13278afe842605c9622590/mklink-cmd.patch) here native (Win10) fails when target is larger than MAX_PATH (didn't try to check that the very value of the limit though) (and your MR crashes because of a buffer overflow when setting file2) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9595#note_124676