[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Avoid returning STATUS_PNP_REBOOT_REQUIRED
- To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
- From: "Durrant, Paul" <xadimgnik@xxxxxxxxx>
- Date: Sat, 29 Jun 2024 16:30:45 +0100
- Delivery-date: Sat, 29 Jun 2024 15:30:55 +0000
- List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
On 11/06/2024 16:03, Owen Smith wrote:
When emulated devices are present, returning STATUS_PNP_REBOOT_REQUIRED
will display the 'reboot required' toast popup, but will also count as
a failure when distributing XenNet via Windows Update, which will
result in Microsoft pulling the XenNet update.
Note: PnpUnplugRequest is called twice in this startup codepath, as
the reference count is decreased by PdoStopDevice later and
keeping the reference count above zero is needed to unplug
the emulated device.
Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
src/xenvif/pdo.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index a3ae061..8ec9814 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1407,7 +1407,6 @@ PdoStartDevice(
IN PIRP Irp
)
{
- PIO_STACK_LOCATION StackLocation;
HANDLE SoftwareKey;
HANDLE HardwareKey;
NTSTATUS status;
@@ -1438,18 +1437,15 @@ PdoStartDevice(
status = PdoParseMibTable(Pdo, SoftwareKey);
if (status == STATUS_PNP_REBOOT_REQUIRED || !PdoUnplugRequested(Pdo)) {
Isn't the status check here now pointless?
- PdoUnplugRequest(Pdo, TRUE);
+ PdoUnplugRequest(Pdo, TRUE); // fix unplug reference count
DriverRequestReboot();
- status = STATUS_PNP_REBOOT_REQUIRED;
- goto fail5;
+ status = STATUS_SUCCESS;
}
- StackLocation = IoGetCurrentIrpStackLocation(Irp);
-
status = PdoD3ToD0(Pdo);
if (!NT_SUCCESS(status))
- goto fail6;
+ goto fail5;
PdoUnplugRequest(Pdo, TRUE);
@@ -1463,9 +1459,6 @@ PdoStartDevice(
return STATUS_SUCCESS;
-fail6:
- Error("fail6\n");
-
fail5:
Error("fail5\n");
|