You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
445948eee3 | ||
|
50bad5b9af | ||
|
eb8cc143d6 | ||
|
680ab2f323 | ||
|
9a4fd0b9b0 | ||
|
aa8b27c396 | ||
|
daf7cb4cb9 | ||
|
9e265ac738 | ||
|
ec3dd19d45 | ||
|
1ba0c55d0d | ||
|
7d2ceeab63 | ||
|
445ab8ff01 | ||
|
64f5451ac7 | ||
|
0b083c6f73 | ||
|
d999a6d250 | ||
|
6a02ba0240 | ||
|
ff5fc9c0fa | ||
|
21b92f9611 | ||
|
3d69e00892 | ||
|
6d50e5c435 | ||
|
dd22e6eb1d | ||
|
e768e46a86 | ||
|
34eb04e7cc | ||
|
91d4974f10 |
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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, ¶ms );
|
||||
+ return copy_file( source, dest, ¶ms, progress );
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [38662] Implement mscoree._CorValidateImage for mono runtime
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 236c1c30f4cf4550a6fc50d3a5be050ec79bac53 Mon Sep 17 00:00:00 2001
|
||||
From 1f891d01326bcb1b7bf6bcaa35f6f10d311fe660 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Sat, 6 Feb 2021 16:16:17 -0700
|
||||
Subject: [PATCH] ntdll: Add an intermediary prefix symlink in reparse point
|
||||
@@ -10,7 +10,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
1 file changed, 39 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 5d7095086d9..6422bdc5ec1 100644
|
||||
index 63a27b89e20..a15c5e19dcb 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -3577,6 +3577,18 @@ static NTSTATUS get_reparse_target( UNICODE_STRING *nt_target, REPARSE_DATA_BUFF
|
||||
@@ -61,7 +61,7 @@ index 5d7095086d9..6422bdc5ec1 100644
|
||||
+ if (append_prefix)
|
||||
+ strcat( target_path, prefix_string );
|
||||
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 );
|
||||
@@ -3887,6 +3914,7 @@ cleanup:
|
||||
NTSTATUS get_reparse_point_unix(const char *unix_name, REPARSE_DATA_BUFFER *buffer, ULONG *size)
|
||||
|
@@ -0,0 +1,26 @@
|
||||
From 3d340d4f31aa1cb3ad6cd9e7a59118e84ab040f1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
|
||||
Date: Fri, 8 Mar 2024 17:52:24 -0600
|
||||
Subject: [PATCH] ntdll: Trigger write watches on the "info" pointer in
|
||||
SystemInterruptInformation.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/system.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
|
||||
index 4c6c4cd23e2..9dc1ff80152 100644
|
||||
--- a/dlls/ntdll/unix/system.c
|
||||
+++ b/dlls/ntdll/unix/system.c
|
||||
@@ -2943,7 +2943,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
||||
len = peb->NumberOfProcessors * sizeof(SYSTEM_INTERRUPT_INFORMATION);
|
||||
if (size >= len)
|
||||
{
|
||||
- if (!info) ret = STATUS_ACCESS_VIOLATION;
|
||||
+ if (!info || !virtual_check_buffer_for_write( info, len )) ret = STATUS_ACCESS_VIOLATION;
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_GETRANDOM
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From c0c14c70039d65f61a73d37950f72d8c66bbc2f0 Mon Sep 17 00:00:00 2001
|
||||
From 92c5616bf7048e9d69010a473fa5fd65db43a6fc Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 26 Apr 2016 13:15:41 +0800
|
||||
Subject: [PATCH] oleaut32: Add support for loading and saving EMF to IPicture
|
||||
@@ -6,15 +6,15 @@ Subject: [PATCH] oleaut32: Add support for loading and saving EMF to IPicture
|
||||
|
||||
For bug #40523.
|
||||
---
|
||||
dlls/oleaut32/olepicture.c | 51 ++++++++++++++++++++++++++++++++++++----
|
||||
dlls/oleaut32/tests/olepicture.c | 5 +---
|
||||
2 files changed, 47 insertions(+), 9 deletions(-)
|
||||
dlls/oleaut32/olepicture.c | 53 +++++++++++++++++++++++++++++---
|
||||
dlls/oleaut32/tests/olepicture.c | 5 +--
|
||||
2 files changed, 49 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index a2a54bd..3fd7638 100644
|
||||
index 78fd3fc5681..91327f78eef 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -266,6 +266,18 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
|
||||
@@ -256,6 +256,18 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index a2a54bd..3fd7638 100644
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_Construct
|
||||
*
|
||||
@@ -349,8 +361,7 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu
|
||||
@@ -339,8 +351,7 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu
|
||||
break;
|
||||
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
@@ -43,25 +43,30 @@ index a2a54bd..3fd7638 100644
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1758,6 +1769,17 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
|
||||
@@ -1760,6 +1771,22 @@ static BOOL serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
|
||||
return success;
|
||||
}
|
||||
|
||||
+static BOOL serializeEMF(HENHMETAFILE hemf, void **buf, unsigned *size)
|
||||
+static HRESULT serializeEMF(HENHMETAFILE hemf, void **buf, unsigned *size)
|
||||
+{
|
||||
+ *size = GetEnhMetaFileBits(hemf, 0, NULL);
|
||||
+ if (!*size) return FALSE;
|
||||
+ if (!(*size = GetEnhMetaFileBits(hemf, 0, NULL)))
|
||||
+ return E_FAIL;
|
||||
+
|
||||
+ *buf = HeapAlloc(GetProcessHeap(), 0, *size);
|
||||
+ if (!*buf) return FALSE;
|
||||
+ if (!(*buf = HeapAlloc(GetProcessHeap(), 0, *size)))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ return GetEnhMetaFileBits(hemf, *size, *buf) != 0;
|
||||
+ if (!GetEnhMetaFileBits(hemf, *size, *buf))
|
||||
+ {
|
||||
+ HeapFree(GetProcessHeap(), 0, *buf);
|
||||
+ return E_FAIL;
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
static HRESULT WINAPI OLEPictureImpl_Save(
|
||||
IPersistStream* iface,IStream*pStm,BOOL fClearDirty)
|
||||
{
|
||||
@@ -1833,12 +1855,31 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
||||
@@ -1831,12 +1858,28 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
||||
IStream_Write(pStm, This->data, This->datalen, &dummy);
|
||||
hResult = S_OK;
|
||||
break;
|
||||
@@ -69,12 +74,9 @@ index a2a54bd..3fd7638 100644
|
||||
+ case PICTYPE_ENHMETAFILE:
|
||||
+ if (This->bIsDirty || !This->data)
|
||||
+ {
|
||||
+ serializeResult = serializeEMF(This->desc.emf.hemf, &pIconData, &iDataSize);
|
||||
+ if (!serializeResult)
|
||||
+ {
|
||||
+ hResult = E_FAIL;
|
||||
+ hResult = serializeEMF(This->desc.emf.hemf, &pIconData, &iDataSize);
|
||||
+ if (hResult != S_OK)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, This->data);
|
||||
+ This->data = pIconData;
|
||||
@@ -97,10 +99,10 @@ index a2a54bd..3fd7638 100644
|
||||
FIXME("(%p,%p,%d), [unknown type] not implemented!\n",This,pStm,fClearDirty);
|
||||
break;
|
||||
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
|
||||
index 2498910..dcbd088 100644
|
||||
index af2c9255e3c..f19ef01c773 100644
|
||||
--- a/dlls/oleaut32/tests/olepicture.c
|
||||
+++ b/dlls/oleaut32/tests/olepicture.c
|
||||
@@ -1471,21 +1471,18 @@ todo_wine
|
||||
@@ -1546,21 +1546,18 @@ todo_wine
|
||||
ok(hr == S_OK, "QueryInterface error %#x\n", hr);
|
||||
|
||||
hr = IPersistStream_Save(src_stream, dst_stream, TRUE);
|
||||
@@ -124,5 +126,5 @@ index 2498910..dcbd088 100644
|
||||
GlobalFree(hmem);
|
||||
|
||||
--
|
||||
1.9.1
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From a9c768a74e8ecbe857dfb851e35c62d5447f8d10 Mon Sep 17 00:00:00 2001
|
||||
From 7b40ae4316f61b52e0ad740bb1ba0a32e6545a40 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 24 Nov 2015 17:22:02 +0800
|
||||
Subject: [PATCH] oleaut32: Implement a better stub for IPicture::SaveAsFile.
|
||||
@@ -12,10 +12,10 @@ For bug 8532.
|
||||
2 files changed, 79 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index bbc5e2aa9c8..0410d2b3cad 100644
|
||||
index 6e0db65a101..48d7ae13846 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -832,19 +832,6 @@ static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface)
|
||||
@@ -819,19 +819,6 @@ static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ index bbc5e2aa9c8..0410d2b3cad 100644
|
||||
/************************************************************************
|
||||
* OLEPictureImpl_get_Attributes
|
||||
*/
|
||||
@@ -1887,6 +1874,85 @@ static HRESULT WINAPI OLEPictureImpl_GetSizeMax(
|
||||
return E_NOTIMPL;
|
||||
@@ -1891,6 +1878,85 @@ static HRESULT WINAPI OLEPictureImpl_GetSizeMax(IPersistStream *iface, ULARGE_IN
|
||||
return hr;
|
||||
}
|
||||
|
||||
+/************************************************************************
|
||||
@@ -122,10 +122,10 @@ index bbc5e2aa9c8..0410d2b3cad 100644
|
||||
/************************************************************************
|
||||
* IDispatch
|
||||
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
|
||||
index beafb98b28f..e0fb3bb3cd8 100644
|
||||
index a269491fd3f..97c80027b99 100644
|
||||
--- a/dlls/oleaut32/tests/olepicture.c
|
||||
+++ b/dlls/oleaut32/tests/olepicture.c
|
||||
@@ -1178,18 +1178,14 @@ static void test_load_save_bmp(void)
|
||||
@@ -1231,18 +1231,14 @@ static void test_load_save_bmp(void)
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, TRUE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
@@ -144,7 +144,7 @@ index beafb98b28f..e0fb3bb3cd8 100644
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
offset.QuadPart = 0;
|
||||
@@ -1256,15 +1252,12 @@ static void test_load_save_icon(void)
|
||||
@@ -1317,15 +1313,12 @@ static void test_load_save_icon(void)
|
||||
todo_wine
|
||||
ok(size == 766, "expected 766, got %ld\n", size);
|
||||
mem = GlobalLock(hmem);
|
||||
@@ -160,7 +160,7 @@ index beafb98b28f..e0fb3bb3cd8 100644
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
offset.QuadPart = 0;
|
||||
@@ -1330,13 +1323,11 @@ static void test_load_save_empty_picture(void)
|
||||
@@ -1399,13 +1392,11 @@ static void test_load_save_empty_picture(void)
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, TRUE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
@@ -175,5 +175,5 @@ index beafb98b28f..e0fb3bb3cd8 100644
|
||||
|
||||
hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream);
|
||||
--
|
||||
2.35.1
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e6f8042ee351aa6821639a1d99e003e8425c36e9 Mon Sep 17 00:00:00 2001
|
||||
From 908557cc6bdd74e9e91cd984b82688e004dcda54 Mon Sep 17 00:00:00 2001
|
||||
From: Damjan Jovanovic <damjan.jov@gmail.com>
|
||||
Date: Sat, 29 Feb 2020 09:21:55 +0200
|
||||
Subject: [PATCH] oleaut32: preferentially load icons having the desired size
|
||||
@@ -16,14 +16,14 @@ Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
|
||||
|
||||
Updated to default 32 when x/y are LP_DEFAULT.
|
||||
---
|
||||
dlls/oleaut32/olepicture.c | 22 ++++++++++++++++++----
|
||||
1 file changed, 18 insertions(+), 4 deletions(-)
|
||||
dlls/oleaut32/olepicture.c | 23 +++++++++++++++++++----
|
||||
1 file changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index 535a16146aa..05ad1137296 100644
|
||||
index 6e0db65a101..32645f5d2d5 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -151,6 +151,8 @@ typedef struct OLEPictureImpl {
|
||||
@@ -149,6 +149,8 @@ typedef struct OLEPictureImpl {
|
||||
BOOL bIsDirty; /* Set to TRUE if picture has changed */
|
||||
unsigned int loadtime_magic; /* If a length header was found, saves value */
|
||||
unsigned int loadtime_format; /* for PICTYPE_BITMAP only, keeps track of image format (GIF/BMP/JPEG) */
|
||||
@@ -32,7 +32,7 @@ index 535a16146aa..05ad1137296 100644
|
||||
} OLEPictureImpl;
|
||||
|
||||
static inline OLEPictureImpl *impl_from_IPicture(IPicture *iface)
|
||||
@@ -1190,14 +1192,20 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
|
||||
@@ -1222,14 +1224,20 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
|
||||
return E_FAIL;
|
||||
}
|
||||
i=0;
|
||||
@@ -57,7 +57,7 @@ index 535a16146aa..05ad1137296 100644
|
||||
if (i==cifd->idCount) i=0;
|
||||
}
|
||||
if (xread < cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize)
|
||||
@@ -2356,6 +2364,7 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
|
||||
@@ -2313,14 +2321,21 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
|
||||
{
|
||||
LPPERSISTSTREAM ps;
|
||||
IPicture *newpic;
|
||||
@@ -65,7 +65,9 @@ index 535a16146aa..05ad1137296 100644
|
||||
HRESULT hr;
|
||||
|
||||
FIXME("%p, %ld, %d, %s, %lu, %lu, %#lx, %p, partially implemented.\n",
|
||||
@@ -2364,6 +2373,11 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
|
||||
lpstream, lSize, fRunmode, debugstr_guid(riid), xsiz, ysiz, flags, ppvObj);
|
||||
+ /* hack to prevent this patch from applying in the wrong place */
|
||||
|
||||
hr = OleCreatePictureIndirect(NULL,riid,!fRunmode,(LPVOID*)&newpic);
|
||||
if (hr != S_OK)
|
||||
return hr;
|
||||
@@ -78,5 +80,5 @@ index 535a16146aa..05ad1137296 100644
|
||||
if (hr != S_OK) {
|
||||
ERR("Could not get IPersistStream iface from Ole Picture?\n");
|
||||
--
|
||||
2.40.1
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,42 +0,0 @@
|
||||
From 6b5ac1e9eaf73aa0d6dddf8e7f53bd9802a25f5b Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 16 Oct 2016 03:21:42 +0200
|
||||
Subject: [PATCH] server: Improve STATUS_CANNOT_DELETE checks for directory
|
||||
case.
|
||||
|
||||
---
|
||||
server/fd.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 784a8c08867..d238c43cf1f 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -1825,6 +1825,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
int root_fd = -1;
|
||||
int rw_mode;
|
||||
char *path;
|
||||
+ int created = (flags & O_CREAT);
|
||||
|
||||
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
|
||||
((options & FILE_DIRECTORY_FILE) && (flags & O_TRUNC)))
|
||||
@@ -1863,6 +1864,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
file_set_error();
|
||||
goto error;
|
||||
}
|
||||
+ created = 0;
|
||||
}
|
||||
flags &= ~(O_CREAT | O_EXCL | O_TRUNC);
|
||||
}
|
||||
@@ -1955,7 +1957,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
}
|
||||
|
||||
/* can't unlink files if we don't have permission to access */
|
||||
- if ((options & FILE_DELETE_ON_CLOSE) && !(flags & O_CREAT) &&
|
||||
+ if ((options & FILE_DELETE_ON_CLOSE) && !created &&
|
||||
!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
|
||||
{
|
||||
set_error( STATUS_CANNOT_DELETE );
|
||||
--
|
||||
2.25.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user