Rebase against 5a61913e90e3725d08c0e1fd06ccfe936434cbcc.

This commit is contained in:
Sebastian Lackner 2017-07-20 03:09:05 +02:00
parent a05970ca53
commit 43f5b05fd5
12 changed files with 69 additions and 463 deletions

View File

@ -1,31 +0,0 @@
From dabf89ee29066b7a133ca2fb1e5c05a8100a0365 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 1 May 2017 19:49:41 +0200
Subject: dmloader/tests: Fix test failures.
---
dlls/dmloader/tests/loader.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c
index 6b2ee3ad93..1735994088 100644
--- a/dlls/dmloader/tests/loader.c
+++ b/dlls/dmloader/tests/loader.c
@@ -66,11 +66,11 @@ static void test_directory(void)
/* Two consecutive SetSearchDirectory with the same path */
GetTempPathW(ARRAY_SIZE(path), path);
hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, path, 0);
- todo_wine ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr);
+ ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr);
hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, path, 0);
- ok(hr == S_FALSE, "Second SetSearchDirectory failed with %#x\n", hr);
+ todo_wine ok(hr == S_FALSE, "Second SetSearchDirectory failed with %#x\n", hr);
hr = IDirectMusicLoader_SetSearchDirectory(loader, &CLSID_DirectSoundWave, path, 0);
- ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr);
+ todo_wine ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr);
hr = IDirectMusicLoader_SetSearchDirectory(loader, &CLSID_DirectSoundWave, path, 0);
ok(hr == S_FALSE, "Second SetSearchDirectory failed with %#x\n", hr);
--
2.12.2

View File

