From 010be6cb0dc876003bbd834968b97e37ed70e4d4 Mon Sep 17 00:00:00 2001 From: short <> Date: Tue, 23 Sep 2003 11:51:50 +0000 Subject: [PATCH] Catched STDCALL IRP (*CompletionRoutine)() and (*CancelRoutine)(). --- include/ddk/iotypes.h | 14 ++++++++++++-- ntoskrnl/io/irp.c | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/ddk/iotypes.h b/include/ddk/iotypes.h index 8e11b46..2507de4 100644 --- a/include/ddk/iotypes.h +++ b/include/ddk/iotypes.h @@ -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); diff --git a/ntoskrnl/io/irp.c b/ntoskrnl/io/irp.c index ec45149..cfa1f1d 100644 --- a/ntoskrnl/io/irp.c +++ b/ntoskrnl/io/irp.c @@ -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) { -- 1.8.3.1