Rebase against 47ac628b4a4e476c1b044765c95d5be2a7101d14.

This commit is contained in:
Alistair Leslie-Hughes 2021-01-31 18:52:51 +11:00
parent 5c5a8f3b2c
commit 43c064ef3c
7 changed files with 11 additions and 254 deletions

View File

@ -1,80 +0,0 @@
From 2543348eb9a6d0ab4cdac725d240b16e0648dce7 Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Tue, 19 Apr 2016 07:25:39 +0200
Subject: [PATCH] kernel32: Implement SetProcessDEPPolicy().
---
dlls/kernel32/process.c | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index ec37b66621f..cb15823c864 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -49,6 +49,8 @@ typedef struct
DWORD dwReserved;
} LOADPARMS32;
+static BOOL is_wow64;
+
SYSTEM_BASIC_INFORMATION system_info = { 0 };
/* Process flags */
@@ -59,6 +61,7 @@ SYSTEM_BASIC_INFORMATION system_info = { 0 };
#define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
#define PDB32_WIN32S_PROC 0x8000 /* Win32s process */
+static DEP_SYSTEM_POLICY_TYPE system_DEP_policy = OptIn;
/***********************************************************************
* wait_input_idle
@@ -177,7 +180,6 @@ DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
return ret;
}
-
/***********************************************************************
* ExitProcess (KERNEL32.@)
*
@@ -562,9 +564,35 @@ DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy(void)
*/
BOOL WINAPI SetProcessDEPPolicy(DWORD newDEP)
{
- FIXME("(%d): stub\n", newDEP);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ ULONG dep_flags = 0;
+ NTSTATUS status;
+
+ TRACE("(%d)\n", newDEP);
+
+ if (is_wow64 || (system_DEP_policy != OptIn && system_DEP_policy != OptOut) )
+ {
+ SetLastError(ERROR_ACCESS_DENIED);
+ return FALSE;
+ }
+
+ if (!newDEP)
+ dep_flags = MEM_EXECUTE_OPTION_ENABLE;
+ else if (newDEP & PROCESS_DEP_ENABLE)
+ dep_flags = MEM_EXECUTE_OPTION_DISABLE|MEM_EXECUTE_OPTION_PERMANENT;
+ else
+ {
+ SetLastError(ERROR_ACCESS_DENIED);
+ return FALSE;
+ }
+
+ if (newDEP & PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION)
+ dep_flags |= MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION;
+
+ status = NtSetInformationProcess( GetCurrentProcess(), ProcessExecuteFlags,
+ &dep_flags, sizeof(dep_flags) );
+
+ if (status) SetLastError( RtlNtStatusToDosError(status) );
+ return !status;
}
/**********************************************************************
--
2.29.2

View File

@ -1,100 +0,0 @@
From aedc3b18250733d5390e88ba451ee58d517eff3b Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Tue, 19 Apr 2016 07:33:32 +0200
Subject: [PATCH] kernel32: Implement GetSystemDEPPolicy().
---
dlls/kernel32/process.c | 70 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 68 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index e8e1e61b354..639c39460d9 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -33,6 +33,7 @@
#include "winnls.h"
#include "wincon.h"
#include "kernel_private.h"
+#include "winreg.h"
#include "psapi.h"
#include "wine/exception.h"
#include "wine/server.h"
@@ -560,8 +561,73 @@ DWORD WINAPI WTSGetActiveConsoleSessionId(void)
*/
DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy(void)
{
- FIXME("stub\n");
- return OptIn;
+ char buffer[MAX_PATH+10];
+ DWORD size = sizeof(buffer);
+ HKEY hkey = 0;
+ HKEY appkey = 0;
+ DWORD len;
+ LSTATUS (WINAPI *pRegOpenKeyA)(HKEY,LPCSTR,PHKEY);
+ LSTATUS (WINAPI *pRegQueryValueExA)(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
+ LSTATUS (WINAPI *pRegCloseKey)(HKEY);
+
+ TRACE("()\n");
+
+ pRegOpenKeyA = (void*)GetProcAddress(GetModuleHandleA("advapi32"), "RegOpenKeyA");
+ pRegQueryValueExA = (void*)GetProcAddress(GetModuleHandleA("advapi32"), "RegQueryValueExA");
+ pRegCloseKey = (void*)GetProcAddress(GetModuleHandleA("advapi32"), "RegCloseKey");
+ if ( !pRegOpenKeyA || !pRegQueryValueExA || !pRegCloseKey ) return OptIn;
+
+ /* @@ Wine registry key: HKCU\Software\Wine\Boot.ini */
+ if ( pRegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Boot.ini", &hkey ) ) hkey = 0;
+
+ len = GetModuleFileNameA( 0, buffer, MAX_PATH );
+ if (len && len < MAX_PATH)
+ {
+ HKEY tmpkey;
+ /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\Boot.ini */
+ if (!pRegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\AppDefaults", &tmpkey ))
+ {
+ char *p, *appname = buffer;
+ if ((p = strrchr( appname, '/' ))) appname = p + 1;
+ if ((p = strrchr( appname, '\\' ))) appname = p + 1;
+ strcat( appname, "\\Boot.ini" );
+ TRACE("appname = [%s]\n", appname);
+ if (pRegOpenKeyA( tmpkey, appname, &appkey )) appkey = 0;
+ pRegCloseKey( tmpkey );
+ }
+ }
+
+ if (hkey || appkey)
+ {
+ if ((appkey && !pRegQueryValueExA(appkey, "NoExecute", 0, NULL, (BYTE *)buffer, &size)) ||
+ (hkey && !pRegQueryValueExA(hkey, "NoExecute", 0, NULL, (BYTE *)buffer, &size)))
+ {
+ if (!strcmp(buffer,"OptIn"))
+ {
+ TRACE("System DEP policy set to OptIn\n");
+ system_DEP_policy = OptIn;
+ }
+ else if (!strcmp(buffer,"OptOut"))
+ {
+ TRACE("System DEP policy set to OptOut\n");
+ system_DEP_policy = OptIn;
+ }
+ else if (!strcmp(buffer,"AlwaysOn"))
+ {
+ TRACE("System DEP policy set to AlwaysOn\n");
+ system_DEP_policy = AlwaysOn;
+ }
+ else if (!strcmp(buffer,"AlwaysOff"))
+ {
+ TRACE("System DEP policy set to AlwaysOff\n");
+ system_DEP_policy = AlwaysOff;
+ }
+ }
+ }
+
+ if (appkey) pRegCloseKey( appkey );
+ if (hkey) pRegCloseKey( hkey );
+ return system_DEP_policy;
}
/**********************************************************************
--
2.28.0

View File

@ -1,44 +0,0 @@
From 54e9832efd935277864c1faa0cb070676d2079a9 Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Tue, 19 Apr 2016 07:36:41 +0200
Subject: [PATCH] kernel32: Make system DEP policy affect
GetProcessDEPPolicy().
---
dlls/kernel32/process.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 958b437cea..d7a444a314 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -3904,13 +3904,21 @@ BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
if (flags)
{
*flags = 0;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
- *flags |= PROCESS_DEP_ENABLE;
- if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
- *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ if (system_DEP_policy != AlwaysOff)
+ {
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE || system_DEP_policy == AlwaysOn)
+ *flags |= PROCESS_DEP_ENABLE;
+ if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
+ *flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
+ }
}
- if (permanent) *permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
+ if (permanent)
+ {
+ *permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
+ if (system_DEP_policy == AlwaysOn || system_DEP_policy == AlwaysOff)
+ *permanent = TRUE;
+ }
return TRUE;
}
--
2.23.0

View File

@ -1 +0,0 @@
Fixes: [24125] kernel32: Implement SetProcessDEPPolicy.

View File

@ -1,4 +1,4 @@
From ca61f3487605168b0f68f9c3d64bec15f5ecef1f Mon Sep 17 00:00:00 2001
From 32a148c4f8b2c62c7c227b17e8fba2a7aac8ae62 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Mon, 16 Mar 2020 12:09:39 -0500
Subject: [PATCH] winegstreamer: Implement decoder MFT on gstreamer.
@ -28,7 +28,7 @@ index 4f6b428f067..81c670c17e4 100644
pin.c \
qualitycontrol.c \
diff --git a/dlls/winegstreamer/gst_cbs.c b/dlls/winegstreamer/gst_cbs.c
index 6c5877ce785..cf410b8934d 100644
index 90c34b1cb39..cfa3a0f566d 100644
--- a/dlls/winegstreamer/gst_cbs.c
+++ b/dlls/winegstreamer/gst_cbs.c
@@ -51,6 +51,8 @@ static void CALLBACK perform_cb(TP_CALLBACK_INSTANCE *instance, void *user)
@ -40,7 +40,7 @@ index 6c5877ce785..cf410b8934d 100644
pthread_mutex_lock(&cbdata->lock);
cbdata->finished = 1;
@@ -301,3 +303,66 @@ void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user)
@@ -260,3 +262,66 @@ void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user)
call_cb(&cbdata);
}
@ -108,10 +108,10 @@ index 6c5877ce785..cf410b8934d 100644
+ return cbdata.u.new_sample_data.ret;
+}
diff --git a/dlls/winegstreamer/gst_cbs.h b/dlls/winegstreamer/gst_cbs.h
index f063a0a2a7b..7737ae589d2 100644
index cbd9a630885..64b037ffed0 100644
--- a/dlls/winegstreamer/gst_cbs.h
+++ b/dlls/winegstreamer/gst_cbs.h
@@ -45,6 +45,12 @@ enum CB_TYPE {
@@ -42,6 +42,12 @@ enum CB_TYPE {
MF_SRC_STREAM_REMOVED,
MF_SRC_NO_MORE_PADS,
MEDIA_SOURCE_MAX,
@ -124,7 +124,7 @@ index f063a0a2a7b..7737ae589d2 100644
};
struct cb_data {
@@ -103,6 +109,17 @@ struct cb_data {
@@ -100,6 +106,17 @@ struct cb_data {
GstQuery *query;
gboolean ret;
} query_sink_data;
@ -142,15 +142,15 @@ index f063a0a2a7b..7737ae589d2 100644
} u;
int finished;
@@ -114,6 +131,7 @@ struct cb_data {
@@ -111,6 +128,7 @@ struct cb_data {
void mark_wine_thread(void) DECLSPEC_HIDDEN;
void perform_cb_gstdemux(struct cb_data *data) DECLSPEC_HIDDEN;
void perform_cb_media_source(struct cb_data *data) DECLSPEC_HIDDEN;
+void perform_cb_mf_decode(struct cb_data *data) DECLSPEC_HIDDEN;
void existing_new_pad_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
gboolean activate_mode_wrapper(GstPad *pad, GstObject *parent, GstPadMode mode, gboolean activate) DECLSPEC_HIDDEN;
@@ -130,5 +148,10 @@ GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpoin
GstFlowReturn got_data_wrapper(GstPad *pad, GstObject *parent, GstBuffer *buf) DECLSPEC_HIDDEN;
@@ -124,5 +142,10 @@ GstBusSyncReply mf_src_bus_watch_wrapper(GstBus *bus, GstMessage *message, gpoin
void mf_src_stream_added_wrapper(GstElement *bin, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
void mf_src_stream_removed_wrapper(GstElement *element, GstPad *pad, gpointer user) DECLSPEC_HIDDEN;
void mf_src_no_more_pads_wrapper(GstElement *element, gpointer user) DECLSPEC_HIDDEN;

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "f72ef20e88fba67254caf0124ab8713e3d15fa2a"
echo "47ac628b4a4e476c1b044765c95d5be2a7101d14"
}
# Show version information
@ -140,7 +140,6 @@ patch_enable_all ()
enable_kernel32_FindFirstFile="$1"
enable_kernel32_Job_Tests="$1"
enable_kernel32_Processor_Group="$1"
enable_kernel32_SetProcessDEPPolicy="$1"
enable_krnl386_exe16_GDT_LDT_Emulation="$1"
enable_krnl386_exe16_Invalid_Console_Handles="$1"
enable_libs_Unicode_Collation="$1"
@ -507,9 +506,6 @@ patch_enable ()
kernel32-Processor_Group)
enable_kernel32_Processor_Group="$2"
;;
kernel32-SetProcessDEPPolicy)
enable_kernel32_SetProcessDEPPolicy="$2"
;;
krnl386.exe16-GDT_LDT_Emulation)
enable_krnl386_exe16_GDT_LDT_Emulation="$2"
;;
@ -2869,20 +2865,6 @@ if test "$enable_kernel32_Processor_Group" -eq 1; then
patch_apply kernel32-Processor_Group/0002-kernel32-Add-stub-for-SetThreadIdealProcessorEx.patch
fi
# Patchset kernel32-SetProcessDEPPolicy
# |
# | This patchset fixes the following Wine bugs:
# | * [#24125] kernel32: Implement SetProcessDEPPolicy.
# |
# | Modified files:
# | * dlls/kernel32/process.c
# |
if test "$enable_kernel32_SetProcessDEPPolicy" -eq 1; then
patch_apply kernel32-SetProcessDEPPolicy/0001-kernel32-Implement-SetProcessDEPPolicy.patch
patch_apply kernel32-SetProcessDEPPolicy/0002-kernel32-Implement-GetSystemDEPPolicy.patch
patch_apply kernel32-SetProcessDEPPolicy/0003-kernel32-Make-system-DEP-policy-affect-GetProcessDEP.patch
fi
# Patchset krnl386.exe16-GDT_LDT_Emulation
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1 +1 @@
f72ef20e88fba67254caf0124ab8713e3d15fa2a
47ac628b4a4e476c1b044765c95d5be2a7101d14