winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
910 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Add support for the different info classes in NtQueryDirectoryFile.
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: 74ae7d358f786740e44ff184d432a42b57291a83 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74ae7d358f786740e44ff184d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 18:07:30 2009 +0100 ntdll: Add support for the different info classes in NtQueryDirectoryFile. --- dlls/ntdll/directory.c | 59 +++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 602b08c..a09aab1 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -151,7 +151,11 @@ static int ignored_files_count; union file_directory_info { ULONG next; + FILE_DIRECTORY_INFORMATION dir; FILE_BOTH_DIRECTORY_INFORMATION both; + FILE_FULL_DIRECTORY_INFORMATION full; + FILE_ID_BOTH_DIRECTORY_INFORMATION id_both; + FILE_ID_FULL_DIRECTORY_INFORMATION id_full; }; static int show_dot_files = -1; @@ -223,8 +227,16 @@ static inline unsigned int dir_info_size( FILE_INFORMATION_CLASS class, unsigned { switch (class) { + case FileDirectoryInformation: + return (FIELD_OFFSET( FILE_DIRECTORY_INFORMATION, FileName[len] ) + 3) & ~3; case FileBothDirectoryInformation: - return (FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName[len] ) + 3) & ~3; + return (FIELD_OFFSET( FILE_BOTH_DIRECTORY_INFORMATION, FileName[len] ) + 3) & ~3; + case FileFullDirectoryInformation: + return (FIELD_OFFSET( FILE_FULL_DIRECTORY_INFORMATION, FileName[len] ) + 3) & ~3; + case FileIdBothDirectoryInformation: + return (FIELD_OFFSET( FILE_ID_BOTH_DIRECTORY_INFORMATION, FileName[len] ) + 3) & ~3; + case FileIdFullDirectoryInformation: + return (FIELD_OFFSET( FILE_ID_FULL_DIRECTORY_INFORMATION, FileName[len] ) + 3) & ~3; default: assert(0); } @@ -953,6 +965,7 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK struct stat st; WCHAR long_nameW[MAX_DIR_ENTRY_LEN]; WCHAR short_nameW[12]; + WCHAR *filename; UNICODE_STRING str; ULONG attributes = 0; @@ -1012,25 +1025,51 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK io->u.Status = STATUS_BUFFER_OVERFLOW; } info = (union file_directory_info *)((char *)info_ptr + io->Information); + /* all the structures start with a FileDirectoryInformation layout */ + fill_stat_info( &st, info, class ); + info->dir.NextEntryOffset = total_len; + info->dir.FileIndex = 0; /* NTFS always has 0 here, so let's not bother with it */ + info->dir.FileAttributes |= attributes; switch (class) { + case FileDirectoryInformation: + info->dir.FileNameLength = long_len * sizeof(WCHAR); + filename = info->dir.FileName; + break; + + case FileFullDirectoryInformation: + info->full.EaSize = 0; /* FIXME */ + info->full.FileNameLength = long_len * sizeof(WCHAR); + filename = info->full.FileName; + break; + + case FileIdFullDirectoryInformation: + info->id_full.EaSize = 0; /* FIXME */ + info->id_full.FileNameLength = long_len * sizeof(WCHAR); + filename = info->id_full.FileName; + break; + case FileBothDirectoryInformation: - fill_stat_info( &st, &info->both, class ); - info->both.NextEntryOffset = total_len; - info->both.FileIndex = 0; /* NTFS always has 0 here, so let's not bother with it */ - info->both.FileAttributes |= attributes; info->both.EaSize = 0; /* FIXME */ info->both.ShortNameLength = short_len * sizeof(WCHAR); for (i = 0; i < short_len; i++) info->both.ShortName[i] = toupperW(short_nameW[i]); info->both.FileNameLength = long_len * sizeof(WCHAR); - memcpy( info->both.FileName, long_nameW, - min( info->both.FileNameLength, - total_len - FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName ))); + filename = info->both.FileName; + break; + + case FileIdBothDirectoryInformation: + info->id_both.EaSize = 0; /* FIXME */ + info->id_both.ShortNameLength = short_len * sizeof(WCHAR); + for (i = 0; i < short_len; i++) info->id_both.ShortName[i] = toupperW(short_nameW[i]); + info->id_both.FileNameLength = long_len * sizeof(WCHAR); + filename = info->id_both.FileName; break; + default: assert(0); } + memcpy( filename, long_nameW, total_len - ((char *)filename - (char *)info) ); io->Information += total_len; return info; } @@ -1650,7 +1689,11 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, } switch (info_class) { + case FileDirectoryInformation: case FileBothDirectoryInformation: + case FileFullDirectoryInformation: + case FileIdBothDirectoryInformation: + case FileIdFullDirectoryInformation: if (length < dir_info_size( info_class, 1 )) return io->u.Status = STATUS_INFO_LENGTH_MISMATCH; break; default:
1
0
0
0
Alexandre Julliard : ntdll: Make the various directory info size functions depend on the info class.
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: 551ddfe4028f5b63ddda703956a1132a59def666 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=551ddfe4028f5b63ddda70395…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:54:06 2009 +0100 ntdll: Make the various directory info size functions depend on the info class. --- dlls/ntdll/directory.c | 47 ++++++++++++++++++++++++++++++----------------- 1 files changed, 30 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index ef5b17e..602b08c 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -154,8 +154,6 @@ union file_directory_info FILE_BOTH_DIRECTORY_INFORMATION both; }; -static const unsigned int max_dir_info_size = FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName[MAX_DIR_ENTRY_LEN] ); - static int show_dot_files = -1; /* at some point we may want to allow Winelib apps to set this */ @@ -221,6 +219,23 @@ static inline BOOL is_ignored_file( const struct stat *st ) return FALSE; } +static inline unsigned int dir_info_size( FILE_INFORMATION_CLASS class, unsigned int len ) +{ + switch (class) + { + case FileBothDirectoryInformation: + return (FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName[len] ) + 3) & ~3; + default: + assert(0); + } +} + +static inline unsigned int max_dir_info_size( FILE_INFORMATION_CLASS class ) +{ + return dir_info_size( class, MAX_DIR_ENTRY_LEN ); +} + + /*********************************************************************** * get_default_com_device * @@ -990,7 +1005,7 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK if (!show_dot_files && long_name[0] == '.' && long_name[1] && (long_name[1] != '.' || long_name[2])) attributes |= FILE_ATTRIBUTE_HIDDEN; - total_len = (FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[long_len]) + 3) & ~3; + total_len = dir_info_size( class, long_len ); if (io->Information + total_len > max_length) { total_len = max_length - io->Information; @@ -1082,7 +1097,7 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG if (restart_scan) lseek( fd, 0, SEEK_SET ); - if (length < max_dir_info_size) /* we may have to return a partial entry here */ + if (length < max_dir_info_size(class)) /* we may have to return a partial entry here */ { off_t old_pos = lseek( fd, 0, SEEK_CUR ); @@ -1132,7 +1147,7 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG last_info = info; if (single_entry) break; /* check if we still have enough space for the largest possible entry */ - if (io->Information + max_dir_info_size > length) break; + if (io->Information + max_dir_info_size(class) > length) break; } if (ioctl( fd, VFAT_IOCTL_READDIR_BOTH, (long)de ) == -1) break; } @@ -1169,7 +1184,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U } if (restart_scan) lseek( fd, 0, SEEK_SET ); - else if (length < max_dir_info_size) /* we may have to return a partial entry here */ + else if (length < max_dir_info_size(class)) /* we may have to return a partial entry here */ { old_pos = lseek( fd, 0, SEEK_CUR ); if (old_pos == -1 && errno == ENOENT) @@ -1209,8 +1224,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U /* make sure we have enough room for both entries */ if (fake_dot_dot) { - static const ULONG min_info_size = (FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[1]) + - FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[2]) + 3) & ~3; + const ULONG min_info_size = dir_info_size( class, 1 ) + dir_info_size( class, 2 ); if (length < min_info_size || single_entry) { FIXME( "not enough room %u/%u for fake . and .. entries\n", length, single_entry ); @@ -1226,7 +1240,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U last_info = info; /* check if we still have enough space for the largest possible entry */ - if (last_info && io->Information + max_dir_info_size > length) + if (last_info && io->Information + max_dir_info_size(class) > length) { lseek( fd, 0, SEEK_SET ); /* reset pos to first entry */ res = 0; @@ -1248,7 +1262,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U break; } /* check if we still have enough space for the largest possible entry */ - if (single_entry || io->Information + max_dir_info_size > length) + if (single_entry || io->Information + max_dir_info_size(class) > length) { if (res > 0) lseek( fd, de->d_off, SEEK_SET ); /* set pos to next entry */ break; @@ -1372,8 +1386,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff /* make sure we have enough room for both entries */ if (fake_dot_dot) { - static const ULONG min_info_size = (FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[1]) + - FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[2]) + 3) & ~3; + const ULONG min_info_size = dir_info_size( class, 1 ) + dir_info_size( class, 2 ); if (length < min_info_size || single_entry) { FIXME( "not enough room %u/%u for fake . and .. entries\n", length, single_entry ); @@ -1392,7 +1405,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff restart_info_pos = io->Information; /* check if we still have enough space for the largest possible entry */ - if (last_info && io->Information + max_dir_info_size > length) + if (last_info && io->Information + max_dir_info_size(class) > length) { lseek( fd, 0, SEEK_SET ); /* reset pos to first entry */ res = 0; @@ -1426,7 +1439,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff goto restart; } /* if we have to return but the buffer contains more data, restart with a smaller size */ - if (res > 0 && (single_entry || io->Information + max_dir_info_size > length)) + 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; @@ -1444,7 +1457,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff if (size < initial_size) break; /* already restarted once, give up now */ size = min( size, length - io->Information ); /* if size is too small don't bother to continue */ - if (size < max_dir_info_size && last_info) break; + if (size < max_dir_info_size(class) && last_info) break; restart_last_info = last_info; restart_info_pos = io->Information; restart: @@ -1530,7 +1543,7 @@ static void read_directory_readdir( int fd, IO_STATUS_BLOCK *io, void *buffer, U } if (single_entry) break; /* check if we still have enough space for the largest possible entry */ - if (io->Information + max_dir_info_size > length) break; + if (io->Information + max_dir_info_size(class) > length) break; } } @@ -1638,7 +1651,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, switch (info_class) { case FileBothDirectoryInformation: - if (length < sizeof(FILE_BOTH_DIR_INFORMATION)) return io->u.Status = STATUS_INFO_LENGTH_MISMATCH; + if (length < dir_info_size( info_class, 1 )) return io->u.Status = STATUS_INFO_LENGTH_MISMATCH; break; default: FIXME( "Unsupported file info class %d\n", info_class );
1
0
0
0
Alexandre Julliard : ntdll: Pass the NtQueryDirectoryFile info class down into the various helper functions .
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: ee9b19ab5f20e43d016c98fd517a4347823a205a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee9b19ab5f20e43d016c98fd5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:47:37 2009 +0100 ntdll: Pass the NtQueryDirectoryFile info class down into the various helper functions. --- dlls/ntdll/directory.c | 96 ++++++++++++++++++++++++++---------------------- 1 files changed, 52 insertions(+), 44 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ee9b19ab5f20e43d016c9…
1
0
0
0
Alexandre Julliard : ntdll: Define a generic file information structure to allow supporting multiple info classes in NtQueryDirectoryFile .
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: cfafcc5a6ef8ccf73e07a92ea0fe7fb041f652d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cfafcc5a6ef8ccf73e07a92ea…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:42:51 2009 +0100 ntdll: Define a generic file information structure to allow supporting multiple info classes in NtQueryDirectoryFile. --- dlls/ntdll/directory.c | 55 +++++++++++++++++++++++++++--------------------- 1 files changed, 31 insertions(+), 24 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index f7736e2..85170aa 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -148,6 +148,12 @@ struct file_identity static struct file_identity ignored_files[MAX_IGNORED_FILES]; static int ignored_files_count; +union file_directory_info +{ + ULONG next; + FILE_BOTH_DIRECTORY_INFORMATION both; +}; + static const unsigned int max_dir_info_size = FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName[MAX_DIR_ENTRY_LEN] ); static int show_dot_files = -1; @@ -923,11 +929,11 @@ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STR * * helper for NtQueryDirectoryFile */ -static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, IO_STATUS_BLOCK *io, ULONG max_length, +static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK *io, ULONG max_length, const char *long_name, const char *short_name, const UNICODE_STRING *mask ) { - FILE_BOTH_DIR_INFORMATION *info; + union file_directory_info *info; int i, long_len, short_len, total_len; struct stat st; WCHAR long_nameW[MAX_DIR_ENTRY_LEN]; @@ -984,24 +990,25 @@ static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, IO_STATUS_BLOCK if (!show_dot_files && long_name[0] == '.' && long_name[1] && (long_name[1] != '.' || long_name[2])) attributes |= FILE_ATTRIBUTE_HIDDEN; - total_len = (sizeof(*info) - sizeof(info->FileName) + long_len*sizeof(WCHAR) + 3) & ~3; + total_len = (FIELD_OFFSET(FILE_BOTH_DIR_INFORMATION, FileName[long_len]) + 3) & ~3; if (io->Information + total_len > max_length) { total_len = max_length - io->Information; io->u.Status = STATUS_BUFFER_OVERFLOW; } - info = (FILE_BOTH_DIR_INFORMATION *)((char *)info_ptr + io->Information); - fill_stat_info( &st, info, FileBothDirectoryInformation ); - info->NextEntryOffset = total_len; - info->FileIndex = 0; /* NTFS always has 0 here, so let's not bother with it */ - info->FileAttributes |= attributes; - info->EaSize = 0; /* FIXME */ - info->ShortNameLength = short_len * sizeof(WCHAR); - for (i = 0; i < short_len; i++) info->ShortName[i] = toupperW(short_nameW[i]); - info->FileNameLength = long_len * sizeof(WCHAR); - memcpy( info->FileName, long_nameW, - min( info->FileNameLength, total_len-sizeof(*info)+sizeof(info->FileName) )); + info = (union file_directory_info *)((char *)info_ptr + io->Information); + fill_stat_info( &st, &info->both, FileBothDirectoryInformation ); + info->both.NextEntryOffset = total_len; + info->both.FileIndex = 0; /* NTFS always has 0 here, so let's not bother with it */ + info->both.FileAttributes |= attributes; + info->both.EaSize = 0; /* FIXME */ + info->both.ShortNameLength = short_len * sizeof(WCHAR); + for (i = 0; i < short_len; i++) info->both.ShortName[i] = toupperW(short_nameW[i]); + info->both.FileNameLength = long_len * sizeof(WCHAR); + memcpy( info->both.FileName, long_nameW, + min( info->both.FileNameLength, + total_len - FIELD_OFFSET( FILE_BOTH_DIR_INFORMATION, FileName ))); io->Information += total_len; return info; @@ -1063,7 +1070,7 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG { size_t len; KERNEL_DIRENT *de; - FILE_BOTH_DIR_INFORMATION *info, *last_info = NULL; + union file_directory_info *info, *last_info = NULL; io->u.Status = STATUS_SUCCESS; @@ -1125,7 +1132,7 @@ static int read_directory_vfat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG } } - if (last_info) last_info->NextEntryOffset = 0; + if (last_info) last_info->next = 0; else io->u.Status = restart_scan ? STATUS_NO_SUCH_FILE : STATUS_NO_MORE_FILES; return 0; } @@ -1147,7 +1154,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U int res, fake_dot_dot = 1; char *data, local_buffer[8192]; KERNEL_DIRENT64 *de; - FILE_BOTH_DIR_INFORMATION *info, *last_info = NULL; + union file_directory_info *info, *last_info = NULL; if (size <= sizeof(local_buffer) || !(data = RtlAllocateHeap( GetProcessHeap(), 0, size ))) { @@ -1251,7 +1258,7 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U } } - if (last_info) last_info->NextEntryOffset = 0; + if (last_info) last_info->next = 0; else io->u.Status = restart_scan ? STATUS_NO_SUCH_FILE : STATUS_NO_MORE_FILES; res = 0; done: @@ -1320,7 +1327,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff int res, fake_dot_dot = 1; char *data, local_buffer[8192]; struct dirent *de; - FILE_BOTH_DIR_INFORMATION *info, *last_info = NULL, *restart_last_info = NULL; + union file_directory_info *info, *last_info = NULL, *restart_last_info = NULL; size = initial_size; data = local_buffer; @@ -1439,7 +1446,7 @@ static int read_directory_getdirentries( int fd, IO_STATUS_BLOCK *io, void *buff de = (struct dirent *)data; } - if (last_info) last_info->NextEntryOffset = 0; + if (last_info) last_info->next = 0; else io->u.Status = restart_scan ? STATUS_NO_SUCH_FILE : STATUS_NO_MORE_FILES; res = 0; done: @@ -1467,7 +1474,7 @@ static void read_directory_readdir( int fd, IO_STATUS_BLOCK *io, void *buffer, U DIR *dir; off_t i, old_pos = 0; struct dirent *de; - FILE_BOTH_DIR_INFORMATION *info, *last_info = NULL; + union file_directory_info *info, *last_info = NULL; if (!(dir = opendir( "." ))) { @@ -1524,7 +1531,7 @@ static void read_directory_readdir( int fd, IO_STATUS_BLOCK *io, void *buffer, U lseek( fd, old_pos, SEEK_SET ); /* store dir offset as filepos for fd */ closedir( dir ); - if (last_info) last_info->NextEntryOffset = 0; + if (last_info) last_info->next = 0; else io->u.Status = restart_scan ? STATUS_NO_SUCH_FILE : STATUS_NO_MORE_FILES; } @@ -1569,10 +1576,10 @@ static int read_directory_stat( int fd, IO_STATUS_BLOCK *io, void *buffer, ULONG ret = stat( unix_name, &st ); if (!ret) { - FILE_BOTH_DIR_INFORMATION *info = append_entry( buffer, io, length, unix_name, NULL, NULL ); + union file_directory_info *info = append_entry( buffer, io, length, unix_name, NULL, NULL ); if (info) { - info->NextEntryOffset = 0; + info->next = 0; if (io->u.Status != STATUS_BUFFER_OVERFLOW) lseek( fd, 1, SEEK_CUR ); } else io->u.Status = STATUS_NO_MORE_FILES;
1
0
0
0
Alexandre Julliard : ntdll: Pass the full I/ O status block to append_entry and have it set the status code on overflow.
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: c843665c12fb7b27253aee79ffcba09ed939ea68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c843665c12fb7b27253aee79f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:37:15 2009 +0100 ntdll: Pass the full I/O status block to append_entry and have it set the status code on overflow. --- dlls/ntdll/directory.c | 75 ++++++++++++++++++++--------------------------- 1 files changed, 32 insertions(+), 43 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c843665c12fb7b27253ae…
1
0
0
0
Alexandre Julliard : ntdll: Use the common fill_stat_info function from the directory code too.
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: da1df74147698dd083d438688736f62ef0ad571c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da1df74147698dd083d438688…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:23:55 2009 +0100 ntdll: Use the common fill_stat_info function from the directory code too. --- dlls/ntdll/directory.c | 32 ++++---------------- dlls/ntdll/file.c | 74 ++++++++++++++++++++++++++++++++++++++--------- dlls/ntdll/ntdll_misc.h | 2 + 3 files changed, 68 insertions(+), 40 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index e7f1dd4..6784e68 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -933,6 +933,7 @@ static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, ULONG_PTR *pos, WCHAR long_nameW[MAX_DIR_ENTRY_LEN]; WCHAR short_nameW[12]; UNICODE_STRING str; + ULONG attributes = 0; long_len = ntdll_umbstowcs( 0, long_name, strlen(long_name), long_nameW, MAX_DIR_ENTRY_LEN ); if (long_len == -1) return NULL; @@ -973,45 +974,24 @@ static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, ULONG_PTR *pos, if (*pos + total_len > max_length) total_len = max_length - *pos; - info->FileAttributes = 0; if (lstat( long_name, &st ) == -1) return NULL; if (S_ISLNK( st.st_mode )) { if (stat( long_name, &st ) == -1) return NULL; - if (S_ISDIR( st.st_mode )) info->FileAttributes |= FILE_ATTRIBUTE_REPARSE_POINT; + if (S_ISDIR( st.st_mode )) attributes |= FILE_ATTRIBUTE_REPARSE_POINT; } if (is_ignored_file( &st )) { TRACE( "ignoring file %s\n", long_name ); return NULL; } + if (!show_dot_files && long_name[0] == '.' && long_name[1] && (long_name[1] != '.' || long_name[2])) + attributes |= FILE_ATTRIBUTE_HIDDEN; + fill_stat_info( &st, info, FileBothDirectoryInformation ); info->NextEntryOffset = total_len; info->FileIndex = 0; /* NTFS always has 0 here, so let's not bother with it */ - - RtlSecondsSince1970ToTime( st.st_mtime, &info->CreationTime ); - RtlSecondsSince1970ToTime( st.st_mtime, &info->LastWriteTime ); - RtlSecondsSince1970ToTime( st.st_atime, &info->LastAccessTime ); - RtlSecondsSince1970ToTime( st.st_ctime, &info->ChangeTime ); - - if (S_ISDIR(st.st_mode)) - { - info->EndOfFile.QuadPart = info->AllocationSize.QuadPart = 0; - info->FileAttributes |= FILE_ATTRIBUTE_DIRECTORY; - } - else - { - info->EndOfFile.QuadPart = st.st_size; - info->AllocationSize.QuadPart = (ULONGLONG)st.st_blocks * 512; - info->FileAttributes |= FILE_ATTRIBUTE_ARCHIVE; - } - - if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) - info->FileAttributes |= FILE_ATTRIBUTE_READONLY; - - if (!show_dot_files && long_name[0] == '.' && long_name[1] && (long_name[1] != '.' || long_name[2])) - info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN; - + info->FileAttributes |= attributes; info->EaSize = 0; /* FIXME */ info->ShortNameLength = short_len * sizeof(WCHAR); for (i = 0; i < short_len; i++) info->ShortName[i] = toupperW(short_nameW[i]); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 8014e15..32e5f93 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -1486,8 +1486,26 @@ NTSTATUS WINAPI NtSetVolumeInformationFile( return 0; } +static inline void get_file_times( const struct stat *st, LARGE_INTEGER *mtime, LARGE_INTEGER *ctime, + LARGE_INTEGER *atime, LARGE_INTEGER *creation ) +{ + RtlSecondsSince1970ToTime( st->st_mtime, mtime ); + RtlSecondsSince1970ToTime( st->st_ctime, ctime ); + RtlSecondsSince1970ToTime( st->st_atime, atime ); +#ifdef HAVE_STRUCT_STAT_ST_MTIM + mtime->QuadPart += st->st_mtim.tv_nsec / 100; +#endif +#ifdef HAVE_STRUCT_STAT_ST_CTIM + ctime->QuadPart += st->st_ctim.tv_nsec / 100; +#endif +#ifdef HAVE_STRUCT_STAT_ST_ATIM + atime->QuadPart += st->st_atim.tv_nsec / 100; +#endif + *creation = *mtime; +} + /* fill in the file information that depends on the stat info */ -static NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLASS class ) +NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLASS class ) { switch (class) { @@ -1495,23 +1513,12 @@ static NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATI { FILE_BASIC_INFORMATION *info = ptr; + get_file_times( st, &info->LastWriteTime, &info->ChangeTime, + &info->LastAccessTime, &info->CreationTime ); if (S_ISDIR(st->st_mode)) info->FileAttributes = FILE_ATTRIBUTE_DIRECTORY; else info->FileAttributes = FILE_ATTRIBUTE_ARCHIVE; if (!(st->st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) info->FileAttributes |= FILE_ATTRIBUTE_READONLY; - RtlSecondsSince1970ToTime( st->st_mtime, &info->LastWriteTime ); - RtlSecondsSince1970ToTime( st->st_ctime, &info->ChangeTime ); - RtlSecondsSince1970ToTime( st->st_atime, &info->LastAccessTime ); -#ifdef HAVE_STRUCT_STAT_ST_MTIM - info->LastWriteTime.QuadPart += st->st_mtim.tv_nsec / 100; -#endif -#ifdef HAVE_STRUCT_STAT_ST_CTIM - info->ChangeTime.QuadPart += st->st_ctim.tv_nsec / 100; -#endif -#ifdef HAVE_STRUCT_STAT_ST_ATIM - info->LastAccessTime.QuadPart += st->st_atim.tv_nsec / 100; -#endif - info->CreationTime = info->LastWriteTime; } break; case FileStandardInformation: @@ -1552,6 +1559,45 @@ static NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATI fill_stat_info( st, &info->InternalInformation, FileInternalInformation ); } break; + /* all directory structures start with the FileDirectoryInformation layout */ + case FileBothDirectoryInformation: + case FileFullDirectoryInformation: + case FileDirectoryInformation: + { + FILE_DIRECTORY_INFORMATION *info = ptr; + + get_file_times( st, &info->LastWriteTime, &info->ChangeTime, + &info->LastAccessTime, &info->CreationTime ); + if (S_ISDIR(st->st_mode)) + { + info->AllocationSize.QuadPart = 0; + info->EndOfFile.QuadPart = 0; + info->FileAttributes = FILE_ATTRIBUTE_DIRECTORY; + } + else + { + info->AllocationSize.QuadPart = (ULONGLONG)st->st_blocks * 512; + info->EndOfFile.QuadPart = st->st_size; + info->FileAttributes = FILE_ATTRIBUTE_ARCHIVE; + } + if (!(st->st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + info->FileAttributes |= FILE_ATTRIBUTE_READONLY; + } + break; + case FileIdFullDirectoryInformation: + { + FILE_ID_FULL_DIRECTORY_INFORMATION *info = ptr; + info->FileId.QuadPart = st->st_ino; + fill_stat_info( st, info, FileDirectoryInformation ); + } + break; + case FileIdBothDirectoryInformation: + { + FILE_ID_BOTH_DIRECTORY_INFORMATION *info = ptr; + info->FileId.QuadPart = st->st_ino; + fill_stat_info( st, info, FileDirectoryInformation ); + } + break; default: return STATUS_INVALID_INFO_CLASS; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index b3842e0..be6c770 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -138,7 +138,9 @@ extern NTSTATUS TAPE_DeviceIoControl(HANDLE hDevice, LPVOID lpOutBuffer, DWORD nOutBufferSize); /* file I/O */ +struct stat; extern NTSTATUS FILE_GetNtStatus(void); +extern NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLASS class ); extern void DIR_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ); extern BOOL DIR_is_hidden_file( const UNICODE_STRING *name ); extern NTSTATUS DIR_unmount_device( HANDLE handle );
1
0
0
0
Alexandre Julliard : ntdll: Add a common function to compute file information from the stat data.
by Alexandre Julliard
19 Nov '09
19 Nov '09
Module: wine Branch: master Commit: c3b602aa23466dc368090188d1fed6489595d69b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3b602aa23466dc368090188d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 18 17:01:15 2009 +0100 ntdll: Add a common function to compute file information from the stat data. --- dlls/ntdll/file.c | 245 ++++++++++++++++++++++++++--------------------------- 1 files changed, 120 insertions(+), 125 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c3b602aa23466dc368090…
1
0
0
0
Paul Vriens : crypt32/tests: Fix a test failure on older crypt32.
by Alexandre Julliard
18 Nov '09
18 Nov '09
Module: wine Branch: master Commit: 7f5b24ed9186d457acd7803a97d4171f332c5fb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f5b24ed9186d457acd7803a9…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Wed Nov 18 15:12:52 2009 +0100 crypt32/tests: Fix a test failure on older crypt32. --- dlls/crypt32/tests/cert.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index 4a1c449..0bc4fda 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -2709,7 +2709,9 @@ static void testIsRDNAttrsInCertificateName(void) "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError()); ret = CertIsRDNAttrsInCertificateName(X509_ASN_ENCODING, CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG, &name, &rdn); - ok(ret, "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); + ok(ret || + broken(!ret && GetLastError() == CRYPT_E_NO_MATCH), /* Older crypt32 */ + "CertIsRDNAttrsInCertificateName failed: %08x\n", GetLastError()); /* The values don't match unless they have the same RDN type */ attr[0].dwValueType = CERT_RDN_UNICODE_STRING; attr[0].Value.cbData = lstrlenW(juanW) * sizeof(WCHAR);
1
0
0
0
Roderick Colenbrander : opengl32: Sync with latest OpenGL extensions.
by Alexandre Julliard
18 Nov '09
18 Nov '09
Module: wine Branch: master Commit: 21bc1ddf932615c63dd4223fb9c53a5ffba0f41c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=21bc1ddf932615c63dd4223fb…
Author: Roderick Colenbrander <thunderbird2k(a)gmail.com> Date: Wed Nov 18 12:58:41 2009 +0100 opengl32: Sync with latest OpenGL extensions. --- dlls/opengl32/make_opengl | 3 + dlls/opengl32/opengl_ext.c | 438 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 441 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=21bc1ddf932615c63dd42…
1
0
0
0
Austin Lund : advapi32/tests: Skip tests for ACL file info if ACL info not stored.
by Alexandre Julliard
18 Nov '09
18 Nov '09
Module: wine Branch: master Commit: 5c45c35e4e21b577a22de5ae2ae4c4f1c25d25ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c45c35e4e21b577a22de5ae2…
Author: Austin Lund <austin.lund(a)gmail.com> Date: Wed Nov 18 20:52:59 2009 +1000 advapi32/tests: Skip tests for ACL file info if ACL info not stored. --- dlls/advapi32/tests/security.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index a327c53..470164a 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3156,8 +3156,10 @@ static void test_GetSecurityInfo(void) ok(sd != NULL, "GetSecurityInfo\n"); ok(owner != NULL, "GetSecurityInfo\n"); ok(group != NULL, "GetSecurityInfo\n"); - ok(dacl != NULL, "GetSecurityInfo\n"); - ok(IsValidAcl(dacl), "GetSecurityInfo\n"); + if (dacl != NULL) + ok(IsValidAcl(dacl), "GetSecurityInfo\n"); + else + win_skip("No ACL information returned\n"); LocalFree(sd); @@ -3176,8 +3178,10 @@ static void test_GetSecurityInfo(void) ok(ret == ERROR_SUCCESS, "GetSecurityInfo returned %d\n", ret); ok(owner != NULL, "GetSecurityInfo\n"); ok(group != NULL, "GetSecurityInfo\n"); - ok(dacl != NULL, "GetSecurityInfo\n"); - ok(IsValidAcl(dacl), "GetSecurityInfo\n"); + if (dacl != NULL) + ok(IsValidAcl(dacl), "GetSecurityInfo\n"); + else + win_skip("No ACL information returned\n"); CloseHandle(obj); }
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
91
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Results per page:
10
25
50
100
200