Compare commits

...

38 Commits
v9.3 ... v9.5

Author SHA1 Message Date
Alistair Leslie-Hughes
722ee5ed7e Release v9.5 2024-03-23 17:49:31 +11:00
Alistair Leslie-Hughes
126e7db0e0 Rebase against 7c5b9304a62b794ba07110e15eef6aec3a46ef0a. 2024-03-23 17:27:34 +11:00
Alistair Leslie-Hughes
5a1e1cb2e0 Updated vkd3d-latest patchset 2024-03-22 17:43:13 +11:00
Alistair Leslie-Hughes
9160b38ad3 Updated vkd3d-latest patchset 2024-03-22 17:43:13 +11:00
Zebediah Figura
e1966ac26e ntdll-Threading: Remove patch.
This has sat here for a long time pending careful review, because the logic is
not easy to follow. Fortunately I think I understand it now.

The described race is pretty much accurate. When a thread called
RtlExitUserThread() in 1.7.38, it first decremented nb_threads. If it was the
last thread, it would call exit() with the thread exit status; if not, it would
mask off signals [the order here is important] and then call pthread_exit() with
the status.

When a thread called RtlExitUserProcess(), this happened:

  * The caller does a terminate_process() request to the server, which sends
    SIGQUIT to every thread *but* the caller.

  * The SIGQUIT handler calls terminate_thread() with a zero status.
    terminate_thread() masks off signals, then decrements nb_threads. If the
    aborting thread is the last thread, it would call _exit(), otherwise, it'd
    again just pthread_exit().

  * Finally, the original thread would call exit(), with the intended status
    code.

[All of the intermediate function calls and helpers are skipped for brevity and
clarity].

The problem happens if both of these happen at the same time in different
threads. In this case the RtlExitUserThread() thread could decrement nb_threads,
then get interrupted by SIGQUIT and decrement nb_threads again. The end result
is that, instead of the RtlExitUserProcess() thread exiting with the intended
status, instead one of the SIGQUIT threads will be the "last" thread, and exit
with the status that SIGQUIT uses, which is zero as described.

A more serious race than this can be constructed if a thread is terminated by
another thread while already exiting. In this case nb_threads would be executed
twice, but the consequence would be that the *penultimate* thread to exit,
later, would end up killing the process, since it thinks it's the ultimate
thread.

2334f4e64582a518e4d5a7627472a0d817b147ef changed this. Now a thread calling
RtlExitUserThread() does not decrement nb_threads, but instead asks the server
if it's the last thread, and if so exit the whole process [at the time via
exit(); later via RtlExitUserProcess().] If not the last thread, the threads
mask off signals and then call pthread_exit() as before.

This avoided the race, but added a different one, essentially the opposite
problem: if two threads exit cleanly at the same time, neither one of them will
think they're the last thread, then both will exit without calling exit().
Apparently (from IRC logs) this would leave the thread in a weird state where
it'd still be running somehow, although it's not really clear how.

In any case, this problem was fixed by fac1aabbef3753afc53a4ea4f933b3d0516fd302
upstream. Now if two threads call NtTerminateThread() on themselves at the same
time, they really will exit cleanly and one will terminate the process.
Critically, this is now safe from the original race, because decrementing
nb_threads is done after masking off signals.
2024-03-22 00:12:27 -05:00
Zebediah Figura
a5a28003b4 Rebase against b053e924e8e13b3637f2a5a8ffe88d84c2d17075. 2024-03-21 19:29:09 -05:00
Zebediah Figura
621740283c Add documentation to a couple more patches.
Thanks Erich for elucidating these.
2024-03-21 19:15:54 -05:00
Zebediah Figura
761fef8d70 ws2_32-TransmitFile: Remove patches.
Erich can't remember the purpose of these, and suspects that it was incidental
to the other patches for TransmitFile (which used to be in the same Wine-Staging
patch set); those were for WineHQ bug 5048.

Moreover, these aren't correct, and a correct implementation would take a lot of
work, and wouldn't really be able to use anything from these patches as a
reference.

Hence, they're not providing any value to anyone, so remove them.
2024-03-21 19:03:46 -05:00
Zebediah Figura
63300ffaad Rebase against 86557b9e0ba8a783f1b0d0918b1ddec7e0a7749e. 2024-03-19 18:42:11 -05:00
Zebediah Figura
badfcbc451 Rebase against 9e639ff1f6c2b913518501b3f99ca085c4eed6c7. 2024-03-18 18:41:32 -05:00
Zebediah Figura
6a314e5994 Rebase against 65864f92f22f6d4668c1c06ed6ef3fe49bfdcfa7. 2024-03-14 17:50:23 -05:00
Alistair Leslie-Hughes
435e01412e Rebase against 174bb7776d3971e1ed91d57a47a7599b14c6eb45. 2024-03-13 15:56:53 +11:00
Alistair Leslie-Hughes
410820a918 Updated wined3d-bindless-texture definition file
List games that are reported to require/not working with this patchset
2024-03-11 07:48:12 +11:00
Alistair Leslie-Hughes
a604ca1f6d Updated wined3d-bindless-texture patchset
If ctx_data->glsl_program is null use the 0 location.

Fixes crash
https://bugs.winehq.org/show_bug.cgi?id=56370
2024-03-10 22:03:35 +11:00
Alistair Leslie-Hughes
445948eee3 Release v9.4.1 2024-03-10 07:45:38 +11:00
Alistair Leslie-Hughes
50bad5b9af Updated user32-rawinput-mouse patchset
https://bugs.winehq.org/show_bug.cgi?id=56410
https://bugs.winehq.org/show_bug.cgi?id=56413
2024-03-10 07:38:53 +11:00
Alistair Leslie-Hughes
eb8cc143d6 Release v9.4 2024-03-09 13:58:06 +11:00
Alistair Leslie-Hughes
680ab2f323 Updated user32-msgbox-Support-WM_COPY-mesg patchset
Sync to latest PR
2024-03-09 11:53:27 +11:00
Alistair Leslie-Hughes
9a4fd0b9b0 Updated vkd3d-latest patchset 2024-03-09 11:53:27 +11:00
Alistair Leslie-Hughes
aa8b27c396 Updated user32-rawinput-mouse patchset
This update supersede user32-rawinput-mouse-experimental, removing.
2024-03-09 11:53:27 +11:00
Zebediah Figura
daf7cb4cb9 ntdll-WRITECOPY: Trigger write watches on the "info" pointer in SystemInterruptInformation.
This goes through a buffer in advapi32, so it's not obviously visible to the application; however, it means that a call to getrandom() will return EFAULT and won't actually fill the buffer.
2024-03-08 18:35:53 -06:00
Zebediah Figura
9e265ac738 Rebase against 1719aef8cbc99994ec93848ae6e9e29e5c4beb78. 2024-03-08 17:40:23 -06:00
Zebediah Figura
ec3dd19d45 ntdll-Junction_Points: Use debugstr_a() in two places.
From Aida JonikienÄ—.
2024-03-07 23:34:34 -06:00
Zebediah Figura
1ba0c55d0d kernel32-CopyFileEx: Rebase and reënable.
Rebased by Aida JonikienÄ—.
2024-03-07 23:29:47 -06:00
Zebediah Figura
7d2ceeab63 Rebase against 934cfb86b5e2b485b4b90e1eeac4021733559591. 2024-03-07 22:02:49 -06:00
Alistair Leslie-Hughes
445ab8ff01 Updated vkd3d-latest patchset 2024-03-07 10:54:09 +11:00
Zebediah Figura
64f5451ac7 Rebase against 83476e3d4ab0a0c7b1eca392e363591ba550440c. 2024-03-06 17:53:08 -06:00
Alistair Leslie-Hughes
0b083c6f73 Updated vkd3d-latest patchset
Squashed patchset.

Updated to vkd3d-1.11.
2024-03-06 16:04:05 +11:00
Alistair Leslie-Hughes
d999a6d250 Updated vkd3d-latest patchset 2024-03-06 16:04:05 +11:00
Zebediah Figura
6a02ba0240 mscoree-CorValidateImage: Remove patch set.
This was implemented upstream in e.g. 52e09e823e2a2b65f1f993145c0a65ab1d84713d and 926dd780697852b375ec0a193c762e7723a3f5e6, albeit in ntdll instead of mscoree.
2024-03-05 22:45:33 -06:00
Zebediah Figura
ff5fc9c0fa Rebase against c1b8db0c28ac5b7a14567bfb6df2c0af364de6a2. 2024-03-04 16:41:59 -06:00
Zebediah Figura
21b92f9611 server-File_Permissions: Remove patch 0001.
This patch concerns the case where we successfully create a read-only directory
with FILE_DELETE_ON_CLOSE. Currently we return STATUS_CANNOT_DELETE (having
cleared O_CREAT). This patch would change that to return success.

However, tests show that this is incorrect. Actually FILE_DELETE_ON_CLOSE should
always fail on a read-only file, including when that file is created by the same
call.
2024-03-01 23:50:11 -06:00
Zebediah Figura
3d69e00892 server-File_Permissions: Remove patches for Cygwin unlink().
These were committed without any explanation, but they do seem to fix Cygwin
unlink(), and it's been observed that many patches in Wine-Staging, whether
labeled or not, were specifically for Cygwin.

The relevant functionality was fixed a different way upstream, namely:

91e442b060
2024-03-01 23:50:11 -06:00
Zebediah Figura
6d50e5c435 wine.inf-Dummy_CA_Certificate: Add link to bug report. 2024-03-01 19:37:39 -06:00
Zebediah Figura
dd22e6eb1d Rebase against 0fb7c99c33507ac494c9c35e15fb6df8b000cdd2. 2024-03-01 19:19:58 -06:00
Zebediah Figura
e768e46a86 Rebase against 1d3b312f225f79bec74d3d265128ead455467e2a. 2024-02-29 18:06:56 -06:00
Alistair Leslie-Hughes
34eb04e7cc Rebase against 6cbe072c3799b27addb67014245ea7c59b1023dd. 2024-02-29 11:17:10 +11:00
Zebediah Figura
91d4974f10 Rebase against c2a4f3810b17f9efa3c848b473b19f641f7881f6. 2024-02-27 16:13:58 -06:00
106 changed files with 11148 additions and 30363 deletions

View File

