From 6b6ddd377dfa6016a445e795b5eaacd548720bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 6 Apr 2025 00:58:58 +0300 Subject: [PATCH] Windows: Fix using NT APIs on i386 While the MS docs don't include the NTAPI attribute here, these functions are presented with stdcall name mangling in the ntdll.lib import library in the Windows SDK (and likewise in the mingw import libraries). Therefore, add NTAPI (which expands to __stdcall) here to fix linking. Change-Id: I7d59b6a3c64823743498497a2ddc869e5556432c Reviewed-by: Thiago Macieira --- src/corelib/io/qstorageinfo_win.cpp | 2 +- src/corelib/kernel/qwinregistry.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qstorageinfo_win.cpp b/src/corelib/io/qstorageinfo_win.cpp index 8840813171a..3582612508c 100644 --- a/src/corelib/io/qstorageinfo_win.cpp +++ b/src/corelib/io/qstorageinfo_win.cpp @@ -13,7 +13,7 @@ #include "qntdll_p.h" -extern "C" NTSTATUS NTSYSCALLAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, +extern "C" NTSTATUS NTSYSCALLAPI NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS); QT_BEGIN_NAMESPACE diff --git a/src/corelib/kernel/qwinregistry.cpp b/src/corelib/kernel/qwinregistry.cpp index 2bd1518e5be..303bae7136e 100644 --- a/src/corelib/kernel/qwinregistry.cpp +++ b/src/corelib/kernel/qwinregistry.cpp @@ -15,7 +15,7 @@ // User mode version of ZwQueryKey, as per: // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwquerykey -extern "C" NTSTATUS NTSYSCALLAPI NtQueryKey(HANDLE KeyHandle, int KeyInformationClass, +extern "C" NTSTATUS NTSYSCALLAPI NTAPI NtQueryKey(HANDLE KeyHandle, int KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength); QT_BEGIN_NAMESPACE