| ... | @@ -42,6 +42,7 @@ pub const OpenError = error{ | ... | @@ -42,6 +42,7 @@ pub const OpenError = error{ |
| 42 | WouldBlock, | 42 | WouldBlock, |
| 43 | NetworkNotFound, | 43 | NetworkNotFound, |
| 44 | AntivirusInterference, | 44 | AntivirusInterference, |
| | 45 | BadPathName, |
| 45 | }; | 46 | }; |
| 46 | | 47 | |
| 47 | pub const OpenFileOptions = struct { | 48 | pub const OpenFileOptions = struct { |
| ... | @@ -120,7 +121,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN | ... | @@ -120,7 +121,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN |
| 120 | ); | 121 | ); |
| 121 | switch (rc) { | 122 | switch (rc) { |
| 122 | .SUCCESS => return result, | 123 | .SUCCESS => return result, |
| 123 | .OBJECT_NAME_INVALID => unreachable, | 124 | .OBJECT_NAME_INVALID => return error.BadPathName, |
| 124 | .OBJECT_NAME_NOT_FOUND => return error.FileNotFound, | 125 | .OBJECT_NAME_NOT_FOUND => return error.FileNotFound, |
| 125 | .OBJECT_PATH_NOT_FOUND => return error.FileNotFound, | 126 | .OBJECT_PATH_NOT_FOUND => return error.FileNotFound, |
| 126 | .BAD_NETWORK_PATH => return error.NetworkNotFound, // \\server was not found | 127 | .BAD_NETWORK_PATH => return error.NetworkNotFound, // \\server was not found |