@@ -1,149 +0,0 @@
From 51cde3dff5de27d1aebc964a4802758534d56773 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 03:39:55 +0200
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
---
dlls/ntdll/loader.c | 37 +++++++++++++++++++++++++++++++++++++
server/process.c | 8 ++++++++
server/process.h | 1 +
server/protocol.def | 7 +++++++
server/token.c | 14 ++++++++++++++
5 files changed, 67 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 6290cbcb4e6..9a8f13901b2 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3489,6 +3489,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
}
+/***********************************************************************
+ * elevate_process
+ */
+static void elevate_process( void )
+{
+ NTSTATUS status;
+ HANDLE token;
+
+ if (!(token = __wine_create_default_token( TRUE )))
+ {
+ ERR( "Failed to create admin token\n" );
+ return;
+ }
+
+ SERVER_START_REQ( replace_process_token )
+ {
+ req->token = wine_server_obj_handle( token );
+ if ((status = wine_server_call( req )))
+ ERR( "Failed to replace process token: %08x\n", status );
+ }
+ SERVER_END_REQ;
+
+ NtClose( token );
+}
+
+
/***********************************************************************
* load_global_options
*/
@@ -3900,6 +3926,7 @@ void __wine_process_init(void)
'k','e','r','n','e','l','3','2','.','d','l','l',0};
void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL;
RTL_USER_PROCESS_PARAMETERS *params;
+ ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
WINE_MODREF *wm;
NTSTATUS status;
ANSI_STRING func_name;
@@ -4021,6 +4048,16 @@ void __wine_process_init(void)
}
#endif
+ /* elevate process if necessary */
+ status = RtlQueryInformationActivationContext( 0, NULL, 0, RunlevelInformationInActivationContext,
+ &runlevel, sizeof(runlevel), NULL );
+ if (!status && (runlevel.RunLevel == ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE ||
+ runlevel.RunLevel == ACTCTX_RUN_LEVEL_REQUIRE_ADMIN))
+ {
+ TRACE( "Application requested admin rights (run level %d)\n", runlevel.RunLevel );
+ elevate_process(); /* FIXME: the process exists with a wrong token for a short time */
+ }
+
/* the main exe needs to be the first in the load order list */
RemoveEntryList( &wm->ldr.InLoadOrderLinks );
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks );
diff --git a/server/process.c b/server/process.c
index fa8495511e0..df72efdecc8 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1086,6 +1086,14 @@ int set_process_debug_flag( struct process *process, int flag )
return write_process_memory( process, process->peb + 2, 1, &data );
}
+/* replace the token of a process */
+void replace_process_token( struct process *process, struct token *new_token )
+{
+ release_object(current->process->token);
+ current->process->token = new_token;
+ grab_object(new_token);
+}
+
/* create a new process */
DECL_HANDLER(new_process)
{
diff --git a/server/process.h b/server/process.h
index 0fdf070b78e..43e8cc1ad7e 100644
--- a/server/process.h
+++ b/server/process.h
@@ -129,6 +129,7 @@ extern void kill_console_processes( struct thread *renderer, int exit_code );
extern void kill_debugged_processes( struct thread *debugger, int exit_code );
extern void detach_debugged_processes( struct thread *debugger );
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
+extern void replace_process_token( struct process *process, struct token *token );
/* console functions */
extern obj_handle_t inherit_console( struct thread *parent_thread, obj_handle_t handle,
diff --git a/server/protocol.def b/server/protocol.def
index a9308904afc..8c40fba8d0a 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3489,6 +3489,13 @@ struct handle_info
@END
+/* Create a new token */
+@REQ(replace_process_token)
+ obj_handle_t token; /* new process token */
+@REPLY
+@END
+
+
/* Create I/O completion port */
@REQ(create_completion)
unsigned int access; /* desired access to a port */
diff --git a/server/token.c b/server/token.c
index 970ed1838da..1c1d49989b3 100644
--- a/server/token.c
+++ b/server/token.c
@@ -1804,3 +1804,17 @@ DECL_HANDLER(create_token)
release_object( token );
}
}
+
+/* Replaces the token of the current process */
+DECL_HANDLER(replace_process_token)
+{
+ struct token *token;
+
+ if ((token = (struct token *)get_handle_obj( current->process, req->token,
+ TOKEN_ASSIGN_PRIMARY,
+ &token_ops )))
+ {
+ replace_process_token( current->process, token );
+ release_object( token );
+ }
+}
--
2.28.0

View File

