From: Grazvydas Ignotas Subject: [PATCH] ntdll: Fix restart size calculation. Message-Id: <1320254871-12663-1-git-send-email-notasas@gmail.com> Date: Wed, 2 Nov 2011 19:27:51 +0200 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