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