@@ -1,80 +0,0 @@
From baff5c160cf7f1ac0011bf8f55d506bf0346e1fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 7 Aug 2017 02:53:06 +0200
Subject: [PATCH] user32: Start explorer.exe using limited rights.
---
dlls/advapi32/tests/security.c | 4 ++--
dlls/user32/win.c | 12 ++++++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index f27642e7a7..0271cd72e0 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -7313,7 +7313,7 @@ static void test_token_security_descriptor(void)
ret = GetTokenInformation(token4, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
- todo_wine ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
+ ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
size = 0;
ret = GetKernelObjectSecurity(token4, LABEL_SECURITY_INFORMATION, NULL, 0, &size);
@@ -7768,7 +7768,7 @@ static void test_child_token_sd_medium(void)
ret = GetTokenInformation(token, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
- todo_wine ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
+ ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
HeapFree(GetProcessHeap(), 0, sd);
}
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index cbfd8bb14a..8039f54fb0 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -43,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
#define NB_USER_HANDLES ((LAST_USER_HANDLE - FIRST_USER_HANDLE + 1) >> 1)
#define USER_HANDLE_TO_INDEX(hwnd) ((LOWORD(hwnd) - FIRST_USER_HANDLE) >> 1)
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
+
static DWORD process_layout = ~0u;
static struct list window_surfaces = LIST_INIT( window_surfaces );
@@ -2052,6 +2054,7 @@ HWND WINAPI GetDesktopWindow(void)
WCHAR app[MAX_PATH + ARRAY_SIZE( explorer )];
WCHAR cmdline[MAX_PATH + ARRAY_SIZE( explorer ) + ARRAY_SIZE( args )];
WCHAR desktop[MAX_PATH];
+ HANDLE token;
void *redir;
SERVER_START_REQ( set_user_object_info )
@@ -2084,9 +2087,12 @@ HWND WINAPI GetDesktopWindow(void)
strcpyW( cmdline, app );
strcatW( cmdline, args );
+ if (!(token = __wine_create_default_token( FALSE )))
+ ERR( "Failed to create limited token\n" );
+
Wow64DisableWow64FsRedirection( &redir );
- if (CreateProcessW( app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
- NULL, windir, &si, &pi ))
+ if (CreateProcessAsUserW( token, app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
+ NULL, windir, &si, &pi ))
{
TRACE( "started explorer pid %04x tid %04x\n", pi.dwProcessId, pi.dwThreadId );
WaitForInputIdle( pi.hProcess, 10000 );
@@ -2096,6 +2102,8 @@ HWND WINAPI GetDesktopWindow(void)
else WARN( "failed to start explorer, err %d\n", GetLastError() );
Wow64RevertWow64FsRedirection( redir );
+ if (token) CloseHandle( token );
+
SERVER_START_REQ( get_desktop_window )
{
req->force = 1;
--
2.18.0

View File

@@ -1,344 +0,0 @@
From 5bf0baa79c46ec44dfd5e1340e96ff9289bc37f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 6 Aug 2017 03:15:34 +0200
Subject: [PATCH] programs/runas: Basic implementation for starting processes
with a different trustlevel.
---
configure.ac | 1 +
programs/runas/Makefile.in | 8 ++
programs/runas/runas.c | 214 +++++++++++++++++++++++++++++++++++++
programs/runas/runas.h | 26 +++++
programs/runas/runas.rc | 39 +++++++
5 files changed, 288 insertions(+)
create mode 100644 programs/runas/Makefile.in
create mode 100644 programs/runas/runas.c
create mode 100644 programs/runas/runas.h
create mode 100644 programs/runas/runas.rc
diff --git a/configure.ac b/configure.ac
index 499c4f37ca..6f12614af1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3891,6 +3891,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
WINE_CONFIG_MAKEFILE(programs/regsvcs)
WINE_CONFIG_MAKEFILE(programs/regsvr32)
WINE_CONFIG_MAKEFILE(programs/rpcss)
+WINE_CONFIG_MAKEFILE(programs/runas)
WINE_CONFIG_MAKEFILE(programs/rundll.exe16,enable_win16)
WINE_CONFIG_MAKEFILE(programs/rundll32)
WINE_CONFIG_MAKEFILE(programs/sc)
diff --git a/programs/runas/Makefile.in b/programs/runas/Makefile.in
new file mode 100644
index 0000000000..33aa00ab03
--- /dev/null
+++ b/programs/runas/Makefile.in
@@ -0,0 +1,8 @@
+MODULE = runas.exe
+APPMODE = -mconsole -municode -mno-cygwin
+IMPORTS = advapi32 user32
+
+C_SRCS = \
+ runas.c
+
+RC_SRCS = runas.rc
diff --git a/programs/runas/runas.c b/programs/runas/runas.c
new file mode 100644
index 0000000000..412755afa0
--- /dev/null
+++ b/programs/runas/runas.c
@@ -0,0 +1,214 @@
+/*
+ * runas.exe implementation
+ *
+ * Copyright 2017 Michael MĂĽller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windows.h>
+#include <wchar.h>
+#include <wine/debug.h>
+
+#include "runas.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(runas);
+
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
+
+struct cmdinfo
+{
+ WCHAR *program;
+ DWORD trustlevel;
+};
+
+static void output_writeconsole(const WCHAR *str, DWORD wlen)
+{
+ DWORD count, ret;
+
+ ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL);
+ if (!ret)
+ {
+ DWORD len;
+ char *msgA;
+
+ /* On Windows WriteConsoleW() fails if the output is redirected. So fall
+ * back to WriteFile(), assuming the console encoding is still the right
+ * one in that case.
+ */
+ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL);
+ msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
+ if (!msgA) return;
+
+ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL);
+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
+ HeapFree(GetProcessHeap(), 0, msgA);
+ }
+}
+
+static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
+{
+ WCHAR *str;
+ DWORD len;
+
+ SetLastError(NO_ERROR);
+ len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ fmt, 0, 0, (WCHAR *)&str, 0, &va_args);
+ if (len == 0 && GetLastError() != NO_ERROR)
+ {
+ WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
+ return;
+ }
+ output_writeconsole(str, len);
+ LocalFree(str);
+}
+
+static void WINAPIV output_message(unsigned int id, ...)
+{
+ WCHAR fmt[1024];
+ __ms_va_list va_args;
+
+ if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, sizeof(fmt)/sizeof(WCHAR)))
+ {
+ WINE_FIXME("LoadString failed with %d\n", GetLastError());
+ return;
+ }
+ __ms_va_start(va_args, id);
+ output_formatstring(fmt, va_args);
+ __ms_va_end(va_args);
+}
+
+static void show_usage(void)
+{
+ output_message(STRING_USAGE);
+}
+
+static void show_trustlevels(void)
+{
+ output_message(STRING_TRUSTLEVELS);
+ ExitProcess(0);
+}
+
+static WCHAR *starts_with(WCHAR *str, const WCHAR *start)
+{
+ DWORD start_len = lstrlenW(start);
+ if (lstrlenW(str) < start_len)
+ return NULL;
+ if (wcsncmp(str, start, start_len))
+ return NULL;
+ return str + start_len;
+}
+
+static BOOL parse_command_line(int argc, WCHAR *argv[], struct cmdinfo *cmd)
+{
+ static const WCHAR showtrustlevelsW[] = {'/','s','h','o','w','t','r','u','s','t','l','e','v','e','l','s',0};
+ static const WCHAR trustlevelW[] = {'/','t','r','u','s','t','l','e','v','e','l',':',0};
+ int i;
+
+ memset(cmd, 0, sizeof(*cmd));
+
+ for (i = 1; i < argc; i++)
+ {
+ if (argv[i][0] == '/')
+ {
+ WCHAR *arg;
+
+ if ((arg = starts_with(argv[i], trustlevelW)))
+ cmd->trustlevel = wcstoul(arg, NULL, 0);
+ else if (!lstrcmpW(argv[i], showtrustlevelsW))
+ show_trustlevels();
+ else
+ WINE_FIXME("Ignoring parameter %s\n", wine_dbgstr_w(argv[i]));
+ }
+ else if (argv[i][0])
+ {
+ if (cmd->program) return FALSE;
+ cmd->program = argv[i];
+ }
+ }
+
+ return TRUE;
+}
+
+static BOOL start_process(struct cmdinfo *cmd)
+{
+ PROCESS_INFORMATION info;
+ STARTUPINFOW startup;
+ HANDLE token = NULL;
+ BOOL ret;
+
+ if (cmd->trustlevel == 0x20000)
+ {
+ if (!(token = __wine_create_default_token(FALSE)))
+ ERR("Failed to create limited token\n");
+ }
+
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ ret = CreateProcessAsUserW(token, NULL, cmd->program, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info);
+ if (ret)
+ {
+ CloseHandle(info.hProcess);
+ CloseHandle(info.hThread);
+ }
+ else
+ {
+ DWORD error = GetLastError();
+ WCHAR *str;
+
+ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, 0, (WCHAR *)&str, 0, NULL))
+ {
+ output_message(STRING_START_ERROR, cmd->program, error, str);
+ LocalFree(str);
+ }
+ else
+ WINE_FIXME("Failed to format error: %u\n", error);
+ }
+
+ if (token) CloseHandle(token);
+ return ret;
+}
+
+int wmain(int argc, WCHAR *argv[])
+{
+ struct cmdinfo cmd;
+
+ if (argc <= 1)
+ {
+ show_usage();
+ return 0;
+ }
+
+ if (!parse_command_line(argc, argv, &cmd))
+ {
+ show_usage();
+ return 1;
+ }
+
+ if (!cmd.program)
+ {
+ show_usage();
+ return 1;
+ }
+
+ if (cmd.trustlevel && cmd.trustlevel != 0x20000)
+ {
+ output_message(STRING_UNHANDLED_TRUSTLEVEL, cmd.trustlevel);
+ return 1;
+ }
+
+ return start_process(&cmd);
+}
diff --git a/programs/runas/runas.h b/programs/runas/runas.h
new file mode 100644
index 0000000000..40599a3b33
--- /dev/null
+++ b/programs/runas/runas.h
@@ -0,0 +1,26 @@
+/*
+ * runas.exe implementation
+ *
+ * Copyright 2017 Michael MĂĽller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <windef.h>
+
+#define STRING_USAGE 101
+#define STRING_UNHANDLED_TRUSTLEVEL 102
+#define STRING_TRUSTLEVELS 103
+#define STRING_START_ERROR 104
diff --git a/programs/runas/runas.rc b/programs/runas/runas.rc
new file mode 100644
index 0000000000..f9297a4479
--- /dev/null
+++ b/programs/runas/runas.rc
@@ -0,0 +1,39 @@
+/*
+ * runas.exe implementation
+ *
+ * Copyright 2017 Michael MĂĽller
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "runas.h"
+
+#pragma makedep po
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+ STRING_USAGE, "Usage of RUNAS:\n\n\
+\RUNAS /trustlevel:<trustlevel> program\n\n\
+\ /showtrustlevels Show possible trustlevels\n\
+\ /trustlevel <trustlevel> should be listed in /showtrustlevels\n\
+\ program Program to start\n\n"
+ STRING_UNHANDLED_TRUSTLEVEL, "runas: Unhandled trustlevel 0x%1!x!\n"
+ STRING_TRUSTLEVELS, "The following trustlevels are supported:\n\
+0x20000 (standard user)\n"
+ STRING_START_ERROR, "RUNAS-Error: %1 could not be started\n\
+ %2!u!: %3\n"
+}
--
2.23.0.rc1

View File

@@ -1,15 +1,15 @@
From e4688a88901a1c13b2df67a0444c34e3ee02bbab Mon Sep 17 00:00:00 2001
From 9c7acdba85edafc52bc0cc2719ac556894a59351 Mon Sep 17 00:00:00 2001
From: Andrew D'Addesio <andrew@fatbag.net>
Date: Fri, 8 Feb 2019 18:48:33 -1000
Subject: [PATCH] ddraw: Return correct devices based off requested DirectX
version.
---
dlls/ddraw/ddraw.c | 232 +++++++++++++++++++++++++--------------------
1 file changed, 129 insertions(+), 103 deletions(-)
dlls/ddraw/ddraw.c | 240 +++++++++++++++++++++++++--------------------
1 file changed, 131 insertions(+), 109 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 5887854556b..5ac95dc3043 100644
index 8f2fd9f3b4b..0ef400b7a26 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -44,37 +44,80 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
@@ -122,7 +122,7 @@ index 5887854556b..5ac95dc3043 100644
/* Fill the missing members, and do some fixup */
caps->dpcLineCaps.dwSize = sizeof(caps->dpcLineCaps);
caps->dpcLineCaps.dwTextureBlendCaps = D3DPTBLENDCAPS_ADD
@@ -3746,8 +3780,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
@@ -3770,8 +3804,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
/*****************************************************************************
* IDirect3D7::EnumDevices
*
@@ -132,7 +132,7 @@ index 5887854556b..5ac95dc3043 100644
*
* Params:
* callback: Function to call for each enumerated device
@@ -3779,13 +3812,16 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3803,13 +3836,16 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
}
dev_caps = device_desc7.dwDevCaps;
@@ -153,7 +153,7 @@ index 5887854556b..5ac95dc3043 100644
if (ret != DDENUMRET_OK)
{
TRACE("Application cancelled the enumeration.\n");
@@ -3801,11 +3837,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3825,11 +3861,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
return D3D_OK;
}
@@ -177,7 +177,7 @@ index 5887854556b..5ac95dc3043 100644
*
* Versions 1, 2 and 3
*
@@ -3820,18 +3866,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3844,18 +3890,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
*****************************************************************************/
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
{
@@ -205,7 +205,7 @@ index 5887854556b..5ac95dc3043 100644
TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
@@ -3840,55 +3886,60 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
@@ -3864,58 +3910,59 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
wined3d_mutex_lock();
@@ -221,7 +221,6 @@ index 5887854556b..5ac95dc3043 100644
wined3d_mutex_unlock();
return hr;
}
+
ddraw_d3dcaps1_from_7(&device_desc1, &device_desc7);
+ device_desc1.dwSize = desc_size;
@@ -245,15 +244,12 @@ index 5887854556b..5ac95dc3043 100644
- * flag set. This way it refuses the emulation device, and HAL devices
- * never have POW2 unset in d3d7 on windows. */
- if (ddraw->d3dversion != 1)
+ clear_device_desc(&empty_desc1);
+ empty_desc1.dwSize = desc_size;
+
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
{
- static CHAR reference_description[] = "RGB Direct3D emulation";
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
+ continue;
- {
- /* Tomb Raider 3 overwrites the reference device description buffer
- * with its own custom string. Reserve some extra space in the array
- * to avoid a buffer overrun. */
- static CHAR reference_description[64] = "RGB Direct3D emulation";
-
- TRACE("Enumerating WineD3D D3DDevice interface.\n");
- hal_desc = device_desc1;
- hel_desc = device_desc1;
@@ -269,13 +265,22 @@ index 5887854556b..5ac95dc3043 100644
- /* RGB, REF, RAMP and MMX devices don't report hardware transform and lighting capability */
- hal_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
- hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
+ if (IsEqualGUID(&IID_IDirect3DHALDevice, device_list[i].device_guid))
+ {
+ hal_desc = device_desc1;
-
- hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
- device_name, &hal_desc, &hel_desc, context);
- if (hr != D3DENUMRET_OK)
+ clear_device_desc(&empty_desc1);
+ empty_desc1.dwSize = desc_size;
+
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
+ {
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
+ continue;
+
+ if (IsEqualGUID(&IID_IDirect3DHALDevice, device_list[i].device_guid))
+ {
+ hal_desc = device_desc1;
+
+ /* The HAL device's hel_desc is almost empty -- but not completely */
+ hel_desc = empty_desc1;
+ hel_desc.dwFlags = D3DDD_COLORMODEL | D3DDD_DEVCAPS | D3DDD_TRANSFORMCAPS
@@ -305,7 +310,7 @@ index 5887854556b..5ac95dc3043 100644
{
TRACE("Application cancelled the enumeration.\n");
wined3d_mutex_unlock();
@@ -3896,31 +3947,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
@@ -3923,31 +3970,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
}
}

View File

@@ -1,4 +1,4 @@
From d09ac9a348309f956a2f3985a1b465b51b6e174c Mon Sep 17 00:00:00 2001
From 6ef73a30a9f0c7c6775786d4cdba169f95056393 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 28 Mar 2015 08:18:10 +0100
Subject: [PATCH] dsound: Apply filters before sound is multiplied to speakers.
@@ -11,10 +11,10 @@ Based on a patch by Mark Harmstone.
3 files changed, 81 insertions(+), 36 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 0b8edaaaf06..bdf3a824511 100644
index 7629810db50..4c1c022acb7 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
@@ -236,6 +236,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
if(device->mmdevice)
IMMDevice_Release(device->mmdevice);
CloseHandle(device->sleepev);
@@ -23,10 +23,10 @@ index 0b8edaaaf06..bdf3a824511 100644
free(device->cp_buffer);
free(device->buffer);
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 124a4311b4c..fe39ca221fa 100644
index 61323be99d8..c2656ab82f1 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -89,8 +89,8 @@ struct DirectSoundDevice
@@ -90,8 +90,8 @@ struct DirectSoundDevice
int speaker_num[DS_MAX_CHANNELS];
int num_speakers;
int lfe_channel;
@@ -34,14 +34,14 @@ index 124a4311b4c..fe39ca221fa 100644
- DWORD tmp_buffer_len, cp_buffer_len;
+ float *tmp_buffer, *cp_buffer, *dsp_buffer;
+ DWORD tmp_buffer_len, cp_buffer_len, dsp_buffer_len;
CO_MTA_USAGE_COOKIE mta_cookie;
DSVOLUMEPAN volpan;
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index c26b19ea8c1..68a45c46d1e 100644
index 042b9499727..f261588454a 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -283,10 +283,9 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
@@ -286,10 +286,9 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
return dsb->get(dsb, buffer + (mixpos % buflen), channel);
}
@@ -53,7 +53,7 @@ index c26b19ea8c1..68a45c46d1e 100644
UINT committed_samples = 0;
DWORD channel, i;
@@ -305,17 +304,16 @@ static UINT cp_fields_noresample(IDirectSoundBufferImpl *dsb, UINT count)
@@ -308,17 +307,16 @@ static UINT cp_fields_noresample(IDirectSoundBufferImpl *dsb, UINT count)
for (; i < count; i++)
for (channel = 0; channel < dsb->mix_channels; channel++)
@@ -74,7 +74,7 @@ index c26b19ea8c1..68a45c46d1e 100644
UINT channels = dsb->mix_channels;
LONG64 freqAcc_start = *freqAccNum;
@@ -343,7 +341,7 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
@@ -346,7 +344,7 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
float s1 = get_current_sample(dsb, dsb->buffer->memory, dsb->buflen, idx, channel);
float s2 = get_current_sample(dsb, dsb->buffer->memory, dsb->buflen, idx + istride, channel);
float result = s1 * cur_freqAcc2 + s2 * cur_freqAcc;
@@ -83,7 +83,7 @@ index c26b19ea8c1..68a45c46d1e 100644
}
}
@@ -351,11 +349,11 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
@@ -354,11 +352,11 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
return max_ipos;
}
@@ -97,7 +97,7 @@ index c26b19ea8c1..68a45c46d1e 100644
UINT committed_samples = 0;
LONG64 freqAcc_start = *freqAccNum;
@@ -430,23 +428,24 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
@@ -433,23 +431,24 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
float* cache = &intermediate[channel * required_input + ipos];
for (j = 0; j < fir_used; j++)
sum += fir_copy[j] * cache[j];
@@ -127,7 +127,7 @@ index c26b19ea8c1..68a45c46d1e 100644
ipos = dsb->sec_mixpos + adv * dsb->pwfx->nBlockAlign;
if (ipos >= dsb->buflen) {
@@ -482,6 +481,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
@@ -485,6 +484,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
return buflen + ptr1 - ptr2;
}
}
@@ -149,7 +149,7 @@ index c26b19ea8c1..68a45c46d1e 100644
/**
* Mix at most the given amount of data into the allocated temporary buffer
* of the given secondary buffer, starting from the dsb's first currently
@@ -497,31 +511,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
@@ -500,31 +514,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
*/
static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
{
@@ -180,12 +180,22 @@ index c26b19ea8c1..68a45c46d1e 100644
+ }
+ if(dsb->put_aux == putieee32_sum)
+ memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
+
- if (size_bytes > 0) {
- for (i = 0; i < dsb->num_filters; i++) {
- if (dsb->filters[i].inplace) {
- hr = IMediaObjectInPlace_Process(dsb->filters[i].inplace, size_bytes, (BYTE*)dsb->device->tmp_buffer, 0, DMO_INPLACE_NORMAL);
+ if (using_filters) {
+ put = putieee32_dsp;
+ ostride = dsb->mix_channels * sizeof(float);
+ size_bytes = frames * ostride;
+
- if (FAILED(hr))
- WARN("IMediaObjectInPlace_Process failed for filter %u\n", i);
- } else
- WARN("filter %u has no inplace object - unsupported\n", i);
- }
- }
+ if (dsb->device->dsp_buffer_len < size_bytes || !dsb->device->dsp_buffer) {
+ if (dsb->device->dsp_buffer)
+ dsb->device->dsp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->dsp_buffer, size_bytes);
@@ -194,11 +204,7 @@ index c26b19ea8c1..68a45c46d1e 100644
+ dsb->device->dsp_buffer_len = size_bytes;
+ }
+ }
- if (size_bytes > 0) {
- for (i = 0; i < dsb->num_filters; i++) {
- if (dsb->filters[i].inplace) {
- hr = IMediaObjectInPlace_Process(dsb->filters[i].inplace, size_bytes, (BYTE*)dsb->device->tmp_buffer, 0, DMO_INPLACE_NORMAL);
+
+ cp_fields(dsb, put, ostride, frames, &dsb->freqAccNum);
+
+ if (using_filters) {
@@ -213,13 +219,7 @@ index c26b19ea8c1..68a45c46d1e 100644
+ WARN("filter %lu has no inplace object - unsupported\n", i);
+ }
+ }
- if (FAILED(hr))
- WARN("IMediaObjectInPlace_Process failed for filter %u\n", i);
- } else
- WARN("filter %u has no inplace object - unsupported\n", i);
- }
- }
+
+ istride = ostride;
+ ostride = dsb->device->pwfx->nChannels * sizeof(float);
+ for (i = 0; i < frames; i++) {
@@ -232,5 +232,5 @@ index c26b19ea8c1..68a45c46d1e 100644
static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames)
--
2.39.2
2.43.0