@ -1,175 +1,57 @@
From 1a619eb84978df08b8f0baebfbd5cc8b02f19a47 Mon Sep 17 00:00:00 2001
From 9411b94da4291a8000a2bb95f9c2a5b739549d07 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 21 Aug 2015 06:39:47 +0800
Subject: ntdll: Do not allow to deallocate thread stack for current thread.
---
dlls/ntdll/ntdll_misc.h | 10 ++++++++++
dlls/ntdll/signal_arm.c | 7 +++++++
dlls/ntdll/signal_arm64.c | 7 +++++++
dlls/ntdll/signal_i386.c | 8 +++++++-
dlls/ntdll/signal_powerpc.c | 7 +++++++
dlls/ntdll/signal_x86_64.c | 7 +++++++
dlls/ntdll/virtual.c | 12 ++++++++++++
7 files changed, 57 insertions(+), 1 deletion(-)
dlls/ntdll/ntdll_misc.h | 1 +
dlls/ntdll/thread.c | 6 ++++++
dlls/ntdll/virtual.c | 12 ++++++++++++
3 files changed, 19 insertions(+)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index cbd19db..6e25915 100644
index ba296d25c3c..faa258a27f4 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -240,8 +240,18 @@ struct ntdll_thread_data
WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */
void *exit_frame; /* 204 exit frame pointer */
#endif
+ void *pthread_stack; /* 208/318 pthread stack */
@@ -224,6 +224,7 @@ struct ntdll_thread_data
int wait_fd[2]; /* fd for sleeping server requests */
BOOL wow64_redir; /* Wow64 filesystem redirection flag */
pthread_t pthread_id; /* pthread thread id */
+ void *pthread_stack; /* pthread stack */
};
+C_ASSERT( FIELD_OFFSET(TEB, SpareBytes1) + sizeof(struct ntdll_thread_data) <=
+ FIELD_OFFSET(TEB, GdiTebBatch) + sizeof(((TEB *)0)->GdiTebBatch) );
+
+#ifdef __i386__
+C_ASSERT( FIELD_OFFSET(TEB, SpareBytes1) + FIELD_OFFSET(struct ntdll_thread_data, vm86) == FIELD_OFFSET(TEB, GdiTebBatch) );
+C_ASSERT( FIELD_OFFSET(TEB, SpareBytes1) + FIELD_OFFSET(struct ntdll_thread_data, vm86) == 0x1fc );
+C_ASSERT( FIELD_OFFSET(TEB, SpareBytes1) + FIELD_OFFSET(struct ntdll_thread_data, gs) == 0x1d8 );
+#endif
+
static inline struct ntdll_thread_data *ntdll_get_thread_data(void)
{
return (struct ntdll_thread_data *)NtCurrentTeb()->SpareBytes1;
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index 1f6da96..a82eb91 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -902,12 +902,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
void signal_free_thread( TEB *teb )
{
SIZE_T size;
+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
if (teb->DeallocationStack)
{
size = 0;
NtFreeVirtualMemory( GetCurrentProcess(), &teb->DeallocationStack, &size, MEM_RELEASE );
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index ba1be0f3d8a..e8f07efb829 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -445,6 +445,12 @@ void exit_thread( int status )
if (thread_data->pthread_id)
{
pthread_join( thread_data->pthread_id, NULL );
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ SIZE_T size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
signal_free_thread( teb );
}
}
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
index 3a41c84..3ad412a 100644
--- a/dlls/ntdll/signal_arm64.c
+++ b/dlls/ntdll/signal_arm64.c
@@ -776,12 +776,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
void signal_free_thread( TEB *teb )
{
SIZE_T size;
+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
if (teb->DeallocationStack)
{
size = 0;
NtFreeVirtualMemory( GetCurrentProcess(), &teb->DeallocationStack, &size, MEM_RELEASE );
}
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 5c3aa819..28d9e29 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -2367,12 +2367,18 @@ void signal_free_thread( TEB *teb )
SIZE_T size;
struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
- if (thread_data) wine_ldt_free_fs( thread_data->fs );
+ wine_ldt_free_fs( thread_data->fs );
if (teb->DeallocationStack)
{
size = 0;
NtFreeVirtualMemory( GetCurrentProcess(), &teb->DeallocationStack, &size, MEM_RELEASE );
}
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
index 886da86..90644a4 100644
--- a/dlls/ntdll/signal_powerpc.c
+++ b/dlls/ntdll/signal_powerpc.c
@@ -982,12 +982,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
void signal_free_thread( TEB *teb )
{
SIZE_T size;
+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
if (teb->DeallocationStack)
{
size = 0;
NtFreeVirtualMemory( GetCurrentProcess(), &teb->DeallocationStack, &size, MEM_RELEASE );
}
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 524de68..d3885eb 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -2732,12 +2732,19 @@ NTSTATUS signal_alloc_thread( TEB **teb )
void signal_free_thread( TEB *teb )
{
SIZE_T size;
+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
if (teb->DeallocationStack)
{
size = 0;
NtFreeVirtualMemory( GetCurrentProcess(), &teb->DeallocationStack, &size, MEM_RELEASE );
}
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE );
}
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 4d4bc3b..eb76cee 100644
index 4aeb282adf7..68c0148fbb5 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1453,6 +1453,8 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi
@@ -1553,6 +1553,8 @@ NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commi
teb->DeallocationStack = view->base;
teb->Tib.StackBase = (char *)view->base + view->size;
teb->Tib.StackLimit = (char *)view->base + 2 * page_size;
+ ((struct ntdll_thread_data *)teb->SpareBytes1)->pthread_stack = view->base;
+ ((struct ntdll_thread_data *)&teb->GdiTebBatch)->pthread_stack = view->base;
+
done:
server_leave_uninterrupted_section( &csVirtual, &sigset );
return status;
@@ -2048,6 +2050,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
@@ -2149,6 +2151,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
/* Free the pages */
if (size || (base != view->base)) status = STATUS_INVALID_PARAMETER;
@ -187,5 +69,5 @@ index 4d4bc3b..eb76cee 100644
{
delete_view( view );
--
2.6.1
2.13.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "9118512135a1aac6969bf575a0656855ba84ef11"
echo "5a61913e90e3725d08c0e1fd06ccfe936434cbcc"
}
# Show version information
@ -152,7 +152,6 @@ patch_enable_all ()
enable_devenum_AudioCompressorCategory="$1"
enable_dinput_Deadlock="$1"
enable_dinput_Initialize="$1"
enable_dmloader_Tests="$1"
enable_dsound_EAX="$1"
enable_dsound_Fast_Mixer="$1"
enable_dsound_Revert_Cleanup="$1"
@ -365,7 +364,6 @@ patch_enable_all ()
enable_shell32_SHELL_execute="$1"
enable_shell32_SHFileOperation_Move="$1"
enable_shell32_SHFileOperation_Win9x="$1"
enable_shell32_SHGetFileInfoW="$1"
enable_shell32_Toolbar_Bitmaps="$1"
enable_shell32_UnixFS="$1"
enable_shlwapi_AssocGetPerceivedType="$1"
@ -473,7 +471,6 @@ patch_enable_all ()
enable_winhlp32_Flex_Workaround="$1"
enable_winhttp_Accept_Headers="$1"
enable_winhttp_System_Proxy_Autoconfig="$1"
enable_winhttp_host_t="$1"
enable_wininet_Cleanup="$1"
enable_wininet_Http_Decoding="$1"
enable_wininet_InternetCrackUrlW="$1"
@ -492,7 +489,6 @@ patch_enable_all ()
enable_ws2_32_WSACleanup="$1"
enable_ws2_32_WriteWatches="$1"
enable_ws2_32_getsockopt="$1"
enable_ws2_32_if_nameindex="$1"
enable_wtsapi32_EnumerateProcesses="$1"
enable_wtsapi32_WTSQueryUserToken="$1"
enable_wuauserv_Dummy_Service="$1"
@ -716,9 +712,6 @@ patch_enable ()
dinput-Initialize)
enable_dinput_Initialize="$2"
;;
dmloader-Tests)
enable_dmloader_Tests="$2"
;;
dsound-EAX)
enable_dsound_EAX="$2"
;;
@ -1355,9 +1348,6 @@ patch_enable ()
shell32-SHFileOperation_Win9x)
enable_shell32_SHFileOperation_Win9x="$2"
;;
shell32-SHGetFileInfoW)
enable_shell32_SHGetFileInfoW="$2"
;;
shell32-Toolbar_Bitmaps)
enable_shell32_Toolbar_Bitmaps="$2"
;;
@ -1679,9 +1669,6 @@ patch_enable ()
winhttp-System_Proxy_Autoconfig)
enable_winhttp_System_Proxy_Autoconfig="$2"
;;
winhttp-host_t)
enable_winhttp_host_t="$2"
;;
wininet-Cleanup)
enable_wininet_Cleanup="$2"
;;
@ -1736,9 +1723,6 @@ patch_enable ()
ws2_32-getsockopt)
enable_ws2_32_getsockopt="$2"
;;
ws2_32-if_nameindex)
enable_ws2_32_if_nameindex="$2"
;;
wtsapi32-EnumerateProcesses)
enable_wtsapi32_EnumerateProcesses="$2"
;;
@ -2143,13 +2127,6 @@ if test "$enable_wininet_Redirect" -eq 1; then
enable_wininet_Cleanup=1
fi
if test "$enable_winhttp_host_t" -eq 1; then
if test "$enable_winhttp_Accept_Headers" -gt 1; then
abort "Patchset winhttp-Accept_Headers disabled, but winhttp-host_t depends on that."
fi
enable_winhttp_Accept_Headers=1
fi
if test "$enable_winex11_WM_WINDOWPOSCHANGING" -eq 1; then
if test "$enable_winex11__NET_ACTIVE_WINDOW" -gt 1; then
abort "Patchset winex11-_NET_ACTIVE_WINDOW disabled, but winex11-WM_WINDOWPOSCHANGING depends on that."
@ -4248,18 +4225,6 @@ if test "$enable_dinput_Initialize" -eq 1; then
) >> "$patchlist"
fi
# Patchset dmloader-Tests
# |
# | Modified files:
# | * dlls/dmloader/tests/loader.c
# |
if test "$enable_dmloader_Tests" -eq 1; then
patch_apply dmloader-Tests/0001-dmloader-tests-Fix-test-failures.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "dmloader/tests: Fix test failures.", 1 },';
) >> "$patchlist"
fi
# Patchset dsound-Fast_Mixer
# |
# | This patchset fixes the following Wine bugs:
@ -5887,8 +5852,7 @@ fi
# Patchset ntdll-Dealloc_Thread_Stack
# |
# | Modified files:
# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/signal_arm.c, dlls/ntdll/signal_arm64.c, dlls/ntdll/signal_i386.c,
# | dlls/ntdll/signal_powerpc.c, dlls/ntdll/signal_x86_64.c, dlls/ntdll/virtual.c
# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/thread.c, dlls/ntdll/virtual.c
# |
if test "$enable_ntdll_Dealloc_Thread_Stack" -eq 1; then
patch_apply ntdll-Dealloc_Thread_Stack/0001-ntdll-Do-not-allow-to-allocate-thread-stack-for-curr.patch
@ -7909,18 +7873,6 @@ if test "$enable_shell32_SHFileOperation_Win9x" -eq 1; then
) >> "$patchlist"
fi
# Patchset shell32-SHGetFileInfoW
# |
# | Modified files:
# | * dlls/shell32/shell32_main.c
# |
if test "$enable_shell32_SHGetFileInfoW" -eq 1; then
patch_apply shell32-SHGetFileInfoW/0001-shell32-Prevent-a-possible-nullptr-dereference-in-SH.patch
(
printf '%s\n' '+ { "Mark Jansen", "shell32: Prevent a possible nullptr dereference in SHGetFileInfoW.", 1 },';
) >> "$patchlist"
fi
# Patchset shell32-Toolbar_Bitmaps
# |
# | This patchset fixes the following Wine bugs:
@ -9782,21 +9734,6 @@ if test "$enable_winhttp_System_Proxy_Autoconfig" -eq 1; then
) >> "$patchlist"
fi
# Patchset winhttp-host_t
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * winhttp-Accept_Headers
# |
# | Modified files:
# | * dlls/winhttp/net.c, dlls/winhttp/request.c, dlls/winhttp/winhttp_private.h
# |
if test "$enable_winhttp_host_t" -eq 1; then
patch_apply winhttp-host_t/0001-winhttp-Rename-host_t-to-hostdata_t.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "winhttp: Rename host_t to hostdata_t.", 1 },';
) >> "$patchlist"
fi
# Patchset wininet-Cleanup
# |
# | Modified files:
@ -10053,18 +9990,6 @@ if test "$enable_ws2_32_getsockopt" -eq 1; then
) >> "$patchlist"
fi
# Patchset ws2_32-if_nameindex
# |
# | Modified files:
# | * configure.ac
# |
if test "$enable_ws2_32_if_nameindex" -eq 1; then
patch_apply ws2_32-if_nameindex/0001-configure.ac-Improve-check-for-if_nameindex.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "configure.ac: Improve check for if_nameindex.", 1 },';
) >> "$patchlist"
fi
# Patchset wtsapi32-EnumerateProcesses
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,26 +0,0 @@
From a7db8be54b079a52c392d6f1e7be86792b60900a Mon Sep 17 00:00:00 2001
From: Mark Jansen <mark.jansen@reactos.org>
Date: Sun, 16 Jul 2017 16:27:12 +0200
Subject: shell32: Prevent a possible nullptr dereference in SHGetFileInfoW.
Signed-off-by: Mark Jansen <mark.jansen@reactos.org>
---
dlls/shell32/shell32_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c
index 34b906c2fd5..0ed67907ca1 100644
--- a/dlls/shell32/shell32_main.c
+++ b/dlls/shell32/shell32_main.c
@@ -431,7 +431,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
- psfi, psfi->dwAttributes, sizeofpsfi, flags);
+ psfi, psfi ? psfi->dwAttributes : 0, sizeofpsfi, flags);
if (!path)
return FALSE;
--
2.13.1

