Rebase against d279bc24934fd1b68324017ae1b9e70975640a0a

This commit is contained in:
Alistair Leslie-Hughes 2018-10-27 16:22:42 +11:00
parent eb630f686f
commit 4f57895f06
6 changed files with 61 additions and 234 deletions

View File

@ -1,109 +0,0 @@
From 6dc2138136a0699c8e8d1337b646a09b93cd8b0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 04:02:16 +0200
Subject: [PATCH] kernel32: Implement CreateProcessInternalW.
---
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/process.c | 24 ++++++++++++++----------
dlls/kernelbase/kernelbase.spec | 2 +-
include/winbase.h | 1 +
4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index cb9c73a..98d5000 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -315,7 +315,7 @@
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr)
# @ stub CreateProcessAsUserW
# @ stub CreateProcessInternalA
-# @ stub CreateProcessInternalW
+@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr)
# @ stub CreateProcessInternalWSecure
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr)
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 658a0b1..15460aa 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2588,12 +2588,13 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
return ret;
}
-
-/* Steam hotpatches CreateProcessA and W, so to prevent it from crashing use an internal function */
-static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_ATTRIBUTES process_attr,
- LPSECURITY_ATTRIBUTES thread_attr, BOOL inherit, DWORD flags,
- LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
- LPPROCESS_INFORMATION info )
+/**********************************************************************
+ * CreateProcessInternalW (KERNEL32.@)
+ */
+BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_ATTRIBUTES process_attr,
+ LPSECURITY_ATTRIBUTES thread_attr, BOOL inherit, DWORD flags,
+ LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
+ LPPROCESS_INFORMATION info, HANDLE *new_token )
{
BOOL retv = FALSE;
HANDLE hFile = 0;
@@ -2608,6 +2609,9 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
+ if (token) FIXME("Creating a process with a token is not yet implemented\n");
+ if (new_token) FIXME("No support for returning created process token\n");
+
if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, ARRAY_SIZE( name ), &hFile, &is_64bit )))
return FALSE;
if (hFile == INVALID_HANDLE_VALUE) goto done;
@@ -2774,8 +2778,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA( LPCSTR app_name, LPSTR cmd_line, L
FIXME("StartupInfo.lpReserved is used, please report (%s)\n",
debugstr_a(startup_info->lpReserved));
- ret = create_process_impl( app_nameW, cmd_lineW, process_attr, thread_attr,
- inherit, flags, env, cur_dirW, &infoW, info );
+ ret = CreateProcessInternalW( NULL, app_nameW, cmd_lineW, process_attr, thread_attr,
+ inherit, flags, env, cur_dirW, &infoW, info, NULL );
done:
HeapFree( GetProcessHeap(), 0, app_nameW );
HeapFree( GetProcessHeap(), 0, cmd_lineW );
@@ -2794,8 +2798,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line,
LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
LPPROCESS_INFORMATION info )
{
- return create_process_impl( app_name, cmd_line, process_attr, thread_attr,
- inherit, flags, env, cur_dir, startup_info, info);
+ return CreateProcessInternalW( NULL, app_name, cmd_line, process_attr, thread_attr,
+ inherit, flags, env, cur_dir, startup_info, info, NULL);
}
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 7d8439f..cfc3bec 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -209,7 +209,7 @@
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) advapi32.CreateProcessAsUserA
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
# @ stub CreateProcessInternalA
-# @ stub CreateProcessInternalW
+@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr) kernel32.CreateProcessInternalW
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx
diff --git a/include/winbase.h b/include/winbase.h
index de52e5a..99e761e 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -1863,6 +1863,7 @@ WINBASEAPI BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTE
WINADVAPI BOOL WINAPI CreateProcessAsUserA(HANDLE,LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
WINADVAPI BOOL WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
#define CreateProcessAsUser WINELIB_NAME_AW(CreateProcessAsUser)
+WINBASEAPI BOOL WINAPI CreateProcessInternalW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION,HANDLE*);
WINADVAPI BOOL WINAPI CreateProcessWithLogonW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPCWSTR,LPWSTR,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
WINBASEAPI HANDLE WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
WINBASEAPI HANDLE WINAPI CreateRemoteThreadEx(HANDLE,LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPPROC_THREAD_ATTRIBUTE_LIST,LPDWORD);
--
2.7.4

