https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9237c1a45587d927b28c1d7ea8f84da2eebfe315

commit 9237c1a45587d927b28c1d7ea8f84da2eebfe315
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Mon Jan 30 22:52:26 2023 +0200
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Tue Jan 31 18:39:21 2023 +0100

    [NTDLL_APITEST] Fix test for ProcessUserModeIOPL in 
Nt[Query/Set]InformationProcess
---
 modules/rostests/apitests/ntdll/probelib.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/modules/rostests/apitests/ntdll/probelib.c 
b/modules/rostests/apitests/ntdll/probelib.c
index 7755d53fb4e..85ca78e9707 100644
--- a/modules/rostests/apitests/ntdll/probelib.c
+++ b/modules/rostests/apitests/ntdll/probelib.c
@@ -49,6 +49,20 @@ QuerySetProcessValidator(
                     break;
                 }
 
+                /* This one works different from the others */
+                case ProcessUserModeIOPL:
+                {
+                    if (ExpectedStatus == STATUS_INFO_LENGTH_MISMATCH)
+                    {
+                        SpecialStatus = STATUS_ACCESS_VIOLATION;
+                    }
+                    else
+                    {
+                        SpecialStatus = STATUS_INVALID_INFO_CLASS;
+                    }
+                    break;
+                }
+
                 /* These classes don't belong in the query group */
                 case ProcessBasePriority:
                 case ProcessRaisePriority:
@@ -56,7 +70,6 @@ QuerySetProcessValidator(
                 case ProcessAccessToken:
                 case ProcessLdtSize:
                 case ProcessIoPortHandlers:
-                case ProcessUserModeIOPL:
                 case ProcessEnableAlignmentFaultFixup:
                 case ProcessAffinityMask:
                 case ProcessForegroundInformation:
@@ -116,9 +129,17 @@ QuerySetProcessValidator(
                     break;
                 }
 
+                /* This one works different from the others */
                 case ProcessUserModeIOPL:
                 {
-                    SpecialStatus = STATUS_PRIVILEGE_NOT_HELD;
+                    if (ExpectedStatus == STATUS_INFO_LENGTH_MISMATCH)
+                    {
+                        SpecialStatus = STATUS_ACCESS_VIOLATION;
+                    }
+                    else
+                    {
+                        SpecialStatus = STATUS_PRIVILEGE_NOT_HELD;
+                    }
                     break;
                 }
 

Reply via email to