summaryrefslogtreecommitdiff
path: root/gpio/samples/simdevice/simdevice.c
diff options
context:
space:
mode:
authorkarlf <[email protected]>2016-08-11 13:28:13 -0700
committerkarlf <[email protected]>2016-08-11 13:28:13 -0700
commit96eb96dfb613e4c745db6bd1f53a92fe7e2290fc (patch)
treead5f3ede5cbcd6b598677ce41bcf8318471bdd92 /gpio/samples/simdevice/simdevice.c
parent687b274aa38fd05c8c26e3068932121876d7f745 (diff)
Updated for "Windows 10 Anniversary Update" (Version 1607)
Diffstat (limited to 'gpio/samples/simdevice/simdevice.c')
-rw-r--r--gpio/samples/simdevice/simdevice.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gpio/samples/simdevice/simdevice.c b/gpio/samples/simdevice/simdevice.c
index f54f1a84..a9856b97 100644
--- a/gpio/samples/simdevice/simdevice.c
+++ b/gpio/samples/simdevice/simdevice.c
@@ -268,7 +268,7 @@ NTSTATUS
SampleDrvEvtDeviceAdd (
WDFDRIVER Driver,
PWDFDEVICE_INIT DeviceInit
-)
+ )
/*++
@@ -340,12 +340,19 @@ Return Value:
}
//
- // Create an interrupt object for the DIRQL ISR
+ // Create an interrupt object. For the KMDF driver, the ISR will be run at
+ // DIRQL. For UMDF(v2), it will be run at PASSIVE_LEVEL, hence the DPC is
+ // only defined in the KMDF case.
//
WDF_INTERRUPT_CONFIG_INIT(&InterruptConfiguration,
SampleDrvInterruptIsr,
- SampleDrvInterruptDpc);
+#ifdef _KERNEL_MODE
+ SampleDrvInterruptDpc
+#else
+ NULL
+#endif
+ );
Status = WdfInterruptCreate(Device,
&InterruptConfiguration,
@@ -491,11 +498,12 @@ Return Value:
}
//
- // Ensure that at least two interrupt resources are defined. One for DIRQL
- // and another for the passive level ISR
+ // Ensure that at least one interrupt resource is defined.
//
+#ifdef _KERNEL_MODE
NT_ASSERT(SampleDrvExtension->InterruptCount > 0);
+#endif
if (SampleDrvExtension->InterruptCount < 1) {
Status = STATUS_UNSUCCESSFUL;