Rebase against 1513c706341a6c04ddfa8b1998a346d343fc4983.

[ntdll-RtlSetCurrentDirectory_U]
Removed patch to open current working directory with FILE_TRAVERSE access
(accepted upstream).

[server-Win32_Prefix]
Removed patch to allow to create win23 prefix when directory already exists
(accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-09-22 21:26:51 +02:00
parent 1281216a26
commit 00fbf6afc8
8 changed files with 19 additions and 227 deletions

View File

@ -1,4 +1,4 @@
From 86ff91dc33ace73a88368efbd5019500b153d8eb Mon Sep 17 00:00:00 2001
From 11664cbe8489c457a4b286253155ba6837269953 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 23 Jan 2016 21:05:14 +0100
Subject: api-ms-win-rtcore-ntuser-window-l1-1-0: Add dll
@ -13,17 +13,17 @@ Subject: api-ms-win-rtcore-ntuser-window-l1-1-0: Add dll
create mode 100644 dlls/api-ms-win-rtcore-ntuser-window-l1-1-0/api-ms-win-rtcore-ntuser-window-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index c31ebf8..67d826a 100644
index 6685769..356dd05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2749,6 +2749,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-classicprovider-l1-1-0)
@@ -2782,6 +2782,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-controller-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0)
+WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-window-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-audit-l1-1-1)
WINE_CONFIG_DLL(api-ms-win-security-base-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-base-l1-2-0)
WINE_CONFIG_DLL(api-ms-win-security-lsalookup-l1-1-0)
diff --git a/dlls/api-ms-win-rtcore-ntuser-window-l1-1-0/Makefile.in b/dlls/api-ms-win-rtcore-ntuser-window-l1-1-0/Makefile.in
new file mode 100644
index 0000000..9641c2a
@ -119,10 +119,10 @@ index 0000000..b7575c6
+@ stdcall WaitMessage() user32.WaitMessage
+@ stdcall WindowFromPoint(int64) user32.WindowFromPoint
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 0f299c5..7678d54 100755
index 1b1e722..56c813a 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -249,6 +249,7 @@ my @dll_groups =
@@ -269,6 +269,7 @@ my @dll_groups =
"api-ms-win-core-string-l2-1-0",
"api-ms-win-downlevel-user32-l1-1-0",
"api-ms-win-ntuser-dc-access-l1-1-0",

View File

@ -1,4 +1,4 @@
From 6d55805327e47fe237814aa4944fe5c7bb5f142a Mon Sep 17 00:00:00 2001
From c67410351d98e086e96dba69cc1a5f351939c017 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 23 Jan 2016 21:08:48 +0100
Subject: api-ms-win-rtcore-ntuser-draw-l1-1-0: Add dll.
@ -13,17 +13,17 @@ Subject: api-ms-win-rtcore-ntuser-draw-l1-1-0: Add dll.
create mode 100644 dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/api-ms-win-rtcore-ntuser-draw-l1-1-0.spec
diff --git a/configure.ac b/configure.ac
index 4a67c23..aa2181d 100644
index c6914fa..78bbc39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2749,6 +2749,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-classicprovider-l1-1-0)
@@ -2782,6 +2782,7 @@ WINE_CONFIG_DLL(api-ms-win-eventing-controller-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventing-provider-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-eventlog-legacy-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-ntuser-dc-access-l1-1-0)
+WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-draw-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-rtcore-ntuser-window-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-audit-l1-1-1)
WINE_CONFIG_DLL(api-ms-win-security-base-l1-1-0)
WINE_CONFIG_DLL(api-ms-win-security-base-l1-2-0)
diff --git a/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/Makefile.in b/dlls/api-ms-win-rtcore-ntuser-draw-l1-1-0/Makefile.in
new file mode 100644
index 0000000..956f2f3
@ -39,10 +39,10 @@ index 0000000..59900a9
@@ -0,0 +1 @@
+@ stdcall RedrawWindow(long ptr long long) user32.RedrawWindow
diff --git a/tools/make_specfiles b/tools/make_specfiles
index 615e6e3..8e768d0 100755
index d222f88..e175d2e 100755
--- a/tools/make_specfiles
+++ b/tools/make_specfiles
@@ -249,6 +249,7 @@ my @dll_groups =
@@ -269,6 +269,7 @@ my @dll_groups =
"api-ms-win-core-string-l2-1-0",
"api-ms-win-downlevel-user32-l1-1-0",
"api-ms-win-ntuser-dc-access-l1-1-0",

