Skip to content

Commit fa08ff2

Browse files
committed
driver: remove fixed codeql suppressions
I fixed the CodeQL rules. Link: microsoft/Windows-Driver-Developer-Supplemental-Tools#217 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 parent 6a7e4dc commit fa08ff2

4 files changed

Lines changed: 0 additions & 16 deletions

File tree

driver/ioctl.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,6 @@ ReadLogLine(_In_ DEVICE_OBJECT *DeviceObject, _Inout_ IRP *Irp)
625625
Irp->IoStatus.Information = sizeof(WG_IOCTL_LOG_ENTRY);
626626
}
627627

628-
#pragma prefast(push)
629-
#pragma prefast(disable : cpp/drivers/invalid-function-class-typedef) /* It's fine to make this paged because it's only ever called from userspace. */
630628
_Dispatch_type_(IRP_MJ_DEVICE_CONTROL)
631629
static DRIVER_DISPATCH_PAGED DispatchDeviceControl;
632630
_Use_decl_annotations_
@@ -655,7 +653,6 @@ DispatchDeviceControl(DEVICE_OBJECT *DeviceObject, IRP *Irp)
655653
IoCompleteRequest(Irp, IO_NO_INCREMENT);
656654
return Status;
657655
}
658-
#pragma prefast(pop)
659656

660657
_Dispatch_type_(IRP_MJ_CREATE)
661658
static DRIVER_DISPATCH DispatchCreate;
@@ -696,8 +693,6 @@ DispatchPnp(DEVICE_OBJECT *DeviceObject, IRP *Irp)
696693
#ifdef ALLOC_PRAGMA
697694
# pragma alloc_text(INIT, IoctlDriverEntry)
698695
#endif
699-
#pragma prefast(push)
700-
#pragma prefast(disable : cpp/drivers/illegal-field-access-2) /* This is a driver entry routine; we've just split them up. */
701696
_Use_decl_annotations_
702697
VOID
703698
IoctlDriverEntry(DRIVER_OBJECT *DriverObject)
@@ -709,4 +704,3 @@ IoctlDriverEntry(DRIVER_OBJECT *DriverObject)
709704
DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate;
710705
DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
711706
}
712-
#pragma prefast(pop)

driver/nsi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ TryBuildMTURow(_In_ IRP *Irp, _Out_ MIB_IPINTERFACE_ROW *Row)
147147
return TRUE;
148148
}
149149

150-
#pragma prefast(push)
151-
#pragma prefast(disable : cpp/drivers/invalid-function-class-typedef) /* It's fine to make this paged because it's only ever called from userspace. */
152150
static DRIVER_DISPATCH_PAGED FilterDispatch;
153151
_Use_decl_annotations_
154152
static NTSTATUS
@@ -173,7 +171,6 @@ FilterDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp)
173171
ExReleaseRundownProtection(&FilterRundown);
174172
return Status;
175173
}
176-
#pragma prefast(pop)
177174

178175
static NTSTATUS
179176
Attach(VOID)
@@ -236,8 +233,6 @@ Detach(VOID)
236233
#ifdef ALLOC_PRAGMA
237234
# pragma alloc_text(INIT, NsiDriverEntry)
238235
#endif
239-
#pragma prefast(push)
240-
#pragma prefast(disable : cpp/drivers/illegal-field-access-2) /* This is a driver entry routine; we've just split them up. */
241236
_Use_decl_annotations_
242237
VOID
243238
NsiDriverEntry(DRIVER_OBJECT *DriverObject)
@@ -252,7 +247,6 @@ NsiDriverEntry(DRIVER_OBJECT *DriverObject)
252247
DriverObject->MajorFunction[i] = FilterDispatch;
253248
}
254249
}
255-
#pragma prefast(pop)
256250

257251
_Use_decl_annotations_
258252
NTSTATUS

driver/rcu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ __RcuCall(_Inout_ RCU_CALLBACK *Head)
107107
KeAcquireInStackQueuedSpinLock(&Cleanup.Lock, &LockHandle);
108108
*(Cleanup.Tail ? &Cleanup.Tail->Next : &Cleanup.Head) = Head;
109109
Cleanup.Tail = Head;
110-
#pragma prefast(suppress : cpp/drivers/irql-too-high) /* The last param is FALSE, so the max level is 2, not 1. */
111110
KeSetEvent(&Cleanup.WorkPending, IO_NO_INCREMENT, FALSE);
112111
KeReleaseInStackQueuedSpinLock(&LockHandle);
113112
}

driver/rcu.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ struct _RCU_CALLBACK
4444
};
4545
};
4646

47-
#pragma prefast(push)
48-
#pragma prefast(disable : cpp/drivers/irql-annotation-issue) /* The annotations are copied directly from KeRaiseIrqlToDpcLevel. */
4947
_IRQL_requires_max_(DISPATCH_LEVEL)
5048
_IRQL_saves_
5149
_IRQL_raises_(DISPATCH_LEVEL)
@@ -55,7 +53,6 @@ static inline KIRQL RcuReadLock(VOID)
5553
_Analysis_assume_rcu_acquired_;
5654
return KeRaiseIrqlToDpcLevel();
5755
}
58-
#pragma prefast(pop)
5956

6057
_IRQL_requires_max_(DISPATCH_LEVEL)
6158
_Releases_rcu_

0 commit comments

Comments
 (0)