Add comments explaining BUFFER_OVERFLOW during NtQueryInformationFile calls
This commit is contained in:
@@ -379,6 +379,9 @@ pub const File = struct {
|
||||
const rc = windows.ntdll.NtQueryInformationFile(self.handle, &io_status_block, &info, @sizeOf(windows.FILE_ALL_INFORMATION), .FileAllInformation);
|
||||
switch (rc) {
|
||||
.SUCCESS => {},
|
||||
// Buffer overflow here indicates that there is more information available than was able to be stored in the buffer
|
||||
// size provided. This is treated as success because the type of variable-length information that this would be relevant for
|
||||
// (name, volume name, etc) we don't care about.
|
||||
.BUFFER_OVERFLOW => {},
|
||||
.INVALID_PARAMETER => unreachable,
|
||||
.ACCESS_DENIED => return error.AccessDenied,
|
||||
@@ -830,6 +833,9 @@ pub const File = struct {
|
||||
const rc = windows.ntdll.NtQueryInformationFile(self.handle, &io_status_block, &info, @sizeOf(windows.FILE_ALL_INFORMATION), .FileAllInformation);
|
||||
switch (rc) {
|
||||
.SUCCESS => {},
|
||||
// Buffer overflow here indicates that there is more information available than was able to be stored in the buffer
|
||||
// size provided. This is treated as success because the type of variable-length information that this would be relevant for
|
||||
// (name, volume name, etc) we don't care about.
|
||||
.BUFFER_OVERFLOW => {},
|
||||
.INVALID_PARAMETER => unreachable,
|
||||
.ACCESS_DENIED => return error.AccessDenied,
|
||||
|
||||
Reference in New Issue
Block a user