From 2347711439091624e6121b4b30f51e956374a6ea Mon Sep 17 00:00:00 2001 From: Andrey Diment Date: Mon, 10 Feb 2025 11:20:32 +0200 Subject: [PATCH] update SAL annotations for kernel, addresses #501 --- include/wil/resource.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/wil/resource.h b/include/wil/resource.h index 193ea929..4cdf5f88 100644 --- a/include/wil/resource.h +++ b/include/wil/resource.h @@ -6844,7 +6844,8 @@ namespace details } _IRQL_requires_(DISPATCH_LEVEL) - static void Release(_In_ _IRQL_restores_ const kspin_lock_saved_irql& spinLockSavedIrql) + _IRQL_restores_global_(savedIrql, spinLockSavedIrql) + static void Release(_In_ const kspin_lock_saved_irql& spinLockSavedIrql) { KeReleaseSpinLock(spinLockSavedIrql.spinLock, spinLockSavedIrql.savedIrql); } @@ -6868,7 +6869,7 @@ using kspin_lock_at_dpc_guard = WI_NODISCARD inline _IRQL_requires_max_(DISPATCH_LEVEL) -_IRQL_saves_ +_IRQL_saves_global_(savedIrql, return) _IRQL_raises_(DISPATCH_LEVEL) kspin_lock_guard acquire_kspin_lock(_In_ PKSPIN_LOCK spinLock) { @@ -6904,7 +6905,7 @@ class kernel_spin_lock WI_NODISCARD _IRQL_requires_max_(DISPATCH_LEVEL) - _IRQL_saves_ + _IRQL_saves_global_(savedIrql, return) _IRQL_raises_(DISPATCH_LEVEL) kspin_lock_guard acquire() WI_NOEXCEPT { @@ -7012,6 +7013,8 @@ using fast_mutex_guard = unique_any