| ... | @@ -1226,8 +1226,18 @@ pub fn GetFinalPathNameByHandle( | ... | @@ -1226,8 +1226,18 @@ pub fn GetFinalPathNameByHandle( |
| 1226 | | 1226 | |
| 1227 | const file_path_begin_index = mem.indexOfPos(u16, final_path, expected_prefix.len, &[_]u16{'\\'}) orelse unreachable; | 1227 | const file_path_begin_index = mem.indexOfPos(u16, final_path, expected_prefix.len, &[_]u16{'\\'}) orelse unreachable; |
| 1228 | const volume_name_u16 = final_path[0..file_path_begin_index]; | 1228 | const volume_name_u16 = final_path[0..file_path_begin_index]; |
| | 1229 | const device_name_u16 = volume_name_u16[expected_prefix.len..]; |
| 1229 | const file_name_u16 = final_path[file_path_begin_index..]; | 1230 | const file_name_u16 = final_path[file_path_begin_index..]; |
| 1230 | | 1231 | |
| | 1232 | // MUP is Multiple UNC Provider, and indicates that the path is a UNC |
| | 1233 | // path. In this case, the canonical UNC path can be gotten by just |
| | 1234 | // dropping the \Device\Mup\ and making sure the path begins with \\ |
| | 1235 | if (mem.eql(u16, device_name_u16, std.unicode.utf8ToUtf16LeStringLiteral("Mup"))) { |
| | 1236 | out_buffer[0] = '\\'; |
| | 1237 | mem.copyForwards(u16, out_buffer[1..][0..file_name_u16.len], file_name_u16); |
| | 1238 | return out_buffer[0 .. 1 + file_name_u16.len]; |
| | 1239 | } |
| | 1240 | |
| 1231 | // Get DOS volume name. DOS volume names are actually symbolic link objects to the | 1241 | // Get DOS volume name. DOS volume names are actually symbolic link objects to the |
| 1232 | // actual NT volume. For example: | 1242 | // actual NT volume. For example: |
| 1233 | // (NT) \Device\HarddiskVolume4 => (DOS) \DosDevices\C: == (DOS) C: | 1243 | // (NT) \Device\HarddiskVolume4 => (DOS) \DosDevices\C: == (DOS) C: |