jumping to invalid addresses when calling HAL legacy fns from a WDM driver

I have an issue that I hope someone has already encountered. I’m
currently writing a wdm driver which needs to call some legacy HAL
functions such as HalGetBusDataByOffset etc. Since I include wdm.h I
have to manually supply the prototypes for the HAL functions in one of
my header files. The driver will compile and link without any errors,
however at runtime when actually calling these legacy fns the execution
jumps to an invalid address causing a bsod, just like if the linker
didn’t do its job properly. Eg. The imp [HalGetBusDataByOffset]
address is invalid and not even in the HAL module’s address range.

I’ve done some tests modifying makefile.def and it turns out that it
will work only if the HAL libraries are processed before the WDM libs,
which prevents me from using DRIVERTYPE=WDM in my SOURCES file. Although
this will make the driver link and run ok it’s still more of a hack than
anything else. Anyone has any idea what may be causing this?

thanks for reading, and happy new year everyone!
chris


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Maybe using IRP_MN_READ_CONFIG is better for this?

----- Original Message -----
From: Christian Bechette
To: NT Developers Interest List
Sent: Wednesday, January 02, 2002 10:26 PM
Subject: [ntdev] jumping to invalid addresses when calling HAL legacy fns from a WDM driver

I have an issue that I hope someone has already encountered. I’m currently writing a wdm driver which needs to call some legacy HAL functions such as HalGetBusDataByOffset etc. Since I include wdm.h I have to manually supply the prototypes for the HAL functions in one of my header files. The driver will compile and link without any errors, however at runtime when actually calling these legacy fns the execution jumps to an invalid address causing a bsod, just like if the linker didn’t do its job properly. Eg. The imp [HalGetBusDataByOffset] address is invalid and not even in the HAL module’s address range.

I’ve done some tests modifying makefile.def and it turns out that it will work only if the HAL libraries are processed before the WDM libs, which prevents me from using DRIVERTYPE=WDM in my SOURCES file. Although this will make the driver link and run ok it’s still more of a hack than anything else. Anyone has any idea what may be causing this?

thanks for reading, and happy new year everyone!

chris


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com