https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4a38a05ec49f0872e06ad414b92a77f11375d25

commit f4a38a05ec49f0872e06ad414b92a77f11375d25
Author:     Dmitry Borisov <[email protected]>
AuthorDate: Tue Feb 6 19:39:42 2024 +0600
Commit:     Stanislav Motylkov <[email protected]>
CommitDate: Sun Feb 11 20:24:15 2024 +0300

    [KMTESTS:NTOS_IO] Add a simple test for IoConnectInterrupt
    
    CORE-17256
---
 modules/rostests/kmtests/ntos_io/IoInterrupt.c | 27 ++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/modules/rostests/kmtests/ntos_io/IoInterrupt.c 
b/modules/rostests/kmtests/ntos_io/IoInterrupt.c
index 6003384789e..9b82b020f1d 100644
--- a/modules/rostests/kmtests/ntos_io/IoInterrupt.c
+++ b/modules/rostests/kmtests/ntos_io/IoInterrupt.c
@@ -91,7 +91,34 @@ TestSynchronizeExecution(VOID)
     }
 }
 
+static
+VOID
+TestConnectInterrupt(VOID)
+{
+    PKINTERRUPT InterruptObject;
+    NTSTATUS Status;
+
+    /* If the IoConnectInterrupt() fails, the interrupt object should be set 
to NULL */
+    InterruptObject = KmtInvalidPointer;
+
+    /* Test for invalid interrupt */
+    Status = IoConnectInterrupt(&InterruptObject,
+                                (PKSERVICE_ROUTINE)TestConnectInterrupt,
+                                NULL,
+                                NULL,
+                                0,
+                                0,
+                                0,
+                                LevelSensitive,
+                                TRUE,
+                                (KAFFINITY)-1,
+                                FALSE);
+    ok_eq_hex(Status, STATUS_INVALID_PARAMETER);
+    ok_eq_pointer(InterruptObject, NULL);
+}
+
 START_TEST(IoInterrupt)
 {
     TestSynchronizeExecution();
+    TestConnectInterrupt();
 }

Reply via email to