View File

@ -1 +0,0 @@
Fixes: Prevent a possible nullptr dereference in SHGetFileInfoW

View File

@ -1,4 +1,4 @@
From 7328ffb1e48698e786ff4b1c8330d50ef24b9ac1 Mon Sep 17 00:00:00 2001
From 4966ad10599a5e8fb68b13243471aba4f80f0fb5 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 16 May 2017 04:37:52 +0200
Subject: krnl386.exe16: Do not abuse WOW32Reserved field for 16-bit stack
@ -470,10 +470,10 @@ index fa49a246ab8..bd69b844607 100644
}
}
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 59dca6cfca0..d0f25ed3ce4 100644
index 2301ba4c3c8..8b8049b80da 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -990,7 +990,7 @@ static inline void *init_handler( const ucontext_t *sigcontext, WORD *fs, WORD *
@@ -1019,7 +1019,7 @@ static inline void *init_handler( const ucontext_t *sigcontext, WORD *fs, WORD *
* SS is still non-system segment. This is why both CS and SS
* are checked.
*/
@ -594,7 +594,7 @@ index 9e07be97779..c020998b7e2 100644
stack16->ds = GetWindowLongPtrW( hwnd, GWLP_HINSTANCE );
diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c
index aba797debc1..44e6f49e1a3 100644
index 35f25859594..d473dcdebda 100644
--- a/dlls/user.exe16/user.c
+++ b/dlls/user.exe16/user.c
@@ -1388,7 +1388,7 @@ DWORD WINAPI GetTabbedTextExtent16( HDC16 hdc, LPCSTR lpstr, INT16 count,
@ -629,7 +629,7 @@ index e81d9ace3ae..afe40b2df98 100644
/* don't use WIN_Handle32 here, we don't care about the full handle */
return IsWindow( HWND_32(hwnd) );
diff --git a/include/winternl.h b/include/winternl.h
index 5cd1664f1fe..ae3163daeac 100644
index b814b86d289..23bf3ac8fd7 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -325,7 +325,7 @@ typedef struct _TEB
@ -640,9 +640,9 @@ index 5cd1664f1fe..ae3163daeac 100644
+ PVOID SystemReserved1[54]; /* 0cc/0110 used for krnl386.exe16 private data in Wine */
LONG ExceptionCode; /* 1a4/02c0 */
ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */
BYTE SpareBytes1[24]; /* 1bc/02e8 used for ntdll private data in Wine */
BYTE SpareBytes1[24]; /* 1bc/02e8 */
diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c
index e9228a00d48..63ae977a0ae 100644
index 1cc6465f1c6..26cd347f14e 100644
--- a/tools/winebuild/relay.c
+++ b/tools/winebuild/relay.c
@@ -31,7 +31,7 @@
@ -652,8 +652,8 @@ index e9228a00d48..63ae977a0ae 100644
-#define STACKOFFSET 0xc0 /* FIELD_OFFSET(TEB,WOW32Reserved) */
+#define STACKOFFSET 0xcc /* FIELD_OFFSET(TEB,SystemReserved1[0]) */
/* fix this if the ntdll_thread_regs structure is changed */
#define GS_OFFSET 0x1d8 /* FIELD_OFFSET(TEB,SpareBytes1) + FIELD_OFFSET(ntdll_thread_data,gs) */
/* fix this if the x86_thread_data structure is changed */
#define GS_OFFSET 0x1d8 /* FIELD_OFFSET(TEB,SystemReserved2) + FIELD_OFFSET(struct x86_thread_data,gs) */
--
2.12.2
2.13.1

View File

@ -1,4 +1,4 @@
From 5cdd660ebd413914330fa49e9d7014c9056662c2 Mon Sep 17 00:00:00 2001
From 32bb8b671dd0c6df8d3cf295447b3c8f7d3b7457 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 11 May 2017 05:32:55 +0200
Subject: winebuild: Generate syscall thunks for ntdll exports.
@ -16,7 +16,7 @@ Based on a patch by Erich E. Hoover.
8 files changed, 164 insertions(+), 26 deletions(-)
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index d0f25ed3ce4..cd7d0dff493 100644
index d3da84c7be9..f2657045c94 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -481,6 +481,7 @@ static wine_signal_handler handlers[256];
@ -27,16 +27,16 @@ index d0f25ed3ce4..cd7d0dff493 100644
enum i386_trap_code
{
@@ -2363,6 +2364,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -2434,6 +2435,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*teb = addr;
(*teb)->Tib.Self = &(*teb)->Tib;
(*teb)->Tib.ExceptionList = (void *)~0UL;
+ (*teb)->WOW32Reserved = __wine_syscall_dispatcher;
thread_data = (struct ntdll_thread_data *)(*teb)->SpareBytes1;
thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2;
if (!(thread_data->fs = wine_ldt_alloc_fs()))
{
diff --git a/include/winternl.h b/include/winternl.h
index ae3163daeac..6b0624290fa 100644
index c11df3e53f6..80b7b91f906 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -322,7 +322,7 @@ typedef struct _TEB
@ -265,10 +265,10 @@ index 85bcf099999..54aad5d95b4 100644
entry_point->u.func.nb_args = 0;
assert( !spec->ordinals[0] );
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index f3feb0f3300..dde1bd0704d 100644
index 39733b2b0b5..b1e71ef99be 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -274,6 +274,73 @@ static void output_relay_debug( DLLSPEC *spec )
@@ -311,6 +311,73 @@ static void output_relay_debug( DLLSPEC *spec )
}
/*******************************************************************
@ -342,7 +342,7 @@ index f3feb0f3300..dde1bd0704d 100644
* output_exports
*
* Output the export table for a Win32 module.
@@ -623,6 +690,7 @@ void BuildSpec32File( DLLSPEC *spec )
@@ -660,6 +727,7 @@ void BuildSpec32File( DLLSPEC *spec )
resolve_imports( spec );
output_standard_file_header();
output_module( spec );
@ -394,5 +394,5 @@ index 6e01f1a5268..925054b8bb7 100644
+ return j + 1;
+}
--
2.12.2
2.13.1

View File

@ -1,4 +1,4 @@
From 3cb1a8e8983c58da032185ca1d76bc4d3a2a15e1 Mon Sep 17 00:00:00 2001
From 47c26e73121327980c26501ecb20cc6d6b08f3f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 15 May 2017 16:27:56 +0200
Subject: winebuild: Add stub functions in fake dlls.
@ -13,7 +13,7 @@ Subject: winebuild: Add stub functions in fake dlls.
6 files changed, 255 insertions(+), 15 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 44c632bdbcf..cfbee0851b5 100644
index f8d45d829fc..77bac0861f7 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -856,9 +856,7 @@ static void test_FakeDLL(void)
@ -61,7 +61,7 @@ index 44c632bdbcf..cfbee0851b5 100644
CloseHandle(map);
CloseHandle(file);
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index cd7d0dff493..b1ec20e8723 100644
index f2657045c94..c2375d6f0e8 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -483,6 +483,45 @@ static BOOL fpux_support; /* whether the CPU supports extended fpu context */
@ -110,16 +110,16 @@ index cd7d0dff493..b1ec20e8723 100644
enum i386_trap_code
{
TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */
@@ -2365,6 +2404,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -2436,6 +2475,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
(*teb)->Tib.Self = &(*teb)->Tib;
(*teb)->Tib.ExceptionList = (void *)~0UL;
(*teb)->WOW32Reserved = __wine_syscall_dispatcher;
+ (*teb)->Spare3 = __wine_fakedll_dispatcher;
thread_data = (struct ntdll_thread_data *)(*teb)->SpareBytes1;
thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2;
if (!(thread_data->fs = wine_ldt_alloc_fs()))
{
diff --git a/include/winternl.h b/include/winternl.h
index 6b0624290fa..8b87f37c65c 100644
index 80b7b91f906..4780aca43a3 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -362,7 +362,7 @@ typedef struct _TEB
@ -144,10 +144,10 @@ index 3434cfe9c90..e76800bb5da 100644
extern void align_output_rva( unsigned int file_align, unsigned int rva_align );
extern size_t label_pos( const char *name );
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index c01ff6d7746..4367b03b0d2 100644
index 623d3f2d553..c6e2fec99a6 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -701,6 +701,163 @@ void BuildSpec32File( DLLSPEC *spec )
@@ -738,6 +738,163 @@ void BuildSpec32File( DLLSPEC *spec )
}
@ -311,7 +311,7 @@ index c01ff6d7746..4367b03b0d2 100644
/*******************************************************************
* output_fake_module_pass
*
@@ -719,7 +876,7 @@ static void output_fake_module_pass( DLLSPEC *spec )
@@ -756,7 +913,7 @@ static void output_fake_module_pass( DLLSPEC *spec )
const unsigned int section_align = page_size;
const unsigned int file_align = 0x200;
const unsigned int lfanew = (0x40 + sizeof(fakedll_signature) + 15) & ~15;
@ -320,7 +320,7 @@ index c01ff6d7746..4367b03b0d2 100644
put_word( 0x5a4d ); /* e_magic */
put_word( 0x40 ); /* e_cblp */
@@ -776,7 +933,7 @@ static void output_fake_module_pass( DLLSPEC *spec )
@@ -813,7 +970,7 @@ static void output_fake_module_pass( DLLSPEC *spec )
put_dword( 0 ); /* SizeOfUninitializedData */
put_dword( label_rva("entrypoint") ); /* AddressOfEntryPoint */
put_dword( label_rva("text_start") ); /* BaseOfCode */
@ -329,7 +329,7 @@ index c01ff6d7746..4367b03b0d2 100644
put_pword( 0x10000000 ); /* ImageBase */
put_dword( section_align ); /* SectionAlignment */
put_dword( file_align ); /* FileAlignment */
@@ -799,7 +956,8 @@ static void output_fake_module_pass( DLLSPEC *spec )
@@ -836,7 +993,8 @@ static void output_fake_module_pass( DLLSPEC *spec )
put_dword( 0 ); /* LoaderFlags */
put_dword( 16 ); /* NumberOfRvaAndSizes */
@ -339,7 +339,7 @@ index c01ff6d7746..4367b03b0d2 100644
put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */
if (spec->nb_resources) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */
{
@@ -839,6 +997,21 @@ static void output_fake_module_pass( DLLSPEC *spec )
@@ -876,6 +1034,21 @@ static void output_fake_module_pass( DLLSPEC *spec )
put_word( 0 ); /* NumberOfLinenumbers */
put_dword( 0x60000020 /* CNT_CODE|MEM_EXECUTE|MEM_READ */ ); /* Characteristics */
@ -361,7 +361,7 @@ index c01ff6d7746..4367b03b0d2 100644
/* .reloc section */
put_data( ".reloc\0", 8 ); /* Name */
put_dword( label_rva_align("reloc_end") - label_rva("reloc_start") ); /* VirtualSize */
@@ -871,13 +1044,31 @@ static void output_fake_module_pass( DLLSPEC *spec )
@@ -908,13 +1081,31 @@ static void output_fake_module_pass( DLLSPEC *spec )
/* .text contents */
align_output_rva( file_align, section_align );
@ -442,5 +442,5 @@ index eada46604ec..eee5419285a 100644
{
size_t size = align - (output_buffer_pos % align);
--
2.12.2
2.13.1

View File

@ -104,7 +104,7 @@ index dd8c4efd938..180b1c4ba74 100644
HANDLE task_wait;
@@ -316,6 +314,8 @@ void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
void release_host( host_t *host ) DECLSPEC_HIDDEN;
void release_host( hostdata_t *host ) DECLSPEC_HIDDEN;
+BOOL process_header( request_t *request, LPCWSTR field, LPCWSTR value, DWORD flags, BOOL request_only ) DECLSPEC_HIDDEN;
+

View File

@ -1,116 +0,0 @@
From deba3b50b155a71af0a8cd449d953317ff691c13 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 19 Jul 2017 01:21:24 +0200
Subject: winhttp: Rename host_t to hostdata_t.
---
dlls/winhttp/net.c | 2 +-
dlls/winhttp/request.c | 10 +++++-----
dlls/winhttp/winhttp_private.h | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index 8c603291b20..c9aa6d48b27 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -299,7 +299,7 @@ void netconn_unload( void )
#endif
}
-netconn_t *netconn_create( host_t *host, const struct sockaddr_storage *sockaddr, int timeout )
+netconn_t *netconn_create( hostdata_t *host, const struct sockaddr_storage *sockaddr, int timeout )
{
netconn_t *conn;
unsigned int addr_len;
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index aaa6a5e7905..2ec7511146f 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1004,7 +1004,7 @@ static CRITICAL_SECTION connection_pool_cs = { &connection_pool_debug, -1, 0, 0,
static struct list connection_pool = LIST_INIT( connection_pool );
-void release_host( host_t *host )
+void release_host( hostdata_t *host )
{
LONG ref;
@@ -1024,7 +1024,7 @@ static DWORD WINAPI connection_collector(void *arg)
{
unsigned int remaining_connections;
netconn_t *netconn, *next_netconn;
- host_t *host, *next_host;
+ hostdata_t *host, *next_host;
ULONGLONG now;
do
@@ -1036,7 +1036,7 @@ static DWORD WINAPI connection_collector(void *arg)
EnterCriticalSection(&connection_pool_cs);
- LIST_FOR_EACH_ENTRY_SAFE(host, next_host, &connection_pool, host_t, entry)
+ LIST_FOR_EACH_ENTRY_SAFE(host, next_host, &connection_pool, hostdata_t, entry)
{
LIST_FOR_EACH_ENTRY_SAFE(netconn, next_netconn, &host->connections, netconn_t, entry)
{
@@ -1095,7 +1095,7 @@ static void cache_connection( netconn_t *netconn )
static BOOL open_connection( request_t *request )
{
BOOL is_secure = request->hdr.flags & WINHTTP_FLAG_SECURE;
- host_t *host = NULL, *iter;
+ hostdata_t *host = NULL, *iter;
netconn_t *netconn = NULL;
connect_t *connect;
WCHAR *addressW = NULL;
@@ -1109,7 +1109,7 @@ static BOOL open_connection( request_t *request )
EnterCriticalSection( &connection_pool_cs );
- LIST_FOR_EACH_ENTRY( iter, &connection_pool, host_t, entry )
+ LIST_FOR_EACH_ENTRY( iter, &connection_pool, hostdata_t, entry )
{
if (iter->port == port && !strcmpW( connect->servername, iter->hostname ) && !is_secure == !iter->secure)
{
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 180b1c4ba74..bda7b060585 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -103,7 +103,7 @@ typedef struct {
INTERNET_PORT port;
BOOL secure;
struct list connections;
-} host_t;
+} hostdata_t;
typedef struct
{
@@ -142,7 +142,7 @@ typedef struct
int socket;
struct sockaddr_storage sockaddr;
BOOL secure; /* SSL active on connection? */
- host_t *host;
+ hostdata_t *host;
ULONGLONG keep_until;
CtxtHandle ssl_ctx;
SecPkgContext_StreamSizes ssl_sizes;
@@ -293,7 +293,7 @@ void send_callback( object_header_t *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN;
void close_connection( request_t * ) DECLSPEC_HIDDEN;
BOOL netconn_close( netconn_t * ) DECLSPEC_HIDDEN;
-netconn_t *netconn_create( host_t *, const struct sockaddr_storage *, int ) DECLSPEC_HIDDEN;
+netconn_t *netconn_create( hostdata_t *, const struct sockaddr_storage *, int ) DECLSPEC_HIDDEN;
void netconn_unload( void ) DECLSPEC_HIDDEN;
ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN;
BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN;
@@ -312,7 +312,7 @@ void delete_domain( domain_t * ) DECLSPEC_HIDDEN;
BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HIDDEN;
void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
-void release_host( host_t *host ) DECLSPEC_HIDDEN;
+void release_host( hostdata_t *host ) DECLSPEC_HIDDEN;
BOOL process_header( request_t *request, LPCWSTR field, LPCWSTR value, DWORD flags, BOOL request_only ) DECLSPEC_HIDDEN;
--
2.13.1

View File

@ -1 +0,0 @@
Depends: winhttp-Accept_Headers

View File

@ -1,26 +0,0 @@
From e003cc0c093e2d382cf19b8b322e30abf105ab0f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 17 Jul 2017 22:08:46 +0200
Subject: configure.ac: Improve check for if_nameindex.
---
configure.ac | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index 7270ce78525..ea427113249 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2343,6 +2343,9 @@ AC_CACHE_CHECK([for if_nameindex],wine_cv_have_if_nameindex,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif]],
--
2.13.1