RE: jumping to invalid addresses when calling HAL leg acy fns from a WDM driver

Stopping being a wdm driver is not an option, because of some other
requirements I’m bound to. This should be working - I ran tests on some
simple wdm drivers and it behaved. There’s something in my project that
causes the execution to fail, I just haven’t digged it out yet. Any
constructive criticism is appreciated.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Thursday, January 03, 2002 1:27 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL leg
acy fns from a WDM driver

Your driver isn’t a wdm driver, so stop trying to force it to be one.
WDM is really the subset of the nt ddk that is supposed to run on both
(win)DOS/9x/Me and W2K. You stopped being a WDM driver as soon as you
bought into the requirement to use your libraries that make non-wdm
calls. So include ntddk.h and stop being a wdm driver.

-----Original Message-----
From: Christian Bechette [mailto:xxxxx@matrox.com]
Sent: Thursday, January 03, 2002 1:30 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL
legacy fns from a WDM driver
I agree these legacy calls shouldn’t be needed anymore. However I’m
linking with some older libraries and those are the ones making the
function calls. These libs aren’t mine and I can’t rewrite any of their
code so I got to take them as-is…

cb

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary Little
Sent: Wednesday, January 02, 2002 3:14 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL
legacy fns from a WDM driver

One question I have is what is it that you need from
HalGetBusDataByOffset that is not supplied by the Start Device parameter
you receive from IRP_MN_START_DEVICE. Slot number? Bus number? Both of
those are generally superfluous to PnP operations.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net
(949) 7372731

-----Original Message-----
From: Christian Bechette [mailto:xxxxx@matrox.com]
Sent: Wednesday, January 02, 2002 11:26 AM
To: NT Developers Interest List
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@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

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

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

You are currently subscribed to ntdev as: xxxxx@matrox.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

MessageLooks like the requirements you’re bound to makes this thing technically impossible :slight_smile:
A WDM driver must not call HalGetBusDataByOffset. I have doubts it will ever load on Win9x.
I have doubts such a driver will be WHQLable.

So, dismissing the WDM requirement (which is null and void anyway as Mark said) is a proper way.
WDM is incompatible with HalGetBusDataByOffset. Plain and simple.

Another way is to stop using exactly this function from the library you use, and write your own code itself which will be WDM-compatible.

Another way is to hack MAKEFILE.DEF.

I would prefer the second way due to strong dislike in having dependencies on external code modules, especially source-less. Re-implementing it in-house is often less problematic in terms of man*hours and the future support pains then dealing with the lamenesses of the problematic library.

The practice have shown that, when a product uses such components, more than a half of support efforts are spent due to lame behaviour of this component, not due to in-house product.

Max

----- Original Message -----
From: Christian Bechette
To: NT Developers Interest List
Sent: Thursday, January 03, 2002 10:04 PM
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL leg acy fns from a WDM driver

Stopping being a wdm driver is not an option, because of some other requirements I’m bound to. This should be working - I ran tests on some simple wdm drivers and it behaved. There’s something in my project that causes the execution to fail, I just haven’t digged it out yet. Any constructive criticism is appreciated.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Thursday, January 03, 2002 1:27 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL leg acy fns from a WDM driver

Your driver isn’t a wdm driver, so stop trying to force it to be one. WDM is really the subset of the nt ddk that is supposed to run on both (win)DOS/9x/Me and W2K. You stopped being a WDM driver as soon as you bought into the requirement to use your libraries that make non-wdm calls. So include ntddk.h and stop being a wdm driver.

-----Original Message-----
From: Christian Bechette [mailto:xxxxx@matrox.com]
Sent: Thursday, January 03, 2002 1:30 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL legacy fns from a WDM driver

I agree these legacy calls shouldn’t be needed anymore. However I’m linking with some older libraries and those are the ones making the function calls. These libs aren’t mine and I can’t rewrite any of their code so I got to take them as-is…

cb

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Gary Little
Sent: Wednesday, January 02, 2002 3:14 PM
To: NT Developers Interest List
Subject: [ntdev] RE: jumping to invalid addresses when calling HAL legacy fns from a WDM driver

One question I have is what is it that you need from HalGetBusDataByOffset that is not supplied by the Start Device parameter you receive from IRP_MN_START_DEVICE. Slot number? Bus number? Both of those are generally superfluous to PnP operations.

Gary G. Little

Broadband Storage, Inc.

xxxxx@broadstor.com

xxxxx@inland.net

(949) 7372731

-----Original Message-----
From: Christian Bechette [mailto:xxxxx@matrox.com]
Sent: Wednesday, January 02, 2002 11:26 AM
To: NT Developers Interest List
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@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


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


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


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


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