[PATCH] ntdll: Fix restart size calculation.

Grazvydas Ignotas notasas at gmail.com
Wed Nov 2 12:27:51 CDT 2011


This code failed to take current entry into account when restarting,
making calls with single_entry flag set always fail and return 1
entry less than needed otherwise.
---
 dlls/ntdll/directory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index e62cc82..65c8b8f 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -1812,7 +1812,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff
             if (res > 0 && (single_entry || io->Information + max_dir_info_size(class) > length))
             {
                 lseek( fd, (unsigned long)restart_pos, SEEK_SET );
-                size = (char *)de - data;
+                size = (char *)de + de->d_reclen - data;
                 io->Information = restart_info_pos;
                 last_info = restart_last_info;
                 goto restart;
-- 
1.7.0.4




More information about the wine-patches mailing list