View File

@@ -1,4 +1,4 @@
From 61fb7e02aa6779469e94c79f1132c4991cb27244 Mon Sep 17 00:00:00 2001
From ad881c0cf988811e4b8662eac50f8998dfed40ca Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 15:11:12 -0500
Subject: [PATCH] server: Create eventfd file descriptors for process objects.
@@ -11,7 +11,7 @@ Subject: [PATCH] server: Create eventfd file descriptors for process objects.
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/server/esync.c b/server/esync.c
index c7b0323f204..27049ffbdb0 100644
index 85f7f1e060f..44214e5fe02 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -295,6 +295,24 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name,
@@ -49,7 +49,7 @@ index 00f9e638d83..8522d8a69ae 100644
void esync_init(void);
+int esync_create_fd( int initval, int flags );
diff --git a/server/process.c b/server/process.c
index da11b90c613..22ac16fb540 100644
index 4a5ef0876b0..a7be3ee3876 100644
--- a/server/process.c
+++ b/server/process.c
@@ -63,6 +63,7 @@
@@ -77,15 +77,15 @@ index da11b90c613..22ac16fb540 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -686,6 +688,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process->rawinput_mouse = NULL;
@@ -688,6 +690,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process->rawinput_kbd = NULL;
memset( &process->image_info, 0, sizeof(process->image_info) );
list_init( &process->rawinput_entry );
+ process->esync_fd = -1;
list_init( &process->kernel_object );
list_init( &process->thread_list );
list_init( &process->locks );
@@ -742,6 +745,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
@@ -744,6 +747,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
if (!token_assign_label( process->token, &high_label_sid ))
goto error;
@@ -95,7 +95,7 @@ index da11b90c613..22ac16fb540 100644
set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */
return process;
@@ -789,6 +795,7 @@ static void process_destroy( struct object *obj )
@@ -792,6 +798,7 @@ static void process_destroy( struct object *obj )
free( process->rawinput_devices );
free( process->dir_cache );
free( process->image );
@@ -103,7 +103,7 @@ index da11b90c613..22ac16fb540 100644
}
/* dump a process on stdout for debugging purposes */
@@ -806,6 +813,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
@@ -809,6 +816,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
return !process->running_threads;
}
@@ -118,11 +118,11 @@ index da11b90c613..22ac16fb540 100644
{
access = default_map_access( obj, access );
diff --git a/server/process.h b/server/process.h
index 97e0d455ece..a0a071d8f88 100644
index 1e73e9d47dc..bedd8bb4586 100644
--- a/server/process.h
+++ b/server/process.h
@@ -85,6 +85,7 @@ struct process
const struct rawinput_device *rawinput_kbd; /* rawinput keyboard device, if any */
@@ -86,6 +86,7 @@ struct process
struct list rawinput_entry; /* entry in the rawinput process list */
struct list kernel_object; /* list of kernel object pointers */
pe_image_info_t image_info; /* main exe image info */
+ int esync_fd; /* esync file descriptor (signaled on exit) */
@@ -130,5 +130,5 @@ index 97e0d455ece..a0a071d8f88 100644
/* process functions */
--
2.35.1
2.43.0

View File

@@ -1,4 +1,4 @@
From 1cf7540fcddc9fbaa7411f3293f115555a6dd0ab Mon Sep 17 00:00:00 2001
From d7b142aa0b60d99bd225849439cd49119a6e3e80 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:11:23 -0500
Subject: [PATCH] server, ntdll: Implement message waits.
@@ -105,10 +105,10 @@ index 399930c444b..06d7d8babc6 100644
{
struct stat st;
diff --git a/server/protocol.def b/server/protocol.def
index 915332ece6f..dd5e996cbc7 100644
index a2700b043ba..fb290c7964c 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3921,3 +3921,8 @@ enum esync_type
@@ -3907,3 +3907,8 @@ enum esync_type
int type;
unsigned int shm_idx;
@END
@@ -118,10 +118,10 @@ index 915332ece6f..dd5e996cbc7 100644
+ int in_msgwait; /* are we in a message wait? */
+@END
diff --git a/server/queue.c b/server/queue.c
index 3d5da326400..80731383401 100644
index 936a6309683..fc13b1cf6eb 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -146,6 +146,7 @@ struct msg_queue
@@ -148,6 +148,7 @@ struct msg_queue
int keystate_lock; /* owns an input keystate lock */
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
int esync_fd; /* esync file descriptor (signalled on message) */
@@ -129,7 +129,7 @@ index 3d5da326400..80731383401 100644
};
struct hotkey
@@ -319,6 +320,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -321,6 +322,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
queue->keystate_lock = 0;
queue->ignore_post_msg = 0;
queue->esync_fd = -1;
@@ -137,7 +137,7 @@ index 3d5da326400..80731383401 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -1106,6 +1108,10 @@ static int is_queue_hung( struct msg_queue *queue )
@@ -1108,6 +1110,10 @@ static int is_queue_hung( struct msg_queue *queue )
if (get_wait_queue_thread(entry)->queue == queue)
return 0; /* thread is waiting on queue -> not hung */
}
@@ -148,9 +148,9 @@ index 3d5da326400..80731383401 100644
return 1;
}
@@ -3568,3 +3574,18 @@ DECL_HANDLER(update_rawinput_devices)
process->rawinput_mouse = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_MOUSE, HID_USAGE_PAGE_GENERIC) );
process->rawinput_kbd = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_KEYBOARD, HID_USAGE_PAGE_GENERIC) );
@@ -3735,3 +3741,18 @@ DECL_HANDLER(update_rawinput_devices)
release_object( desktop );
}
}
+
+DECL_HANDLER(esync_msgwait)

View File

