Michael Karcher : ntdll: Add ProcessExecuteFlags handling to NtQueryInformationProcess.

Alexandre Julliard julliard at winehq.org
Tue Aug 18 09:59:57 CDT 2009


Module: wine
Branch: master
Commit: 7aa1f6c346ab6610cd91e4016ae8cdc81fdaa6d6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7aa1f6c346ab6610cd91e4016ae8cdc81fdaa6d6

Author: Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>
Date:   Tue Aug 18 01:20:52 2009 +0200

ntdll: Add ProcessExecuteFlags handling to NtQueryInformationProcess.

---

 dlls/ntdll/process.c         |   11 +++++++++++
 dlls/ntdll/tests/exception.c |   10 +++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 265aa2e..ef581bc 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -37,6 +37,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
 
+static ULONG execute_flags = MEM_EXECUTE_OPTION_ENABLE;
+
 /*
  *	Process object
  */
@@ -347,6 +349,14 @@ NTSTATUS WINAPI NtQueryInformationProcess(
         }
         SERVER_END_REQ;
         break;
+    case ProcessExecuteFlags:
+        if (ProcessInformationLength == sizeof(ULONG))
+        {
+            *(ULONG *)ProcessInformation = execute_flags;
+            len = sizeof(ULONG);
+        }
+        else ret = STATUS_INFO_LENGTH_MISMATCH;
+        break;
     default:
         FIXME("(%p,info_class=%d,%p,0x%08x,%p) Unknown information class\n",
               ProcessHandle,ProcessInformationClass,
@@ -424,6 +434,7 @@ NTSTATUS WINAPI NtSetInformationProcess(
             default:
                 return STATUS_INVALID_PARAMETER;
             }
+            execute_flags = *(ULONG *)ProcessInformation;
             VIRTUAL_SetForceExec( enable );
         }
         break;
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 2a959f7..d0b85f6 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -1053,7 +1053,11 @@ static void test_dpe_exceptions(void)
         info.exception_caught = FALSE;
         run_exception_test(dpe_exception_handler, &info, single_ret, sizeof(single_ret), PAGE_NOACCESS);
         ok(info.exception_caught == TRUE, "Execution of disabled memory suceeded\n");
-        ok(info.exception_info == EXCEPTION_READ_FAULT,
+        if(has_hw_support)
+            todo_wine ok(info.exception_info == EXCEPTION_READ_FAULT,
+              "Access violation type: %08x\n", (unsigned)info.exception_info);
+        else
+            ok(info.exception_info == EXCEPTION_READ_FAULT,
               "Access violation type: %08x\n", (unsigned)info.exception_info);
     }
     else
@@ -1070,12 +1074,12 @@ static void test_dpe_exceptions(void)
     /* Try to turn off DEP */
     val = MEM_EXECUTE_OPTION_ENABLE;
     stat = pNtSetInformationProcess(GetCurrentProcess(), ProcessExecuteFlags, &val, sizeof val);
-    ok(stat == STATUS_ACCESS_DENIED, "disabling DEP while permanent: status %08x\n", stat);
+    todo_wine ok(stat == STATUS_ACCESS_DENIED, "disabling DEP while permanent: status %08x\n", stat);
 
     /* Try to turn on DEP */
     val = MEM_EXECUTE_OPTION_DISABLE;
     stat = pNtSetInformationProcess(GetCurrentProcess(), ProcessExecuteFlags, &val, sizeof val);
-    ok(stat == STATUS_ACCESS_DENIED, "enabling DEP while permanent: status %08x\n", stat);
+    todo_wine ok(stat == STATUS_ACCESS_DENIED, "enabling DEP while permanent: status %08x\n", stat);
 }
 
 #elif defined(__x86_64__)




More information about the wine-cvs mailing list