| ... | ... | @@ -3599,7 +3599,6 @@ test QueryObjectName { |
| 3599 | 3599 | |
| 3600 | 3600 | pub const GetFinalPathNameByHandleError = error{ |
| 3601 | 3601 | AccessDenied, |
| 3602 | | BadPathName, |
| 3603 | 3602 | FileNotFound, |
| 3604 | 3603 | NameTooLong, |
| 3605 | 3604 | /// The volume does not contain a recognized file system. File system |
| ... | ... | @@ -3705,6 +3704,7 @@ pub fn GetFinalPathNameByHandle( |
| 3705 | 3704 | error.WouldBlock => return error.Unexpected, |
| 3706 | 3705 | error.NetworkNotFound => return error.Unexpected, |
| 3707 | 3706 | error.AntivirusInterference => return error.Unexpected, |
| 3707 | error.BadPathName => return error.Unexpected, |
| 3708 | 3708 | else => |e| return e, |
| 3709 | 3709 | }; |
| 3710 | 3710 | defer CloseHandle(mgmt_handle); |
| ... | ... | @@ -3750,9 +3750,7 @@ pub fn GetFinalPathNameByHandle( |
| 3750 | 3750 | const total_len = drive_letter.len + file_name_u16.len; |
| 3751 | 3751 | |
| 3752 | 3752 | // Validate that DOS does not contain any spurious nul bytes. |
| 3753 | | if (mem.findScalar(u16, out_buffer[0..total_len], 0)) |_| { |
| 3754 | | return error.BadPathName; |
| 3755 | | } |
| 3753 | assert(mem.findScalar(u16, out_buffer[0..total_len], 0) == null); |
| 3756 | 3754 | |
| 3757 | 3755 | return out_buffer[0..total_len]; |
| 3758 | 3756 | } else if (mountmgrIsVolumeName(symlink)) { |
| ... | ... | @@ -3802,9 +3800,7 @@ pub fn GetFinalPathNameByHandle( |
| 3802 | 3800 | const total_len = volume_path.len + file_name_u16.len; |
| 3803 | 3801 | |
| 3804 | 3802 | // Validate that DOS does not contain any spurious nul bytes. |
| 3805 | | if (mem.findScalar(u16, out_buffer[0..total_len], 0)) |_| { |
| 3806 | | return error.BadPathName; |
| 3807 | | } |
| 3803 | assert(mem.findScalar(u16, out_buffer[0..total_len], 0) == null); |
| 3808 | 3804 | |
| 3809 | 3805 | return out_buffer[0..total_len]; |
| 3810 | 3806 | } |