From 9237c1a45587d927b28c1d7ea8f84da2eebfe315 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 30 Jan 2023 22:52:26 +0200 Subject: [PATCH] [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; }