Catched STDCALL IRP (*CompletionRoutine)() and (*CancelRoutine)(). captive-0_9 captive-0_9_1 captive-0_9_2
authorshort <>
Tue, 23 Sep 2003 11:51:50 +0000 (11:51 +0000)
committershort <>
Tue, 23 Sep 2003 11:51:50 +0000 (11:51 +0000)
include/ddk/iotypes.h
ntoskrnl/io/irp.c

index 8e11b46..2507de4 100644 (file)
@@ -92,7 +92,12 @@ typedef NTSTATUS STDCALL_FUNC
                            ULONG PeripheralNumber,
                            PKEY_VALUE_FULL_INFORMATION* PI);
 
-typedef NTSTATUS STDCALL_FUNC
+typedef NTSTATUS
+#ifndef LIBCAPTIVE
+               STDCALL_FUNC
+#else /* !LIBCAPTIVE */
+               CAPTIVE_STDCALL
+#endif /* !LIBCAPTIVE */
 (*PIO_COMPLETION_ROUTINE)(struct _DEVICE_OBJECT* DeviceObject,
                          struct _IRP* Irp,
                          PVOID Context);
@@ -764,7 +769,12 @@ typedef NTSTATUS
 /*
  * Driver cancel declaration
  */
-typedef NTSTATUS STDCALL_FUNC
+typedef NTSTATUS
+#ifndef LIBCAPTIVE
+               STDCALL_FUNC
+#else /* !LIBCAPTIVE */
+               CAPTIVE_STDCALL
+#endif /* !LIBCAPTIVE */
 (*PDRIVER_CANCEL)(struct _DEVICE_OBJECT* DeviceObject,
                  struct _IRP* RegistryPath);
 
index ec45149..cfa1f1d 100644 (file)
@@ -290,9 +290,16 @@ IofCompleteRequest(PIRP Irp,
          (!NT_SUCCESS(Irp->IoStatus.Status) && (Irp->Stack[i].Control & SL_INVOKE_ON_ERROR)) ||
          (Irp->Cancel && (Irp->Stack[i].Control & SL_INVOKE_ON_CANCEL))))
       {
+#ifndef LIBCAPTIVE
          Status = Irp->Stack[i].CompletionRoutine(DeviceObject,
                                                   Irp,
                                                   Irp->Stack[i].Context);
+#else /* !LIBCAPTIVE */
+         Status = (NTSTATUS)captive_stdcall_call_12((CaptiveStdCallFunc12)Irp->Stack[i].CompletionRoutine,
+                                                    DeviceObject,
+                                                    Irp,
+                                                    Irp->Stack[i].Context);
+#endif /* LIBCAPTIVE */
 
          if (Status == STATUS_MORE_PROCESSING_REQUIRED)
          {