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