[PATCH 5/5] kernel32: Also accept STATUS_BUFFER_OVERFLOW as a valid return code in GetFileInformationByHandle().

Henri Verbeet hverbeet at codeweavers.com
Thu Nov 19 04:41:26 CST 2009


FileAllInformation is supposed to also return the file name. If it did,
"all_info" would be too small for the returned data, but since it would still
return as much information as fits in the buffer, we don't need a larger
buffer either.
---
 dlls/kernel32/file.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index e6d83bc..8932dea 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -821,6 +821,7 @@ BOOL WINAPI GetFileInformationByHandle( HANDLE hFile, BY_HANDLE_FILE_INFORMATION
     NTSTATUS status;
 
     status = NtQueryInformationFile( hFile, &io, &all_info, sizeof(all_info), FileAllInformation );
+    if (status == STATUS_BUFFER_OVERFLOW) status = STATUS_SUCCESS;
     if (status == STATUS_SUCCESS)
     {
         info->dwFileAttributes                = all_info.BasicInformation.FileAttributes;
-- 
1.6.4.4




More information about the wine-patches mailing list