From fdc1d96dc1259093a07d6cd36c050716e831de74 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Sat, 6 Jul 2024 00:50:03 +0600 Subject: [PATCH] [ISAPNP] Make sure that APCs are disabled before acquiring a lock Note: We could just use a fast mutex instead --- drivers/bus/isapnp/isapnp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bus/isapnp/isapnp.h b/drivers/bus/isapnp/isapnp.h index 344cc23691d..8c58679d156 100644 --- a/drivers/bus/isapnp/isapnp.h +++ b/drivers/bus/isapnp/isapnp.h @@ -111,6 +111,8 @@ FORCEINLINE VOID IsaPnpAcquireBusDataLock(VOID) { + ASSERT(PsGetCurrentProcess() == PsInitialSystemProcess); + KeWaitForSingleObject(&BusSyncEvent, Executive, KernelMode, FALSE, NULL); } @@ -129,6 +131,8 @@ VOID IsaPnpAcquireDeviceDataLock( _In_ PISAPNP_FDO_EXTENSION FdoExt) { + ASSERT(PsGetCurrentProcess() == PsInitialSystemProcess); + KeWaitForSingleObject(&FdoExt->DeviceSyncEvent, Executive, KernelMode, FALSE, NULL); }