| ... | @@ -602,6 +602,9 @@ pub const ReadFileError = error{ | ... | @@ -602,6 +602,9 @@ pub const ReadFileError = error{ |
| 602 | OperationAborted, | 602 | OperationAborted, |
| 603 | /// Unable to read file due to lock. | 603 | /// Unable to read file due to lock. |
| 604 | LockViolation, | 604 | LockViolation, |
| | 605 | /// Known to be possible when: |
| | 606 | /// - Unable to read from disconnected virtual com port (Windows) |
| | 607 | AccessDenied, |
| 605 | Unexpected, | 608 | Unexpected, |
| 606 | }; | 609 | }; |
| 607 | | 610 | |
| ... | @@ -634,6 +637,7 @@ pub fn ReadFile(in_hFile: HANDLE, buffer: []u8, offset: ?u64) ReadFileError!usiz | ... | @@ -634,6 +637,7 @@ pub fn ReadFile(in_hFile: HANDLE, buffer: []u8, offset: ?u64) ReadFileError!usiz |
| 634 | .HANDLE_EOF => return 0, | 637 | .HANDLE_EOF => return 0, |
| 635 | .NETNAME_DELETED => return error.ConnectionResetByPeer, | 638 | .NETNAME_DELETED => return error.ConnectionResetByPeer, |
| 636 | .LOCK_VIOLATION => return error.LockViolation, | 639 | .LOCK_VIOLATION => return error.LockViolation, |
| | 640 | .ACCESS_DENIED => return error.AccessDenied, |
| 637 | else => |err| return unexpectedError(err), | 641 | else => |err| return unexpectedError(err), |
| 638 | } | 642 | } |
| 639 | } | 643 | } |
| ... | @@ -651,6 +655,9 @@ pub const WriteFileError = error{ | ... | @@ -651,6 +655,9 @@ pub const WriteFileError = error{ |
| 651 | LockViolation, | 655 | LockViolation, |
| 652 | /// The specified network name is no longer available. | 656 | /// The specified network name is no longer available. |
| 653 | ConnectionResetByPeer, | 657 | ConnectionResetByPeer, |
| | 658 | /// Known to be possible when: |
| | 659 | /// - Unable to write to disconnected virtual com port (Windows) |
| | 660 | AccessDenied, |
| 654 | Unexpected, | 661 | Unexpected, |
| 655 | }; | 662 | }; |
| 656 | | 663 | |
| ... | @@ -687,6 +694,7 @@ pub fn WriteFile( | ... | @@ -687,6 +694,7 @@ pub fn WriteFile( |
| 687 | .INVALID_HANDLE => return error.NotOpenForWriting, | 694 | .INVALID_HANDLE => return error.NotOpenForWriting, |
| 688 | .LOCK_VIOLATION => return error.LockViolation, | 695 | .LOCK_VIOLATION => return error.LockViolation, |
| 689 | .NETNAME_DELETED => return error.ConnectionResetByPeer, | 696 | .NETNAME_DELETED => return error.ConnectionResetByPeer, |
| | 697 | .ACCESS_DENIED => return error.AccessDenied, |
| 690 | else => |err| return unexpectedError(err), | 698 | else => |err| return unexpectedError(err), |
| 691 | } | 699 | } |
| 692 | } | 700 | } |