| ... | ... | @@ -453,7 +453,8 @@ pub fn FindClose(hFindFile: HANDLE) void { |
| 453 | 453 | |
| 454 | 454 | pub const ReadFileError = error{ |
| 455 | 455 | BrokenPipe, |
| 456 | | NetNameDeleted, |
| 456 | /// The specified network name is no longer available. |
| 457 | ConnectionResetByPeer, |
| 457 | 458 | OperationAborted, |
| 458 | 459 | Unexpected, |
| 459 | 460 | }; |
| ... | ... | @@ -485,7 +486,7 @@ pub fn ReadFile(in_hFile: HANDLE, buffer: []u8, offset: ?u64) ReadFileError!usiz |
| 485 | 486 | .OPERATION_ABORTED => continue, |
| 486 | 487 | .BROKEN_PIPE => return 0, |
| 487 | 488 | .HANDLE_EOF => return 0, |
| 488 | | .NETNAME_DELETED => return error.NetNameDeleted, |
| 489 | .NETNAME_DELETED => return error.ConnectionResetByPeer, |
| 489 | 490 | else => |err| return unexpectedError(err), |
| 490 | 491 | } |
| 491 | 492 | } |
| ... | ... | @@ -501,6 +502,8 @@ pub const WriteFileError = error{ |
| 501 | 502 | /// The process cannot access the file because another process has locked |
| 502 | 503 | /// a portion of the file. |
| 503 | 504 | LockViolation, |
| 505 | /// The specified network name is no longer available. |
| 506 | ConnectionResetByPeer, |
| 504 | 507 | Unexpected, |
| 505 | 508 | }; |
| 506 | 509 | |
| ... | ... | @@ -517,8 +520,8 @@ pub fn WriteFile( |
| 517 | 520 | .InternalHigh = 0, |
| 518 | 521 | .DUMMYUNIONNAME = .{ |
| 519 | 522 | .DUMMYSTRUCTNAME = .{ |
| 520 | | .Offset = @as(u32, @truncate(off)), |
| 521 | | .OffsetHigh = @as(u32, @truncate(off >> 32)), |
| 523 | .Offset = @truncate(off), |
| 524 | .OffsetHigh = @truncate(off >> 32), |
| 522 | 525 | }, |
| 523 | 526 | }, |
| 524 | 527 | .hEvent = null, |
| ... | ... | @@ -536,6 +539,7 @@ pub fn WriteFile( |
| 536 | 539 | .BROKEN_PIPE => return error.BrokenPipe, |
| 537 | 540 | .INVALID_HANDLE => return error.NotOpenForWriting, |
| 538 | 541 | .LOCK_VIOLATION => return error.LockViolation, |
| 542 | .NETNAME_DELETED => return error.ConnectionResetByPeer, |
| 539 | 543 | else => |err| return unexpectedError(err), |
| 540 | 544 | } |
| 541 | 545 | } |