mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-30 02:50:25 +08:00
* path.cc (symlink_info::check): Avoid special handling for
STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile. * strace.cc (strace::vprntf): Use bigger buffer.
This commit is contained in:
parent
08c76b4b9c
commit
43657e6bd3
@ -1,3 +1,9 @@
|
||||
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* path.cc (symlink_info::check): Avoid special handling for
|
||||
STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile.
|
||||
* strace.cc (strace::vprntf): Use bigger buffer.
|
||||
|
||||
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* kernel32.cc (CreateFileMappingW): Remove stray small_printf.
|
||||
|
@ -2310,7 +2310,10 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||
UNICODE_STRING dirname, basename;
|
||||
OBJECT_ATTRIBUTES dattr;
|
||||
HANDLE dir;
|
||||
FILE_DIRECTORY_INFORMATION fdi;
|
||||
struct {
|
||||
FILE_DIRECTORY_INFORMATION fdi;
|
||||
WCHAR dummy_buf[NAME_MAX + 1];
|
||||
} fdi_buf;
|
||||
|
||||
RtlSplitUnicodePath (&upath, &dirname, &basename);
|
||||
InitializeObjectAttributes (&dattr, &dirname,
|
||||
@ -2328,27 +2331,18 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
|
||||
else
|
||||
{
|
||||
status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
|
||||
&fdi, sizeof fdi,
|
||||
&fdi_buf, sizeof fdi_buf,
|
||||
FileDirectoryInformation,
|
||||
TRUE, &basename, TRUE);
|
||||
NtClose (dir);
|
||||
/* Per MSDN, ZwQueryDirectoryFile allows to specify a buffer
|
||||
which only fits the static parts of the structure (without
|
||||
filename that is) in the first call. The buffer actually
|
||||
contains valid data, even though ZwQueryDirectoryFile
|
||||
returned STATUS_BUFFER_OVERFLOW.
|
||||
|
||||
Please note that this doesn't work for the info class
|
||||
FileIdBothDirectoryInformation, unfortunately, so we don't
|
||||
use this technique in fhandler_base::fstat_by_name, */
|
||||
if (!NT_SUCCESS (status) && status != STATUS_BUFFER_OVERFLOW)
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
debug_printf ("%p = NtQueryDirectoryFile(%S)",
|
||||
status, &dirname);
|
||||
fileattr = 0;
|
||||
}
|
||||
else
|
||||
fileattr = fdi.FileAttributes;
|
||||
fileattr = fdi_buf.fdi.FileAttributes;
|
||||
}
|
||||
ext_tacked_on = !!*ext_here;
|
||||
goto file_not_symlink;
|
||||
|
@ -234,7 +234,7 @@ strace::vprntf (unsigned category, const char *func, const char *fmt, va_list ap
|
||||
{
|
||||
DWORD err = GetLastError ();
|
||||
int len;
|
||||
char buf[10000];
|
||||
char buf[NT_MAX_PATH];
|
||||
|
||||
PROTECT (buf);
|
||||
SetLastError (err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user