Signed-off-by: Zebediah Figura z.figura12@gmail.com ---
I have been unable to locate a program that requires these. (However, due to ease of implementation, and the fact that the ntdll side of ProcessExecuteFlags is already implemented, I am inclined to believe that they're worth implementing anyway.)
programs/wineboot/wineboot.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 05a5ee6aa62..9427448b612 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -291,6 +291,7 @@ static void create_user_shared_data(void) data->NtMinorVersion = version.dwMinorVersion; data->SuiteMask = version.wSuiteMask; data->NumberOfPhysicalPages = sbi.MmNumberOfPhysicalPages; + data->NXSupportPolicy = NX_SUPPORT_POLICY_OPTIN; wcscpy( data->NtSystemRoot, L"C:\windows" );
features = data->ProcessorFeatures;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 92582ae31de..227d49ea37e 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -34,6 +34,7 @@ #include "wincon.h" #include "kernel_private.h" #include "psapi.h" +#include "ddk/wdm.h" #include "wine/exception.h" #include "wine/server.h" #include "wine/asm.h" @@ -41,6 +42,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(process);
+static const struct _KUSER_SHARED_DATA *user_shared_data = (struct _KUSER_SHARED_DATA *)0x7ffe0000; + typedef struct { LPSTR lpEnvAddress; @@ -553,8 +556,7 @@ DWORD WINAPI WTSGetActiveConsoleSessionId(void) */ DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy(void) { - FIXME("stub\n"); - return OptIn; + return user_shared_data->NXSupportPolicy; }
/**********************************************************************
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/process.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 227d49ea37e..085fff1454e 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -562,11 +562,19 @@ DEP_SYSTEM_POLICY_TYPE WINAPI GetSystemDEPPolicy(void) /********************************************************************** * SetProcessDEPPolicy (KERNEL32.@) */ -BOOL WINAPI SetProcessDEPPolicy(DWORD newDEP) +BOOL WINAPI SetProcessDEPPolicy( DWORD flags ) { - FIXME("(%d): stub\n", newDEP); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + ULONG dep_flags = 0; + + TRACE("%#x\n", flags); + + if (flags & PROCESS_DEP_ENABLE) + dep_flags |= MEM_EXECUTE_OPTION_DISABLE | MEM_EXECUTE_OPTION_PERMANENT; + if (flags & PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION) + dep_flags |= MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION; + + return set_ntstatus( NtSetInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, + &dep_flags, sizeof(dep_flags) ) ); }
/**********************************************************************