path: fix bugs and inconsistencies
This PR fixes resolving device paths like \\.\PHYSICALDRIVE
.
The resolve
function was adding a trailing backslash, considering that this device path was a UNC path. However, device paths are different than UNC paths.
This PR includes more changes than originally intended because fixing the bug caused inconsistencies between other functions and operating systems. Now, this PR fixes all these problems.