https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d1ca3553ea8b497de364…
commit 6d1ca3553ea8b497de3644745c1f59872bea354b
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Wed Mar 10 18:41:03 2021 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Wed Mar 10 18:41:03 2021 +0300
[SDK:KMDF] Fix calling convention for the kernel function pointers
---
.../wdf/shared/inc/primitives/common/mxmacros.h | 6 ++
.../wdf/shared/inc/primitives/km/mxtimerkm.h | 2 +-
.../wdf/shared/inc/private/km/fxglobalskm.h | 68 +++++++++++-----------
3 files changed, 41 insertions(+), 35 deletions(-)
diff --git a/sdk/lib/drivers/wdf/shared/inc/primitives/common/mxmacros.h
b/sdk/lib/drivers/wdf/shared/inc/primitives/common/mxmacros.h
index a92c7644c5b..e9364ea3fe2 100644
--- a/sdk/lib/drivers/wdf/shared/inc/primitives/common/mxmacros.h
+++ b/sdk/lib/drivers/wdf/shared/inc/primitives/common/mxmacros.h
@@ -27,3 +27,9 @@ Revision History:
#else
#define CHECK_RETURN_IF_USER_MODE
#endif
+
+#ifdef __REACTOS__
+# ifndef STDCALL
+# define STDCALL __stdcall
+# endif
+#endif
diff --git a/sdk/lib/drivers/wdf/shared/inc/primitives/km/mxtimerkm.h
b/sdk/lib/drivers/wdf/shared/inc/primitives/km/mxtimerkm.h
index 9bc1d4de1af..dfb4a3d8182 100644
--- a/sdk/lib/drivers/wdf/shared/inc/primitives/km/mxtimerkm.h
+++ b/sdk/lib/drivers/wdf/shared/inc/primitives/km/mxtimerkm.h
@@ -26,7 +26,7 @@ Revision History:
typedef
BOOLEAN
-(*PFN_KE_SET_COALESCABLE_TIMER) (
+(STDCALL *PFN_KE_SET_COALESCABLE_TIMER) (
__inout PKTIMER Timer,
__in LARGE_INTEGER DueTime,
__in ULONG Period,
diff --git a/sdk/lib/drivers/wdf/shared/inc/private/km/fxglobalskm.h
b/sdk/lib/drivers/wdf/shared/inc/private/km/fxglobalskm.h
index dbe65de0b4a..293050e29c8 100644
--- a/sdk/lib/drivers/wdf/shared/inc/private/km/fxglobalskm.h
+++ b/sdk/lib/drivers/wdf/shared/inc/private/km/fxglobalskm.h
@@ -57,18 +57,18 @@ struct FxAllocatedMdls {
typedef
BOOLEAN
-(*PFN_KD_REFRESH)(
+(STDCALL *PFN_KD_REFRESH)(
);
typedef
VOID
-(*PFN_KE_FLUSH_QUEUED_DPCS)(
+(STDCALL *PFN_KE_FLUSH_QUEUED_DPCS)(
VOID
);
typedef
NTSTATUS
-(*PFN_IO_SET_COMPLETION_ROUTINE_EX)(
+(STDCALL *PFN_IO_SET_COMPLETION_ROUTINE_EX)(
__in PDEVICE_OBJECT DeviceObject,
__in PIRP Irp,
__in PIO_COMPLETION_ROUTINE CompletionRoutine,
@@ -80,7 +80,7 @@ NTSTATUS
typedef
BOOLEAN
-(*PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK) (
+(STDCALL *PFN_KE_REGISTER_BUGCHECK_REASON_CALLBACK) (
__in PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord,
__in PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine,
__in KBUGCHECK_CALLBACK_REASON Reason,
@@ -89,25 +89,25 @@ BOOLEAN
typedef
BOOLEAN
-(*PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK) (
+(STDCALL *PFN_KE_DEREGISTER_BUGCHECK_REASON_CALLBACK) (
__in PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecords
);
typedef
NTSTATUS
-(*PFN_IO_CONNECT_INTERRUPT_EX)(
+(STDCALL *PFN_IO_CONNECT_INTERRUPT_EX)(
__inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters
);
typedef
NTSTATUS
-(*PFN_IO_DISCONNECT_INTERRUPT_EX)(
+(STDCALL *PFN_IO_DISCONNECT_INTERRUPT_EX)(
__in PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters
);
typedef
NTSTATUS
-(*PFN_IO_CONNECT_INTERRUPT)(
+(STDCALL *PFN_IO_CONNECT_INTERRUPT)(
__out PKINTERRUPT *InterruptObject,
__in PKSERVICE_ROUTINE ServiceRoutine,
__in_opt PVOID ServiceContext,
@@ -123,7 +123,7 @@ NTSTATUS
typedef
VOID
-(*PFN_IO_DISCONNECT_INTERRUPT)(
+(STDCALL *PFN_IO_DISCONNECT_INTERRUPT)(
__in PKINTERRUPT InterruptObject
);
@@ -154,32 +154,32 @@ PSLIST_ENTRY
typedef
BOOLEAN
-(*PFN_PO_GET_SYSTEM_WAKE)(
+(STDCALL *PFN_PO_GET_SYSTEM_WAKE)(
__in PIRP Irp
);
typedef
VOID
-(*PFN_PO_SET_SYSTEM_WAKE)(
+(STDCALL *PFN_PO_SET_SYSTEM_WAKE)(
__inout PIRP Irp
);
typedef
KAFFINITY
-(*PFN_KE_QUERY_ACTIVE_PROCESSORS)(
+(STDCALL *PFN_KE_QUERY_ACTIVE_PROCESSORS)(
VOID
);
typedef
VOID
-(*PFN_KE_SET_TARGET_PROCESSOR_DPC)(
+(STDCALL *PFN_KE_SET_TARGET_PROCESSOR_DPC)(
__in PRKDPC Dpc,
__in CCHAR Number
);
typedef
BOOLEAN
-(*PFN_KE_SET_COALESCABLE_TIMER)(
+(STDCALL *PFN_KE_SET_COALESCABLE_TIMER)(
__inout PKTIMER Timer,
__in LARGE_INTEGER DueTime,
__in ULONG Period,
@@ -189,49 +189,49 @@ BOOLEAN
typedef
ULONG
-(*PFN_KE_GET_CURRENT_PROCESSOR_NUMBER)(
+(STDCALL *PFN_KE_GET_CURRENT_PROCESSOR_NUMBER)(
VOID
);
typedef
ULONG
-(*PFN_KE_GET_CURRENT_PROCESSOR_NUMBER_EX)(
+(STDCALL *PFN_KE_GET_CURRENT_PROCESSOR_NUMBER_EX)(
__out_opt PPROCESSOR_NUMBER ProcNumber
);
typedef
ULONG
-(*PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT_EX)(
+(STDCALL *PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT_EX)(
__in USHORT GroupNumber
);
typedef
ULONG
-(*PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT)(
+(STDCALL *PFN_KE_QUERY_MAXIMUM_PROCESSOR_COUNT)(
VOID
);
typedef
BOOLEAN
-(*PFN_KE_ARE_APCS_DISABLED)(
+(STDCALL *PFN_KE_ARE_APCS_DISABLED)(
VOID
);
typedef
ULONG
-(*PFN_KE_GET_RECOMMENDED_SHARED_DATA_ALIGNMENT)(
+(STDCALL *PFN_KE_GET_RECOMMENDED_SHARED_DATA_ALIGNMENT)(
VOID
);
typedef
NTSTATUS
-(*PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX)(
+(STDCALL *PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX)(
__in PVOID NotificationEntry
);
typedef
NTSTATUS
-(*PFN_POX_REGISTER_DEVICE) (
+(STDCALL *PFN_POX_REGISTER_DEVICE) (
__in MdDeviceObject Pdo,
__in PPO_FX_DEVICE PoxDevice,
__out POHANDLE * Handle
@@ -239,19 +239,19 @@ NTSTATUS
typedef
VOID
-(*PFN_POX_START_DEVICE_POWER_MANAGEMENT) (
+(STDCALL *PFN_POX_START_DEVICE_POWER_MANAGEMENT) (
__in POHANDLE Handle
);
typedef
VOID
-(*PFN_POX_UNREGISTER_DEVICE) (
+(STDCALL *PFN_POX_UNREGISTER_DEVICE) (
__in POHANDLE Handle
);
typedef
VOID
-(*PFN_POX_ACTIVATE_COMPONENT) (
+(STDCALL *PFN_POX_ACTIVATE_COMPONENT) (
__in POHANDLE Handle,
__in ULONG Component,
__in ULONG Flags
@@ -259,7 +259,7 @@ VOID
typedef
VOID
-(*PFN_POX_IDLE_COMPONENT) (
+(STDCALL *PFN_POX_IDLE_COMPONENT) (
__in POHANDLE Handle,
__in ULONG Component,
__in ULONG Flags
@@ -267,52 +267,52 @@ VOID
typedef
VOID
-(*PFN_POX_REPORT_DEVICE_POWERED_ON) (
+(STDCALL *PFN_POX_REPORT_DEVICE_POWERED_ON) (
__in POHANDLE Handle
);
typedef
VOID
-(*PFN_POX_COMPLETE_IDLE_STATE) (
+(STDCALL *PFN_POX_COMPLETE_IDLE_STATE) (
__in POHANDLE Handle,
__in ULONG Component
);
typedef
VOID
-(*PFN_POX_COMPLETE_IDLE_CONDITION) (
+(STDCALL *PFN_POX_COMPLETE_IDLE_CONDITION) (
__in POHANDLE Handle,
__in ULONG Component
);
typedef
VOID
-(*PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED) (
+(STDCALL *PFN_POX_COMPLETE_DEVICE_POWER_NOT_REQUIRED) (
__in POHANDLE Handle
);
typedef
VOID
-(*PFN_POX_SET_DEVICE_IDLE_TIMEOUT) (
+(STDCALL *PFN_POX_SET_DEVICE_IDLE_TIMEOUT) (
__in POHANDLE Handle,
__in ULONGLONG IdleTimeout
);
typedef
VOID
-(*PFN_IO_REPORT_INTERRUPT_ACTIVE) (
+(STDCALL *PFN_IO_REPORT_INTERRUPT_ACTIVE) (
_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters
);
typedef
VOID
-(*PFN_IO_REPORT_INTERRUPT_INACTIVE) (
+(STDCALL *PFN_IO_REPORT_INTERRUPT_INACTIVE) (
_In_ PIO_REPORT_INTERRUPT_ACTIVE_STATE_PARAMETERS Parameters
);
typedef
VOID
-(*PFN_VF_CHECK_NX_POOL_TYPE) (
+(STDCALL *PFN_VF_CHECK_NX_POOL_TYPE) (
_In_ POOL_TYPE PoolType,
_In_ PVOID CallingAddress,
_In_ ULONG PoolTag