https://git.reactos.org/?p=reactos.git;a=commitdiff;h=807af6a4d13d5b280e0f1…
commit 807af6a4d13d5b280e0f113124e8f5085cfc9f4e
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat Oct 9 07:21:53 2021 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Oct 14 23:39:31 2021 +0200
[VIDEOPRT] Correctly return failure when adapter can't be found
This was wrong in both call chains (PNP case or legacy case)
HwFindAdapter returns a VP_STATUS, while we were expecting a NTSTATUS.
CORE-17789
---
win32ss/drivers/videoprt/videoprt.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c
index d49cd20f033..35580904a7b 100644
--- a/win32ss/drivers/videoprt/videoprt.c
+++ b/win32ss/drivers/videoprt/videoprt.c
@@ -345,6 +345,7 @@ IntVideoPortFindAdapter(
{
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
+ VP_STATUS vpStatus;
VIDEO_PORT_CONFIG_INFO ConfigInfo;
SYSTEM_BASIC_INFORMATION SystemBasicInfo;
UCHAR Again = FALSE;
@@ -405,32 +406,27 @@ IntVideoPortFindAdapter(
DriverExtension->InitializationData.HwDeviceExtensionSize);
/* FIXME: Need to figure out what string to pass as param 3. */
- Status = DriverExtension->InitializationData.HwFindAdapter(
+ vpStatus = DriverExtension->InitializationData.HwFindAdapter(
&DeviceExtension->MiniPortDeviceExtension,
DriverExtension->HwContext,
NULL,
&ConfigInfo,
&Again);
- if (Status == ERROR_DEV_NOT_EXIST)
+ if (vpStatus == ERROR_DEV_NOT_EXIST)
{
continue;
}
- else if (Status == NO_ERROR)
- {
- break;
- }
else
{
- ERR_(VIDEOPRT, "HwFindAdapter call failed with error 0x%X\n",
Status);
- goto Failure;
+ break;
}
}
}
else
{
/* FIXME: Need to figure out what string to pass as param 3. */
- Status = DriverExtension->InitializationData.HwFindAdapter(
+ vpStatus = DriverExtension->InitializationData.HwFindAdapter(
&DeviceExtension->MiniPortDeviceExtension,
DriverExtension->HwContext,
NULL,
@@ -438,9 +434,10 @@ IntVideoPortFindAdapter(
&Again);
}
- if (Status != NO_ERROR)
+ if (vpStatus != NO_ERROR)
{
- ERR_(VIDEOPRT, "HwFindAdapter call failed with error 0x%X\n", Status);
+ ERR_(VIDEOPRT, "HwFindAdapter call failed with error 0x%X\n",
vpStatus);
+ Status = STATUS_UNSUCCESSFUL;
goto Failure;
}