View File

@ -1,107 +0,0 @@
From 09a50547e7f7653e79a5baa47e425ea91f0ae885 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 18 Sep 2016 07:05:14 +0200
Subject: ntdll: Open current working directory with FILE_TRAVERSE access.
---
dlls/kernel32/tests/directory.c | 49 +++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/path.c | 3 ++-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/directory.c b/dlls/kernel32/tests/directory.c
index a3af052..6c7bad8 100644
--- a/dlls/kernel32/tests/directory.c
+++ b/dlls/kernel32/tests/directory.c
@@ -20,10 +20,23 @@
#include <stdarg.h>
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
+#include "winternl.h"
+
+static NTSTATUS (WINAPI *pNtQueryObject)(HANDLE,OBJECT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
+
+static void init_ntdll(void)
+{
+ HMODULE hntdll = GetModuleHandleA("ntdll.dll");
+ if (!hntdll) return;
+
+ pNtQueryObject = (void *)GetProcAddress(hntdll, "NtQueryObject");
+}
/* If you change something in these tests, please do the same
* for GetSystemDirectory tests.
@@ -486,15 +499,51 @@ static void test_RemoveDirectoryW(void)
static void test_SetCurrentDirectoryA(void)
{
+ OBJECT_BASIC_INFORMATION info;
+ WCHAR curdir[MAX_PATH];
+ char tmpdir[MAX_PATH];
+ NTSTATUS status;
+ HANDLE handle;
+
SetLastError(0);
ok( !SetCurrentDirectoryA( "\\some_dummy_dir" ), "SetCurrentDirectoryA succeeded\n" );
ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %d\n", GetLastError() );
ok( !SetCurrentDirectoryA( "\\some_dummy\\subdir" ), "SetCurrentDirectoryA succeeded\n" );
ok( GetLastError() == ERROR_PATH_NOT_FOUND, "wrong error %d\n", GetLastError() );
+
+ GetTempPathA( MAX_PATH, tmpdir );
+ lstrcatA( tmpdir, "Please Remove Me" );
+ ok( CreateDirectoryA( tmpdir, NULL ), "CreateDirectoryA failed\n" );
+
+ GetCurrentDirectoryW( MAX_PATH, curdir );
+ ok( SetCurrentDirectoryA( tmpdir ), "SetCurrentDirectoryA failed\n" );
+
+ SetLastError( 0xdeadbeef );
+ ok( !RemoveDirectoryA( tmpdir ), "RemoveDirectoryA succeeded\n" );
+ ok( GetLastError() == ERROR_SHARING_VIOLATION,
+ "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError() );
+
+ if (pNtQueryObject)
+ {
+ handle = NtCurrentTeb()->Peb->ProcessParameters->CurrentDirectory.Handle;
+ ok( handle != NULL, "current directory handle is NULL\n" );
+
+ status = pNtQueryObject( handle, ObjectBasicInformation, &info, sizeof(info), NULL );
+ ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
+ ok( info.GrantedAccess == (FILE_TRAVERSE|SYNCHRONIZE),
+ "Expected FILE_TRAVERSE|SYNCHRONIZE, got %08x\n", info.GrantedAccess );
+ }
+ else
+ win_skip( "Failed to get pointer to NtQueryObject, skipping handle permission test\n" );
+
+ SetCurrentDirectoryW( curdir );
+ RemoveDirectoryA( tmpdir );
}
START_TEST(directory)
{
+ init_ntdll();
+
test_GetWindowsDirectoryA();
test_GetWindowsDirectoryW();
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index ac4807f..e76ce3f 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -984,7 +984,8 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- nts = NtOpenFile( &handle, SYNCHRONIZE, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
+ nts = NtOpenFile( &handle, FILE_TRAVERSE | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
if (nts != STATUS_SUCCESS) goto out;
/* don't keep the directory handle open on removable media */
--
2.9.0

View File

@ -1 +0,0 @@
Fixes: [27671] Open current working directory with FILE_TRAVERSE access

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "6fd36314d051ceff8dbb0f2d442f57983e0bcd65"
echo "1513c706341a6c04ddfa8b1998a346d343fc4983"
}
# Show version information
@ -230,7 +230,6 @@ patch_enable_all ()
enable_ntdll_RtlIpStringToAddress_Stubs="$1"
enable_ntdll_RtlIpStringToAddress_Tests="$1"
enable_ntdll_RtlQueryPackageIdentity="$1"
enable_ntdll_RtlSetCurrentDirectory_U="$1"
enable_ntdll_Serial_Port_Detection="$1"
enable_ntdll_Stack_Guard_Page="$1"
enable_ntdll_Stack_Overflow="$1"
@ -290,7 +289,6 @@ patch_enable_all ()
enable_server_Signal_Thread="$1"
enable_server_Stored_ACLs="$1"
enable_server_Timestamp_Compat="$1"
enable_server_Win32_Prefix="$1"
enable_setupapi_DelReg="$1"
enable_setupapi_DiskSpaceList="$1"
enable_setupapi_Display_Device="$1"
@ -872,9 +870,6 @@ patch_enable ()
ntdll-RtlQueryPackageIdentity)
enable_ntdll_RtlQueryPackageIdentity="$2"
;;
ntdll-RtlSetCurrentDirectory_U)
enable_ntdll_RtlSetCurrentDirectory_U="$2"
;;
ntdll-Serial_Port_Detection)
enable_ntdll_Serial_Port_Detection="$2"
;;
@ -1052,9 +1047,6 @@ patch_enable ()
server-Timestamp_Compat)
enable_server_Timestamp_Compat="$2"
;;
server-Win32_Prefix)
enable_server_Win32_Prefix="$2"
;;
setupapi-DelReg)
enable_setupapi_DelReg="$2"
;;
@ -5193,21 +5185,6 @@ if test "$enable_ntdll_RtlIpStringToAddress_Tests" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-RtlSetCurrentDirectory_U
# |
# | This patchset fixes the following Wine bugs:
# | * [#27671] Open current working directory with FILE_TRAVERSE access
# |
# | Modified files:
# | * dlls/kernel32/tests/directory.c, dlls/ntdll/path.c
# |
if test "$enable_ntdll_RtlSetCurrentDirectory_U" -eq 1; then
patch_apply ntdll-RtlSetCurrentDirectory_U/0001-ntdll-Open-current-working-directory-with-FILE_TRAVE.patch
(
echo '+ { "Michael Müller", "ntdll: Open current working directory with FILE_TRAVERSE access.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-Serial_Port_Detection
# |
# | This patchset fixes the following Wine bugs:
@ -6167,21 +6144,6 @@ if test "$enable_server_Timestamp_Compat" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-Win32_Prefix
# |
# | This patchset fixes the following Wine bugs:
# | * [#29661] Allow to create win23 prefix when directory already exists
# |
# | Modified files:
# | * dlls/ntdll/server.c, server/registry.c
# |
if test "$enable_server_Win32_Prefix" -eq 1; then
patch_apply server-Win32_Prefix/0001-server-Allow-to-create-win23-prefix-when-directory-a.patch
(
echo '+ { "Sebastian Lackner", "server: Allow to create win23 prefix when directory already exists.", 1 },';
) >> "$patchlist"
fi
# Patchset setupapi-DelReg
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,61 +0,0 @@
From 11444a1efc32c983c49e40112d9a71042fd92f36 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 18 Sep 2016 19:48:14 +0200
Subject: server: Allow to create win23 prefix when directory already exists.
---
dlls/ntdll/server.c | 11 -----------
server/registry.c | 8 +++++++-
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 356d631..25c6473 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -1139,17 +1139,6 @@ static void setup_config_dir(void)
mkdir( config_dir, 0777 );
if (chdir( config_dir ) == -1) fatal_perror( "chdir to %s\n", config_dir );
- if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" ))
- {
- /* force creation of a 32-bit prefix */
- int fd = open( "system.reg", O_WRONLY | O_CREAT | O_EXCL, 0666 );
- if (fd != -1)
- {
- static const char regfile[] = "WINE REGISTRY Version 2\n\n#arch=win32\n";
- write( fd, regfile, sizeof(regfile) - 1 );
- close( fd );
- }
- }
MESSAGE( "wine: created the configuration directory '%s'\n", config_dir );
}
diff --git a/server/registry.c b/server/registry.c
index 97b16ed..0731b22 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -1805,6 +1805,7 @@ void init_registry(void)
WCHAR *current_user_path;
struct unicode_str current_user_str;
struct key *key, *hklm, *hkcu;
+ char *p;
/* switch to the config dir */
@@ -1821,7 +1822,12 @@ void init_registry(void)
fatal_error( "could not create Machine registry key\n" );
if (!load_init_registry_from_file( "system.reg", hklm ))
- prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT;
+ {
+ if ((p = getenv( "WINEARCH" )) && !strcmp( p, "win32" ))
+ prefix_type = PREFIX_32BIT;
+ else
+ prefix_type = sizeof(void *) > sizeof(int) ? PREFIX_64BIT : PREFIX_32BIT;
+ }
else if (prefix_type == PREFIX_UNKNOWN)
prefix_type = PREFIX_32BIT;
--
2.9.0