@@ -1,12 +1,12 @@
From 5e3315735a72bedc1fc45feee59018a3900338e0 Mon Sep 17 00:00:00 2001
From fe242e3483f040fdffd2ff7aa9774f7212149f56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 26 Feb 2015 06:41:26 +0100
Subject: [PATCH] kernelbase: Add support for progress callback in CopyFileEx.
---
dlls/kernel32/tests/file.c | 6 ----
dlls/kernelbase/file.c | 72 ++++++++++++++++++++++++++++++++++----
2 files changed, 66 insertions(+), 12 deletions(-)
dlls/kernel32/tests/file.c | 6 ---
dlls/kernelbase/file.c | 87 ++++++++++++++++++++++++++++++++------
2 files changed, 73 insertions(+), 20 deletions(-)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 02625140702..251010eb5d8 100644
@@ -37,10 +37,21 @@ index 02625140702..251010eb5d8 100644
retok = CopyFileExA(source, NULL, copy_progress_cb, hfile, NULL, 0);
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index b6f8208ac9e..32a672fc9d9 100644
index 7806ad2ec1f..e5adc0d4e2c 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -499,11 +499,16 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
@@ -490,23 +490,29 @@ BOOL WINAPI DECLSPEC_HOTPATCH AreFileApisANSI(void)
/******************************************************************************
* copy_file
*/
-static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDED_PARAMETERS *params )
+static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDED_PARAMETERS *params, LPPROGRESS_ROUTINE progress )
{
DWORD flags = params ? params->dwCopyFlags : 0;
BOOL *cancel_ptr = params ? params->pfCancel : NULL;
- PCOPYFILE2_PROGRESS_ROUTINE progress = params ? params->pProgressRoutine : NULL;
+ void *param = params ? params->pvCallbackContext : NULL;
+ PCOPYFILE2_PROGRESS_ROUTINE progress2 = params ? params->pProgressRoutine : NULL;
static const int buffer_size = 65536;
HANDLE h1, h2;
@@ -58,7 +69,12 @@ index b6f8208ac9e..32a672fc9d9 100644
if (cancel_ptr)
FIXME("pfCancel is not supported\n");
@@ -530,7 +535,10 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
- if (progress)
+ if (progress2)
FIXME("PCOPYFILE2_PROGRESS_ROUTINE is not supported\n");
if (!source || !dest)
@@ -529,7 +535,10 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
if (flags & COPY_FILE_OPEN_SOURCE_FOR_WRITE)
FIXME("COPY_FILE_OPEN_SOURCE_FOR_WRITE is not supported\n");
@@ -70,7 +86,7 @@ index b6f8208ac9e..32a672fc9d9 100644
NULL, OPEN_EXISTING, 0, 0 )) == INVALID_HANDLE_VALUE)
{
WARN("Unable to open source %s\n", debugstr_w(source));
@@ -538,7 +546,7 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
@@ -537,7 +546,7 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
return FALSE;
}
@@ -79,7 +95,7 @@ index b6f8208ac9e..32a672fc9d9 100644
{
WARN("GetFileInformationByHandle returned error for %s\n", debugstr_w(source));
HeapFree( GetProcessHeap(), 0, buffer );
@@ -564,7 +572,11 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
@@ -563,7 +572,11 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
}
}
@@ -92,7 +108,7 @@ index b6f8208ac9e..32a672fc9d9 100644
(flags & COPY_FILE_FAIL_IF_EXISTS) ? CREATE_NEW : CREATE_ALWAYS,
info.FileAttributes, h1 )) == INVALID_HANDLE_VALUE)
{
@@ -574,6 +586,29 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
@@ -573,6 +586,29 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
return FALSE;
}
@@ -122,7 +138,7 @@ index b6f8208ac9e..32a672fc9d9 100644
while (ReadFile( h1, buffer, buffer_size, &count, NULL ) && count)
{
char *p = buffer;
@@ -583,13 +618,38 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
@@ -582,13 +618,38 @@ static BOOL copy_file( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDE
if (!WriteFile( h2, p, count, &res, NULL ) || !res) goto done;
p += res;
count -= res;
@@ -163,6 +179,36 @@ index b6f8208ac9e..32a672fc9d9 100644
HeapFree( GetProcessHeap(), 0, buffer );
CloseHandle( h1 );
CloseHandle( h2 );
@@ -601,7 +662,7 @@ done:
*/
HRESULT WINAPI CopyFile2( const WCHAR *source, const WCHAR *dest, COPYFILE2_EXTENDED_PARAMETERS *params )
{
- return copy_file(source, dest, params) ? S_OK : HRESULT_FROM_WIN32(GetLastError());
+ return copy_file(source, dest, params, NULL) ? S_OK : HRESULT_FROM_WIN32(GetLastError());
}
@@ -613,18 +674,16 @@ BOOL WINAPI CopyFileExW( const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUT
{
COPYFILE2_EXTENDED_PARAMETERS params;
- if (progress)
- FIXME("LPPROGRESS_ROUTINE is not supported\n");
if (cancel_ptr)
FIXME("cancel_ptr is not supported\n");
params.dwSize = sizeof(params);
params.dwCopyFlags = flags;
params.pProgressRoutine = NULL;
- params.pvCallbackContext = NULL;
+ params.pvCallbackContext = param;
params.pfCancel = NULL;
- return copy_file( source, dest, &params );
+ return copy_file( source, dest, &params, progress );
}
--
2.43.0

View File

@@ -1,3 +1,2 @@
Fixes: [22692] Add support for CopyFileEx progress callback
Fixes: [22690] Allow to cancel a file operation via progress callback
Disabled: True

View File

@@ -1,223 +0,0 @@
From dd46b005cfcc8aa02bf25c031326e28bd75e0ff2 Mon Sep 17 00:00:00 2001
From: Mark Jansen <mark.jansen@reactos.org>
Date: Sun, 24 Sep 2017 22:45:22 +0200
Subject: [PATCH] kernel32/tests: Add tests for job object accounting
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
---
dlls/kernel32/tests/process.c | 95 +++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index e9e8555c32e..e5a9914ca7b 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -2541,6 +2541,69 @@ static void _create_process(int line, const char *command, LPPROCESS_INFORMATION
ok_(__FILE__, line)(ret, "CreateProcess error %lu\n", GetLastError());
}
+#define test_assigned_proc(job, ...) _test_assigned_proc(__LINE__, job, __VA_ARGS__)
+static void _test_assigned_proc(int line, HANDLE job, int expected_count, ...)
+{
+ char buf[sizeof(JOBOBJECT_BASIC_PROCESS_ID_LIST) + sizeof(ULONG_PTR) * 20];
+ PJOBOBJECT_BASIC_PROCESS_ID_LIST pid_list = (JOBOBJECT_BASIC_PROCESS_ID_LIST *)buf;
+ DWORD ret_len, pid;
+ va_list valist;
+ int n;
+ BOOL ret;
+
+ memset(buf, 0, sizeof(buf));
+ ret = pQueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list, sizeof(buf), &ret_len);
+ ok_(__FILE__, line)(ret, "QueryInformationJobObject error %lu\n", GetLastError());
+ if (ret)
+ {
+ todo_wine_if(expected_count)
+ ok_(__FILE__, line)(expected_count == pid_list->NumberOfAssignedProcesses,
+ "Expected NumberOfAssignedProcesses to be %d (expected_count) is %ld\n",
+ expected_count, pid_list->NumberOfAssignedProcesses);
+ todo_wine_if(expected_count)
+ ok_(__FILE__, line)(expected_count == pid_list->NumberOfProcessIdsInList,
+ "Expected NumberOfProcessIdsInList to be %d (expected_count) is %ld\n",
+ expected_count, pid_list->NumberOfProcessIdsInList);
+
+ va_start(valist, expected_count);
+ for (n = 0; n < min(expected_count, pid_list->NumberOfProcessIdsInList); ++n)
+ {
+ pid = va_arg(valist, DWORD);
+ ok_(__FILE__, line)(pid == pid_list->ProcessIdList[n],
+ "Expected pid_list->ProcessIdList[%d] to be %lx is %Ix\n",
+ n, pid, pid_list->ProcessIdList[n]);
+ }
+ va_end(valist);
+ }
+}
+
+#define test_accounting(job, total_proc, active_proc, terminated_proc) _test_accounting(__LINE__, job, total_proc, active_proc, terminated_proc)
+static void _test_accounting(int line, HANDLE job, int total_proc, int active_proc, int terminated_proc)
+{
+ JOBOBJECT_BASIC_ACCOUNTING_INFORMATION basic_accounting;
+ DWORD ret_len;
+ BOOL ret;
+
+ memset(&basic_accounting, 0, sizeof(basic_accounting));
+ ret = pQueryInformationJobObject(job, JobObjectBasicAccountingInformation, &basic_accounting, sizeof(basic_accounting), &ret_len);
+ ok_(__FILE__, line)(ret, "QueryInformationJobObject error %lu\n", GetLastError());
+ if (ret)
+ {
+ /* Not going to check process times or page faults */
+
+ todo_wine_if(total_proc)
+ ok_(__FILE__, line)(total_proc == basic_accounting.TotalProcesses,
+ "Expected basic_accounting.TotalProcesses to be %d (total_proc) is %ld\n",
+ total_proc, basic_accounting.TotalProcesses);
+ todo_wine_if(active_proc)
+ ok_(__FILE__, line)(active_proc == basic_accounting.ActiveProcesses,
+ "Expected basic_accounting.ActiveProcesses to be %d (active_proc) is %ld\n",
+ active_proc, basic_accounting.ActiveProcesses);
+ ok_(__FILE__, line)(terminated_proc == basic_accounting.TotalTerminatedProcesses,
+ "Expected basic_accounting.TotalTerminatedProcesses to be %d (terminated_proc) is %ld\n",
+ terminated_proc, basic_accounting.TotalTerminatedProcesses);
+ }
+}
static void test_IsProcessInJob(void)
{
@@ -2566,11 +2629,15 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 0);
+ test_accounting(job, 0, 0, 0);
out = TRUE;
ret = pIsProcessInJob(pi.hProcess, job2, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job2, 0);
+ test_accounting(job2, 0, 0, 0);
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
@@ -2579,11 +2646,15 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 1, pi.dwProcessId);
+ test_accounting(job, 1, 1, 0);
out = TRUE;
ret = pIsProcessInJob(pi.hProcess, job2, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job2, 0);
+ test_accounting(job2, 0, 0, 0);
out = FALSE;
ret = pIsProcessInJob(pi.hProcess, NULL, &out);
@@ -2597,6 +2668,8 @@ static void test_IsProcessInJob(void)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 0);
+ test_accounting(job, 1, 0, 0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -2613,11 +2686,15 @@ static void test_TerminateJobObject(void)
job = pCreateJobObjectW(NULL, NULL);
ok(job != NULL, "CreateJobObject error %lu\n", GetLastError());
+ test_assigned_proc(job, 0);
+ test_accounting(job, 0, 0, 0);
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
+ test_assigned_proc(job, 1, pi.dwProcessId);
+ test_accounting(job, 1, 1, 0);
ret = pTerminateJobObject(job, 123);
ok(ret, "TerminateJobObject error %lu\n", GetLastError());
@@ -2626,6 +2703,8 @@ static void test_TerminateJobObject(void)
dwret = WaitForSingleObject(pi.hProcess, 1000);
ok(dwret == WAIT_OBJECT_0, "WaitForSingleObject returned %lu\n", dwret);
if (dwret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0);
+ test_assigned_proc(job, 0);
+ test_accounting(job, 1, 0, 0);
ret = GetExitCodeProcess(pi.hProcess, &dwret);
ok(ret, "GetExitCodeProcess error %lu\n", GetLastError());
@@ -2643,6 +2722,8 @@ static void test_TerminateJobObject(void)
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(!ret, "AssignProcessToJobObject unexpectedly succeeded\n");
expect_eq_d(ERROR_ACCESS_DENIED, GetLastError());
+ test_assigned_proc(job, 0);
+ test_accounting(job, 1, 0, 0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
@@ -2841,11 +2922,15 @@ static void test_KillOnJobClose(void)
return;
}
ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
+ test_assigned_proc(job, 0);
+ test_accounting(job, 0, 0, 0);
create_process("wait", &pi);
ret = pAssignProcessToJobObject(job, pi.hProcess);
ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
+ test_assigned_proc(job, 1, pi.dwProcessId);
+ test_accounting(job, 1, 1, 0);
CloseHandle(job);
@@ -2955,6 +3040,8 @@ static HANDLE test_AddSelfToJob(void)
ret = pAssignProcessToJobObject(job, GetCurrentProcess());
ok(ret, "AssignProcessToJobObject error %lu\n", GetLastError());
+ test_assigned_proc(job, 1, GetCurrentProcessId());
+ test_accounting(job, 1, 1, 0);
return job;
}
@@ -2976,6 +3063,8 @@ static void test_jobInheritance(HANDLE job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 2, GetCurrentProcessId(), pi.dwProcessId);
+ test_accounting(job, 2, 2, 0);
wait_and_close_child_process(&pi);
}
@@ -3009,6 +3098,8 @@ static void test_BreakawayOk(HANDLE parent_job)
ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, &si, &pi);
ok(!ret, "CreateProcessA expected failure\n");
expect_eq_d(ERROR_ACCESS_DENIED, GetLastError());
+ test_assigned_proc(job, 1, GetCurrentProcessId());
+ test_accounting(job, 2, 1, 0);
if (ret)
{
@@ -3048,6 +3139,8 @@ static void test_BreakawayOk(HANDLE parent_job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 1, GetCurrentProcessId());
+ test_accounting(job, 2, 1, 0);
ret = pIsProcessInJob(pi.hProcess, parent_job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
@@ -3065,6 +3158,8 @@ static void test_BreakawayOk(HANDLE parent_job)
ret = pIsProcessInJob(pi.hProcess, job, &out);
ok(ret, "IsProcessInJob error %lu\n", GetLastError());
ok(!out, "IsProcessInJob returned out=%u\n", out);
+ test_assigned_proc(job, 1, GetCurrentProcessId());
+ test_accounting(job, 2, 1, 0);
wait_and_close_child_process(&pi);
--
2.35.1

View File

@@ -1,4 +1,4 @@
From d4f9fa0c33b6a414fe3b6c604f3039e98d416263 Mon Sep 17 00:00:00 2001
From a808aeb6fbb9c7cace366a262715607379ca1b58 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 9 Jul 2019 14:13:28 +1000
Subject: [PATCH] user32: Do not enumerate the registry in
@@ -13,10 +13,10 @@ not the complete list from the registry.
3 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 1fff29c7f87..9bf65573d87 100644
index 00337aa72b7..375ca3abee3 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -486,7 +486,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
@@ -497,7 +497,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
return FALSE;
}
@@ -25,11 +25,11 @@ index 1fff29c7f87..9bf65573d87 100644
{
SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 350baff600d..27066fc46f4 100644
index b92e59396ac..364afc08b26 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -5542,6 +5542,40 @@ static void test_keyboard_ll_hook_blocking(void)
ok_ret( 1, DestroyWindow( hwnd ) );
@@ -5637,6 +5637,40 @@ static void test_LoadKeyboardLayoutEx(void)
ok_eq( old_hkl, GetKeyboardLayout( 0 ), HKL, "%p" );
}
+static void test_GetKeyboardLayoutList(void)
@@ -69,7 +69,7 @@ index 350baff600d..27066fc46f4 100644
/* run the tests in a separate desktop to avoid interaction with other
* tests, current desktop state, or user actions. */
static void test_input_desktop( char **argv )
@@ -5633,6 +5667,7 @@ START_TEST(input)
@@ -5730,6 +5764,7 @@ START_TEST(input)
test_GetKeyState();
test_OemKeyScan();
test_rawinput(argv[0]);
@@ -78,10 +78,10 @@ index 350baff600d..27066fc46f4 100644
if(pGetMouseMovePointsEx)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index ef8d564c264..9a7c58f359d 100644
index 1886ff979d7..1834ae40441 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -1267,11 +1267,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
@@ -1266,11 +1266,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
*/
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
{
@@ -94,7 +94,7 @@ index ef8d564c264..9a7c58f359d 100644
HKL layout;
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
@@ -1285,33 +1281,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
@@ -1284,33 +1280,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
if (size && layouts)
{
layouts[count - 1] = layout;

View File

@@ -1,110 +0,0 @@
From 8a8068b5527ed4ab069a85a2d338454f4a58b887 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 25 Aug 2015 11:31:34 +0200
Subject: [PATCH] mscoree: Implement semi-stub for _CorValidateImage.
This is required in order to implement "proper" loader support for .NET executables.
(Yes, its intentional that both NTSTATUS and HRESULT values are returned, don't ask...)
---
dlls/mscoree/mscoree_main.c | 75 ++++++++++++++++++++++++++++++++++++-
1 file changed, 73 insertions(+), 2 deletions(-)
diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index 15bbc235207..cef566e49be 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -21,9 +21,12 @@
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
+#include "winternl.h"
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
@@ -258,8 +261,76 @@ VOID WINAPI _CorImageUnloading(PVOID imageBase)
HRESULT WINAPI _CorValidateImage(PVOID* imageBase, LPCWSTR imageName)
{
- TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
- return E_FAIL;
+ IMAGE_COR20_HEADER *cliheader;
+ IMAGE_NT_HEADERS *nt;
+ ULONG size;
+
+ TRACE("(%p, %s)\n", imageBase, debugstr_w(imageName));
+
+ if (!imageBase)
+ return E_INVALIDARG;
+
+ nt = RtlImageNtHeader(*imageBase);
+ if (!nt)
+ return STATUS_INVALID_IMAGE_FORMAT;
+
+ cliheader = RtlImageDirectoryEntryToData(*imageBase, TRUE, IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR, &size);
+ if (!cliheader || size < sizeof(*cliheader))
+ return STATUS_INVALID_IMAGE_FORMAT;
+
+#ifdef _WIN64
+ if (cliheader->Flags & COMIMAGE_FLAGS_32BITREQUIRED)
+ return STATUS_INVALID_IMAGE_FORMAT;
+
+ if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
+ {
+ if (cliheader->Flags & COMIMAGE_FLAGS_ILONLY)
+ {
+ DWORD *entry = &nt->OptionalHeader.AddressOfEntryPoint;
+ DWORD old_protect;
+
+ if (!VirtualProtect(entry, sizeof(*entry), PAGE_READWRITE, &old_protect))
+ return E_UNEXPECTED;
+ *entry = 0;
+ if (!VirtualProtect(entry, sizeof(*entry), old_protect, &old_protect))
+ return E_UNEXPECTED;
+ }
+
+ return STATUS_SUCCESS;
+ }
+
+ if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
+ {
+ if (!(cliheader->Flags & COMIMAGE_FLAGS_ILONLY))
+ return STATUS_INVALID_IMAGE_FORMAT;
+
+ FIXME("conversion of IMAGE_NT_HEADERS32 -> IMAGE_NT_HEADERS64 not implemented\n");
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
+#else
+ if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
+ {
+ if (cliheader->Flags & COMIMAGE_FLAGS_ILONLY)
+ {
+ DWORD *entry = &nt->OptionalHeader.AddressOfEntryPoint;
+ DWORD old_protect;
+
+ if (!VirtualProtect(entry, sizeof(*entry), PAGE_READWRITE, &old_protect))
+ return E_UNEXPECTED;
+ *entry = (nt->FileHeader.Characteristics & IMAGE_FILE_DLL) ?
+ ((DWORD_PTR)&_CorDllMain - (DWORD_PTR)*imageBase) :
+ ((DWORD_PTR)&_CorExeMain - (DWORD_PTR)*imageBase);
+ if (!VirtualProtect(entry, sizeof(*entry), old_protect, &old_protect))
+ return E_UNEXPECTED;
+ }
+
+ return STATUS_SUCCESS;
+ }
+
+#endif
+
+ return STATUS_INVALID_IMAGE_FORMAT;
}
HRESULT WINAPI GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
--
2.20.1

View File

@@ -1 +0,0 @@
Fixes: [38662] Implement mscoree._CorValidateImage for mono runtime

View File

@@ -1,33 +0,0 @@
From 19fd6f33b8e55707072feb5d08d0f62028265951 Mon Sep 17 00:00:00 2001
From: Mark Jansen <learn0more+wine@gmail.com>
Date: Fri, 13 Jan 2017 23:20:52 +0100
Subject: [PATCH] msi: Do not sign extend after multiplying.
Signed-off-by: Mark Jansen <learn0more+wine@gmail.com>
---
dlls/msi/dialog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 8825c28..97fc89c 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3200,13 +3200,13 @@ static LONGLONG msi_vcl_get_cost( msi_dialog *dialog )
MSICOSTTREE_SELFONLY, INSTALLSTATE_LOCAL, &each_cost)))
{
/* each_cost is in 512-byte units */
- total_cost += each_cost * 512;
+ total_cost += ((LONGLONG)each_cost) * 512;
}
if (ERROR_SUCCESS == (MSI_GetFeatureCost(dialog->package, feature,
MSICOSTTREE_SELFONLY, INSTALLSTATE_ABSENT, &each_cost)))
{
/* each_cost is in 512-byte units */
- total_cost -= each_cost * 512;
+ total_cost -= ((LONGLONG)each_cost) * 512;
}
}
return total_cost;
--
1.9.1

View File

@@ -1,20 +1,20 @@
From aba54e8536ab5423e8293452db6462dcca0bea0b Mon Sep 17 00:00:00 2001
From d683f0129b0df79227b23133874960284b76baa8 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 11 Sep 2020 17:55:59 +1000
Subject: [PATCH] include: Remove interfaces already define in msxml6.idl
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/msxml3/factory.c | 1 +
dlls/msxml3/factory.c | 3 +-
dlls/msxml3/tests/saxreader.c | 1 +
dlls/msxml3/tests/schema.c | 5 ++
dlls/msxml3/uuid.c | 11 ++++
include/msxml2.idl | 109 ----------------------------------
dlls/msxml3/uuid.c | 10 ++++
include/msxml2.idl | 101 ----------------------------------
include/msxml6.idl | 24 ++++----
6 files changed, 30 insertions(+), 121 deletions(-)
6 files changed, 29 insertions(+), 115 deletions(-)
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index c2d3cd30c60..243ee379712 100644
index e91666c6d79..e35839db2a3 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -31,6 +31,7 @@
@@ -25,6 +25,15 @@ index c2d3cd30c60..243ee379712 100644
#include "xmlparser.h"
/* undef the #define in msxml2 so that we can access the v.2 version
@@ -43,8 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
-extern GUID CLSID_XMLSchemaCache60;
-
typedef HRESULT (*ClassFactoryCreateInstanceFunc)(void**);
typedef HRESULT (*DOMFactoryCreateInstanceFunc)(MSXML_VERSION, void**);
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index e123d4eba5a..48cfa8f5593 100644
--- a/dlls/msxml3/tests/saxreader.c
@@ -38,7 +47,7 @@ index e123d4eba5a..48cfa8f5593 100644
#include "ocidl.h"
#include "dispex.h"
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index efc3a8e56e3..a4fe29aca02 100644
index 50e5a743b82..c83e72e136a 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -32,6 +32,11 @@
@@ -52,12 +61,12 @@ index efc3a8e56e3..a4fe29aca02 100644
+
#include "wine/test.h"
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static const WCHAR xdr_schema1_uri[] = L"x-schema:test1.xdr";
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
index 4abbe5e4763..333d4f3d3c7 100644
index 7e50b439146..7214d23c5dc 100644
--- a/dlls/msxml3/uuid.c
+++ b/dlls/msxml3/uuid.c
@@ -41,6 +41,17 @@
@@ -41,6 +41,16 @@
#include "initguid.h"
#include "msxml2.h"
@@ -69,14 +78,13 @@ index 4abbe5e4763..333d4f3d3c7 100644
+DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+
/*
* Note that because of a #define in msxml2.h, we end up initializing
* CLSID_DOMDocument2 to be the v.3 version independent DOMDocument
diff --git a/include/msxml2.idl b/include/msxml2.idl
index ede4113ecbf..85bb6a5b0cb 100644
index 848bc13952a..85bb6a5b0cb 100644
--- a/include/msxml2.idl
+++ b/include/msxml2.idl
@@ -1612,15 +1612,6 @@ coclass FreeThreadedDOMDocument40
@@ -125,22 +133,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("Server XML HTTP"),
progid("Msxml2.ServerXMLHTTP"),
@@ -1750,14 +1725,6 @@ coclass XMLSchemaCache40
[default] interface IXMLDOMSchemaCollection2;
}
-[
- uuid(88d96a07-f192-11d4-a65f-0040963251e5)
-]
-coclass XMLSchemaCache60
-{
- [default] interface IXMLDOMSchemaCollection2;
-}
-
[
helpstring("XML Schema Cache"),
progid("Msxml2.XMLSchemaCache"),
@@ -1798,14 +1765,6 @@ coclass XSLTemplate40
@@ -1790,14 +1765,6 @@ coclass XSLTemplate40
[default] interface IXSLTemplate;
}
@@ -155,7 +148,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("XSL Template"),
progid("Msxml2.XSLTemplate"),
@@ -3297,15 +3256,6 @@ coclass SAXXMLReader40
@@ -3289,15 +3256,6 @@ coclass SAXXMLReader40
interface ISAXXMLReader;
}
@@ -171,7 +164,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("SAX XML Reader"),
progid("Msxml2.SAXXMLReader"),
@@ -3380,26 +3330,6 @@ coclass MXHTMLWriter40
@@ -3372,26 +3330,6 @@ coclass MXHTMLWriter40
interface IVBSAXLexicalHandler;
}
@@ -198,7 +191,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("MXXMLWriter 3.0"),
progid("Msxml2.MXXMLWriter.3.0"),
@@ -3444,26 +3374,6 @@ coclass MXXMLWriter40
@@ -3436,26 +3374,6 @@ coclass MXXMLWriter40
interface IVBSAXLexicalHandler;
}
@@ -225,7 +218,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("MXXMLWriter"),
progid("Msxml2.MXXMLWriter"),
@@ -3506,15 +3416,6 @@ coclass MXNamespaceManager40
@@ -3498,15 +3416,6 @@ coclass MXNamespaceManager40
interface IMXNamespaceManager;
}
@@ -241,7 +234,7 @@ index ede4113ecbf..85bb6a5b0cb 100644
[
helpstring("SAXAttributes 3.0"),
progid("Msxml2.SAXAttributes.3.0"),
@@ -3539,16 +3440,6 @@ coclass SAXAttributes40
@@ -3531,16 +3440,6 @@ coclass SAXAttributes40
interface ISAXAttributes;
}
@@ -301,5 +294,5 @@ index d4a5c490243..7396826a1f6 100644
helpstring("XML HTTP 6.0"),
progid("Msxml2.XMLHTTP.6.0"),
--
2.41.0
2.43.0

View File

@@ -1,4 +1,4 @@
From b26ba4d86df312d28bc2422ed1e544b058e4aacd Mon Sep 17 00:00:00 2001
From c4694f8dfffa56648976c1a05bb4788262a8677b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 8 Sep 2020 18:43:52 +0200
Subject: [PATCH] msxml3: Implement FreeThreadedXMLHTTP60.
@@ -27,10 +27,10 @@ index 7e59a223143..5044c4e2c79 100644
SOURCES = \
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index 243ee379712..323c7b49848 100644
index 218ba87c4a8..ed14bd63a87 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -279,6 +279,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
@@ -281,6 +281,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create };
static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create };
@@ -38,7 +38,7 @@ index 243ee379712..323c7b49848 100644
static ClassFactory serverhttp = { { &ClassFactoryVtbl }, ServerXMLHTTP_create };
static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create };
static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create };
@@ -340,6 +341,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
@@ -342,6 +343,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
{
cf = &httpreqcf.IClassFactory_iface;
}
@@ -50,7 +50,7 @@ index 243ee379712..323c7b49848 100644
IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP30 ) ||
IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP40 ) ||
diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
index 459466a1234..d059c20ae81 100644
index 6e4ab4c6519..412958a2a40 100644
--- a/dlls/msxml3/httprequest.c
+++ b/dlls/msxml3/httprequest.c
@@ -37,10 +37,12 @@
@@ -67,7 +67,7 @@ index 459466a1234..d059c20ae81 100644
static const WCHAR colspaceW[] = {':',' ',0};
static const WCHAR crlfW[] = {'\r','\n',0};
@@ -2057,6 +2059,468 @@ static const struct IServerXMLHTTPRequestVtbl ServerXMLHTTPRequestVtbl =
@@ -2054,6 +2056,468 @@ static const struct IServerXMLHTTPRequestVtbl ServerXMLHTTPRequestVtbl =
ServerXMLHTTPRequest_setOption
};
@@ -536,7 +536,7 @@ index 459466a1234..d059c20ae81 100644
static void init_httprequest(httprequest *req)
{
req->IXMLHTTPRequest_iface.lpVtbl = &XMLHTTPRequestVtbl;
@@ -2106,6 +2570,35 @@ HRESULT XMLHTTPRequest_create(void **obj)
@@ -2103,6 +2567,35 @@ HRESULT XMLHTTPRequest_create(void **obj)
return S_OK;
}
@@ -573,10 +573,10 @@ index 459466a1234..d059c20ae81 100644
{
serverhttp *req;
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index 449a86df5e8..3e5181fa6d8 100644
index 54f54995c76..6188414c5ce 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -344,6 +344,7 @@ extern HRESULT XMLDocument_create(void**);
@@ -343,6 +343,7 @@ extern HRESULT XMLDocument_create(void**);
extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**);
extern HRESULT SAXAttributes_create(MSXML_VERSION, void**);
extern HRESULT XMLHTTPRequest_create(void **);
@@ -1017,7 +1017,7 @@ index bccfbaf582a..23d7680d196 100644
CoUninitialize();
}
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
index a4fe29aca02..fd244ee2e1c 100644
index c83e72e136a..c896f1e6a04 100644
--- a/dlls/msxml3/tests/schema.c
+++ b/dlls/msxml3/tests/schema.c
@@ -32,10 +32,16 @@
@@ -1038,7 +1038,7 @@ index a4fe29aca02..fd244ee2e1c 100644
#include "wine/test.h"
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
index 333d4f3d3c7..1b4f0452c5f 100644
index 7214d23c5dc..320a7e04fa3 100644
--- a/dlls/msxml3/uuid.c
+++ b/dlls/msxml3/uuid.c
@@ -43,6 +43,7 @@
@@ -1049,9 +1049,9 @@ index 333d4f3d3c7..1b4f0452c5f 100644
DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
@@ -51,6 +52,10 @@ DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0
@@ -50,6 +51,10 @@ DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x
DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04);
+DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c);
@@ -1101,5 +1101,5 @@ index 7396826a1f6..b2d8bd3b337 100644
helpstring("XML DOM Document 6.0"),
progid("Msxml2.DOMDocument.6.0"),
--
2.42.0
2.43.0

View File

@@ -1,4 +1,4 @@
From 4dd82c635bcf8c2c7d070d6c5786787ff2d7d887 Mon Sep 17 00:00:00 2001
From 49fa193ec777f68372b549752482ef82fb63a7b7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 5 Aug 2017 03:38:38 +0200
Subject: [PATCH] ntdll: Add inline versions of RtlEnterCriticalSection /
@@ -9,20 +9,20 @@ Subject: [PATCH] ntdll: Add inline versions of RtlEnterCriticalSection /
1 file changed, 34 insertions(+)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index a7967a6c242..8b088f9d3c3 100644
index 171ded98c67..54a65e3bae5 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -28,6 +28,7 @@
#include "winnt.h"
@@ -29,6 +29,7 @@
#include "winternl.h"
#include "rtlsupportapi.h"
#include "unixlib.h"
+#include "wine/debug.h"
#include "wine/asm.h"
#define DECLARE_CRITICAL_SECTION(cs) \
@@ -94,6 +95,39 @@ extern struct _KUSER_SHARED_DATA *user_shared_data;
extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, va_list args );
extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, va_list args );
#define MAX_NT_PATH_LENGTH 277
@@ -106,6 +107,39 @@ extern void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *
extern struct _KUSER_SHARED_DATA *user_shared_data;
+/* inline version of RtlEnterCriticalSection */
+static inline void enter_critical_section( RTL_CRITICAL_SECTION *crit )
@@ -57,9 +57,9 @@ index a7967a6c242..8b088f9d3c3 100644
+ }
+}
+
struct dllredirect_data
{
ULONG size;
#ifdef _WIN64
static inline TEB64 *NtCurrentTeb64(void) { return NULL; }
#else
--
2.42.0
2.43.0

View File

@@ -1,4 +1,4 @@
From 9abcf9173358a37b01ea189f80f841af35307922 Mon Sep 17 00:00:00 2001
From 43ca4e4a3c633d405b3d282badb028c4250f942d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 30 May 2015 02:23:15 +0200
Subject: [PATCH] ntdll: Add support for hiding wine version information from
@@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Add support for hiding wine version information from
2 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 8e2b3282a75..5cb6b48e7ae 100644
index fbad84d2c36..5afeb0f63b0 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -88,6 +88,9 @@ const WCHAR system_dir[] = L"C:\\windows\\system32\\";
@@ -87,6 +87,9 @@ const WCHAR system_dir[] = L"C:\\windows\\system32\\";
/* system search path */
static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows";
@@ -23,7 +23,7 @@ index 8e2b3282a75..5cb6b48e7ae 100644
static BOOL is_prefix_bootstrap; /* are we bootstrapping the prefix? */
static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
@@ -107,6 +110,8 @@ struct dll_dir_entry
@@ -106,6 +109,8 @@ struct dll_dir_entry
static struct list dll_dir_list = LIST_INIT( dll_dir_list ); /* extra dirs from LdrAddDllDirectory */
@@ -32,7 +32,7 @@ index 8e2b3282a75..5cb6b48e7ae 100644
struct ldr_notification
{
struct list entry;
@@ -1978,6 +1983,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
@@ -2030,6 +2035,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
}
@@ -129,7 +129,7 @@ index 8e2b3282a75..5cb6b48e7ae 100644
/******************************************************************
* LdrGetProcedureAddress (NTDLL.@)
*/
@@ -1997,7 +2092,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
@@ -2050,7 +2145,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
{
void *proc = name ? find_named_export( module, exports, exp_size, name->Buffer, -1, NULL )
: find_ordinal_export( module, exports, exp_size, ord - exports->Base, NULL );
@@ -138,7 +138,7 @@ index 8e2b3282a75..5cb6b48e7ae 100644
{
*address = proc;
ret = STATUS_SUCCESS;
@@ -2235,6 +2330,8 @@ static void build_ntdll_module( HMODULE module )
@@ -2311,6 +2406,8 @@ static void build_ntdll_module(void)
wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS;
node_ntdll = wm->ldr.DdagNode;
if (TRACE_ON(relay)) RELAY_SetupDLL( module );
@@ -148,12 +148,12 @@ index 8e2b3282a75..5cb6b48e7ae 100644
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 8801c518039..78ff79625ea 100644
index cffe27d847c..d3c4a9cae68 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -153,6 +153,11 @@ static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiB
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
@@ -145,6 +145,11 @@ static inline TEB64 *NtCurrentTeb64(void) { return NULL; }
static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiBatchCount; }
#endif
+/* version */
+extern const char * CDECL wine_get_version(void);
@@ -164,5 +164,5 @@ index 8801c518039..78ff79625ea 100644
static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
{
--
2.38.1
2.43.0

View File

@@ -1,4 +1,4 @@
From ed0b9682a8e134eeefa4186b930a92843383b8b1 Mon Sep 17 00:00:00 2001
From ef771cfa26c9d15568d0711073145b3cf11c6b5a Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 20:56:49 -0700
Subject: [PATCH] ntdll: Add support for creating reparse points.
@@ -13,10 +13,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
5 files changed, 451 insertions(+), 19 deletions(-)
diff --git a/configure.ac b/configure.ac
index 475743bc121..c82d6ec371b 100644
index 417b1a63a13..88e53b11c05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2089,6 +2089,8 @@ AC_CHECK_FUNCS(\
@@ -2084,6 +2084,8 @@ AC_CHECK_FUNCS(\
prctl \
proc_pidinfo \
sched_yield \
@@ -26,7 +26,7 @@ index 475743bc121..c82d6ec371b 100644
setprogname \
sigprocmask \
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index d3f2a0e5523..74e6da5bb56 100644
index b519bcd655f..f71f79b9f5f 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -4,7 +4,7 @@ UNIXLIB = ntdll.so
@@ -39,7 +39,7 @@ index d3f2a0e5523..74e6da5bb56 100644
EXTRADLLFLAGS = -nodefaultlibs
i386_EXTRADLLFLAGS = -Wl,--image-base,0x7bc00000
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index da3611f74f2..5889bebace4 100644
index 9dd49c925b7..89d65bf6f46 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -38,6 +38,7 @@
@@ -50,7 +50,7 @@ index da3611f74f2..5889bebace4 100644
#ifndef IO_COMPLETION_ALL_ACCESS
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
@@ -5803,32 +5804,154 @@ static void test_mailslot_name(void)
@@ -5854,32 +5855,154 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@@ -101,7 +101,9 @@ index da3611f74f2..5889bebace4 100644
+ INT buffer_len;
+ HANDLE handle;
+ BOOL bret;
+
- pRtlInitUnicodeString( &nameW, L"\\??\\C:\\" );
- InitializeObjectAttributes( &attr, &nameW, 0, NULL, NULL );
+ /* Create a temporary folder for the junction point tests */
+ GetTempFileNameW(dotW, fooW, 0, path);
+ DeleteFileW(path);
@@ -110,7 +112,9 @@ index da3611f74f2..5889bebace4 100644
+ win_skip("Unable to create a temporary junction point directory.\n");
+ return;
+ }
+
- status = pNtOpenFile( &handle, READ_CONTROL, &attr, &io, 0, 0 );
- ok( !status, "open %s failed %#lx\n", wine_dbgstr_w(nameW.Buffer), status );
+ /* Check that the volume this folder is located on supports junction points */
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
+ volW[0] = nameW.Buffer[4];
@@ -127,15 +131,17 @@ index da3611f74f2..5889bebace4 100644
+ RemoveDirectoryW(path);
+ return;
+ }
+
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, NULL, 0 );
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
+ /* Create the folder to be replaced by a junction point */
+ lstrcpyW(reparse_path, path);
+ lstrcatW(reparse_path, reparseW);
+ bret = CreateDirectoryW(reparse_path, NULL);
+ ok(bret, "Failed to create junction point directory.\n");
- pRtlInitUnicodeString( &nameW, L"\\??\\C:\\" );
- InitializeObjectAttributes( &attr, &nameW, 0, NULL, NULL );
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 0 );
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
+ /* Create a destination folder for the junction point to target */
+ lstrcpyW(target_path, path);
+ for (int i=0; i<1; i++)
@@ -148,8 +154,9 @@ index da3611f74f2..5889bebace4 100644
+ ok(bret, "Failed to create junction point target directory.\n");
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
- status = pNtOpenFile( &handle, READ_CONTROL, &attr, &io, 0, 0 );
- ok( !status, "open %s failed %#lx\n", wine_dbgstr_w(nameW.Buffer), status );
- /* a volume cannot be a reparse point by definition */
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 1 );
- ok( status == STATUS_NOT_A_REPARSE_POINT, "expected %#lx, got %#lx\n", STATUS_NOT_A_REPARSE_POINT, status );
+ /* construct a too long pathname (resulting reparse buffer over 16 kiB limit) */
+ long_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32767);
+ lstrcpyW(long_path, nameW.Buffer);
@@ -159,7 +166,8 @@ index da3611f74f2..5889bebace4 100644
+ lstrcatW(long_path, path);
+ }
+ lstrcatW(long_path, targetW);
+
- CloseHandle( handle );
+ /* Create the junction point */
+ handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@@ -173,9 +181,7 @@ index da3611f74f2..5889bebace4 100644
+ ok(!bret && GetLastError()==ERROR_INVALID_REPARSE_DATA, "Unexpected error (0x%lx)\n", GetLastError());
+ HeapFree(GetProcessHeap(), 0, buffer);
+ CloseHandle(handle);
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, NULL, 0 );
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
+
+ /* construct a long pathname to demonstrate correct behavior with very large reparse points */
+ pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
+ lstrcpyW(long_path, nameW.Buffer);
@@ -185,16 +191,11 @@ index da3611f74f2..5889bebace4 100644
+ lstrcatW(long_path, path);
+ }
+ lstrcatW(long_path, targetW);
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 0 );
- ok( status == STATUS_INVALID_USER_BUFFER, "expected %#lx, got %#lx\n", STATUS_INVALID_USER_BUFFER, status );
+
+ /* use a sane (not obscenely long) target for the rest of testing */
+ pRtlFreeUnicodeString(&nameW);
+ pRtlDosPathNameToNtPathName_U(target_path, &nameW, NULL, NULL);
- /* a volume cannot be a reparse point by definition */
- status = pNtFsControlFile( handle, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT, NULL, 0, reparse_data, 1 );
- ok( status == STATUS_NOT_A_REPARSE_POINT, "expected %#lx, got %#lx\n", STATUS_NOT_A_REPARSE_POINT, status );
+
+ /* Create the junction point */
+ handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@@ -207,8 +208,7 @@ index da3611f74f2..5889bebace4 100644
+ bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
+ ok(bret, "Failed to create junction point! (0x%lx)\n", GetLastError());
+ CloseHandle(handle);
- CloseHandle( handle );
+
+cleanup:
+ /* Cleanup */
+ pRtlFreeUnicodeString(&nameW);
@@ -222,7 +222,7 @@ index da3611f74f2..5889bebace4 100644
}
START_TEST(file)
@@ -5908,6 +6031,6 @@ START_TEST(file)
@@ -5960,6 +6083,6 @@ START_TEST(file)
test_ioctl();
test_query_ea();
test_flush_buffers_file();
@@ -231,7 +231,7 @@ index da3611f74f2..5889bebace4 100644
+ test_mailslot_name();
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ee68e4dee9b..2b5ab4e232a 100644
index d292d934efa..d67983ffac7 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -36,6 +36,8 @@
@@ -434,7 +434,7 @@ index ee68e4dee9b..2b5ab4e232a 100644
+ }
+ encoded_len = encode_base64url( (const char *)buffer, buffer_len, encoded );
+
+ TRACE( "Linking %s to %s\n", unix_src, encoded );
+ TRACE( "Linking %s to %s\n", debugstr_a(unix_src), encoded );
+ strcpy( filename_buf, unix_src );
+ filename = basename( filename_buf );
+
@@ -571,7 +571,7 @@ index ee68e4dee9b..2b5ab4e232a 100644
/******************************************************************************
* lookup_unix_name
*
@@ -6153,6 +6448,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6181,6 +6476,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@@ -1,4 +1,4 @@
From c491128fb95c0aaf54cc917061d46910b7bd2e4a Mon Sep 17 00:00:00 2001
From f1675a9b37980cafd0b6f76e23ef8b042b60bb1e Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sun, 4 Sep 2022 13:19:16 -0600
Subject: [PATCH] ntdll: Allow reparse points to target the applicable Unix
@@ -13,10 +13,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 129 insertions(+)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 71311bec9c9..28aa839b34a 100644
index f2e182d9076..63a27b89e20 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3581,6 +3581,125 @@ static NTSTATUS get_reparse_target( UNICODE_STRING *nt_target, REPARSE_DATA_BUFF
@@ -3577,6 +3577,125 @@ static NTSTATUS get_reparse_target( UNICODE_STRING *nt_target, REPARSE_DATA_BUFF
}
@@ -126,7 +126,7 @@ index 71311bec9c9..28aa839b34a 100644
+ for (;is_relative && depth > 0; depth--)
+ strcat( target_path, "../" );
+ strcat( target_path, &unix_target[relative_offset] );
+ TRACE( "adding reparse point target: %s\n", target_path );
+ TRACE( "adding reparse point target: %s\n", debugstr_a(target_path) );
+ symlinkat( target_path, dirfd, link_path );
+ }
+ free( unix_target );
@@ -142,7 +142,7 @@ index 71311bec9c9..28aa839b34a 100644
/*
* Retrieve the unix name corresponding to a file handle, remove that directory, and then symlink
* the requested directory to the location of the old directory.
@@ -3714,6 +3833,16 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -3710,6 +3829,16 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
link_dir_fd = fd;
}
@@ -160,5 +160,5 @@ index 71311bec9c9..28aa839b34a 100644
if (!renameat2( -1, tmplink, -1, unix_src, RENAME_EXCHANGE ))
{
--
2.40.1
2.43.0

Some files were not shown because too many files have changed in this diff Show More