View File

@ -1,62 +0,0 @@
From bddfc5e460ca5d5751bf7d9069379e0e0462ae94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 6 Aug 2017 02:11:15 +0200
Subject: advapi32: Use token in CreateProcessAsUserW and
CreateProcessWithTokenW.
---
dlls/advapi32/security.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index c531e45c9a0..4fc27ef82f9 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -5700,13 +5700,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(
LPSTARTUPINFOW lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation )
{
- FIXME("%p %s %s %p %p %d 0x%08x %p %s %p %p - semi-stub\n", hToken,
+ TRACE("%p %s %s %p %p %d 0x%08x %p %s %p %p\n", hToken,
debugstr_w(lpApplicationName), debugstr_w(lpCommandLine), lpProcessAttributes,
lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment,
debugstr_w(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
/* We should create the process with a suspended main thread */
- if (!CreateProcessW (lpApplicationName,
+ if (!CreateProcessInternalW(hToken,
+ lpApplicationName,
lpCommandLine,
lpProcessAttributes,
lpThreadAttributes,
@@ -5715,7 +5716,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(
lpEnvironment,
lpCurrentDirectory,
lpStartupInfo,
- lpProcessInformation))
+ lpProcessInformation,
+ NULL))
{
return FALSE;
}
@@ -5742,14 +5744,14 @@ BOOL WINAPI CreateProcessWithTokenW(HANDLE token, DWORD logon_flags, LPCWSTR app
DWORD creation_flags, void *environment, LPCWSTR current_directory, STARTUPINFOW *startup_info,
PROCESS_INFORMATION *process_information )
{
- FIXME("%p 0x%08x %s %s 0x%08x %p %s %p %p - semi-stub\n", token,
+ TRACE("%p 0x%08x %s %s 0x%08x %p %s %p %p\n", token,
logon_flags, debugstr_w(application_name), debugstr_w(command_line),
creation_flags, environment, debugstr_w(current_directory),
startup_info, process_information);
/* FIXME: check if handles should be inherited */
- return CreateProcessW( application_name, command_line, NULL, NULL, FALSE, creation_flags, environment,
- current_directory, startup_info, process_information );
+ return CreateProcessInternalW( token, application_name, command_line, NULL, NULL, FALSE, creation_flags, environment,
+ current_directory, startup_info, process_information, NULL );
}
/******************************************************************************
--
2.13.1

View File

@ -1,4 +1,4 @@
From 3755d929ed2c1ceb101bf0741e78888624fbcf44 Mon Sep 17 00:00:00 2001
From 636fa0f406701e9af68f4274f07da1489a7b0c72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 19 Jan 2017 16:54:42 +0100
Subject: [PATCH] wined3d: Add wined3d_resource_map_info function.
@ -13,11 +13,11 @@ Subject: [PATCH] wined3d: Add wined3d_resource_map_info function.
6 files changed, 70 insertions(+)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 3f4552f..2350661 100644
index 17bcb70bc3..1777638751 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1275,6 +1275,24 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
return wined3d_buffer_map(buffer, offset, size, (BYTE **)&map_desc->data, flags);
@@ -1304,6 +1304,24 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
return wined3d_buffer_gl_map(buffer_gl, offset, size, (BYTE **)&map_desc->data, flags);
}
+static HRESULT buffer_resource_sub_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx,
@ -41,7 +41,7 @@ index 3f4552f..2350661 100644
static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
{
if (sub_resource_idx)
@@ -1294,6 +1312,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
@@ -1323,6 +1341,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
buffer_resource_preload,
buffer_unload,
buffer_resource_sub_resource_map,
@ -50,10 +50,10 @@ index 3f4552f..2350661 100644
};
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index b5dcdf0..28581a1 100644
index 9df0a0923b..909dd3ae4b 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -358,6 +358,14 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
@@ -360,6 +360,14 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
return wined3d_cs_map(resource->device->cs, resource, sub_resource_idx, map_desc, box, flags);
}
@ -69,10 +69,10 @@ index b5dcdf0..28581a1 100644
{
TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index dadcd03..ed63158 100644
index a3d834e8f5..2d62e697f5 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2345,6 +2345,36 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -2683,6 +2683,36 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
return WINED3D_OK;
}
@ -109,7 +109,7 @@ index dadcd03..ed63158 100644
static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
{
struct wined3d_texture_sub_resource *sub_resource;
@@ -2396,6 +2426,7 @@ static const struct wined3d_resource_ops texture_resource_ops =
@@ -2734,6 +2764,7 @@ static const struct wined3d_resource_ops texture_resource_ops =
texture_resource_preload,
wined3d_texture_unload,
texture_resource_sub_resource_map,
@ -118,10 +118,10 @@ index dadcd03..ed63158 100644
};
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index bf29e20..58dc0a9 100644
index ee70221191..f494456451 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -229,6 +229,7 @@
@@ -220,6 +220,7 @@
@ cdecl wined3d_resource_get_parent(ptr)
@ cdecl wined3d_resource_get_priority(ptr)
@ cdecl wined3d_resource_map(ptr long ptr ptr long)
@ -130,10 +130,10 @@ index bf29e20..58dc0a9 100644
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_priority(ptr long)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b297799..ed08c4b 100644
index 2b52218972..e0ec463805 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3030,6 +3030,8 @@ struct wined3d_resource_ops
@@ -3094,6 +3094,8 @@ struct wined3d_resource_ops
void (*resource_unload)(struct wined3d_resource *resource);
HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
@ -143,10 +143,10 @@ index b297799..ed08c4b 100644
};
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 15e14e5..fa929e5 100644
index dc491d3b98..8e0cf66509 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1806,6 +1806,13 @@ struct wined3d_map_desc
@@ -1835,6 +1835,13 @@ struct wined3d_map_desc
void *data;
};
@ -160,7 +160,7 @@ index 15e14e5..fa929e5 100644
struct wined3d_sub_resource_data
{
const void *data;
@@ -2584,6 +2591,8 @@ void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resour
@@ -2606,6 +2613,8 @@ void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resour
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
@ -170,5 +170,5 @@ index 15e14e5..fa929e5 100644
void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent);
DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority);
--
1.9.1
2.19.1

View File

@ -1,15 +1,15 @@
From 6fa6beeb94f2c8b2d98706ac1b428b1be5a44597 Mon Sep 17 00:00:00 2001
From a2db3d4e01b9194ae0f79ebb416134a7c8d6bb42 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Tue, 24 Jul 2018 11:26:39 -0600
Subject: [PATCH] ntdll: Add a futex-based condition variable implementation.
With significant contributions from Andrew Wesie.
---
dlls/ntdll/sync.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 184 insertions(+), 28 deletions(-)
dlls/ntdll/sync.c | 213 ++++++++++++++++++++++++++++++++++++++++------
1 file changed, 185 insertions(+), 28 deletions(-)
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index 8e406ce..09ecec5 100644
index a00a159d24..cef0035850 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -26,6 +26,7 @@
@ -30,10 +30,12 @@ index 8e406ce..09ecec5 100644
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -61,6 +65,138 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
@@ -61,7 +65,140 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
HANDLE keyed_event = NULL;
+
static const LARGE_INTEGER zero_timeout;
+#define TICKSPERSEC 10000000
+
+#ifdef __linux__
@ -166,15 +168,15 @@ index 8e406ce..09ecec5 100644
+}
+#endif
+
static inline int interlocked_dec_if_nonzero( int *dest )
{
int val, tmp;
@@ -1813,8 +1949,11 @@ void WINAPI RtlInitializeConditionVariable( RTL_CONDITION_VARIABLE *variable )
@@ -1867,8 +2004,11 @@ void WINAPI RtlInitializeConditionVariable( RTL_CONDITION_VARIABLE *variable )
*/
void WINAPI RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable )
{
- if (interlocked_dec_if_nonzero( (int *)&variable->Ptr ))
- NtReleaseKeyedEvent( keyed_event, &variable->Ptr, FALSE, NULL );
- NtReleaseKeyedEvent( 0, &variable->Ptr, FALSE, NULL );
+ if (fast_wake( variable, 1 ) == STATUS_NOT_IMPLEMENTED)
+ {
+ if (interlocked_dec_if_nonzero( (int *)&variable->Ptr ))
@ -183,13 +185,13 @@ index 8e406ce..09ecec5 100644
}
/***********************************************************************
@@ -1824,9 +1963,12 @@ void WINAPI RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable )
@@ -1878,9 +2018,12 @@ void WINAPI RtlWakeConditionVariable( RTL_CONDITION_VARIABLE *variable )
*/
void WINAPI RtlWakeAllConditionVariable( RTL_CONDITION_VARIABLE *variable )
{
- int val = interlocked_xchg( (int *)&variable->Ptr, 0 );
- while (val-- > 0)
- NtReleaseKeyedEvent( keyed_event, &variable->Ptr, FALSE, NULL );
- NtReleaseKeyedEvent( 0, &variable->Ptr, FALSE, NULL );
+ if (fast_wake( variable, INT_MAX ) == STATUS_NOT_IMPLEMENTED)
+ {
+ int val = interlocked_xchg( (int *)&variable->Ptr, 0 );
@ -199,19 +201,19 @@ index 8e406ce..09ecec5 100644
}
/***********************************************************************
@@ -1848,17 +1990,24 @@ NTSTATUS WINAPI RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE *variable, R
@@ -1902,17 +2045,24 @@ NTSTATUS WINAPI RtlSleepConditionVariableCS( RTL_CONDITION_VARIABLE *variable, R
const LARGE_INTEGER *timeout )
{
NTSTATUS status;
- interlocked_xchg_add( (int *)&variable->Ptr, 1 );
- RtlLeaveCriticalSection( crit );
- status = NtWaitForKeyedEvent( keyed_event, &variable->Ptr, FALSE, timeout );
- status = NtWaitForKeyedEvent( 0, &variable->Ptr, FALSE, timeout );
- if (status != STATUS_SUCCESS)
+ if ((status = fast_sleep_cs( variable, crit, timeout )) == STATUS_NOT_IMPLEMENTED)
{
- if (!interlocked_dec_if_nonzero( (int *)&variable->Ptr ))
- status = NtWaitForKeyedEvent( keyed_event, &variable->Ptr, FALSE, NULL );
- status = NtWaitForKeyedEvent( 0, &variable->Ptr, FALSE, NULL );
- }
+ interlocked_xchg_add( (int *)&variable->Ptr, 1 );
+ RtlLeaveCriticalSection( crit );
@ -232,23 +234,23 @@ index 8e406ce..09ecec5 100644
return status;
}
@@ -1885,23 +2034,30 @@ NTSTATUS WINAPI RtlSleepConditionVariableSRW( RTL_CONDITION_VARIABLE *variable,
@@ -1939,24 +2089,31 @@ NTSTATUS WINAPI RtlSleepConditionVariableSRW( RTL_CONDITION_VARIABLE *variable,
const LARGE_INTEGER *timeout, ULONG flags )
{
NTSTATUS status;
- interlocked_xchg_add( (int *)&variable->Ptr, 1 );
-
- if (flags & RTL_CONDITION_VARIABLE_LOCKMODE_SHARED)
- RtlReleaseSRWLockShared( lock );
- else
- RtlReleaseSRWLockExclusive( lock );
-
- status = NtWaitForKeyedEvent( keyed_event, &variable->Ptr, FALSE, timeout );
- status = NtWaitForKeyedEvent( 0, &variable->Ptr, FALSE, timeout );
- if (status != STATUS_SUCCESS)
+ if ((status = fast_sleep_srw( variable, lock, timeout, flags )) == STATUS_NOT_IMPLEMENTED)
{
- if (!interlocked_dec_if_nonzero( (int *)&variable->Ptr ))
- status = NtWaitForKeyedEvent( keyed_event, &variable->Ptr, FALSE, NULL );
- status = NtWaitForKeyedEvent( 0, &variable->Ptr, FALSE, NULL );
- }
+ interlocked_xchg_add( (int *)&variable->Ptr, 1 );
@ -278,6 +280,7 @@ index 8e406ce..09ecec5 100644
+ }
return status;
}
--
2.7.4
2.19.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "13cdcdae1a9e58f2eec9cd99b7b7f7899b4d111b"
echo "d279bc24934fd1b68324017ae1b9e70975640a0a"
}
# Show version information
@ -2445,10 +2445,9 @@ fi
# | * [#39262] Run explorer.exe as unevaluated process
# |
# | Modified files:
# | * configure.ac, dlls/advapi32/security.c, dlls/advapi32/tests/Makefile.in, dlls/advapi32/tests/security.c,
# | dlls/kernel32/kernel32.spec, dlls/kernel32/process.c, dlls/kernelbase/kernelbase.spec, dlls/ntdll/loader.c,
# | dlls/ntdll/nt.c, dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, dlls/ntdll/process.c, dlls/shell32/shlexec.c,
# | dlls/user32/win.c, include/winbase.h, programs/runas/Makefile.in, programs/runas/runas.c, programs/runas/runas.h,
# | * configure.ac, dlls/advapi32/tests/Makefile.in, dlls/advapi32/tests/security.c, dlls/kernel32/process.c,
# | dlls/ntdll/loader.c, dlls/ntdll/nt.c, dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, dlls/ntdll/process.c,
# | dlls/shell32/shlexec.c, dlls/user32/win.c, programs/runas/Makefile.in, programs/runas/runas.c, programs/runas/runas.h,
# | programs/runas/runas.rc, server/process.c, server/process.h, server/protocol.def, server/request.c, server/security.h,
# | server/token.c
# |
@ -2461,9 +2460,7 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
patch_apply advapi32-Token_Integrity_Level/0006-ntdll-Add-function-to-create-new-tokens-for-elevatio.patch
patch_apply advapi32-Token_Integrity_Level/0007-shell32-Implement-process-elevation-using-runas-verb.patch
patch_apply advapi32-Token_Integrity_Level/0008-ntdll-Implement-process-token-elevation-through-mani.patch
patch_apply advapi32-Token_Integrity_Level/0009-kernel32-Implement-CreateProcessInternalW.patch
patch_apply advapi32-Token_Integrity_Level/0010-server-Implement-support-for-creating-processes-usin.patch
patch_apply advapi32-Token_Integrity_Level/0011-advapi32-Use-token-in-CreateProcessAsUserW-and-Creat.patch
patch_apply advapi32-Token_Integrity_Level/0012-user32-Start-explorer.exe-using-limited-rights.patch
patch_apply advapi32-Token_Integrity_Level/0013-server-Correctly-assign-security-labels-for-tokens.patch
patch_apply advapi32-Token_Integrity_Level/0014-programs-runas-Basic-implementation-for-starting-pro.patch
@ -2477,9 +2474,7 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
printf '%s\n' '+ { "Michael Müller", "ntdll: Add function to create new tokens for elevation purposes.", 1 },';
printf '%s\n' '+ { "Michael Müller", "shell32: Implement process elevation using runas verb.", 1 },';
printf '%s\n' '+ { "Michael Müller", "ntdll: Implement process token elevation through manifests.", 1 },';
printf '%s\n' '+ { "Michael Müller", "kernel32: Implement CreateProcessInternalW.", 1 },';
printf '%s\n' '+ { "Michael Müller", "server: Implement support for creating processes using a token.", 1 },';
printf '%s\n' '+ { "Michael Müller", "advapi32: Use token in CreateProcessAsUserW and CreateProcessWithTokenW.", 1 },';
printf '%s\n' '+ { "Michael Müller", "user32: Start explorer.exe using limited rights.", 1 },';
printf '%s\n' '+ { "Michael Müller", "server: Correctly assign security labels for tokens.", 1 },';
printf '%s\n' '+ { "Michael Müller", "programs/runas: Basic implementation for starting processes with a different trustlevel.", 1 },';

View File

@ -1,17 +1,17 @@
From 1fe3ee5e7cc9efd49203f9b9b67354823f4fe66b Mon Sep 17 00:00:00 2001
From 860c03c4e27d50537c05c29b086eb91fc136668f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 8 Mar 2017 19:39:29 +0100
Subject: [PATCH] ntdll: Mimic object type behavior for different windows
versions.
---
dlls/ntdll/nt.c | 17 ++++++++++++--
dlls/ntdll/nt.c | 17 +++++++++--
dlls/ntdll/om.c | 5 +++-
dlls/ntdll/tests/om.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++-
dlls/ntdll/tests/om.c | 65 ++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 14c2435..b9a2b93 100644
index 14c2435eeb..b9a2b93c26 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -127,6 +127,19 @@ struct smbios_chassis {
@ -53,7 +53,7 @@ index 14c2435..b9a2b93 100644
}
}
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
index 629f785..060b502 100644
index 629f785099..060b502d75 100644
--- a/dlls/ntdll/om.c
+++ b/dlls/ntdll/om.c
@@ -186,7 +186,10 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
@ -69,18 +69,18 @@ index 629f785..060b502 100644
}
}
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
index d22ef05..6c039ba 100644
index 1c3114d29c..5a2ca9b740 100644
--- a/dlls/ntdll/tests/om.c
+++ b/dlls/ntdll/tests/om.c
@@ -70,6 +70,7 @@ static NTSTATUS (WINAPI *pNtReleaseKeyedEvent)( HANDLE, const void *, BOOLEAN, c
static NTSTATUS (WINAPI *pNtCreateIoCompletion)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, ULONG);
static NTSTATUS (WINAPI *pNtOpenIoCompletion)( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES );
static NTSTATUS (WINAPI *pNtQueryInformationFile)(HANDLE, PIO_STATUS_BLOCK, void *, ULONG, FILE_INFORMATION_CLASS);
@@ -74,6 +74,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemTime)( LARGE_INTEGER * );
static NTSTATUS (WINAPI *pRtlWaitOnAddress)( const void *, const void *, SIZE_T, const LARGE_INTEGER * );
static void (WINAPI *pRtlWakeAddressAll)( const void * );
static void (WINAPI *pRtlWakeAddressSingle)( const void * );
+static NTSTATUS (WINAPI *pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
#define KEYEDEVENT_WAIT 0x0001
#define KEYEDEVENT_WAKE 0x0002
@@ -1620,13 +1621,31 @@ static void test_query_object(void)
@@ -1624,13 +1625,31 @@ static void test_query_object(void)
pRtlFreeUnicodeString( &session );
}
@ -113,7 +113,7 @@ index d22ef05..6c039ba 100644
buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(OBJECT_TYPES_INFORMATION) );
ok( buffer != NULL, "Failed to allocate memory\n" );
@@ -1654,11 +1673,54 @@ static void test_query_object_types(void)
@@ -1658,11 +1677,54 @@ static void test_query_object_types(void)
ok( type->TypeName.Length == sizeof(typeW) && !strncmpW(typeW, type->TypeName.Buffer, 4),
"Expected 'Type' as first type, got %s\n", wine_dbgstr_us(&type->TypeName) );
}
@ -168,14 +168,14 @@ index d22ef05..6c039ba 100644
}
static void test_type_mismatch(void)
@@ -2173,6 +2235,7 @@ START_TEST(om)
pNtCreateIoCompletion = (void *)GetProcAddress(hntdll, "NtCreateIoCompletion");
pNtOpenIoCompletion = (void *)GetProcAddress(hntdll, "NtOpenIoCompletion");
pNtQueryInformationFile = (void *)GetProcAddress(hntdll, "NtQueryInformationFile");
@@ -2254,6 +2316,7 @@ START_TEST(om)
pRtlWaitOnAddress = (void *)GetProcAddress(hntdll, "RtlWaitOnAddress");
pRtlWakeAddressAll = (void *)GetProcAddress(hntdll, "RtlWakeAddressAll");
pRtlWakeAddressSingle = (void *)GetProcAddress(hntdll, "RtlWakeAddressSingle");
+ pNtQuerySystemInformation = (void *)GetProcAddress(hntdll, "NtQuerySystemInformation");
test_case_sensitive();
test_namespace_pipe();
--
1.9.1
2.19.1