mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 262e4ab9e0eeb126dde5cb4cba13fbf7f1d1cef0.
This commit is contained in:
parent
553c1cff5a
commit
f6954e6e77
@ -1,4 +1,4 @@
|
||||
From 67cacb66b16c354aa30f4c94bba9da44f7e45619 Mon Sep 17 00:00:00 2001
|
||||
From 3473ccddec5c67bbfe1d477ce36f537493fae54b Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 21:02:11 -0700
|
||||
Subject: [PATCH] kernel32,ntdll: Add support for deleting junction points with
|
||||
@ -6,55 +6,14 @@ Subject: [PATCH] kernel32,ntdll: Add support for deleting junction points with
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernel32/path.c | 19 +++++++++++++------
|
||||
dlls/ntdll/tests/file.c | 34 +++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 46 insertions(+), 7 deletions(-)
|
||||
1 file changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index db2c1fb0240..6b7912359cf 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -233,6 +233,7 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU
|
||||
*/
|
||||
BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
{
|
||||
+ FILE_BASIC_INFORMATION info;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
UNICODE_STRING nt_name;
|
||||
ANSI_STRING unix_name;
|
||||
@@ -264,15 +265,21 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
}
|
||||
|
||||
status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN );
|
||||
- RtlFreeUnicodeString( &nt_name );
|
||||
- if (!set_ntstatus( status ))
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
{
|
||||
- NtClose( handle );
|
||||
- return FALSE;
|
||||
+ status = NtQueryAttributesFile( &attr, &info );
|
||||
+ if (status == STATUS_SUCCESS && (info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
|
||||
+ (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
+ ret = (unlink( unix_name.Buffer ) != -1);
|
||||
+ else
|
||||
+ ret = (rmdir( unix_name.Buffer ) != -1);
|
||||
+ if (!ret) FILE_SetDosError();
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
+ else
|
||||
+ set_ntstatus( status );
|
||||
+ RtlFreeUnicodeString( &nt_name );
|
||||
|
||||
- if (!(ret = (rmdir( unix_name.Buffer ) != -1))) FILE_SetDosError();
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
NtClose( handle );
|
||||
return ret;
|
||||
}
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index c7107500939..5b71f6f658b 100644
|
||||
index 6b3071f4095..1d5e0ce95b0 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -5009,7 +5009,7 @@ static void test_reparse_points(void)
|
||||
@@ -5010,7 +5010,7 @@ static void test_reparse_points(void)
|
||||
REPARSE_GUID_DATA_BUFFER guid_buffer;
|
||||
static const WCHAR dotW[] = {'.',0};
|
||||
REPARSE_DATA_BUFFER *buffer = NULL;
|
||||
@ -63,7 +22,7 @@ index c7107500939..5b71f6f658b 100644
|
||||
INT buffer_len, string_len;
|
||||
IO_STATUS_BLOCK iosb;
|
||||
UNICODE_STRING nameW;
|
||||
@@ -5098,6 +5098,38 @@ static void test_reparse_points(void)
|
||||
@@ -5099,6 +5099,38 @@ static void test_reparse_points(void)
|
||||
"Junction point folder's access time does not match.\n");
|
||||
CloseHandle(handle);
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 95288f8fe17bf7c8f772c863fe49a85c117a71eb Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Sat, 30 Mar 2019 12:01:50 -0600
|
||||
Subject: kernel32: Set error code when attempting to delete file symlinks as
|
||||
directories.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/kernel32/path.c | 5 ++++-
|
||||
dlls/ntdll/tests/file.c | 6 +++---
|
||||
2 files changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index 5ef66b5913..227473f71a 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -1738,7 +1738,10 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
ret = (unlink( unix_name.Buffer ) != -1);
|
||||
else
|
||||
ret = (rmdir( unix_name.Buffer ) != -1);
|
||||
- if (!ret) FILE_SetDosError();
|
||||
+ if (status == STATUS_SUCCESS && (info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
|
||||
+ !(info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
+ SetLastError( ERROR_DIRECTORY );
|
||||
+ else if (!ret) FILE_SetDosError();
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
else
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index fbd824fd10..0041a41b6d 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -5067,9 +5067,9 @@ static void test_reparse_points(void)
|
||||
bret = RemoveDirectoryW(reparse_path);
|
||||
ok(!bret, "Succeeded in deleting file symlink as a directory!\n");
|
||||
err = GetLastError();
|
||||
- todo_wine ok(err == ERROR_DIRECTORY,
|
||||
- "Expected last error 0x%x for RemoveDirectory on file symlink (actually 0x%x)!\n",
|
||||
- ERROR_DIRECTORY, err);
|
||||
+ ok(err == ERROR_DIRECTORY,
|
||||
+ "Expected last error 0x%x for RemoveDirectory on file symlink (actually 0x%x)!\n",
|
||||
+ ERROR_DIRECTORY, err);
|
||||
dwret = GetFileAttributesW(reparse_path);
|
||||
ok(dwret != (DWORD)~0, "Symlink doesn't exist (attributes: 0x%x)!\n", dwret);
|
||||
ok(dwret & FILE_ATTRIBUTE_REPARSE_POINT, "File is not a symlink! (attributes: 0x%x)\n", dwret);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -2,4 +2,5 @@ Fixes: [12401] NET Framework 2.0, 3.0, 4.0 installers and other apps that make u
|
||||
Fixes: [44948] Multiple apps (Spine (Mod starter for Gothic), MS Office 365 installer) need CreateSymbolicLinkW implementation
|
||||
# FIXME: patch 0006 was broken by e36a9c459d. We really want to get that information from ntdll instead, but the how is not trivial...
|
||||
# FIXME 2: patch 0019 needs to call RemoveDirectoryW() from kernelbase, but it's stuck in kernel32 for now...
|
||||
# FIXME 3: RemoveDirectory() doesn't work anymore, I think.
|
||||
Depends: ntdll-DOS_Attributes
|
||||
|
@ -1,4 +1,3 @@
|
||||
Fixes: [48291] Detroit: Become Human crashes on launch
|
||||
Depends: winebuild-Fake_Dlls
|
||||
# Re-enable me when winebuild-Fake_Dlls gets re-enabled!
|
||||
# Needs to be reimplemented on top of upstream syscall changes.
|
||||
Disabled: true
|
||||
|
@ -1,92 +0,0 @@
|
||||
From 11ce8824189ece2741a98c932b22ac7ccf2f4388 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 9 Mar 2017 00:00:46 +0100
|
||||
Subject: [PATCH] ntdll: Set correct thread creation time for
|
||||
SystemProcessInformation in NtQuerySystemInformation.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/system.c | 4 +++-
|
||||
server/protocol.def | 1 +
|
||||
server/snapshot.c | 13 +++++++------
|
||||
server/thread.h | 1 +
|
||||
4 files changed, 12 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
|
||||
index 7045bc1550b..3d37578b34a 100644
|
||||
--- a/dlls/ntdll/unix/system.c
|
||||
+++ b/dlls/ntdll/unix/system.c
|
||||
@@ -2162,6 +2162,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
while (ret == STATUS_SUCCESS)
|
||||
{
|
||||
int unix_tid, pid, tid, base_pri, delta_pri;
|
||||
+ timeout_t creation_time;
|
||||
SERVER_START_REQ( next_thread )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
@@ -2173,6 +2174,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
tid = reply->tid;
|
||||
base_pri = reply->base_pri;
|
||||
delta_pri = reply->delta_pri;
|
||||
+ creation_time = reply->creation_time;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
@@ -2184,7 +2186,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
{
|
||||
memset(&spi->ti[i], 0, sizeof(spi->ti));
|
||||
|
||||
- spi->ti[i].CreateTime.QuadPart = 0xdeadbeef;
|
||||
+ spi->ti[i].CreateTime.QuadPart = creation_time;
|
||||
spi->ti[i].ClientId.UniqueProcess = UlongToHandle(pid);
|
||||
spi->ti[i].ClientId.UniqueThread = UlongToHandle(tid);
|
||||
spi->ti[i].dwCurrentPriority = base_pri + delta_pri;
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 38079f23daf..89a0332691c 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -1911,6 +1911,7 @@ enum char_info_mode
|
||||
int count; /* thread usage count */
|
||||
process_id_t pid; /* process id */
|
||||
thread_id_t tid; /* thread id */
|
||||
+ timeout_t creation_time; /* thread creation time */
|
||||
int base_pri; /* base priority */
|
||||
int delta_pri; /* delta priority */
|
||||
int unix_tid; /* thread native pid */
|
||||
diff --git a/server/snapshot.c b/server/snapshot.c
|
||||
index bdceaef5302..fe25e07e02a 100644
|
||||
--- a/server/snapshot.c
|
||||
+++ b/server/snapshot.c
|
||||
@@ -145,12 +145,13 @@ static int snapshot_next_thread( struct snapshot *snapshot, struct next_thread_r
|
||||
return 0;
|
||||
}
|
||||
ptr = &snapshot->threads[snapshot->thread_pos++];
|
||||
- reply->count = ptr->count;
|
||||
- reply->pid = get_process_id( ptr->thread->process );
|
||||
- reply->tid = get_thread_id( ptr->thread );
|
||||
- reply->base_pri = ptr->priority;
|
||||
- reply->delta_pri = 0; /* FIXME */
|
||||
- reply->unix_tid = ptr->thread->unix_tid;
|
||||
+ reply->count = ptr->count;
|
||||
+ reply->pid = get_process_id( ptr->thread->process );
|
||||
+ reply->tid = get_thread_id( ptr->thread );
|
||||
+ reply->creation_time = get_thread_creation_time( ptr->thread );
|
||||
+ reply->base_pri = ptr->priority;
|
||||
+ reply->delta_pri = 0; /* FIXME */
|
||||
+ reply->unix_tid = ptr->thread->unix_tid;
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff --git a/server/thread.h b/server/thread.h
|
||||
index 5d12d24dd89..43b17534693 100644
|
||||
--- a/server/thread.h
|
||||
+++ b/server/thread.h
|
||||
@@ -150,5 +150,6 @@ static inline void clear_error(void) { set_error(0); }
|
||||
static inline void set_win32_error( unsigned int err ) { set_error( 0xc0010000 | err ); }
|
||||
|
||||
static inline thread_id_t get_thread_id( struct thread *thread ) { return thread->id; }
|
||||
+static inline timeout_t get_thread_creation_time( struct thread *thread ) { return thread->creation_time; }
|
||||
|
||||
#endif /* __WINE_SERVER_THREAD_H */
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1,64 +0,0 @@
|
||||
From 72c4b3f95ad4c8a8ed31ad61c3678cf7d534fba9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 9 Mar 2017 16:32:59 +0100
|
||||
Subject: [PATCH] ntdll: Set process start time.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/system.c | 1 +
|
||||
server/protocol.def | 1 +
|
||||
server/snapshot.c | 15 ++++++++-------
|
||||
3 files changed, 10 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
|
||||
index f137ccf97a7..94915bd9e47 100644
|
||||
--- a/dlls/ntdll/unix/system.c
|
||||
+++ b/dlls/ntdll/unix/system.c
|
||||
@@ -2137,6 +2137,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
spi->UniqueProcessId = UlongToHandle(reply->pid);
|
||||
spi->ParentProcessId = UlongToHandle(reply->ppid);
|
||||
spi->HandleCount = reply->handles;
|
||||
+ spi->CreationTime.QuadPart = reply->start_time;
|
||||
|
||||
/* spi->ti will be set later on */
|
||||
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 89a0332691c..b29e014958e 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -1899,6 +1899,7 @@ enum char_info_mode
|
||||
int priority; /* process priority */
|
||||
int handles; /* number of handles */
|
||||
int unix_pid; /* Unix pid */
|
||||
+ timeout_t start_time; /* start time */
|
||||
VARARG(filename,unicode_str); /* file name of main exe */
|
||||
@END
|
||||
|
||||
diff --git a/server/snapshot.c b/server/snapshot.c
|
||||
index fe25e07e02a..b6b790e21bd 100644
|
||||
--- a/server/snapshot.c
|
||||
+++ b/server/snapshot.c
|
||||
@@ -114,13 +114,14 @@ static int snapshot_next_process( struct snapshot *snapshot, struct next_process
|
||||
return 0;
|
||||
}
|
||||
ptr = &snapshot->processes[snapshot->process_pos++];
|
||||
- reply->count = ptr->count;
|
||||
- reply->pid = get_process_id( ptr->process );
|
||||
- reply->ppid = ptr->process->parent_id;
|
||||
- reply->threads = ptr->threads;
|
||||
- reply->priority = ptr->priority;
|
||||
- reply->handles = ptr->handles;
|
||||
- reply->unix_pid = ptr->process->unix_pid;
|
||||
+ reply->count = ptr->count;
|
||||
+ reply->pid = get_process_id( ptr->process );
|
||||
+ reply->ppid = ptr->process->parent_id;
|
||||
+ reply->threads = ptr->threads;
|
||||
+ reply->priority = ptr->priority;
|
||||
+ reply->handles = ptr->handles;
|
||||
+ reply->unix_pid = ptr->process->unix_pid;
|
||||
+ reply->start_time = ptr->process->start_time;
|
||||
if ((exe_module = get_process_exe_module( ptr->process )) && exe_module->filename)
|
||||
{
|
||||
data_size_t len = min( exe_module->namelen, get_reply_max_size() );
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1,4 +1,3 @@
|
||||
Fixes: Use a separate stack when starting new threads
|
||||
Fixes: Ignore invalid exit_frame when exiting thread
|
||||
Depends: ntdll-ThreadTime
|
||||
Disabled: true
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "e0e3b6bc91f7db956e3a66f2938eea45d4055a39"
|
||||
echo "262e4ab9e0eeb126dde5cb4cba13fbf7f1d1cef0"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -3669,8 +3669,9 @@ fi
|
||||
# | * [#44948] Multiple apps (Spine (Mod starter for Gothic), MS Office 365 installer) need CreateSymbolicLinkW implementation
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, dlls/kernel32/path.c, dlls/ntdll/tests/file.c, dlls/ntdll/unix/file.c, include/Makefile.in,
|
||||
# | include/ntifs.h, include/wine/port.h, include/winternl.h, libs/port/Makefile.in, libs/port/renameat2.c, server/fd.c
|
||||
# | * configure.ac, dlls/kernel32/path.c, dlls/kernel32/tests/path.c, dlls/kernelbase/file.c, dlls/msvcp120/tests/msvcp120.c,
|
||||
# | dlls/msvcp140/tests/msvcp140.c, dlls/ntdll/tests/file.c, dlls/ntdll/unix/file.c, include/Makefile.in, include/ntifs.h,
|
||||
# | include/wine/port.h, include/winternl.h, libs/port/Makefile.in, libs/port/renameat2.c, server/fd.c
|
||||
# |
|
||||
if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
patch_apply ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch
|
||||
@ -3686,10 +3687,10 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
patch_apply ntdll-Junction_Points/0012-ntdll-Add-support-for-file-symlinks.patch
|
||||
patch_apply ntdll-Junction_Points/0013-ntdll-Allow-creation-of-dangling-reparse-points-to-n.patch
|
||||
patch_apply ntdll-Junction_Points/0014-ntdll-Correctly-report-file-symbolic-links-as-files.patch
|
||||
patch_apply ntdll-Junction_Points/0015-kernel32-Set-error-code-when-attempting-to-delete-fi.patch
|
||||
patch_apply ntdll-Junction_Points/0016-server-Properly-handle-file-symlink-deletion.patch
|
||||
patch_apply ntdll-Junction_Points/0017-ntdll-Always-report-symbolic-links-as-containing-zer.patch
|
||||
patch_apply ntdll-Junction_Points/0018-ntdll-Find-dangling-symlinks-quickly.patch
|
||||
patch_apply ntdll-Junction_Points/0019-kernel32-Implement-CreateSymbolicLink-A-W-with-ntdll.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Add support for junction point creation.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Add support for reading junction points.", 1 },';
|
||||
@ -3704,10 +3705,10 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Add support for file symlinks.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Allow creation of dangling reparse points to non-existent paths.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Correctly report file symbolic links as files.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "kernel32: Set error code when attempting to delete file symlinks as directories.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "server: Properly handle file symlink deletion.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Always report symbolic links as containing zero bytes.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "ntdll: Find dangling symlinks quickly.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "kernel32: Implement CreateSymbolicLink[A|W] with ntdll reparse points.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
@ -4470,7 +4471,7 @@ fi
|
||||
# | * [#45374] Yet Another Process Monitor (.NET 2.0 app) reports System.AccessViolationException
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/om.c, dlls/ntdll/tests/info.c, dlls/ntdll/tests/om.c, dlls/ntdll/unix/system.c, include/winternl.h,
|
||||
# | * dlls/ntdll/tests/info.c, dlls/ntdll/tests/om.c, dlls/ntdll/unix/file.c, dlls/ntdll/unix/system.c, include/winternl.h,
|
||||
# | server/completion.c, server/directory.c, server/event.c, server/file.c, server/handle.c, server/mailslot.c,
|
||||
# | server/main.c, server/mapping.c, server/mutex.c, server/named_pipe.c, server/object.c, server/object.h,
|
||||
# | server/process.c, server/protocol.def, server/registry.c, server/semaphore.c, server/symlink.c, server/thread.c,
|
||||
|
@ -1,90 +1,21 @@
|
||||
From df0394fbe1b04909081ab265eb8ec7f20ff4e8b6 Mon Sep 17 00:00:00 2001
|
||||
From 6c4383e0d465d9cf79e772687111ac7b5d250b75 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 8 Mar 2017 02:12:37 +0100
|
||||
Subject: ntdll: Implement ObjectTypesInformation in NtQueryObject.
|
||||
Subject: [PATCH] ntdll: Implement ObjectTypesInformation in NtQueryObject.
|
||||
|
||||
---
|
||||
dlls/ntdll/om.c | 51 ++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/tests/om.c | 57 +++++++++++++++++++++++++++++++++++++++++++
|
||||
include/winternl.h | 30 +++++++++++++++++++++--
|
||||
server/directory.c | 19 ++++++++++++++-
|
||||
server/protocol.def | 9 +++++++
|
||||
5 files changed, 163 insertions(+), 3 deletions(-)
|
||||
dlls/ntdll/tests/om.c | 57 ++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/unix/file.c | 53 +++++++++++++++++++++++++++++++++++++++
|
||||
include/winternl.h | 30 ++++++++++++++++++++--
|
||||
server/directory.c | 19 +++++++++++++-
|
||||
server/protocol.def | 9 +++++++
|
||||
5 files changed, 165 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
|
||||
index 0b562513..88a4f800 100644
|
||||
--- a/dlls/ntdll/om.c
|
||||
+++ b/dlls/ntdll/om.c
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
||||
|
||||
+#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
|
||||
|
||||
/*
|
||||
* Generic object functions
|
||||
@@ -187,6 +188,56 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
break;
|
||||
+ case ObjectTypesInformation:
|
||||
+ {
|
||||
+ OBJECT_TYPES_INFORMATION *p = ptr;
|
||||
+ OBJECT_TYPE_INFORMATION *type = (OBJECT_TYPE_INFORMATION *)(p + 1);
|
||||
+ ULONG count, type_len, req_len = sizeof(OBJECT_TYPES_INFORMATION);
|
||||
+
|
||||
+ for (count = 0, status = STATUS_SUCCESS; !status; count++)
|
||||
+ {
|
||||
+ SERVER_START_REQ( get_object_type_by_index )
|
||||
+ {
|
||||
+ req->index = count;
|
||||
+ if (len > sizeof(*type))
|
||||
+ wine_server_set_reply( req, type + 1, len - sizeof(*type) );
|
||||
+ status = wine_server_call( req );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ type_len = sizeof(*type);
|
||||
+ if (reply->total)
|
||||
+ type_len += ROUND_UP( reply->total + sizeof(WCHAR), sizeof(DWORD_PTR) );
|
||||
+ req_len += type_len;
|
||||
+ }
|
||||
+ if (status == STATUS_SUCCESS && len >= req_len)
|
||||
+ {
|
||||
+ ULONG res = wine_server_reply_size( reply );
|
||||
+ memset( type, 0, sizeof(*type) );
|
||||
+ if (reply->total)
|
||||
+ {
|
||||
+ type->TypeName.Buffer = (WCHAR *)(type + 1);
|
||||
+ type->TypeName.Length = res;
|
||||
+ type->TypeName.MaximumLength = res + sizeof(WCHAR);
|
||||
+ type->TypeName.Buffer[res / sizeof(WCHAR)] = 0;
|
||||
+ }
|
||||
+ type->TypeIndex = count;
|
||||
+ type = (OBJECT_TYPE_INFORMATION *)((char *)type + type_len);
|
||||
+ }
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ }
|
||||
+
|
||||
+ if (status != STATUS_NO_MORE_ENTRIES)
|
||||
+ return status;
|
||||
+
|
||||
+ if (used_len) *used_len = req_len;
|
||||
+ if (len < req_len)
|
||||
+ return STATUS_INFO_LENGTH_MISMATCH;
|
||||
+
|
||||
+ p->NumberOfTypes = count - 1;
|
||||
+ status = STATUS_SUCCESS;
|
||||
+ }
|
||||
+ break;
|
||||
case ObjectDataInformation:
|
||||
{
|
||||
OBJECT_DATA_INFORMATION* p = ptr;
|
||||
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
|
||||
index 3f627aad..dbe7be39 100644
|
||||
index c17b6ffa8db..6e760066915 100644
|
||||
--- a/dlls/ntdll/tests/om.c
|
||||
+++ b/dlls/ntdll/tests/om.c
|
||||
@@ -79,6 +79,21 @@ static void (WINAPI *pRtlWakeAddressSingle)( const void * );
|
||||
@@ -81,6 +81,21 @@ static void (WINAPI *pRtlWakeAddressSingle)( const void * );
|
||||
#define KEYEDEVENT_WAKE 0x0002
|
||||
#define KEYEDEVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x0003)
|
||||
|
||||
@ -106,7 +37,7 @@ index 3f627aad..dbe7be39 100644
|
||||
static void test_case_sensitive (void)
|
||||
{
|
||||
static const WCHAR buffer1[] = {'\\','B','a','s','e','N','a','m','e','d','O','b','j','e','c','t','s','\\','t','e','s','t',0};
|
||||
@@ -1579,6 +1594,47 @@ static void test_query_object(void)
|
||||
@@ -1583,6 +1598,47 @@ static void test_query_object(void)
|
||||
|
||||
}
|
||||
|
||||
@ -154,7 +85,7 @@ index 3f627aad..dbe7be39 100644
|
||||
static void test_type_mismatch(void)
|
||||
{
|
||||
HANDLE h;
|
||||
@@ -2178,6 +2234,7 @@ START_TEST(om)
|
||||
@@ -2215,6 +2271,7 @@ START_TEST(om)
|
||||
test_directory();
|
||||
test_symboliclink();
|
||||
test_query_object();
|
||||
@ -162,11 +93,82 @@ index 3f627aad..dbe7be39 100644
|
||||
test_type_mismatch();
|
||||
test_event();
|
||||
test_mutant();
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index dff246f5e74..708fe842020 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -130,6 +130,8 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(file);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
|
||||
+#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
|
||||
+
|
||||
#define MAX_DOS_DRIVES 26
|
||||
|
||||
#define FILE_WRITE_TO_END_OF_FILE ((LONGLONG)-1)
|
||||
@@ -6464,6 +6466,57 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
|
||||
break;
|
||||
}
|
||||
|
||||
+ case ObjectTypesInformation:
|
||||
+ {
|
||||
+ OBJECT_TYPES_INFORMATION *p = ptr;
|
||||
+ OBJECT_TYPE_INFORMATION *type = (OBJECT_TYPE_INFORMATION *)(p + 1);
|
||||
+ ULONG count, type_len, req_len = sizeof(OBJECT_TYPES_INFORMATION);
|
||||
+
|
||||
+ for (count = 0, status = STATUS_SUCCESS; !status; count++)
|
||||
+ {
|
||||
+ SERVER_START_REQ( get_object_type_by_index )
|
||||
+ {
|
||||
+ req->index = count;
|
||||
+ if (len > sizeof(*type))
|
||||
+ wine_server_set_reply( req, type + 1, len - sizeof(*type) );
|
||||
+ status = wine_server_call( req );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ type_len = sizeof(*type);
|
||||
+ if (reply->total)
|
||||
+ type_len += ROUND_UP( reply->total + sizeof(WCHAR), sizeof(DWORD_PTR) );
|
||||
+ req_len += type_len;
|
||||
+ }
|
||||
+ if (status == STATUS_SUCCESS && len >= req_len)
|
||||
+ {
|
||||
+ ULONG res = wine_server_reply_size( reply );
|
||||
+ memset( type, 0, sizeof(*type) );
|
||||
+ if (reply->total)
|
||||
+ {
|
||||
+ type->TypeName.Buffer = (WCHAR *)(type + 1);
|
||||
+ type->TypeName.Length = res;
|
||||
+ type->TypeName.MaximumLength = res + sizeof(WCHAR);
|
||||
+ type->TypeName.Buffer[res / sizeof(WCHAR)] = 0;
|
||||
+ }
|
||||
+ type->TypeIndex = count;
|
||||
+ type = (OBJECT_TYPE_INFORMATION *)((char *)type + type_len);
|
||||
+ }
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ }
|
||||
+
|
||||
+ if (status != STATUS_NO_MORE_ENTRIES)
|
||||
+ return status;
|
||||
+
|
||||
+ if (used_len) *used_len = req_len;
|
||||
+ if (len < req_len)
|
||||
+ return STATUS_INFO_LENGTH_MISMATCH;
|
||||
+
|
||||
+ p->NumberOfTypes = count - 1;
|
||||
+ status = STATUS_SUCCESS;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
case ObjectDataInformation:
|
||||
{
|
||||
OBJECT_DATA_INFORMATION* p = ptr;
|
||||
diff --git a/include/winternl.h b/include/winternl.h
|
||||
index 0c8a5014..0b17c2f5 100644
|
||||
index 347b79ef8e0..fbc52b7d127 100644
|
||||
--- a/include/winternl.h
|
||||
+++ b/include/winternl.h
|
||||
@@ -826,7 +826,7 @@ typedef enum _OBJECT_INFORMATION_CLASS {
|
||||
@@ -843,7 +843,7 @@ typedef enum _OBJECT_INFORMATION_CLASS {
|
||||
ObjectBasicInformation,
|
||||
ObjectNameInformation,
|
||||
ObjectTypeInformation,
|
||||
@ -175,7 +177,7 @@ index 0c8a5014..0b17c2f5 100644
|
||||
ObjectDataInformation
|
||||
} OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
|
||||
|
||||
@@ -1237,9 +1237,35 @@ typedef struct _OBJECT_NAME_INFORMATION {
|
||||
@@ -1281,9 +1281,35 @@ typedef struct _OBJECT_NAME_INFORMATION {
|
||||
|
||||
typedef struct __OBJECT_TYPE_INFORMATION {
|
||||
UNICODE_STRING TypeName;
|
||||
@ -213,10 +215,10 @@ index 0c8a5014..0b17c2f5 100644
|
||||
#ifdef __WINESRC__
|
||||
DWORD_PTR ExitStatus;
|
||||
diff --git a/server/directory.c b/server/directory.c
|
||||
index 6aa3a55f..6e22a741 100644
|
||||
index 4d38393a6c8..799102379ff 100644
|
||||
--- a/server/directory.c
|
||||
+++ b/server/directory.c
|
||||
@@ -71,6 +71,8 @@ static const struct object_ops object_type_ops =
|
||||
@@ -72,6 +72,8 @@ static const struct object_ops object_type_ops =
|
||||
no_destroy /* destroy */
|
||||
};
|
||||
|
||||
@ -235,7 +237,7 @@ index 6aa3a55f..6e22a741 100644
|
||||
make_object_static( &type->obj );
|
||||
}
|
||||
clear_error();
|
||||
@@ -529,3 +532,17 @@ DECL_HANDLER(get_object_type)
|
||||
@@ -563,3 +566,17 @@ DECL_HANDLER(get_object_type)
|
||||
}
|
||||
release_object( obj );
|
||||
}
|
||||
@ -254,10 +256,10 @@ index 6aa3a55f..6e22a741 100644
|
||||
+ else set_error( STATUS_NO_MORE_ENTRIES );
|
||||
+}
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 3ffb8940..0d866986 100644
|
||||
index bf2d8bfd167..def84b35967 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3575,6 +3575,15 @@ struct handle_info
|
||||
@@ -3533,6 +3533,15 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@ -274,5 +276,5 @@ index 3ffb8940..0d866986 100644
|
||||
@REQ(unlink_object)
|
||||
obj_handle_t handle; /* handle to the object */
|
||||
--
|
||||
2.20.1
|
||||
2.27.0
|
||||
|
||||
|
@ -1,31 +1,32 @@
|
||||
From 1e3e93483b223c6e0e9d712fff4a8874c503c973 Mon Sep 17 00:00:00 2001
|
||||
From 574a79c56964a86181cb721b5e7e4f672455027e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 8 Mar 2017 17:41:11 +0100
|
||||
Subject: ntdll: Set TypeIndex for ObjectTypeInformation in NtQueryObject.
|
||||
Subject: [PATCH] ntdll: Set TypeIndex for ObjectTypeInformation in
|
||||
NtQueryObject.
|
||||
|
||||
---
|
||||
dlls/ntdll/om.c | 4 ++++
|
||||
server/directory.c | 5 ++++-
|
||||
server/protocol.def | 1 +
|
||||
dlls/ntdll/unix/file.c | 4 ++++
|
||||
server/directory.c | 5 ++++-
|
||||
server/protocol.def | 1 +
|
||||
3 files changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
|
||||
index 8911a28b20..8f54d4f49f 100644
|
||||
--- a/dlls/ntdll/om.c
|
||||
+++ b/dlls/ntdll/om.c
|
||||
@@ -184,6 +184,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
|
||||
p->TypeName.Buffer[res / sizeof(WCHAR)] = 0;
|
||||
if (used_len) *used_len = sizeof(*p) + p->TypeName.MaximumLength;
|
||||
}
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ p->TypeIndex = reply->index;
|
||||
+ }
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 708fe842020..4544df55d16 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -6460,6 +6460,10 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
|
||||
p->TypeName.Buffer[res / sizeof(WCHAR)] = 0;
|
||||
if (used_len) *used_len = sizeof(*p) + p->TypeName.MaximumLength;
|
||||
}
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ p->TypeIndex = reply->index;
|
||||
+ }
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
diff --git a/server/directory.c b/server/directory.c
|
||||
index b4f53e2edf..59c8194d09 100644
|
||||
index 0d5a320690e..1bc97fb2682 100644
|
||||
--- a/server/directory.c
|
||||
+++ b/server/directory.c
|
||||
@@ -44,6 +44,7 @@
|
||||
@ -36,7 +37,7 @@ index b4f53e2edf..59c8194d09 100644
|
||||
};
|
||||
|
||||
static void object_type_dump( struct object *obj, int verbose );
|
||||
@@ -239,7 +240,8 @@ struct object_type *get_object_type( const struct unicode_str *name )
|
||||
@@ -237,7 +238,8 @@ struct object_type *get_object_type( const struct unicode_str *name )
|
||||
if (get_error() != STATUS_OBJECT_NAME_EXISTS)
|
||||
{
|
||||
assert( object_type_count < sizeof(object_type_list)/sizeof(object_type_list[0]) );
|
||||
@ -46,7 +47,7 @@ index b4f53e2edf..59c8194d09 100644
|
||||
make_object_static( &type->obj );
|
||||
}
|
||||
clear_error();
|
||||
@@ -528,6 +530,7 @@ DECL_HANDLER(get_object_type)
|
||||
@@ -560,6 +562,7 @@ DECL_HANDLER(get_object_type)
|
||||
{
|
||||
if ((name = get_object_name( &type->obj, &reply->total )))
|
||||
set_reply_data( name, min( reply->total, get_reply_max_size() ) );
|
||||
@ -55,10 +56,10 @@ index b4f53e2edf..59c8194d09 100644
|
||||
}
|
||||
release_object( obj );
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 98c4c58a4e..d6847f8d55 100644
|
||||
index def84b35967..3406a056688 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3543,6 +3543,7 @@ struct handle_info
|
||||
@@ -3528,6 +3528,7 @@ struct handle_info
|
||||
@REQ(get_object_type)
|
||||
obj_handle_t handle; /* handle to the object */
|
||||
@REPLY
|
||||
@ -67,5 +68,5 @@ index 98c4c58a4e..d6847f8d55 100644
|
||||
VARARG(type,unicode_str); /* type name */
|
||||
@END
|
||||
--
|
||||
2.11.0
|
||||
2.27.0
|
||||
|
||||
|
@ -1,31 +1,15 @@
|
||||
From 76c342fe6c01c59bfcf387f19046d78415227f3d Mon Sep 17 00:00:00 2001
|
||||
From a82fe5d2ad7ff0683ca7078dffb232676ea8a16f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 8 Mar 2017 19:39:29 +0100
|
||||
Subject: [PATCH] ntdll: Mimic object type behavior for different windows
|
||||
versions.
|
||||
|
||||
---
|
||||
dlls/ntdll/om.c | 5 +++-
|
||||
dlls/ntdll/tests/om.c | 65 +++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/ntdll/unix/file.c | 5 +++-
|
||||
dlls/ntdll/unix/system.c | 17 +++++++++--
|
||||
3 files changed, 82 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
|
||||
index 4fea106cc46..eea095acbf9 100644
|
||||
--- a/dlls/ntdll/om.c
|
||||
+++ b/dlls/ntdll/om.c
|
||||
@@ -182,7 +182,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
|
||||
}
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
- p->TypeIndex = reply->index;
|
||||
+ WORD version = MAKEWORD(NtCurrentTeb()->Peb->OSMinorVersion,
|
||||
+ NtCurrentTeb()->Peb->OSMajorVersion);
|
||||
+ if (version >= 0x0602)
|
||||
+ p->TypeIndex = reply->index;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
|
||||
index 398ad6bed4e..b538160f6d0 100644
|
||||
--- a/dlls/ntdll/tests/om.c
|
||||
@ -134,8 +118,24 @@ index 398ad6bed4e..b538160f6d0 100644
|
||||
|
||||
test_case_sensitive();
|
||||
test_namespace_pipe();
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 4544df55d16..8ff963585da 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -6462,7 +6462,10 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
|
||||
}
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
- p->TypeIndex = reply->index;
|
||||
+ WORD version = MAKEWORD(NtCurrentTeb()->Peb->OSMinorVersion,
|
||||
+ NtCurrentTeb()->Peb->OSMajorVersion);
|
||||
+ if (version >= 0x0602)
|
||||
+ p->TypeIndex = reply->index;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
|
||||
index 9b42c475b47..828b891be9c 100644
|
||||
index cd2f45d9f55..b56747e0273 100644
|
||||
--- a/dlls/ntdll/unix/system.c
|
||||
+++ b/dlls/ntdll/unix/system.c
|
||||
@@ -2024,6 +2024,18 @@ static void get_timezone_info( RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi )
|
||||
@ -157,7 +157,7 @@ index 9b42c475b47..828b891be9c 100644
|
||||
|
||||
/******************************************************************************
|
||||
* NtQuerySystemInformation (NTDLL.@)
|
||||
@@ -2407,7 +2419,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
@@ -2390,7 +2402,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
shi->Handle[i].OwnerPid = handle_info[i].owner;
|
||||
shi->Handle[i].HandleValue = handle_info[i].handle;
|
||||
shi->Handle[i].AccessMask = handle_info[i].access;
|
||||
@ -166,7 +166,7 @@ index 9b42c475b47..828b891be9c 100644
|
||||
/* FIXME: Fill out HandleFlags, ObjectPointer */
|
||||
}
|
||||
}
|
||||
@@ -2460,7 +2472,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
@@ -2443,7 +2455,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
shi->Handle[i].UniqueProcessId = handle_info[i].owner;
|
||||
shi->Handle[i].HandleValue = handle_info[i].handle;
|
||||
shi->Handle[i].GrantedAccess = handle_info[i].access;
|
||||
@ -175,7 +175,7 @@ index 9b42c475b47..828b891be9c 100644
|
||||
/* FIXME: Fill out remaining fields */
|
||||
}
|
||||
}
|
||||
@@ -2720,7 +2732,6 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
@@ -2663,7 +2675,6 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1,121 +0,0 @@
|
||||
From 8b88aa45856684e63786425f72886f2ac57b3630 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 25 May 2017 07:02:46 +0200
|
||||
Subject: [PATCH] kernel32/tests: Add basic tests for fake dlls.
|
||||
|
||||
---
|
||||
dlls/kernel32/tests/loader.c | 91 ++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 91 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
|
||||
index ef8c47c04f1a..efd5a25a432d 100644
|
||||
--- a/dlls/kernel32/tests/loader.c
|
||||
+++ b/dlls/kernel32/tests/loader.c
|
||||
@@ -1572,6 +1572,96 @@ static void test_filenames(void)
|
||||
DeleteFileA( long_path );
|
||||
}
|
||||
|
||||
+static void test_FakeDLL(void)
|
||||
+{
|
||||
+#ifdef __i386__
|
||||
+ NTSTATUS (WINAPI *pNtSetEvent)(HANDLE, ULONG *) = NULL;
|
||||
+ IMAGE_EXPORT_DIRECTORY *dir;
|
||||
+ HMODULE module = GetModuleHandleA("ntdll.dll");
|
||||
+ HANDLE file, map, event;
|
||||
+ WCHAR path[MAX_PATH];
|
||||
+ DWORD *names, *funcs;
|
||||
+ WORD *ordinals;
|
||||
+ ULONG size;
|
||||
+ void *ptr;
|
||||
+ int i;
|
||||
+
|
||||
+ GetModuleFileNameW(module, path, MAX_PATH);
|
||||
+
|
||||
+ file = CreateFileW(path, GENERIC_READ | GENERIC_EXECUTE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
||||
+ ok(file != INVALID_HANDLE_VALUE, "Failed to open %s (error %u)\n", wine_dbgstr_w(path), GetLastError());
|
||||
+
|
||||
+ map = CreateFileMappingW(file, NULL, PAGE_EXECUTE_READ | SEC_IMAGE, 0, 0, NULL);
|
||||
+ ok(map != NULL, "CreateFileMapping failed with error %u\n", GetLastError());
|
||||
+ ptr = MapViewOfFile(map, FILE_MAP_READ | FILE_MAP_EXECUTE, 0, 0, 0);
|
||||
+ ok(ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError());
|
||||
+
|
||||
+ dir = RtlImageDirectoryEntryToData(ptr, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size);
|
||||
+todo_wine
|
||||
+ ok(dir != NULL, "RtlImageDirectoryEntryToData failed\n");
|
||||
+ if (dir == NULL) goto done;
|
||||
+
|
||||
+ names = RVAToAddr(dir->AddressOfNames, ptr);
|
||||
+ ordinals = RVAToAddr(dir->AddressOfNameOrdinals, ptr);
|
||||
+ funcs = RVAToAddr(dir->AddressOfFunctions, ptr);
|
||||
+ ok(dir->NumberOfNames > 0, "Could not find any exported functions\n");
|
||||
+
|
||||
+ for (i = 0; i < dir->NumberOfNames; i++)
|
||||
+ {
|
||||
+ DWORD map_rva, dll_rva, map_offset, dll_offset;
|
||||
+ char *func_name = RVAToAddr(names[i], ptr);
|
||||
+ BYTE *dll_func, *map_func;
|
||||
+
|
||||
+ /* check only Nt functions for now */
|
||||
+ if (strncmp(func_name, "Zw", 2) && strncmp(func_name, "Nt", 2))
|
||||
+ continue;
|
||||
+
|
||||
+ dll_func = (BYTE *)GetProcAddress(module, func_name);
|
||||
+ ok(dll_func != NULL, "%s: GetProcAddress returned NULL\n", func_name);
|
||||
+ if (dll_func[0] == 0x90 && dll_func[1] == 0x90 &&
|
||||
+ dll_func[2] == 0x90 && dll_func[3] == 0x90)
|
||||
+ {
|
||||
+ todo_wine ok(0, "%s: Export is a stub-function, skipping\n", func_name);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /* check position in memory */
|
||||
+ dll_rva = (DWORD_PTR)dll_func - (DWORD_PTR)module;
|
||||
+ map_rva = funcs[ordinals[i]];
|
||||
+ ok(map_rva == dll_rva, "%s: Rva of mapped function (0x%x) does not match dll (0x%x)\n",
|
||||
+ func_name, dll_rva, map_rva);
|
||||
+
|
||||
+ /* check position in file */
|
||||
+ map_offset = (DWORD_PTR)RtlImageRvaToVa(RtlImageNtHeader(ptr), ptr, map_rva, NULL) - (DWORD_PTR)ptr;
|
||||
+ dll_offset = (DWORD_PTR)RtlImageRvaToVa(RtlImageNtHeader(module), module, dll_rva, NULL) - (DWORD_PTR)module;
|
||||
+ ok(map_offset == dll_offset, "%s: File offset of mapped function (0x%x) does not match dll (0x%x)\n",
|
||||
+ func_name, map_offset, dll_offset);
|
||||
+
|
||||
+ /* check function content */
|
||||
+ map_func = RVAToAddr(map_rva, ptr);
|
||||
+ ok(!memcmp(map_func, dll_func, 0x20), "%s: Function content does not match!\n", func_name);
|
||||
+
|
||||
+ if (!strcmp(func_name, "NtSetEvent"))
|
||||
+ pNtSetEvent = (void *)map_func;
|
||||
+ }
|
||||
+
|
||||
+ ok(pNtSetEvent != NULL, "Could not find NtSetEvent export\n");
|
||||
+ if (pNtSetEvent)
|
||||
+ {
|
||||
+ event = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||
+ ok(event != NULL, "CreateEvent failed with error %u\n", GetLastError());
|
||||
+ pNtSetEvent(event, 0);
|
||||
+ ok(WaitForSingleObject(event, 0) == WAIT_OBJECT_0, "Event was not signaled\n");
|
||||
+ CloseHandle(event);
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ UnmapViewOfFile(ptr);
|
||||
+ CloseHandle(map);
|
||||
+ CloseHandle(file);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
/* Verify linking style of import descriptors */
|
||||
static void test_ImportDescriptors(void)
|
||||
{
|
||||
@@ -4094,6 +4184,7 @@ START_TEST(loader)
|
||||
return;
|
||||
}
|
||||
|
||||
+ test_FakeDLL();
|
||||
test_filenames();
|
||||
test_ResolveDelayLoadedAPI();
|
||||
test_ImportDescriptors();
|
||||
--
|
||||
2.26.2
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
||||
Fixes: [21232] Chromium-based browser engines (Chrome, Opera, Comodo Dragon, SRWare Iron) crash on startup unless '--no-sandbox' is used (native API sandboxing/hooking scheme incompatible with Wine)
|
||||
Fixes: [42741] StarCraft I: 1.18 PTR fails to initialize ClientSdk.dll
|
||||
Fixes: [45349] Multiple applications and games crash due to missing support for 64-bit syscall thunks (StreetFighter V)
|
||||
Fixes: [45573] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of syscall return instructions)
|
||||
Fixes: [45650] chromium 32-bit sandbox expects different syscall thunks depending on Windows version
|
||||
Depends: ntdll-WRITECOPY
|
||||
Depends: ws2_32-WSACleanup
|
||||
Depends: ntdll-ApiSetMap
|
||||
|
||||
# As of 43be3507c04, unless I've misread, ntdll.dll no longer has the chance to
|
||||
# run code before ntdll.so performs process initialization. Unfortunately,
|
||||
# ntdll.so is still making calls to Nt* exports during that process
|
||||
# initialization, which in practice means it's calling syscall thunks. In order
|
||||
# for this series to work, we need to poke __wine_syscall_dispatcher into the
|
||||
# TEB before those calls are made. Fixing this would require a nontrivial amount
|
||||
# of effort, which will be obviated as soon as Alexandre finishes splitting
|
||||
# ntdll upstream.
|
||||
Disabled: true
|
@ -1,4 +1,4 @@
|
||||
From 3f245724b06ff75421810f5069beadc6b7610f52 Mon Sep 17 00:00:00 2001
|
||||
From da32913e84869282c7e78c09f6b15cb71c4fb255 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
|
||||
Date: Wed, 24 Jun 2020 17:31:03 -0600
|
||||
Subject: [PATCH] winevulkan: Avoid returning 0 for swapchain maxImageCount.
|
||||
@ -14,7 +14,7 @@ AMDVLK also sets this to 16 when no maxImageCount is specified.
|
||||
4 files changed, 23 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
|
||||
index a0bf6b0859e..c28abe8ebb4 100755
|
||||
index b84eb39587e..59df1dbf407 100755
|
||||
--- a/dlls/winevulkan/make_vulkan
|
||||
+++ b/dlls/winevulkan/make_vulkan
|
||||
@@ -183,7 +183,7 @@ FUNCTION_OVERRIDES = {
|
||||
@ -27,11 +27,11 @@ index a0bf6b0859e..c28abe8ebb4 100755
|
||||
"vkGetPhysicalDeviceSurfacePresentModesKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
|
||||
|
||||
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
|
||||
index eb22e72ae36..543388abe8e 100644
|
||||
index 4642975ad0f..abb9e0a9063 100644
|
||||
--- a/dlls/winevulkan/vulkan.c
|
||||
+++ b/dlls/winevulkan/vulkan.c
|
||||
@@ -1358,6 +1358,25 @@ void WINAPI wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDev
|
||||
properties->externalSemaphoreFeatures = 0;
|
||||
@@ -1409,6 +1409,25 @@ void WINAPI wine_vkGetPrivateDataEXT(VkDevice device, VkObjectType object_type,
|
||||
device->funcs.p_vkGetPrivateDataEXT(device->device, object_type, object_handle, private_data_slot, data);
|
||||
}
|
||||
|
||||
+VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice phys_dev,
|
||||
@ -57,7 +57,7 @@ index eb22e72ae36..543388abe8e 100644
|
||||
{
|
||||
TRACE("%p, %u, %p\n", hinst, reason, reserved);
|
||||
diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c
|
||||
index f8d171a6db3..3dcbd824a30 100644
|
||||
index 94aa1e3fb7b..d5b39851eaf 100644
|
||||
--- a/dlls/winevulkan/vulkan_thunks.c
|
||||
+++ b/dlls/winevulkan/vulkan_thunks.c
|
||||
@@ -4956,9 +4956,8 @@ static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysica
|
||||
@ -72,7 +72,7 @@ index f8d171a6db3..3dcbd824a30 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h
|
||||
index 9580c6bbcd2..18e3ce5fe1c 100644
|
||||
index 7055d4fb135..f0f0ae787b5 100644
|
||||
--- a/dlls/winevulkan/vulkan_thunks.h
|
||||
+++ b/dlls/winevulkan/vulkan_thunks.h
|
||||
@@ -40,6 +40,7 @@ VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice
|
||||
@ -80,10 +80,10 @@ index 9580c6bbcd2..18e3ce5fe1c 100644
|
||||
void WINAPI wine_vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties);
|
||||
void WINAPI wine_vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties) DECLSPEC_HIDDEN;
|
||||
+VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities);
|
||||
void WINAPI wine_vkGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t *pData) DECLSPEC_HIDDEN;
|
||||
VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence);
|
||||
|
||||
/* Private thunks */
|
||||
@@ -47,6 +48,7 @@ VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physic
|
||||
VkResult WINAPI wine_vkSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data) DECLSPEC_HIDDEN;
|
||||
@@ -49,6 +50,7 @@ VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physic
|
||||
VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
|
||||
void thunk_vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties) DECLSPEC_HIDDEN;
|
||||
void thunk_vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties) DECLSPEC_HIDDEN;
|
||||
|
@ -1 +1 @@
|
||||
e0e3b6bc91f7db956e3a66f2938eea45d4055a39
|
||||
262e4ab9e0eeb126dde5cb4cba13fbf7f1d1cef0
|
||||
|
Loading…
x
Reference in New Issue
Block a user