I get the following warning for my routine
warning 28144: Within a cancel routine, at the point of exit, the IRQL in
Irp->CancelIrql should be the current IRQL.: The value need not be restored
by any specific function, but must be restored before exit. PREfast was
unable to determine that it was restored to the required value.
Found in function 'ListCancelRoutine'
here is the faulting function, can someonetell me why this is flagging when
I have done wht is already said in the above warning.
*VOID ListCancelRoutine(* queue.cpp(1101) : warning 28144:
Within a cancel routine, at the point of exit, the IRQL in Irp->CancelIrql
should be the current IRQL.: The value need not be restored by any specific
function, but must be restored before exit. PREfast was unable to determine
that it was restored to the required value.
Found in function 'ListCancelRoutine'
Path includes 12 statements on the following lines:
1106 1107 1109 1115 1118 1121 1124 1127 1130 1131 1133 1135
1102 IN PDEVICE_OBJECT DeviceObject,
1103 IN PIRP Irp
1104 )
1105 {
PREfast analysis path begins
1106 KIRQL oldIrql;
1107 P_LIST list;
1108
1109 oldIrql = Irp->CancelIrql;
1110
1111
1112 //AP: To remove Warning 28144
1113 // release the system cancel spinlock
1114 //IoReleaseCancelSpinLock(DISPATCH_LEVEL);
1115 IoReleaseCancelSpinLock(Irp->CancelIrql);
1116
1117 // get our list context from the IRP
1118 list = (P_LIST)Irp->Tail.Overlay.DriverContext[0];
1119
1120 // grab the list protection
1121 KeAcquireSpinLockAtDpcLevel(&list->ListLock);
1122
1123 // remove our IRP from the list
1124 RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
1125
1126 // drop the list protection
1127 KeReleaseSpinLock(&list->ListLock, oldIrql);
1128
1129 // cancel the IRP
1130 Irp->IoStatus.Status = STATUS_CANCELLED;
1131 Irp->IoStatus.Information = 0;
1132
1133 IoCompleteRequest(Irp, IO_NO_INCREMENT);
1134
1135 return;