View File

@ -1 +0,0 @@
Fixes: [29661] Allow to create win23 prefix when directory already exists

View File

@ -1,4 +1,4 @@
From 80a3e2c7b41b6504805e91065058072bc83c4ac4 Mon Sep 17 00:00:00 2001
From e5cdbbf9fdf7c927f66bc4c3f7be4bcca0694791 Mon Sep 17 00:00:00 2001
From: Damjan Jovanovic <damjan.jov@gmail.com>
Date: Fri, 8 Aug 2014 20:05:54 +0200
Subject: winex11.drv: Import X11's "text/html" as "HTML Format". (try 3)
@ -15,7 +15,7 @@ Changes by Sebastian Lackner <sebastian@fds-team.de>:
1 file changed, 201 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index dcb1403..058ee53 100644
index 0850448..08dd885 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -134,6 +134,7 @@ static HANDLE import_image_bmp( Atom type, const void *data, size_t size );
@ -24,18 +24,18 @@ index dcb1403..058ee53 100644
static HANDLE import_compound_text( Atom type, const void *data, size_t size );
+static HANDLE import_text_html( Atom type, const void *data, size_t size );
static HANDLE import_text_uri_list( Atom type, const void *data, size_t size );
static HANDLE import_targets( Atom type, const void *data, size_t size );
static BOOL export_data( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
@@ -205,7 +206,7 @@ static const struct
@@ -206,7 +207,7 @@ static const struct
{ JFIFW, 0, XATOM_image_jpeg, import_data, export_data },
{ PNGW, 0, XATOM_image_png, import_data, export_data },
{ HTMLFormatW, 0, XATOM_HTML_Format, import_data, export_data },
- { HTMLFormatW, 0, XATOM_text_html, import_data, export_text_html },
+ { HTMLFormatW, 0, XATOM_text_html, import_text_html, export_text_html },
{ 0, 0, XATOM_TARGETS, NULL, export_targets },
{ 0, 0, XATOM_TARGETS, import_targets, export_targets },
{ 0, 0, XATOM_MULTIPLE, NULL, export_multiple },
};
@@ -1136,6 +1137,205 @@ static HANDLE import_enhmetafile( Atom type, const void *data, size_t size )
@@ -1178,6 +1179,205 @@ static HANDLE import_enhmetafile( Atom type, const void *data, size_t size )
}