ntdll-Syscall_Wrappers: Run directory initialization early during process startup instead of wrapping syscalls.

This commit is contained in:
Sebastian Lackner
2015-10-17 12:49:06 +02:00
parent 6971149e11
commit 091bcbce3c
5 changed files with 141 additions and 98 deletions

View File

@@ -1,4 +1,4 @@
From c2f89b20617d6d3e89c518c7ccb10f493d75efa4 Mon Sep 17 00:00:00 2001
From 1b29dfe82eab39b3fc91bfadb82c2822abcef859 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 11:26:48 -0600
Subject: ntdll: Perform the Unix-style hidden file check within the unified
@@ -11,10 +11,10 @@ Subject: ntdll: Perform the Unix-style hidden file check within the unified
3 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 9b10385..a85c5e1 100644
index 94b6d77..9bb0e13 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -1199,17 +1199,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
@@ -1214,15 +1214,15 @@ void DIR_init_options(void)
*
* Check if the specified file should be hidden based on its name and the show dot files option.
*/
@@ -24,8 +24,6 @@ index 9b10385..a85c5e1 100644
- WCHAR *p, *end;
+ char *p, *end;
RtlRunOnceExecuteOnce( &init_once, init_options, NULL, NULL );
if (show_dot_files) return FALSE;
- end = p = name->Buffer + name->Length/sizeof(WCHAR);
@@ -37,7 +35,7 @@ index 9b10385..a85c5e1 100644
if (p == end || *p != '.') return FALSE;
/* make sure it isn't '.' or '..' */
if (p + 1 == end) return FALSE;
@@ -1424,9 +1424,6 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK
@@ -1437,9 +1437,6 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK
TRACE( "ignoring file %s\n", long_name );
return NULL;
}
@@ -48,10 +46,10 @@ index 9b10385..a85c5e1 100644
if (io->Information + total_len > max_length)
{
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index b4187d4..45caa2e 100644
index 0b4754e..cfd967e 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -199,6 +199,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -213,6 +213,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
}
*attr |= get_file_attributes( st );
@@ -62,7 +60,7 @@ index b4187d4..45caa2e 100644
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
if (len == -1) return ret;
*attr |= get_file_xattr( hexattr, len );
@@ -2567,8 +2571,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
@@ -2997,8 +3001,6 @@ NTSTATUS WINAPI SYSCALL(NtQueryFullAttributesFile)( const OBJECT_ATTRIBUTES *att
info->AllocationSize = std.AllocationSize;
info->EndOfFile = std.EndOfFile;
info->FileAttributes = basic.FileAttributes;
@@ -71,7 +69,7 @@ index b4187d4..45caa2e 100644
}
RtlFreeAnsiString( &unix_name );
}
@@ -2596,11 +2598,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
@@ -3027,11 +3029,7 @@ NTSTATUS WINAPI SYSCALL(NtQueryAttributesFile)( const OBJECT_ATTRIBUTES *attr, F
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
status = STATUS_INVALID_INFO_CLASS;
else
@@ -84,12 +82,12 @@ index b4187d4..45caa2e 100644
}
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index b7ea6dc..1ab120c 100644
index 5ba1308..e46ba22 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -153,7 +153,7 @@ extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
FILE_INFORMATION_CLASS class ) DECLSPEC_HIDDEN;
@@ -155,7 +155,7 @@ extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
extern NTSTATUS server_get_unix_name( HANDLE handle, ANSI_STRING *unix_name ) DECLSPEC_HIDDEN;
extern void DIR_init_options(void) DECLSPEC_HIDDEN;
extern void DIR_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ) DECLSPEC_HIDDEN;
-extern BOOL DIR_is_hidden_file( const UNICODE_STRING *name ) DECLSPEC_HIDDEN;
+extern BOOL DIR_is_hidden_file( const char *name ) DECLSPEC_HIDDEN;
@@ -97,5 +95,5 @@ index b7ea6dc..1ab120c 100644
extern NTSTATUS DIR_get_unix_cwd( char **cwd ) DECLSPEC_HIDDEN;
extern unsigned int DIR_get_drives_info( struct drive_info info[MAX_DOS_DRIVES] ) DECLSPEC_HIDDEN;
--
1.9.1
2.6.1

View File

@@ -1,2 +1,3 @@
Fixes: [9158] Support for DOS hidden/system file attributes
Depends: ntdll-Syscall_Wrappers
Category: stable