Rebase against 2d6b0b67d91b6433744ec859b10b8ee8eb4a37b3.

This commit is contained in:
Zebediah Figura
2021-02-10 19:09:42 -06:00
parent 6347bdd1fc
commit 41e15516bd
36 changed files with 318 additions and 1419 deletions

View File

@@ -1,12 +1,12 @@
From 92aeb076183fd7311b5fa05b33af0304d897361d Mon Sep 17 00:00:00 2001
From fb7e1b2b7cb08e5fd1f9be9064e7862588896f4b Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 15:28:00 -0600
Subject: [PATCH] ntdll: Implement storing DOS attributes in NtCreateFile.
---
dlls/ntdll/tests/directory.c | 24 ++++++++---------
dlls/ntdll/unix/file.c | 51 ++++++++++++++++++++++++++++++++----
2 files changed, 57 insertions(+), 18 deletions(-)
dlls/ntdll/tests/directory.c | 24 +++++++--------
dlls/ntdll/unix/file.c | 59 ++++++++++++++++++++++++++++++------
2 files changed, 61 insertions(+), 22 deletions(-)
diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c
index d21a2e64f8e..dc4f09729ac 100644
@@ -58,10 +58,10 @@ index d21a2e64f8e..dc4f09729ac 100644
}
testfiles[i].nfound++;
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 0a326a7a1bd..a72d95f8378 100644
index ee6382611a9..a92c40ddd6a 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -406,6 +406,26 @@ static int xattr_get( const char *path, const char *name, void *value, size_t si
@@ -409,6 +409,26 @@ static int xattr_get( const char *path, const char *name, void *value, size_t si
#endif
}
@@ -88,7 +88,7 @@ index 0a326a7a1bd..a72d95f8378 100644
/* get space from the current directory data buffer, allocating a new one if necessary */
static void *get_dir_data_space( struct dir_data *data, unsigned int size )
{
@@ -3582,6 +3602,20 @@ void CDECL set_show_dot_files( BOOL enable )
@@ -3620,6 +3640,20 @@ void CDECL set_show_dot_files( BOOL enable )
show_dot_files = enable;
}
@@ -109,27 +109,42 @@ index 0a326a7a1bd..a72d95f8378 100644
/******************************************************************************
* open_unix_file
@@ -3669,13 +3703,14 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
@@ -3662,6 +3696,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
ULONG attributes, ULONG sharing, ULONG disposition,
ULONG options, void *ea_buffer, ULONG ea_length )
{
+ OBJECT_ATTRIBUTES nt_attr;
UNICODE_STRING nt_name = { 0 };
char *unix_name;
BOOL created = FALSE;
@@ -3705,17 +3740,17 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
io->u.Status = STATUS_SUCCESS;
}
- if (io->u.Status == STATUS_SUCCESS)
+ if (io->u.Status != STATUS_SUCCESS)
{
- io->u.Status = open_unix_file( handle, unix_name, access, attr, attributes,
- OBJECT_ATTRIBUTES nt_attr = *attr;
-
- if (nt_name.Buffer) nt_attr.ObjectName = &nt_name;
- io->u.Status = open_unix_file( handle, unix_name, access, &nt_attr, attributes,
- sharing, disposition, options, ea_buffer, ea_length );
- free( nt_name.Buffer );
- free( unix_name );
+ WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+ return io->u.Status;
}
- else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+
+ io->u.Status = open_unix_file( handle, unix_name, access, attr, attributes,
+ nt_attr = *attr;
+ if (nt_name.Buffer) nt_attr.ObjectName = &nt_name;
+ io->u.Status = open_unix_file( handle, unix_name, access, &nt_attr, attributes,
+ sharing, disposition, options, ea_buffer, ea_length );
+ free( nt_name.Buffer );
if (io->u.Status == STATUS_SUCCESS)
{
@@ -3697,6 +3732,11 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
@@ -3737,6 +3772,11 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
io->Information = FILE_OVERWRITTEN;
break;
}
@@ -141,7 +156,7 @@ index 0a326a7a1bd..a72d95f8378 100644
}
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
{
@@ -3704,6 +3744,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
@@ -3744,6 +3784,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
}
@@ -150,5 +165,5 @@ index 0a326a7a1bd..a72d95f8378 100644
}
--
2.28.0
2.20.1