Web lists-archives.org

[Mingw-users] Invalid stdcall mangling for HalFreeCommonBuffer in lib/ddk/hal.def




HalFreeCommonBuffer is defined as:

NTOSAPI
VOID
DDKAPI
HalFreeCommonBuffer(
  /*IN*/ PADAPTER_OBJECT  AdapterObject,
  /*IN*/ ULONG  Length,
  /*IN*/ PHYSICAL_ADDRESS  LogicalAddress,
  /*IN*/ PVOID  VirtualAddress,
  /*IN*/ BOOLEAN  CacheEnabled);

in include/ddk/winnt4.h for instance it looks as if HalFreeCommonBuffer@20
as used in lib/ddk/hal.def fits, but LogicalAddress is a PHYSICAL_ADDRESS
which in turn is a typedef for LARGE_INTEGER which is a struct of size 8.
Since LogicalAddress is passed by value the correct mangling for this function
is @24 (4 4 byte long arguments and one 8 byte long, 16 + 8 = 24).

There might be more mistakes in similar vein, but i haven't checked.

Patch:

Index: hal.def
===================================================================
RCS file: /cvs/src/src/winsup/w32api/lib/ddk/hal.def,v
retrieving revision 1.1
diff -u -r1.1 hal.def
--- hal.def     6 Oct 2002 22:18:25 -0000       1.1
+++ hal.def     10 Nov 2007 23:38:17 -0000
@@ -18,7 +18,7 @@
 ;HalEnableSystemInterrupt
 ;HalEndSystemInterrupt
 ;HalFlushCommonBuffer
-HalFreeCommonBuffer@20
+HalFreeCommonBuffer@24
 HalGetAdapter@8
 HalGetBusData@20
 HalGetBusDataByOffset@24



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users