在 2025-01-04 20:24, Duncan Ogilvie 写道:
Is there a reason why you changed the return type of `RtlMultipleAllocateHeap` 
from `DWORD` to
`ULONG`? They are the same type and interchangeable.

No reason, just found all the other definitions used ULONG (since
DWORD generally isn't available in the kernel/ntdll context).
Feel free to remove this part of the patch if it's undesirable :)

winnt.h is not a kernel header but a user-mode header, and indeed contains references to `DWORD`. The Microsoft header actually doesn't compile without including windows.h first.

I don't mind changing `DWORD` to `ULONG`; however there are occurrences in 
arguments too.

Does the attached patch look good to you?


--
Best regards,
LIU Hao
From 0dde812ca8db884d0b481cc1cfc535599f334dee Mon Sep 17 00:00:00 2001
From: Duncan Ogilvie <mr.exodia.tp...@gmail.com>
Date: Sat, 4 Jan 2025 02:34:26 +0100
Subject: [PATCH] headers: Fix a few return types in winnt.h

Signed-off-by: LIU Hao <lh_mo...@126.com>
---
 mingw-w64-headers/include/winnt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-headers/include/winnt.h 
b/mingw-w64-headers/include/winnt.h
index b6d1f58ed..2d3190a4a 100644
--- a/mingw-w64-headers/include/winnt.h
+++ b/mingw-w64-headers/include/winnt.h
@@ -9705,8 +9705,8 @@ typedef DWORD (WINAPI 
*PRTL_RUN_ONCE_INIT_FN)(PRTL_RUN_ONCE, PVOID, PVOID *);
 #define VERIFIER_STOP(Code,Msg,P1,S1,P2,S2,P3,S3,P4,S4) { 
RtlApplicationVerifierStop 
((Code),(Msg),(ULONG_PTR)(P1),(S1),(ULONG_PTR)(P2),(S2),(ULONG_PTR)(P3),(S3),(ULONG_PTR)(P4),(S4));
 }
 
     VOID NTAPI RtlApplicationVerifierStop(ULONG_PTR Code,PSTR 
Message,ULONG_PTR Param1,PSTR Description1,ULONG_PTR Param2,PSTR 
Description2,ULONG_PTR Param3,PSTR Description3,ULONG_PTR Param4,PSTR 
Description4);
-    NTSYSAPI DWORD NTAPI RtlSetHeapInformation(PVOID 
HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID 
HeapInformation,SIZE_T HeapInformationLength);
-    NTSYSAPI DWORD NTAPI RtlQueryHeapInformation(PVOID 
HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID 
HeapInformation,SIZE_T HeapInformationLength,PSIZE_T ReturnLength);
+    NTSYSAPI LONG NTAPI RtlSetHeapInformation(PVOID 
HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID 
HeapInformation,SIZE_T HeapInformationLength);
+    NTSYSAPI LONG NTAPI RtlQueryHeapInformation(PVOID 
HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID 
HeapInformation,SIZE_T HeapInformationLength,PSIZE_T ReturnLength);
     DWORD NTAPI RtlMultipleAllocateHeap(PVOID HeapHandle,DWORD Flags,SIZE_T 
Size,DWORD Count,PVOID *Array);
     DWORD NTAPI RtlMultipleFreeHeap(PVOID HeapHandle,DWORD Flags,DWORD 
Count,PVOID *Array);
 
-- 
2.47.1

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to